@ncino/web-components 2.0.0-preview.7 → 2.0.0-preview.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-chunk13.js +1 -1
- package/dist/assets/index-chunk14.js +1 -0
- package/dist/components/boolean/boolean.gator.js +2 -2
- package/dist/components/boolean/index.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.gator.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/input/base/input-base.gator.js +16 -10
- package/dist/components/input/gator/dropdown/input-dropdown.gator.js +72 -0
- package/dist/components/input/gator/input-label/input-label.gator.js +11 -6
- package/dist/components/input/gator/input-text/input-text.gator.js +10 -8
- package/dist/components/input/gator/input-textarea/input-textarea.gator.js +2 -2
- package/dist/components/input/index.js +1 -1
- package/dist/components/list/gator/list/list.gator.js +3 -2
- package/dist/components/list/gator/list-item/list-item.gator.js +13 -13
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/radio-group/radio-group.gator.js +1 -1
- package/dist/components/selection-box-group/index.js +1 -1
- package/dist/components/selection-box-group/selection-box-group.gator.js +1 -1
- package/dist/components/tooltip/gator/tooltip.gator.js +3 -3
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/slds/tooltip.slds.js +2 -2
- package/dist/index.gator.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.slds.js +1 -1
- package/dist/types/components/input/base/input-base.gator.d.ts +12 -3
- package/dist/types/components/input/gator/dropdown/input-dropdown.gator.d.ts +32 -0
- package/dist/types/components/input/gator/dropdown/input-dropdown.gator.test.d.ts +0 -0
- package/dist/types/components/input/gator/input-text/input-text.gator.d.ts +2 -12
- package/dist/types/utils/vitest-utils.d.ts +1 -1
- package/package.json +1 -1
- package/web-types.json +125 -11
- package/dist/types/components/input/gator/input-label/input-label.gator.d.ts +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
const St="div[role=tooltip]{position:absolute;width:max-content;top:0;left:0;visibility:hidden;opacity:0;transition:opacity .2s}#floating{position:absolute;width:max-content;top:0;left:0}",$=Math.min,D=Math.max,M=Math.round,H=Math.floor,T=t=>({x:t,y:t});function Z(t){return t.split("-")[0]}function ft(t){return t.split("-")[1]}function ut(t){return t==="x"?"y":"x"}function at(t){return t==="y"?"height":"width"}function tt(t){return["top","bottom"].includes(Z(t))?"y":"x"}function dt(t){return ut(tt(t))}function et(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function K(t,e,o){let{reference:n,floating:i}=t;const c=tt(e),r=dt(e),s=at(r),f=Z(e),l=c==="y",a=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,g=n[s]/2-i[s]/2;let u;switch(f){case"top":u={x:a,y:n.y-i.height};break;case"bottom":u={x:a,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:d};break;case"left":u={x:n.x-i.width,y:d};break;default:u={x:n.x,y:n.y}}switch(ft(e)){case"start":u[r]-=g*(o&&l?-1:1);break;case"end":u[r]+=g*(o&&l?-1:1);break}return u}const ht=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:c=[],platform:r}=o,s=c.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:d}=K(l,n,f),g=n,u={},x=0;for(let h=0;h<s.length;h++){const{name:m,fn:p}=s[h],{x:w,y:R,data:F,reset:L}=await p({x:a,y:d,initialPlacement:n,placement:g,strategy:i,middlewareData:u,rects:l,platform:r,elements:{reference:t,floating:e}});a=w??a,d=R??d,u={...u,[m]:{...u[m],...F}},L&&x<=50&&(x++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(l=L.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:a,y:d}=K(l,g,f)),h=-1)}return{x:a,y:d,placement:g,strategy:i,middlewareData:u}};function V(){return typeof window<"u"}function W(t){return nt(t)?(t.nodeName||"").toLowerCase():"#document"}function y(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function E(t){var e;return(e=(nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function nt(t){return V()?t instanceof Node||t instanceof y(t).Node:!1}function v(t){return V()?t instanceof Element||t instanceof y(t).Element:!1}function C(t){return V()?t instanceof HTMLElement||t instanceof y(t).HTMLElement:!1}function G(t){return!V()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof y(t).ShadowRoot}function k(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=b(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function gt(t){return["table","td","th"].includes(W(t))}function z(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function X(t){const e=j(),o=v(t)?b(t):t;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function pt(t){let e=O(t);for(;C(e)&&!N(e);){if(X(e))return e;if(z(e))return null;e=O(e)}return null}function j(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function N(t){return["html","body","#document"].includes(W(t))}function b(t){return y(t).getComputedStyle(t)}function _(t){return v(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function O(t){if(W(t)==="html")return t;const e=t.assignedSlot||t.parentNode||G(t)&&t.host||E(t);return G(e)?e.host:e}function ot(t){const e=O(t);return N(e)?t.ownerDocument?t.ownerDocument.body:t.body:C(e)&&k(e)?e:ot(e)}function B(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=ot(t),c=i===((n=t.ownerDocument)==null?void 0:n.body),r=y(i);if(c){const s=Y(r);return e.concat(r,r.visualViewport||[],k(i)?i:[],s&&o?B(s):[])}return e.concat(i,B(i,[],o))}function Y(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function it(t){const e=b(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=C(t),c=i?t.offsetWidth:o,r=i?t.offsetHeight:n,s=M(o)!==c||M(n)!==r;return s&&(o=c,n=r),{width:o,height:n,$:s}}function q(t){return v(t)?t:t.contextElement}function S(t){const e=q(t);if(!C(e))return T(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:c}=it(e);let r=(c?M(o.width):o.width)/n,s=(c?M(o.height):o.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const mt=T(0);function rt(t){const e=y(t);return!j()||!e.visualViewport?mt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function wt(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==y(t)?!1:e}function A(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),c=q(t);let r=T(1);e&&(n?v(n)&&(r=S(n)):r=S(t));const s=wt(c,o,n)?rt(c):T(0);let f=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,a=i.width/r.x,d=i.height/r.y;if(c){const g=y(c),u=n&&v(n)?y(n):n;let x=g,h=Y(x);for(;h&&n&&u!==x;){const m=S(h),p=h.getBoundingClientRect(),w=b(h),R=p.left+(h.clientLeft+parseFloat(w.paddingLeft))*m.x,F=p.top+(h.clientTop+parseFloat(w.paddingTop))*m.y;f*=m.x,l*=m.y,a*=m.x,d*=m.y,f+=R,l+=F,x=y(h),h=Y(x)}}return et({width:a,height:d,x:f,y:l})}function U(t,e){const o=_(t).scrollLeft;return e?e.left+o:A(E(t)).left+o}function st(t,e,o){o===void 0&&(o=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(o?0:U(t,n)),c=n.top+e.scrollTop;return{x:i,y:c}}function yt(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const c=i==="fixed",r=E(n),s=e?z(e.floating):!1;if(n===r||s&&c)return o;let f={scrollLeft:0,scrollTop:0},l=T(1);const a=T(0),d=C(n);if((d||!d&&!c)&&((W(n)!=="body"||k(r))&&(f=_(n)),C(n))){const u=A(n);l=S(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}const g=r&&!d&&!c?st(r,f,!0):T(0);return{width:o.width*l.x,height:o.height*l.y,x:o.x*l.x-f.scrollLeft*l.x+a.x+g.x,y:o.y*l.y-f.scrollTop*l.y+a.y+g.y}}function xt(t){return Array.from(t.getClientRects())}function vt(t){const e=E(t),o=_(t),n=t.ownerDocument.body,i=D(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),c=D(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-o.scrollLeft+U(t);const s=-o.scrollTop;return b(n).direction==="rtl"&&(r+=D(e.clientWidth,n.clientWidth)-i),{width:i,height:c,x:r,y:s}}function bt(t,e){const o=y(t),n=E(t),i=o.visualViewport;let c=n.clientWidth,r=n.clientHeight,s=0,f=0;if(i){c=i.width,r=i.height;const l=j();(!l||l&&e==="fixed")&&(s=i.offsetLeft,f=i.offsetTop)}return{width:c,height:r,x:s,y:f}}function Rt(t,e){const o=A(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,c=C(t)?S(t):T(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,f=i*c.x,l=n*c.y;return{width:r,height:s,x:f,y:l}}function J(t,e,o){let n;if(e==="viewport")n=bt(t,o);else if(e==="document")n=vt(E(t));else if(v(e))n=Rt(e,o);else{const i=rt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return et(n)}function ct(t,e){const o=O(t);return o===e||!v(o)||N(o)?!1:b(o).position==="fixed"||ct(o,e)}function Lt(t,e){const o=e.get(t);if(o)return o;let n=B(t,[],!1).filter(s=>v(s)&&W(s)!=="body"),i=null;const c=b(t).position==="fixed";let r=c?O(t):t;for(;v(r)&&!N(r);){const s=b(r),f=X(r);!f&&s.position==="fixed"&&(i=null),(c?!f&&!i:!f&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||k(r)&&!f&&ct(t,r))?n=n.filter(a=>a!==r):i=s,r=O(r)}return e.set(t,n),n}function Tt(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const r=[...o==="clippingAncestors"?z(e)?[]:Lt(e,this._c):[].concat(o),n],s=r[0],f=r.reduce((l,a)=>{const d=J(e,a,i);return l.top=D(d.top,l.top),l.right=$(d.right,l.right),l.bottom=$(d.bottom,l.bottom),l.left=D(d.left,l.left),l},J(e,s,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Ct(t){const{width:e,height:o}=it(t);return{width:e,height:o}}function Et(t,e,o){const n=C(e),i=E(e),c=o==="fixed",r=A(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const f=T(0);if(n||!n&&!c)if((W(e)!=="body"||k(i))&&(s=_(e)),n){const g=A(e,!0,c,e);f.x=g.x+e.clientLeft,f.y=g.y+e.clientTop}else i&&(f.x=U(i));const l=i&&!n&&!c?st(i,s):T(0),a=r.left+s.scrollLeft-f.x-l.x,d=r.top+s.scrollTop-f.y-l.y;return{x:a,y:d,width:r.width,height:r.height}}function P(t){return b(t).position==="static"}function Q(t,e){if(!C(t)||b(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return E(t)===o&&(o=o.ownerDocument.body),o}function lt(t,e){const o=y(t);if(z(t))return o;if(!C(t)){let i=O(t);for(;i&&!N(i);){if(v(i)&&!P(i))return i;i=O(i)}return o}let n=Q(t,e);for(;n&>(n)&&P(n);)n=Q(n,e);return n&&N(n)&&P(n)&&!X(n)?o:n||pt(t)||o}const Ot=async function(t){const e=this.getOffsetParent||lt,o=this.getDimensions,n=await o(t.floating);return{reference:Et(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function At(t){return b(t).direction==="rtl"}const Ft={convertOffsetParentRelativeRectToViewportRelativeRect:yt,getDocumentElement:E,getClippingRect:Tt,getOffsetParent:lt,getElementRects:Ot,getClientRects:xt,getDimensions:Ct,getScale:S,isElement:v,isRTL:At};function Dt(t,e){let o=null,n;const i=E(t);function c(){var s;clearTimeout(n),(s=o)==null||s.disconnect(),o=null}function r(s,f){s===void 0&&(s=!1),f===void 0&&(f=1),c();const{left:l,top:a,width:d,height:g}=t.getBoundingClientRect();if(s||e(),!d||!g)return;const u=H(a),x=H(i.clientWidth-(l+d)),h=H(i.clientHeight-(a+g)),m=H(l),w={rootMargin:-u+"px "+-x+"px "+-h+"px "+-m+"px",threshold:D(0,$(1,f))||1};let R=!0;function F(L){const I=L[0].intersectionRatio;if(I!==f){if(!R)return r();I?r(!1,I):n=setTimeout(()=>{r(!1,1e-7)},1e3)}R=!1}try{o=new IntersectionObserver(F,{...w,root:i.ownerDocument})}catch{o=new IntersectionObserver(F,w)}o.observe(t)}return r(!0),c}function Nt(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,l=q(t),a=i||c?[...l?B(l):[],...B(e)]:[];a.forEach(p=>{i&&p.addEventListener("scroll",o,{passive:!0}),c&&p.addEventListener("resize",o)});const d=l&&s?Dt(l,o):null;let g=-1,u=null;r&&(u=new ResizeObserver(p=>{let[w]=p;w&&w.target===l&&u&&(u.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=u)==null||R.observe(e)})),o()}),l&&!f&&u.observe(l),u.observe(e));let x,h=f?A(t):null;f&&m();function m(){const p=A(t);h&&(p.x!==h.x||p.y!==h.y||p.width!==h.width||p.height!==h.height)&&o(),h=p,x=requestAnimationFrame(m)}return o(),()=>{var p;a.forEach(w=>{i&&w.removeEventListener("scroll",o),c&&w.removeEventListener("resize",o)}),d==null||d(),(p=u)==null||p.disconnect(),u=null,f&&cancelAnimationFrame(x)}}const Wt=(t,e,o)=>{const n=new Map,i={platform:Ft,...o},c={...i.platform,_c:n};return ht(t,e,{...i,platform:c})};export{Nt as a,Wt as c,St as t};
|
|
1
|
+
const t="div[role=tooltip]{position:absolute;width:max-content;top:0;left:0;visibility:hidden;opacity:0;transition:opacity .2s}#floating{position:absolute;width:max-content;top:0;left:0}";export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const Rt=["top","right","bottom","left"],nt=["start","end"],ot=Rt.reduce((t,e)=>t.concat(e,e+"-"+nt[0],e+"-"+nt[1]),[]),U=Math.min,B=Math.max,$=Math.round,_=Math.floor,C=t=>({x:t,y:t}),Ot={left:"right",right:"left",bottom:"top",top:"bottom"},Et={start:"end",end:"start"};function ft(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function P(t){return t.split("-")[1]}function Tt(t){return t==="x"?"y":"x"}function ut(t){return t==="y"?"height":"width"}function at(t){return["top","bottom"].includes(I(t))?"y":"x"}function dt(t){return Tt(at(t))}function Ct(t,e,n){n===void 0&&(n=!1);const o=P(t),i=dt(t),s=ut(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=it(r)),[r,it(r)]}function Lt(t){return t.replace(/start|end/g,e=>Et[e])}function it(t){return t.replace(/left|right|bottom|top/g,e=>Ot[e])}function St(t){return{top:0,right:0,bottom:0,left:0,...t}}function At(t){return typeof t!="number"?St(t):{top:t,right:t,bottom:t,left:t}}function z(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function rt(t,e,n){let{reference:o,floating:i}=t;const s=at(e),r=dt(e),c=ut(r),f=I(e),l=s==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2;let a;switch(f){case"top":a={x:d,y:o.y-i.height};break;case"bottom":a={x:d,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:u};break;case"left":a={x:o.x-i.width,y:u};break;default:a={x:o.x,y:o.y}}switch(P(e)){case"start":a[r]-=g*(n&&l?-1:1);break;case"end":a[r]+=g*(n&&l?-1:1);break}return a}const Pt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=rt(l,o,f),g=o,a={},y=0;for(let m=0;m<c.length;m++){const{name:w,fn:h}=c[m],{x:p,y:v,data:b,reset:x}=await h({x:d,y:u,initialPlacement:o,placement:g,strategy:i,middlewareData:a,rects:l,platform:r,elements:{reference:t,floating:e}});d=p??d,u=v??u,a={...a,[w]:{...a[w],...b}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(g=x.placement),x.rects&&(l=x.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:d,y:u}=rt(l,g,f)),m=-1)}return{x:d,y:u,placement:g,strategy:i,middlewareData:a}};async function Dt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:f}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:g=!1,padding:a=0}=ft(e,t),y=At(a),w=c[g?u==="floating"?"reference":"floating":u],h=z(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:f})),p=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},x=z(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:p,offsetParent:v,strategy:f}):p);return{top:(h.top-x.top+y.top)/b.y,bottom:(x.bottom-h.bottom+y.bottom)/b.y,left:(h.left-x.left+y.left)/b.x,right:(x.right-h.right+y.right)/b.x}}function Ft(t,e,n){return(t?[...n.filter(i=>P(i)===t),...n.filter(i=>P(i)!==t)]:n.filter(i=>I(i)===i)).filter(i=>t?P(i)===t||(e?Lt(i)!==i:!1):!0)}const Bt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:s,middlewareData:r,placement:c,platform:f,elements:l}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:g=ot,autoAlignment:a=!0,...y}=ft(t,e),m=u!==void 0||g===ot?Ft(u||null,a,g):g,w=await Dt(e,y),h=((n=r.autoPlacement)==null?void 0:n.index)||0,p=m[h];if(p==null)return{};const v=Ct(p,s,await(f.isRTL==null?void 0:f.isRTL(l.floating)));if(c!==p)return{reset:{placement:m[0]}};const b=[w[I(p)],w[v[0]],w[v[1]]],x=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:p,overflows:b}],F=m[h+1];if(F)return{data:{index:h+1,overflows:x},reset:{placement:F}};const tt=x.map(T=>{const V=P(T.placement);return[T.placement,V&&d?T.overflows.slice(0,2).reduce((vt,bt)=>vt+bt,0):T.overflows[0],T.overflows]}).sort((T,V)=>T[1]-V[1]),et=((i=tt.filter(T=>T[2].slice(0,P(T[0])?2:3).every(V=>V<=0))[0])==null?void 0:i[0])||tt[0][0];return et!==c?{data:{index:h+1,overflows:x},reset:{placement:et}}:{}}}};function j(){return typeof window<"u"}function M(t){return ht(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function S(t){var e;return(e=(ht(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ht(t){return j()?t instanceof Node||t instanceof R(t).Node:!1}function O(t){return j()?t instanceof Element||t instanceof R(t).Element:!1}function L(t){return j()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function st(t){return!j()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Nt(t){return["table","td","th"].includes(M(t))}function Y(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function G(t){const e=J(),n=O(t)?E(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Wt(t){let e=A(t);for(;L(e)&&!W(e);){if(G(e))return e;if(Y(e))return null;e=A(e)}return null}function J(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function W(t){return["html","body","#document"].includes(M(t))}function E(t){return R(t).getComputedStyle(t)}function X(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function A(t){if(M(t)==="html")return t;const e=t.assignedSlot||t.parentNode||st(t)&&t.host||S(t);return st(e)?e.host:e}function gt(t){const e=A(t);return W(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&H(e)?e:gt(e)}function k(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=gt(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const c=K(r);return e.concat(r,r.visualViewport||[],H(i)?i:[],c&&n?k(c):[])}return e.concat(i,k(i,[],n))}function K(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function mt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=L(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=$(n)!==s||$(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function Q(t){return O(t)?t:t.contextElement}function N(t){const e=Q(t);if(!L(e))return C(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=mt(e);let r=(s?$(n.width):n.width)/o,c=(s?$(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Mt=C(0);function pt(t){const e=R(t);return!J()||!e.visualViewport?Mt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Vt(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function D(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Q(t);let r=C(1);e&&(o?O(o)&&(r=N(o)):r=N(t));const c=Vt(s,n,o)?pt(s):C(0);let f=(i.left+c.x)/r.x,l=(i.top+c.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(s){const g=R(s),a=o&&O(o)?R(o):o;let y=g,m=K(y);for(;m&&o&&a!==y;){const w=N(m),h=m.getBoundingClientRect(),p=E(m),v=h.left+(m.clientLeft+parseFloat(p.paddingLeft))*w.x,b=h.top+(m.clientTop+parseFloat(p.paddingTop))*w.y;f*=w.x,l*=w.y,d*=w.x,u*=w.y,f+=v,l+=b,y=R(m),m=K(y)}}return z({width:d,height:u,x:f,y:l})}function Z(t,e){const n=X(t).scrollLeft;return e?e.left+n:D(S(t)).left+n}function wt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Z(t,o)),s=o.top+e.scrollTop;return{x:i,y:s}}function kt(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=S(o),c=e?Y(e.floating):!1;if(o===r||c&&s)return n;let f={scrollLeft:0,scrollTop:0},l=C(1);const d=C(0),u=L(o);if((u||!u&&!s)&&((M(o)!=="body"||H(r))&&(f=X(o)),L(o))){const a=D(o);l=N(o),d.x=a.x+o.clientLeft,d.y=a.y+o.clientTop}const g=r&&!u&&!s?wt(r,f,!0):C(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-f.scrollLeft*l.x+d.x+g.x,y:n.y*l.y-f.scrollTop*l.y+d.y+g.y}}function Ht(t){return Array.from(t.getClientRects())}function _t(t){const e=S(t),n=X(t),o=t.ownerDocument.body,i=B(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=B(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Z(t);const c=-n.scrollTop;return E(o).direction==="rtl"&&(r+=B(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}function $t(t,e){const n=R(t),o=S(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,c=0,f=0;if(i){s=i.width,r=i.height;const l=J();(!l||l&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:s,height:r,x:c,y:f}}function zt(t,e){const n=D(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=L(t)?N(t):C(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,f=i*s.x,l=o*s.y;return{width:r,height:c,x:f,y:l}}function ct(t,e,n){let o;if(e==="viewport")o=$t(t,n);else if(e==="document")o=_t(S(t));else if(O(e))o=zt(e,n);else{const i=pt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return z(o)}function yt(t,e){const n=A(t);return n===e||!O(n)||W(n)?!1:E(n).position==="fixed"||yt(n,e)}function It(t,e){const n=e.get(t);if(n)return n;let o=k(t,[],!1).filter(c=>O(c)&&M(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?A(t):t;for(;O(r)&&!W(r);){const c=E(r),f=G(r);!f&&c.position==="fixed"&&(i=null),(s?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||H(r)&&!f&&yt(t,r))?o=o.filter(d=>d!==r):i=c,r=A(r)}return e.set(t,o),o}function jt(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?Y(e)?[]:It(e,this._c):[].concat(n),o],c=r[0],f=r.reduce((l,d)=>{const u=ct(e,d,i);return l.top=B(u.top,l.top),l.right=U(u.right,l.right),l.bottom=U(u.bottom,l.bottom),l.left=B(u.left,l.left),l},ct(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Yt(t){const{width:e,height:n}=mt(t);return{width:e,height:n}}function Xt(t,e,n){const o=L(e),i=S(e),s=n==="fixed",r=D(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const f=C(0);if(o||!o&&!s)if((M(e)!=="body"||H(i))&&(c=X(e)),o){const g=D(e,!0,s,e);f.x=g.x+e.clientLeft,f.y=g.y+e.clientTop}else i&&(f.x=Z(i));const l=i&&!o&&!s?wt(i,c):C(0),d=r.left+c.scrollLeft-f.x-l.x,u=r.top+c.scrollTop-f.y-l.y;return{x:d,y:u,width:r.width,height:r.height}}function q(t){return E(t).position==="static"}function lt(t,e){if(!L(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return S(t)===n&&(n=n.ownerDocument.body),n}function xt(t,e){const n=R(t);if(Y(t))return n;if(!L(t)){let i=A(t);for(;i&&!W(i);){if(O(i)&&!q(i))return i;i=A(i)}return n}let o=lt(t,e);for(;o&&Nt(o)&&q(o);)o=lt(o,e);return o&&W(o)&&q(o)&&!G(o)?n:o||Wt(t)||n}const qt=async function(t){const e=this.getOffsetParent||xt,n=this.getDimensions,o=await n(t.floating);return{reference:Xt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ut(t){return E(t).direction==="rtl"}const Kt={convertOffsetParentRelativeRectToViewportRelativeRect:kt,getDocumentElement:S,getClippingRect:jt,getOffsetParent:xt,getElementRects:qt,getClientRects:Ht,getDimensions:Yt,getScale:N,isElement:O,isRTL:Ut};function Gt(t,e){let n=null,o;const i=S(t);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const{left:l,top:d,width:u,height:g}=t.getBoundingClientRect();if(c||e(),!u||!g)return;const a=_(d),y=_(i.clientWidth-(l+u)),m=_(i.clientHeight-(d+g)),w=_(l),p={rootMargin:-a+"px "+-y+"px "+-m+"px "+-w+"px",threshold:B(0,U(1,f))||1};let v=!0;function b(x){const F=x[0].intersectionRatio;if(F!==f){if(!v)return r();F?r(!1,F):o=setTimeout(()=>{r(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(b,{...p,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,p)}n.observe(t)}return r(!0),s}function Qt(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,l=Q(t),d=i||s?[...l?k(l):[],...k(e)]:[];d.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const u=l&&c?Gt(l,n):null;let g=-1,a=null;r&&(a=new ResizeObserver(h=>{let[p]=h;p&&p.target===l&&a&&(a.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=a)==null||v.observe(e)})),n()}),l&&!f&&a.observe(l),a.observe(e));let y,m=f?D(t):null;f&&w();function w(){const h=D(t);m&&(h.x!==m.x||h.y!==m.y||h.width!==m.width||h.height!==m.height)&&n(),m=h,y=requestAnimationFrame(w)}return n(),()=>{var h;d.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),u==null||u(),(h=a)==null||h.disconnect(),a=null,f&&cancelAnimationFrame(y)}}const Zt=Bt,te=(t,e,n)=>{const o=new Map,i={platform:Kt,...n},s={...i.platform,_c:o};return Pt(t,e,{...i,platform:s})};export{Qt as a,Zt as b,te as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as p,a as i,x as b}from"../../assets/index-chunk2.js";import{t as g}from"../../assets/index-chunk3.js";import{n as
|
|
1
|
+
import{r as p,a as i,x as b}from"../../assets/index-chunk2.js";import{t as g}from"../../assets/index-chunk3.js";import{n as a}from"../../assets/index-chunk.js";import{p as u}from"../../assets/index-chunk4.js";import{s as h}from"../../assets/index-chunk5.js";import{g as m,a as v}from"../../utils/string-utils.js";import"../radio-group/radio-group.gator.js";import"../../consts/key-constants.js";import"../radio/radio.gator.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../utils/lightdom-utils.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../input/gator/help-text/help-text.gator.js";import"../input/gator/input-label/input-label.gator.js";import"../../utils/mixins/attribute-deletion.js";import"../../utils/datatestid-utils.js";import"../../assets/index-chunk9.js";const f=":root,:host{--ngc-radio-group-flex-direction: row;--ngc-radio-group-gap: 0}ngc-radio{display:flex;padding:1.5rem 5.1875rem;flex-direction:column;justify-content:center;align-items:center;flex:1 0 0;cursor:pointer;z-index:0;border:var(--ngc-boolean-border);background:var(--ngc-boolean-background-color)}.gator-boolean-option-0{border-radius:var(--ngc-boolean-outer-border-radius) 0 0 var(--ngc-boolean-outer-border-radius)}.gator-boolean-option-1{margin-top:0;margin-left:-1px;border-radius:0 var(--ngc-boolean-outer-border-radius) var(--ngc-boolean-outer-border-radius) 0}.gator-boolean_wrapped .gator-boolean-option-0{border-radius:var(--ngc-boolean-outer-border-radius) var(--ngc-boolean-outer-border-radius) 0 0}.gator-boolean_wrapped .gator-boolean-option-1{margin-top:-1px;margin-left:0;border-radius:0 0 var(--ngc-boolean-outer-border-radius) var(--ngc-boolean-outer-border-radius)}.gator-boolean-option_selected{z-index:1;background:var(--ngc-boolean-background-color-selected);border:var(--ngc-boolean-border-selected);animation:.3s ease-out selectBoolean}@keyframes selectBoolean{0%{background:var(--ngc-boolean-background-color);border:var(--ngc-boolean-border)}to{background:var(--ngc-boolean-background-color-selected);border:var(--ngc-boolean-border-selected)}}:hover:not(.gator-boolean_disabled){z-index:1;box-shadow:var(--ngc-boolean-box-shadow-hover)}:hover:not(.gator-boolean_disabled):not(.gator-boolean_error) ngc-radio:hover{border:var(--ngc-boolean-border-hover)}.gator-boolean_disabled ngc-radio{cursor:not-allowed}ngc-radio:focus-within{z-index:1;border:var(--ngc-boolean-border-focus);outline:var(--ngc-boolean-outline-focus);outline-offset:1px;--ngc-radio-focus-border: none}.gator-boolean_error ngc-radio{border:var(--ngc-boolean-border-error);--ngc-radio-icon-color-error: var(--color-neutral-40)}",x=":host,:root{--ngc-boolean-background-color: var(--color-neutral-0, #FFF);--ngc-boolean-background-color-selected: var(--color-blue-10, #F3F5F7);--ngc-boolean-border-color: var(--color-neutral-40, #BFBFBF);--ngc-boolean-border-color-selected: var(--color-blue-30, #11395B);--ngc-boolean-border-color-hover: var(--color-blue-30, #11395B);--ngc-boolean-border-color-focus: var(--color-blue-30, #11395B);--ngc-boolean-outline-color-focus: var(--color-blue-30, #11395B);--ngc-boolean-border-color-error: var(--color-stroke-error-strong);--ngc-boolean-border: var(--size-stroke-1, 1px) solid var(--ngc-boolean-border-color);--ngc-boolean-border-selected: var(--size-stroke-1, 1px) solid var(--ngc-boolean-border-color-selected);--ngc-boolean-border-hover: var(--size-stroke-1, 1px) solid var(--ngc-boolean-border-color-hover);--ngc-boolean-border-focus: var(--size-stroke-1, 1px) solid var(--ngc-boolean-border-color-focus);--ngc-boolean-border-error: var(--size-stroke-1, 1px) solid var(--ngc-boolean-border-color-error);--ngc-boolean-outline-focus: var(--size-stroke-1, 1px) solid var(--ngc-boolean-outline-color-focus);--ngc-boolean-box-shadow-hover: 0px 5px 10px 0px rgba(31, 31, 31, .1), 0px 7px 14px 0px rgba(31, 31, 31, .08), 0px 3px 6px 0px rgba(31, 31, 31, .08);--ngc-boolean-outer-border-radius: .125rem}";var y=Object.defineProperty,w=Object.getOwnPropertyDescriptor,t=(o,r,l,s)=>{for(var n=s>1?void 0:s?w(r,l):r,d=o.length-1,c;d>=0;d--)(c=o[d])&&(n=(s?c(r,l,n):c(n))||n);return s&&n&&y(r,l,n),n};let e=class extends p{constructor(){super(...arguments),this.id="",this.options=[],this.disabled=!1,this.value="",this.label="",this.helpText="",this.hasError=!1,this.errorMessage="",this._randomId=m()}firstUpdated(){this.handleResize(),window.addEventListener("resize",()=>this.handleResize())}render(){return b`
|
|
2
2
|
<ngc-radio-group
|
|
3
3
|
class=${this.booleanClasses}
|
|
4
4
|
id=${this.elementId}
|
|
@@ -18,4 +18,4 @@ import{r as p,a as i,x as b}from"../../assets/index-chunk2.js";import{t as g}fro
|
|
|
18
18
|
value=${r.value}
|
|
19
19
|
title-text=${r.label}
|
|
20
20
|
></ngc-radio>
|
|
21
|
-
`);return b`${o}`}get isWrapped(){var r;const o=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("ngc-radio");return o&&o.length>1?o[0].offsetTop<o[1].offsetTop:window.innerWidth<475}handleChange(o){const r=o;r.stopImmediatePropagation(),this.value=r.detail,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:this.value}))}handleResize(){var r;const o=(r=this.shadowRoot)==null?void 0:r.querySelector("ngc-radio-group");this.isWrapped?o==null||o.classList.add("gator-boolean_wrapped"):o==null||o.classList.remove("gator-boolean_wrapped")}selectedClass(o){return this.value===o.value?" gator-boolean-option_selected":""}};e.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0};e.styles=[i(f),i(x),i(u),i(h)];
|
|
21
|
+
`);return b`${o}`}get isWrapped(){var r;const o=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("ngc-radio");return o&&o.length>1?o[0].offsetTop<o[1].offsetTop:window.innerWidth<475}handleChange(o){const r=o;r.stopImmediatePropagation(),this.value=r.detail,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:this.value}))}handleResize(){var r;const o=(r=this.shadowRoot)==null?void 0:r.querySelector("ngc-radio-group");this.isWrapped?o==null||o.classList.add("gator-boolean_wrapped"):o==null||o.classList.remove("gator-boolean_wrapped")}selectedClass(o){return this.value===o.value?" gator-boolean-option_selected":""}};e.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0};e.styles=[i(f),i(x),i(u),i(h)];t([a({type:String})],e.prototype,"id",2);t([a({type:Array})],e.prototype,"options",2);t([a({type:Boolean})],e.prototype,"disabled",2);t([a({type:String})],e.prototype,"value",2);t([a({type:String})],e.prototype,"label",2);t([a({type:String,attribute:"help-text"})],e.prototype,"helpText",2);t([a({type:Boolean,attribute:"has-error"})],e.prototype,"hasError",2);t([a({type:String,attribute:"error-message"})],e.prototype,"errorMessage",2);e=t([g("ngc-boolean")],e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./boolean.gator.js";import"../../assets/index-chunk2.js";import"../../assets/index-chunk3.js";import"../../assets/index-chunk.js";import"../../assets/index-chunk4.js";import"../../assets/index-chunk5.js";import"../../utils/string-utils.js";import"../radio-group/radio-group.gator.js";import"../../consts/key-constants.js";import"../radio/radio.gator.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../utils/lightdom-utils.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../input/gator/help-text/help-text.gator.js";import"../input/gator/input-label/input-label.gator.js";import"../../utils/datatestid-utils.js";import"../../assets/index-chunk9.js";
|
|
1
|
+
import"./boolean.gator.js";import"../../assets/index-chunk2.js";import"../../assets/index-chunk3.js";import"../../assets/index-chunk.js";import"../../assets/index-chunk4.js";import"../../assets/index-chunk5.js";import"../../utils/string-utils.js";import"../radio-group/radio-group.gator.js";import"../../consts/key-constants.js";import"../radio/radio.gator.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../utils/lightdom-utils.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../input/gator/help-text/help-text.gator.js";import"../input/gator/input-label/input-label.gator.js";import"../../utils/mixins/attribute-deletion.js";import"../../utils/datatestid-utils.js";import"../../assets/index-chunk9.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c,x as n}from"../../assets/index-chunk2.js";import{t as m}from"../../assets/index-chunk3.js";import{n as p}from"../../assets/index-chunk.js";import{g,a as u}from"../../utils/string-utils.js";import{p as b}from"../../assets/index-chunk4.js";import{s as x}from"../../assets/index-chunk5.js";import"../checkbox/checkbox.gator.js";import"../input/gator/input-label/input-label.gator.js";import"../input/gator/help-text/help-text.gator.js";import{h as y}from"../../utils/datatestid-utils.js";import{T as f}from"../../utils/components/testable-lit-element/testable-lit-element.js";import{o as d}from"../../assets/index-chunk9.js";import"../../utils/lightdom-utils.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";const v=".gator-checkbox-group,.gator-checkbox-group-container{display:flex;flex-direction:column;gap:var(--spacing-gap-8)}";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(e,t,r,o)=>{for(var i=o>1?void 0:o?k(t,r):t,a=e.length-1,h;a>=0;a--)(h=e[a])&&(i=(o?h(t,r,i):h(i))||i);return o&&i&&$(t,r,i),i};let s=class extends f{constructor(){super(...arguments),this.id="",this.label="",this.helpText="",this.value="",this.disabled=!1,this.hasError=!1,this.errorMessage="",this.options=[],this._randomId=g()}render(){const e=this.elementId;return n`
|
|
1
|
+
import{a as c,x as n}from"../../assets/index-chunk2.js";import{t as m}from"../../assets/index-chunk3.js";import{n as p}from"../../assets/index-chunk.js";import{g,a as u}from"../../utils/string-utils.js";import{p as b}from"../../assets/index-chunk4.js";import{s as x}from"../../assets/index-chunk5.js";import"../checkbox/checkbox.gator.js";import"../input/gator/input-label/input-label.gator.js";import"../input/gator/help-text/help-text.gator.js";import{h as y}from"../../utils/datatestid-utils.js";import{T as f}from"../../utils/components/testable-lit-element/testable-lit-element.js";import{o as d}from"../../assets/index-chunk9.js";import"../../utils/lightdom-utils.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../utils/mixins/attribute-deletion.js";const v=".gator-checkbox-group,.gator-checkbox-group-container{display:flex;flex-direction:column;gap:var(--spacing-gap-8)}";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(e,t,r,o)=>{for(var i=o>1?void 0:o?k(t,r):t,a=e.length-1,h;a>=0;a--)(h=e[a])&&(i=(o?h(t,r,i):h(i))||i);return o&&i&&$(t,r,i),i};let s=class extends f{constructor(){super(...arguments),this.id="",this.label="",this.helpText="",this.value="",this.disabled=!1,this.hasError=!1,this.errorMessage="",this.options=[],this._randomId=g()}render(){const e=this.elementId;return n`
|
|
2
2
|
<div class="gator-checkbox-group-container">
|
|
3
3
|
${this.label?n`<ngc-input-label id="${e}-label" data-testid=${d(this.labelDataTestid)}>${this.label}</ngc-input-label>`:null}
|
|
4
4
|
<div id="${e}-group"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./checkbox-group.gator.js";import"../../assets/index-chunk2.js";import"../../assets/index-chunk3.js";import"../../assets/index-chunk.js";import"../../utils/string-utils.js";import"../../assets/index-chunk4.js";import"../../assets/index-chunk5.js";import"../checkbox/checkbox.gator.js";import"../../utils/lightdom-utils.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../input/gator/input-label/input-label.gator.js";import"../input/gator/help-text/help-text.gator.js";import"../../utils/datatestid-utils.js";import"../../assets/index-chunk9.js";
|
|
1
|
+
import"./checkbox-group.gator.js";import"../../assets/index-chunk2.js";import"../../assets/index-chunk3.js";import"../../assets/index-chunk.js";import"../../utils/string-utils.js";import"../../assets/index-chunk4.js";import"../../assets/index-chunk5.js";import"../checkbox/checkbox.gator.js";import"../../utils/lightdom-utils.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../input/gator/input-label/input-label.gator.js";import"../../utils/mixins/attribute-deletion.js";import"../input/gator/help-text/help-text.gator.js";import"../../utils/datatestid-utils.js";import"../../assets/index-chunk9.js";
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import{x as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import{a as o,x as r}from"../../../assets/index-chunk2.js";import"../gator/input-label/input-label.gator.js";import"../gator/help-text/help-text.gator.js";import"../../icon/gator/icon.gator.js";import"../../icon/gator/templates/arrow-left.js";import"../../icon/gator/templates/arrow-right.js";import"../../icon/gator/templates/balloons.js";import"../../icon/gator/templates/check-circle.js";import"../../icon/gator/templates/check.js";import"../../icon/gator/templates/checkbox.js";import"../../icon/gator/templates/checkbox-selected.js";import"../../icon/gator/templates/chevron-down.js";import"../../icon/gator/templates/chevron-right.js";import"../../icon/gator/templates/chevron-up.js";import"../../icon/gator/templates/exit.js";import"../../icon/gator/templates/exit-circle.js";import"../../icon/gator/templates/eye-crossed.js";import"../../icon/gator/templates/info.js";import"../../icon/gator/templates/link.js";import"../../icon/gator/templates/overflow-menu.js";import"../../icon/gator/templates/picture.js";import"../../icon/gator/templates/radio.js";import"../../icon/gator/templates/radio-selected.js";import"../../icon/gator/templates/restricted.js";import"../../icon/gator/templates/warning.js";import{s as i}from"../../../assets/index-chunk5.js";import{p as a}from"../../../assets/index-chunk4.js";import{I as p}from"./input-base.js";import{e as s}from"../../../assets/index-chunk7.js";import"../../../assets/index-chunk3.js";import"../../../assets/index-chunk.js";import"../../../utils/mixins/attribute-deletion.js";import"../../icon/icon-registry.js";import"../../../utils/components/testable-lit-element/testable-lit-element.js";import"../../../assets/index-chunk8.js";const l='input,textarea{border:none}input:focus,textarea:focus{outline:none}.gator-form-element-control:focus-within{outline:2px solid var(--ngc-input-border-color-focused, #1F1F1F)!important;border:1px solid transparent!important}.gator-form-element{display:block;margin-bottom:1rem}.gator-form-element-control{padding:var(--ngc-input-padding);display:flex;flex-direction:column}.gator-input,.gator-faux-input{display:flex;width:100%;height:100%;font-size:var(--ngc-input-font-size, 1.0625rem);font-family:var(--text-family-sans-serif, "Open Sans", sans-serif)}.gator-form-element-control{margin:.5rem 0;border:1px solid var(--ngc-input-border-color, #BFBFBF);border-radius:var(--ngc-input-border-radius, 2px);flex:1}.gator-form-element-control:hover:not(.gator-disabled){border:1px solid var(--ngc-input-border-color-hovered, #1F1F1F);outline:none}.gator-has-error{border-color:var(--ngc-input-error-border)!important}.gator-disabled{background:var(--color-surface-secondary, #F7F7F7);border:none;cursor:not-allowed}.gator-disabled input,.gator-disabled textarea{background-color:transparent;cursor:not-allowed}.gator-form-element-control-icon-right{display:flex;align-items:center}.gator-input-container{max-width:var(--ngc-input-max-width, 200px);display:flex;align-items:center;position:relative}.gator-input-start,.gator-input-end{display:flex;align-items:center}.gator-input-start{margin-right:.5rem}.gator-cursor-pointer{cursor:pointer}',c=":root,:host{--ngc-input-error-border: var(--color-error, #D0021B);--ngc-input-border-color: var(--color-grey-40, #BFBFBF);--ngc-input-border-color-focused: var(--color-stroke-brand, #1F1F1F);--ngc-input-border-color-hovered: var(--color-stroke-interactive, #0052CC);--ngc-input-min-width: 200px;--ngc-input-padding: var(--spacing-3, .75rem) var(--spacing-4, 1rem);--ngc-input-border-radius: var(--radius-sm, .125rem);--ngc-input-max-width: 100%;--ngc-input-font-size: 17px}",e=class e extends p{constructor(){super(...arguments),this.controlRef=s()}get shouldHaveStartMarkup(){return this.startIcon}get shouldHaveEndMarkup(){return this.endIcon||this.type==="password"}get startIconMarkup(){return this.startIcon?r`<ngc-icon .name="${this.startIcon}"></ngc-icon>`:null}get endIconMarkup(){return this.endIcon?r`
|
|
2
|
+
<ngc-icon .name="${this.endIcon}"></ngc-icon>`:null}get labelMarkup(){return r`
|
|
3
|
+
<ngc-input-label
|
|
4
|
+
.for="${this.id}"
|
|
5
|
+
.required="${this.required}"
|
|
6
|
+
>
|
|
7
|
+
${this.label}
|
|
8
|
+
</ngc-input-label>`}get helpTextMarkup(){return this.helpText?r`
|
|
9
|
+
<ngc-help-text icon="info">
|
|
10
|
+
${this.helpText}
|
|
11
|
+
</ngc-help-text>`:null}get bottomText(){return r`
|
|
12
|
+
${this.helpTextMarkup}
|
|
8
13
|
${this.errorTextMarkup}
|
|
9
|
-
|
|
10
|
-
<ngc-help-text icon error
|
|
11
|
-
|
|
14
|
+
`}get errorTextMarkup(){return this.errorText?r`
|
|
15
|
+
<ngc-help-text icon="warning" error>
|
|
16
|
+
${this.errorText}
|
|
17
|
+
</ngc-help-text>`:null}handleInputFocusIn(){var t;(t=this.controlRef.value)==null||t.classList.add("gator-input-has-focus")}handleInputFocusOut(){var t;(t=this.controlRef.value)==null||t.classList.remove("gator-input-has-focus")}};e.styles=[o(l),o(i),o(a),o(c)];let n=e;export{n as N,c as g,l as i};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import{a as v,x as d}from"../../../../assets/index-chunk2.js";import"../input-label/input-label.gator.js";import"../help-text/help-text.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/arrow-left.js";import"../../../icon/gator/templates/arrow-right.js";import"../../../icon/gator/templates/balloons.js";import"../../../icon/gator/templates/check-circle.js";import"../../../icon/gator/templates/check.js";import"../../../icon/gator/templates/checkbox.js";import"../../../icon/gator/templates/checkbox-selected.js";import"../../../icon/gator/templates/chevron-down.js";import"../../../icon/gator/templates/chevron-right.js";import"../../../icon/gator/templates/chevron-up.js";import"../../../icon/gator/templates/exit.js";import"../../../icon/gator/templates/exit-circle.js";import"../../../icon/gator/templates/eye-crossed.js";import"../../../icon/gator/templates/info.js";import"../../../icon/gator/templates/link.js";import"../../../icon/gator/templates/overflow-menu.js";import"../../../icon/gator/templates/picture.js";import"../../../icon/gator/templates/radio.js";import"../../../icon/gator/templates/radio-selected.js";import"../../../icon/gator/templates/restricted.js";import"../../../icon/gator/templates/warning.js";import"../../../list/gator/list/list.gator.js";import"../../../list/gator/list-item/list-item.gator.js";import{t as f}from"../../../../assets/index-chunk3.js";import{n as m}from"../../../../assets/index-chunk.js";import{r as u}from"../../../../assets/index-chunk11.js";import{e as h,n as c}from"../../../../assets/index-chunk7.js";import{a as x,c as b,b as w}from"../../../../assets/index-chunk14.js";import{K as s}from"../../../../consts/key-constants.js";import{N as g}from"../../base/input-base.gator.js";import"../../../../assets/index-chunk4.js";import"../../../../assets/index-chunk5.js";import"../../../../utils/mixins/attribute-deletion.js";import"../../../icon/icon-registry.js";import"../../../../utils/components/testable-lit-element/testable-lit-element.js";import"../../../divider/gator/divider.gator.js";import"../../../divider/divider.js";import"../../../../assets/index-chunk9.js";import"../../../../assets/index-chunk8.js";import"../../base/input-base.js";const y=".gator-dropdown-listbox{position:absolute;width:max-content;top:0;left:0;display:none;border-radius:var(--radius-card-medium, .5rem);padding:var(--spacing-padding-margin-8, .5rem) 0;background:var(--color-surface-primary-white, #FFF);box-shadow:var(--shadow-x-offset-0, 0px) var(--shadow-shadow-3-dropdown-property-1-y-offset, 7px) var(--shadow-shadow-3-dropdown-property-1-blur, 12px) var(--shadow-shadow-3-dropdown-property-1-spread, 0px) var(--shadow-color-10, rgba(31, 31, 31, .1)),var(--shadow-x-offset-0, 0px) var(--shadow-shadow-3-dropdown-property-2-y-offset, 8px) var(--shadow-shadow-3-dropdown-property-2-blur, 16px) var(--shadow-shadow-3-dropdown-property-2-spread, 0px) var(--shadow-color-8, rgba(31, 31, 31, .08)),var(--shadow-x-offset-0, 0px) var(--shadow-shadow-3-dropdown-property-3-y-offset, 9px) var(--shadow-shadow-3-dropdown-property-3-blur, 18px) var(--shadow-shadow-3-dropdown-property-3-spread, 0px) var(--shadow-color-8, rgba(31, 31, 31, .08))}.gator-form-element-control:focus{outline:2px solid var(--ngc-input-border-color-focused, #1F1F1F)!important;border:1px solid transparent!important}.gator-dropdown-listbox_expanded{display:block}";var _=Object.defineProperty,$=Object.getOwnPropertyDescriptor,R=Object.getPrototypeOf,D=Reflect.get,l=(t,e,i,o)=>{for(var a=o>1?void 0:o?$(e,i):e,n=t.length-1,p;n>=0;n--)(p=t[n])&&(a=(o?p(e,i,a):p(a))||a);return o&&a&&_(e,i,a),a},A=(t,e,i)=>D(R(t),i,e);let r=class extends g{constructor(){super(...arguments),this.options=[],this._expanded=!1,this.listboxRef=h(),this.listRef=h()}render(){return d`
|
|
2
|
+
<div class="gator-form-element">
|
|
3
|
+
${this.label?this.labelMarkup:null}
|
|
4
|
+
<div
|
|
5
|
+
${c(this.controlRef)}
|
|
6
|
+
class="gator-form-element-control ${this.errorClass} gator-cursor-pointer"
|
|
7
|
+
aria-controls="listbox-${this.id}"
|
|
8
|
+
aria-expanded="${this._expanded}"
|
|
9
|
+
aria-haspopup="listbox"
|
|
10
|
+
aria-labelledby="dropdown-label-${this.id}"
|
|
11
|
+
id="listbox-control-${this.id}"
|
|
12
|
+
tabindex="0"
|
|
13
|
+
role="combobox"
|
|
14
|
+
title="${this.id}"
|
|
15
|
+
@click="${this.toggleListbox}"
|
|
16
|
+
@keydown="${this.handleComboboxKeydown}"
|
|
17
|
+
@focusout="${()=>this._expanded=!1}"
|
|
18
|
+
>
|
|
19
|
+
<div class="gator-input-container">
|
|
20
|
+
${this.shouldHaveStartMarkup?d`
|
|
21
|
+
<div class="gator-input-start">
|
|
22
|
+
${this.startIconMarkup}
|
|
23
|
+
</div>`:null}
|
|
24
|
+
|
|
25
|
+
<div class="gator-faux-input">
|
|
26
|
+
${this.value}
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="gator-input-end">
|
|
30
|
+
${this.endIconMarkup}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
${this.bottomText}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
${this.listboxMarkup}
|
|
39
|
+
</div>
|
|
40
|
+
`}firstUpdated(){this._expanded&&this.toggleListbox(s.ENTER,!0)}updated(){var t,e,i,o;this._expanded&&this.value&&((t=this.controlRef.value)==null||t.setAttribute("aria-activedescendant",this.replacedActiveDescendant)),this._expanded&&!this.value&&(this._activeDescendant=(i=(e=this.shadowRoot)==null?void 0:e.querySelector("ngc-list-item"))==null?void 0:i.id,(o=this.controlRef.value)==null||o.setAttribute("aria-activedescendant",this.replacedActiveDescendant))}get replacedActiveDescendant(){return this._activeDescendant?this._activeDescendant.replace(" ",""):""}get listboxMarkup(){return d`
|
|
41
|
+
<div
|
|
42
|
+
${c(this.listboxRef)}
|
|
43
|
+
class="gator-dropdown-listbox ${this._expanded?"gator-dropdown-listbox_expanded":""}"
|
|
44
|
+
>
|
|
45
|
+
<ngc-list
|
|
46
|
+
.id="listbox-${this.id}"
|
|
47
|
+
${c(this.listRef)}
|
|
48
|
+
selectable
|
|
49
|
+
@selected="${this.handleSelected}"
|
|
50
|
+
faux-focus
|
|
51
|
+
.title="${this.id}-list"
|
|
52
|
+
.aria-labelledby="dropdown-label-${this.id}"
|
|
53
|
+
>
|
|
54
|
+
${this.options.map(t=>d`
|
|
55
|
+
<ngc-list-item
|
|
56
|
+
text="${t.label}"
|
|
57
|
+
value="${t.value}"
|
|
58
|
+
?selected="${t.value===this.value}"
|
|
59
|
+
.id="${this.id}-${t.value}"
|
|
60
|
+
faux-focus
|
|
61
|
+
></ngc-list-item>
|
|
62
|
+
`)}
|
|
63
|
+
</ngc-list>
|
|
64
|
+
</div>
|
|
65
|
+
`}handleSelected(){var t;this._expanded=!1,this._activeDescendant=void 0,(t=this.controlRef.value)==null||t.removeAttribute("aria-activedescendant")}handleComboboxKeydown(t){var e,i;!this._expanded&&(t.key===s.ENTER||t.key===s.SPACE||t.key===s.DOWN)?this.toggleListbox(t.key,!1):this._expanded&&this.listRef.value&&((t.key===s.ENTER||t.key===s.SPACE)&&this.listRef.value.selectFalseFocusedItem(),t.key===s.DOWN&&(this._activeDescendant=this.listRef.value.falseFocusNextItem(),(e=this.controlRef.value)==null||e.setAttribute("aria-activedescendant",this.replacedActiveDescendant)),t.key===s.UP&&(this._activeDescendant=this.listRef.value.falseFocusPreviousItem(),(i=this.controlRef.value)==null||i.setAttribute("aria-activedescendant",this.replacedActiveDescendant))),t.key===s.ESCAPE&&(this._expanded=!1)}get errorClass(){return this.errorText?"gator-has-error":""}get labelMarkup(){return d`
|
|
66
|
+
<ngc-input-label
|
|
67
|
+
.for="dropdown-label-${this.id}"
|
|
68
|
+
.required="${this.required}"
|
|
69
|
+
type="div"
|
|
70
|
+
>
|
|
71
|
+
${this.label}
|
|
72
|
+
</ngc-input-label>`}toggleListbox(t,e){var i;e||(this._expanded=!this._expanded),setTimeout(()=>{var o;this.assignPosition(),this.listRef.value&&(t==s.DOWN||!this.value)?this._activeDescendant=this.listRef.value.falseFocusFirstItem():this.value&&this.listRef.value&&(this._activeDescendant=this.listRef.value.setFalseFocusToValue(this.value)),this._expanded&&((o=this.controlRef.value)==null||o.setAttribute("aria-activedescendant",this.replacedActiveDescendant))}),this._expanded||(this._activeDescendant=void 0,(i=this.controlRef.value)==null||i.removeAttribute("aria-activedescendant"))}get endIconMarkup(){return d`<ngc-icon .name="${this.endIcon||"chevron-down"}"></ngc-icon>`}assignPosition(){const t=this.controlRef.value;!this.listboxRef||!this.listboxRef.value||!t||(this._cleanup=x(t,this.listboxRef.value,async()=>{if(!this.listboxRef||!this.listboxRef.value||!t)return;const{x:e,y:i,placement:o}=await b(t,this.listboxRef.value,{placement:"bottom",middleware:[w()]});let a=o==="bottom"?4:-4;Object.assign(this.listboxRef.value.style,{left:`${e}px`,top:`${i+a}px`,width:`${t.clientWidth}px`})}))}};r.styles=[...A(r,r,"styles"),v(y)];l([m({type:Array})],r.prototype,"options",2);l([u()],r.prototype,"_activeDescendant",2);l([u()],r.prototype,"_expanded",2);r=l([f("ngc-input-dropdown")],r);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import{r as u,a,x as l}from"../../../../assets/index-chunk2.js";import{t as b}from"../../../../assets/index-chunk3.js";import{n as g}from"../../../../assets/index-chunk.js";import{p as m}from"../../../../assets/index-chunk4.js";import{s as h}from"../../../../assets/index-chunk5.js";import{A as c}from"../../../../utils/mixins/attribute-deletion.js";const v=".gator-label{font-family:var(--gator-input-label-font-family);font-weight:var(--gator-input-label-font-weight, 400);color:var(--gator-input-label-color, var(--color-neutral-50, #6D6D6D));font-size:var(--gator-input-label-font-size, var(--text-size-body-1, 1.0625rem));line-height:var(--gator-input-label-line-height, var(--text-line-height-body-1, 1.5rem))}.gator-label_required{font-size:var(--text-size-subtitle-1, 1.0625rem);margin-right:var(--spacing-padding-margin-8, .5rem);color:var(--color-text-error, #AA330E);font-weight:700}",d=':host{--gator-input-label-color: var(--color-text-primary-base, #1F1F1F);--gator-input-label-font-family: var(--text-family-sans-serif, "Open Sans", sans-serif);--gator-input-label-font-weight: 400;--gator-input-label-font-size: 1.0625rem;--gator-input-label-line-height: 1.5rem}';var y=Object.defineProperty,w=Object.getOwnPropertyDescriptor,i=(f,r,s,o)=>{for(var t=o>1?void 0:o?w(r,s):r,n=f.length-1,p;n>=0;n--)(p=f[n])&&(t=(o?p(r,s,t):p(t))||t);return o&&t&&y(r,s,t),t};let e=class extends c(u){constructor(){super(...arguments),this.for="",this.type="label",this.required=!1}render(){switch(this.type){default:case"label":return l`
|
|
2
|
+
<label class="gator-label" for=${this.for}>
|
|
3
|
+
${this.required?l`<span class="gator-label_required">*</span>`:null}
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</label>
|
|
6
|
+
`;case"div":return l`
|
|
7
|
+
<div class="gator-label" id=${this.for}>
|
|
8
|
+
${this.required?l`<span class="gator-label_required">*</span>`:null}
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</div>
|
|
11
|
+
`}}};e.shadowRootOptions={...u.shadowRootOptions,mode:"open"};e.styles=[a(v),a(d),a(h),a(m)];i([g({type:String})],e.prototype,"for",2);i([g({type:String})],e.prototype,"type",2);i([g({type:Boolean})],e.prototype,"required",2);e=i([b("ngc-input-label")],e);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{x as a}from"../../../../assets/index-chunk2.js";import"../input-label/input-label.gator.js";import"../help-text/help-text.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/arrow-left.js";import"../../../icon/gator/templates/arrow-right.js";import"../../../icon/gator/templates/balloons.js";import"../../../icon/gator/templates/check-circle.js";import"../../../icon/gator/templates/check.js";import"../../../icon/gator/templates/checkbox.js";import"../../../icon/gator/templates/checkbox-selected.js";import"../../../icon/gator/templates/chevron-down.js";import"../../../icon/gator/templates/chevron-right.js";import"../../../icon/gator/templates/chevron-up.js";import"../../../icon/gator/templates/exit.js";import"../../../icon/gator/templates/exit-circle.js";import"../../../icon/gator/templates/eye-crossed.js";import"../../../icon/gator/templates/info.js";import"../../../icon/gator/templates/link.js";import"../../../icon/gator/templates/overflow-menu.js";import"../../../icon/gator/templates/picture.js";import"../../../icon/gator/templates/radio.js";import"../../../icon/gator/templates/radio-selected.js";import"../../../icon/gator/templates/restricted.js";import"../../../icon/gator/templates/warning.js";import{t as m}from"../../../../assets/index-chunk3.js";import{n as u}from"../../../../assets/index-chunk.js";import{r as c}from"../../../../assets/index-chunk11.js";import{e as d,n as h}from"../../../../assets/index-chunk7.js";import{N as v}from"../../base/input-base.gator.js";import"../../../../assets/index-chunk4.js";import"../../../../assets/index-chunk5.js";import"../../../../utils/mixins/attribute-deletion.js";import"../../../icon/icon-registry.js";import"../../../../assets/index-chunk8.js";import"../../base/input-base.js";import"../../../../utils/components/testable-lit-element/testable-lit-element.js";var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(t,i,n,o)=>{for(var r=o>1?void 0:o?g(i,n):i,p=t.length-1,l;p>=0;p--)(l=t[p])&&(r=(o?l(i,n,r):l(r))||r);return o&&r&&f(i,n,r),r};let e=class extends v{constructor(){super(...arguments),this.for="",this.inputRef=d(),this.controlRef=d()}render(){return a`
|
|
2
2
|
<div class="gator-form-element">
|
|
3
|
-
${this.labelMarkup}
|
|
4
|
-
<div ${
|
|
3
|
+
${this.label?this.labelMarkup:null}
|
|
4
|
+
<div ${h(this.controlRef)} class="gator-form-element-control ${this.errorClass} ${this.disabledClass}">
|
|
5
5
|
<div class="gator-input-container">
|
|
6
|
-
${this.shouldHaveStartMarkup?
|
|
6
|
+
${this.shouldHaveStartMarkup?a`
|
|
7
7
|
<div class="gator-input-start">
|
|
8
8
|
${this.startIconMarkup}
|
|
9
9
|
</div>`:null}
|
|
10
10
|
<input
|
|
11
|
-
${
|
|
11
|
+
${h(this.inputRef)}
|
|
12
12
|
type="${this.type}"
|
|
13
13
|
.id="${this.id}"
|
|
14
14
|
.placeholder="${this.placeholder}"
|
|
@@ -20,18 +20,20 @@ import{r as g,a as s,x as o}from"../../../../assets/index-chunk2.js";import"../i
|
|
|
20
20
|
.value="${this.value}"
|
|
21
21
|
@input="${this.handleInputEvent}"
|
|
22
22
|
@change="${this.handleChange}"
|
|
23
|
+
@focusin="${this.handleInputFocusIn}"
|
|
24
|
+
@focusout="${this.handleInputFocusOut}"
|
|
23
25
|
@invalid="${this.handleNativeInputValidation}"
|
|
24
26
|
.min="${this.min}"
|
|
25
27
|
.max="${this.max}"
|
|
26
28
|
/>
|
|
27
|
-
${this.shouldHaveEndMarkup?
|
|
29
|
+
${this.shouldHaveEndMarkup?a`
|
|
28
30
|
<div class="gator-input-end">
|
|
29
31
|
${this.passwordVisibilityMarkup}
|
|
30
32
|
${this.endIconMarkup}
|
|
31
33
|
</div>`:null}
|
|
32
34
|
</div>
|
|
33
35
|
</div>
|
|
36
|
+
|
|
34
37
|
${this.bottomText}
|
|
35
38
|
</div>
|
|
36
|
-
`}handleNativeInputValidation(t){this.inputRef.value&&(this._nativeInputError=this.inputRef.value.validationMessage),t.preventDefault()}get displayedErrorText(){return this.errorText||this._nativeInputError}get
|
|
37
|
-
<ngc-icon .name="${this.endIcon}"></ngc-icon>`:null}get isAriaInvalid(){return this.displayedErrorText?"true":"false"}get errorClass(){return this.displayedErrorText?"gator-has-error":""}get disabledClass(){return this.disabled?"gator-disabled":""}get passwordVisibilityMarkup(){return this.endIconMarkup||this.type!=="password"?null:o`<ngc-icon name="eye-crossed" @click="${this.togglePasswordVisibility}"></ngc-icon>`}handleInputEvent(t){const i=t.target;this.value=i.value}handleChange(){this.dispatchEvent(new CustomEvent("change",{composed:!0,bubbles:!0,detail:{value:this.value}}))}togglePasswordVisibility(){const t=this.inputRef.value;t&&(t.type=t.type==="password"?"text":"password")}};r.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0};r.styles=[s(y),s(h),s(v),s($)];n([u()],r.prototype,"for",2);n([u({type:Number})],r.prototype,"min",2);n([u({type:Number})],r.prototype,"max",2);n([b()],r.prototype,"_nativeInputError",2);r=n([f("ngc-input-text")],r);export{r as N,$ as g,y as i};
|
|
39
|
+
`}handleNativeInputValidation(t){this.inputRef.value&&(this._nativeInputError=this.inputRef.value.validationMessage),t.preventDefault()}get displayedErrorText(){return this.errorText||this._nativeInputError}get isAriaInvalid(){return this.displayedErrorText?"true":"false"}get errorClass(){return this.displayedErrorText?"gator-has-error":""}get disabledClass(){return this.disabled?"gator-disabled":""}get passwordVisibilityMarkup(){return this.endIconMarkup||this.type!=="password"?null:a`<ngc-icon name="eye-crossed" @click="${this.togglePasswordVisibility}"></ngc-icon>`}handleInputEvent(t){const i=t.target;this.value=i.value}handleChange(){this.dispatchEvent(new CustomEvent("change",{composed:!0,bubbles:!0,detail:{value:this.value}}))}togglePasswordVisibility(){const t=this.inputRef.value;t&&(t.type=t.type==="password"?"text":"password")}handleInputFocusOut(){var t,i;(t=this.controlRef.value)==null||t.classList.remove("gator-input-has-focus"),(i=this.inputRef.value)!=null&&i.checkValidity()&&(this._nativeInputError="")}};s([u()],e.prototype,"for",2);s([u({type:Number})],e.prototype,"min",2);s([u({type:Number})],e.prototype,"max",2);s([c()],e.prototype,"_nativeInputError",2);e=s([m("ngc-input-text")],e);export{e as N};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,a as r,x as d}from"../../../../assets/index-chunk2.js";import"../input-label/input-label.gator.js";import"../help-text/help-text.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/arrow-left.js";import"../../../icon/gator/templates/arrow-right.js";import"../../../icon/gator/templates/balloons.js";import"../../../icon/gator/templates/check-circle.js";import"../../../icon/gator/templates/check.js";import"../../../icon/gator/templates/checkbox.js";import"../../../icon/gator/templates/checkbox-selected.js";import"../../../icon/gator/templates/chevron-down.js";import"../../../icon/gator/templates/chevron-right.js";import"../../../icon/gator/templates/chevron-up.js";import"../../../icon/gator/templates/exit.js";import"../../../icon/gator/templates/exit-circle.js";import"../../../icon/gator/templates/eye-crossed.js";import"../../../icon/gator/templates/info.js";import"../../../icon/gator/templates/link.js";import"../../../icon/gator/templates/overflow-menu.js";import"../../../icon/gator/templates/picture.js";import"../../../icon/gator/templates/radio.js";import"../../../icon/gator/templates/radio-selected.js";import"../../../icon/gator/templates/restricted.js";import"../../../icon/gator/templates/warning.js";import{
|
|
1
|
+
import{r as l,a as r,x as d}from"../../../../assets/index-chunk2.js";import"../input-label/input-label.gator.js";import"../help-text/help-text.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/arrow-left.js";import"../../../icon/gator/templates/arrow-right.js";import"../../../icon/gator/templates/balloons.js";import"../../../icon/gator/templates/check-circle.js";import"../../../icon/gator/templates/check.js";import"../../../icon/gator/templates/checkbox.js";import"../../../icon/gator/templates/checkbox-selected.js";import"../../../icon/gator/templates/chevron-down.js";import"../../../icon/gator/templates/chevron-right.js";import"../../../icon/gator/templates/chevron-up.js";import"../../../icon/gator/templates/exit.js";import"../../../icon/gator/templates/exit-circle.js";import"../../../icon/gator/templates/eye-crossed.js";import"../../../icon/gator/templates/info.js";import"../../../icon/gator/templates/link.js";import"../../../icon/gator/templates/overflow-menu.js";import"../../../icon/gator/templates/picture.js";import"../../../icon/gator/templates/radio.js";import"../../../icon/gator/templates/radio-selected.js";import"../../../icon/gator/templates/restricted.js";import"../../../icon/gator/templates/warning.js";import{i as h,g as c}from"../../base/input-base.gator.js";import{s as g}from"../../../../assets/index-chunk5.js";import{p as u}from"../../../../assets/index-chunk4.js";import{t as v}from"../../../../assets/index-chunk3.js";import{n}from"../../../../assets/index-chunk7.js";import{N as $}from"../input-text/input-text.gator.js";import"../../../../assets/index-chunk.js";import"../../../../utils/mixins/attribute-deletion.js";import"../../../icon/icon-registry.js";import"../../base/input-base.js";import"../../../../utils/components/testable-lit-element/testable-lit-element.js";import"../../../../assets/index-chunk8.js";import"../../../../assets/index-chunk11.js";const f=":host .gator-form-element-control{padding:0}:host textarea{min-height:6rem;padding:12px 30px 12px 16px;resize:vertical}:host .gator-icon-right{position:absolute;right:var(--spacing-3, .75rem);top:var(--spacing-3, .75rem)}";var x=Object.defineProperty,b=Object.getOwnPropertyDescriptor,T=(m,i,p,o)=>{for(var t=o>1?void 0:o?b(i,p):i,s=m.length-1,a;s>=0;s--)(a=m[s])&&(t=(o?a(i,p,t):a(t))||t);return o&&t&&x(i,p,t),t};let e=class extends ${render(){return d`
|
|
2
2
|
<div class="gator-form-element">
|
|
3
3
|
${this.labelMarkup}
|
|
4
4
|
<div ${n(this.controlRef)} class="gator-form-element-control ${this.errorClass} ${this.disabledClass}">
|
|
@@ -24,4 +24,4 @@ import{r as l,a as r,x as d}from"../../../../assets/index-chunk2.js";import"../i
|
|
|
24
24
|
</div>
|
|
25
25
|
${this.bottomText}
|
|
26
26
|
</div>
|
|
27
|
-
`}};e.shadowRootOptions={...l.shadowRootOptions,delegatesFocus:!0};e.styles=[r(
|
|
27
|
+
`}};e.shadowRootOptions={...l.shadowRootOptions,delegatesFocus:!0};e.styles=[r(h),r(g),r(u),r(c),r(f)];e=T([v("ngc-input-textarea")],e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./gator/input-label/input-label.gator.js";import"./gator/help-text/help-text.gator.js";import"./gator/input-text/input-text.gator.js";import"./gator/input-textarea/input-textarea.gator.js";import"./slds/input-text/input-text.slds.js";import"./slds/input-error/input-error.slds.js";import"./slds/input-label/input-label.slds.js";import"../../assets/index-chunk2.js";import"../../assets/index-chunk3.js";import"../../assets/index-chunk.js";import"../../assets/index-chunk4.js";import"../../assets/index-chunk5.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../assets/index-chunk11.js";import"../../assets/index-chunk7.js";import"../../assets/index-chunk8.js";import"./base/input-base.gator.js";import"./base/input-base.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../../assets/index-chunk6.js";
|
|
1
|
+
import"./gator/input-label/input-label.gator.js";import"./gator/help-text/help-text.gator.js";import"./gator/input-text/input-text.gator.js";import"./gator/input-textarea/input-textarea.gator.js";import"./slds/input-text/input-text.slds.js";import"./slds/input-error/input-error.slds.js";import"./slds/input-label/input-label.slds.js";import"../../assets/index-chunk2.js";import"../../assets/index-chunk3.js";import"../../assets/index-chunk.js";import"../../assets/index-chunk4.js";import"../../assets/index-chunk5.js";import"../../utils/mixins/attribute-deletion.js";import"../icon/gator/icon.gator.js";import"../icon/gator/templates/arrow-left.js";import"../icon/icon-registry.js";import"../icon/gator/templates/arrow-right.js";import"../icon/gator/templates/balloons.js";import"../icon/gator/templates/check-circle.js";import"../icon/gator/templates/check.js";import"../icon/gator/templates/checkbox.js";import"../icon/gator/templates/checkbox-selected.js";import"../icon/gator/templates/chevron-down.js";import"../icon/gator/templates/chevron-right.js";import"../icon/gator/templates/chevron-up.js";import"../icon/gator/templates/exit.js";import"../icon/gator/templates/exit-circle.js";import"../icon/gator/templates/eye-crossed.js";import"../icon/gator/templates/info.js";import"../icon/gator/templates/link.js";import"../icon/gator/templates/overflow-menu.js";import"../icon/gator/templates/picture.js";import"../icon/gator/templates/radio.js";import"../icon/gator/templates/radio-selected.js";import"../icon/gator/templates/restricted.js";import"../icon/gator/templates/warning.js";import"../../assets/index-chunk11.js";import"../../assets/index-chunk7.js";import"../../assets/index-chunk8.js";import"./base/input-base.gator.js";import"./base/input-base.js";import"../../utils/components/testable-lit-element/testable-lit-element.js";import"../../assets/index-chunk6.js";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{r as h,a as c,x as f}from"../../../../assets/index-chunk2.js";import{t as p}from"../../../../assets/index-chunk3.js";import{n}from"../../../../assets/index-chunk.js";import{r as m}from"../../../../assets/index-chunk11.js";import{s as I}from"../../../../assets/index-chunk5.js";import{p as _}from"../../../../assets/index-chunk4.js";import{A as x}from"../../../../utils/mixins/attribute-deletion.js";import{T as y}from"../../../../utils/components/testable-lit-element/testable-lit-element.js";import"../list-item/list-item.gator.js";import{N as v}from"../../../divider/gator/divider.gator.js";import{K as u}from"../../../../consts/key-constants.js";import"../../../../assets/index-chunk7.js";import"../../../../assets/index-chunk8.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/arrow-left.js";import"../../../icon/icon-registry.js";import"../../../icon/gator/templates/arrow-right.js";import"../../../icon/gator/templates/balloons.js";import"../../../icon/gator/templates/check-circle.js";import"../../../icon/gator/templates/check.js";import"../../../icon/gator/templates/checkbox.js";import"../../../icon/gator/templates/checkbox-selected.js";import"../../../icon/gator/templates/chevron-down.js";import"../../../icon/gator/templates/chevron-right.js";import"../../../icon/gator/templates/chevron-up.js";import"../../../icon/gator/templates/exit.js";import"../../../icon/gator/templates/exit-circle.js";import"../../../icon/gator/templates/eye-crossed.js";import"../../../icon/gator/templates/info.js";import"../../../icon/gator/templates/link.js";import"../../../icon/gator/templates/overflow-menu.js";import"../../../icon/gator/templates/picture.js";import"../../../icon/gator/templates/radio.js";import"../../../icon/gator/templates/radio-selected.js";import"../../../icon/gator/templates/restricted.js";import"../../../icon/gator/templates/warning.js";import"../../../../assets/index-chunk9.js";import"../../../divider/divider.js";var L=Object.defineProperty,F=Object.getOwnPropertyDescriptor,a=(t,e,s,i)=>{for(var l=i>1?void 0:i?F(e,s):e,o=t.length-1,d;o>=0;o--)(d=t[o])&&(l=(i?d(e,s,l):d(l))||l);return i&&l&&L(e,s,l),l};let r=class extends x(y){constructor(){super(...arguments),this.id="",this.density="default",this.selectable=!1,this.multiselect=!1,this.ariaLabelledBy="",this.title="",this.fauxFocus=!1,this._selectedListItem=null,this._role="list",this._activeIndex=0,this._totalListItems=0,this._hasIndexChanged=!1}updated(t){var e,s;this.selectable&&(this._role="listbox"),t.has("density")&&this.assignChildNodeDensity(),(this.selectable||this.multiselect)&&this.updateSlottedItems(((s=(e=this.shadowRoot)==null?void 0:e.querySelector("slot"))==null?void 0:s.assignedElements())||[])}render(){return f`
|
|
2
2
|
<div
|
|
3
3
|
aria-labelledby="${this.ariaLabelledBy}"
|
|
4
4
|
class="gator-list"
|
|
5
5
|
title="${this.title}"
|
|
6
6
|
role="${this._role}"
|
|
7
|
+
id="${this.id}"
|
|
7
8
|
@keydown="${this.handleKeyUp}"
|
|
8
9
|
${this.selectable?`aria-multiselectable="${this.multiselect}"`:null}
|
|
9
10
|
${this.selectable?`aria-activedescendant="${this._selectedListItem}"`:null}
|
|
10
11
|
>
|
|
11
12
|
<slot @slotchange="${this.handleSlotChanged}"></slot>
|
|
12
13
|
</div>
|
|
13
|
-
`}handleSlotChanged(
|
|
14
|
+
`}handleSlotChanged(t){const s=t.target.assignedElements();this.updateSlottedItems(s)}updateSlottedItems(t){this._totalListItems=0;for(const e of t)e.nodeName=="NGC-LIST-ITEM"&&(this._totalListItems++,this.selectable&&(e.selectable=!0),this.multiselect&&(e.multiselect=!0),e.addEventListener("selected",s=>{this._selectedListItem=s.detail.id,this.multiselect?(e.selected=!e.selected,e.multiselect=!0):(this.unselectAllListItems(),e.selected=!0)}));this.setCurrentListItem()}setFalseFocusToValue(t){var s,i;const e=(i=(s=this.shadowRoot)==null?void 0:s.querySelector("slot"))==null?void 0:i.assignedElements();if(e){for(const[l,o]of e.entries())if(o.nodeName=="NGC-LIST-ITEM"&&o.value==t)return this._activeIndex=l,o.replacedStringId}}setCurrentListItem(){var s,i;const t=(i=(s=this.shadowRoot)==null?void 0:s.querySelector("slot"))==null?void 0:i.assignedElements();if(!t||this._focusFirstSelectedItem(t))return;let e;for(const[l,o]of t.entries())this._activeIndex==-1&&(this._activeIndex=this._totalListItems-1),this._activeIndex==this._totalListItems&&(this._activeIndex=0),o.nodeName=="NGC-LIST-ITEM"&&(o.currentListItem=l==this._activeIndex,o.currentListItem?(this.fauxFocus?this._setFauxFocus(o):o.focus(),e=o.replacedStringId):this.fauxFocus&&this._removeFauxFocus(o));return e}_focusFirstSelectedItem(t){if(this._hasIndexChanged)return!1;let e=!1;for(const s of t){if(e)break;s.nodeName=="NGC-LIST-ITEM"&&(s.selected?(this.fauxFocus?this._setFauxFocus(s):s.focus(),e=!0):this.fauxFocus&&this._removeFauxFocus(s))}return this._hasIndexChanged=!0,e}_setFauxFocus(t){t.falseFocus()}_removeFauxFocus(t){t.removeFalseFocus()}falseFocusFirstItem(){return this._activeIndex=0,this.setCurrentListItem()}falseFocusPreviousItem(){return this._activeIndex--,this.setCurrentListItem()}falseFocusNextItem(){return this._activeIndex++,this.setCurrentListItem()}selectFalseFocusedItem(){var e,s;const t=(s=(e=this.shadowRoot)==null?void 0:e.querySelector("slot"))==null?void 0:s.assignedElements();if(t)for(const i of t)i.nodeName=="NGC-LIST-ITEM"&&i.falseFocusing&&i.selectItem()}unselectAllListItems(){var e,s;const t=(s=(e=this.shadowRoot)==null?void 0:e.querySelector("slot"))==null?void 0:s.assignedElements();if(t)for(const i of t)i.nodeName=="NGC-LIST-ITEM"&&(i.selected=!1)}handleKeyUp(t){switch(t.key){case u.UP:this._activeIndex--,this.setCurrentListItem(),t.preventDefault();break;case u.DOWN:this._activeIndex++,this.setCurrentListItem(),t.preventDefault();break}}assignChildNodeDensity(){var e,s;const t=(s=(e=this.shadowRoot)==null?void 0:e.querySelector("slot"))==null?void 0:s.assignedElements();if(t)for(const i of t)(i.nodeName=="NGC-LIST-ITEM"||i.nodeName=="NGC-DIVIDER")&&((i||v).density=this.density)}};r.shadowRootOptions={...h.shadowRootOptions,mode:"open"};r.styles=[c(I),c(_)];a([n()],r.prototype,"id",2);a([n()],r.prototype,"density",2);a([n({type:Boolean})],r.prototype,"selectable",2);a([n({type:Boolean})],r.prototype,"multiselect",2);a([n({attribute:"aria-labelledby"})],r.prototype,"ariaLabelledBy",2);a([n()],r.prototype,"title",2);a([n({type:Boolean,attribute:"faux-focus"})],r.prototype,"fauxFocus",2);a([m()],r.prototype,"_selectedListItem",2);a([m()],r.prototype,"_role",2);a([m()],r.prototype,"_activeIndex",2);r=a([p("ngc-list")],r);
|