@solid-design-system/components 3.4.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/es/checkbox.js +1 -1
- package/dist/components/es/dialog.js +1 -1
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/interactive.js +1 -1
- package/dist/components/es/option.js +1 -1
- package/dist/components/es/select.js +1 -1
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +2 -2
- package/dist/components/es/step-group.js +1 -0
- package/dist/components/es/step.js +1 -0
- package/dist/components/es/textarea.js +1 -1
- package/dist/components/umd/solid-components.js +21 -21
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/checkbox/checkbox.js +1 -1
- package/dist/package/components/icon/library.system.d.ts +1 -2
- package/dist/package/components/icon/library.system.js +2 -7
- package/dist/package/components/input/input.js +1 -1
- package/dist/package/components/option/option.js +1 -1
- package/dist/package/components/select/select.js +1 -1
- package/dist/package/components/step/step.d.ts +27 -0
- package/dist/package/components/step/step.js +147 -0
- package/dist/package/components/step-group/step-group.d.ts +22 -0
- package/dist/package/components/step-group/step-group.js +127 -0
- package/dist/package/components/textarea/textarea.js +1 -1
- package/dist/package/solid-components.d.ts +2 -0
- package/dist/package/solid-components.js +24 -20
- package/dist/package/styles/headline/headline.css.js +1 -1
- package/dist/package/styles/interactive/interactive.css.js +1 -1
- package/dist/package/styles/paragraph/paragraph.css.js +4 -0
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/styles/solid-styles.css +1 -1
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -1
- package/dist/versioned-components/es/dialog.js +1 -1
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/header.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -1
- package/dist/versioned-components/es/interactive.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/map-marker.js +1 -1
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/notification.js +1 -1
- package/dist/versioned-components/es/option.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-button.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/scrollable.js +1 -1
- package/dist/versioned-components/es/select.js +3 -3
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +2 -2
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/step-group.js +1 -0
- package/dist/versioned-components/es/step.js +1 -0
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tab-group.js +1 -1
- package/dist/versioned-components/es/tab-panel.js +1 -1
- package/dist/versioned-components/es/tab.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser-media.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/textarea.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +1 -1
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +3 -3
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
- package/dist/versioned-package/components/dialog/dialog.d.ts +1 -1
- package/dist/versioned-package/components/dialog/dialog.js +2 -2
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
- package/dist/versioned-package/components/header/header.d.ts +1 -1
- package/dist/versioned-package/components/header/header.js +4 -4
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/icon/library.system.d.ts +1 -2
- package/dist/versioned-package/components/icon/library.system.js +2 -7
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +1 -1
- package/dist/versioned-package/components/input/input.js +2 -2
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/map-marker/map-marker.d.ts +1 -1
- package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/notification/notification.d.ts +1 -1
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -1
- package/dist/versioned-package/components/option/option.js +2 -2
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
- package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +13 -13
- package/dist/versioned-package/components/scrollable/scrollable.d.ts +1 -1
- package/dist/versioned-package/components/scrollable/scrollable.js +3 -3
- package/dist/versioned-package/components/select/select.d.ts +4 -4
- package/dist/versioned-package/components/select/select.js +25 -25
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/step/step.d.ts +27 -0
- package/dist/versioned-package/components/step/step.js +147 -0
- package/dist/versioned-package/components/step-group/step-group.d.ts +22 -0
- package/dist/versioned-package/components/step-group/step-group.js +127 -0
- package/dist/versioned-package/components/switch/switch.d.ts +1 -1
- package/dist/versioned-package/components/switch/switch.js +1 -1
- package/dist/versioned-package/components/tab/tab.d.ts +1 -1
- package/dist/versioned-package/components/tab/tab.js +2 -2
- package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
- package/dist/versioned-package/components/tab-group/tab-group.js +13 -13
- package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
- package/dist/versioned-package/components/textarea/textarea.js +2 -2
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +3 -3
- package/dist/versioned-package/solid-components.d.ts +2 -0
- package/dist/versioned-package/solid-components.js +24 -20
- package/dist/versioned-package/styles/headline/headline.css.js +1 -1
- package/dist/versioned-package/styles/interactive/interactive.css.js +1 -1
- package/dist/versioned-package/styles/paragraph/paragraph.css.js +4 -0
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-package/utilities/autocomplete-config.js +4 -4
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +263 -39
- package/dist/web-types.json +600 -40
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as t,x as e,i as n,n as o,c as i}from"./solid-element.js";import{e as r}from"./query.js";import{c as a}from"./component.styles.js";import{t as s}from"./classix.js";const l=Math.min,c=Math.max,f=Math.round,u=Math.floor,h=t=>({x:t,y:t}),p={left:"right",right:"left",bottom:"top",top:"bottom"},d={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function w(t){return t.split("-")[1]}function b(t){return"x"===t?"y":"x"}function v(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(g(t))?"y":"x"}function P(t){return b(x(t))}function E(t){return t.replace(/start|end/g,(t=>d[t]))}function z(t){return t.replace(/left|right|bottom|top/g,(t=>p[t]))}function R(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function S(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function O(t,e,n){let{reference:o,floating:i}=t;const r=x(e),a=P(e),s=v(a),l=g(e),c="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let p;switch(l){case"top":p={x:f,y:o.y-i.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(w(e)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1)}return p}async function T(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=y(e,t),d=R(p),m=s[h?"floating"===u?"reference":"floating":u],g=S(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),w="floating"===u?{...a.floating,x:o,y:i}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},x=S(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+d.top)/v.y,bottom:(x.bottom-g.bottom+d.bottom)/v.y,left:(g.left-x.left+d.left)/v.x,right:(x.right-g.right+d.right)/v.x}}const L=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=g(n),s=w(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,f=r&&l?-1:1,u=y(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:d}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return s&&"number"==typeof d&&(p="end"===s?-1*d:d),l?{x:p*f,y:h*c}:{x:h*c,y:p*f}}(e,t);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}};function A(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function C(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return t instanceof Node||t instanceof k(t).Node}function F(t){return t instanceof Element||t instanceof k(t).Element}function B(t){return t instanceof HTMLElement||t instanceof k(t).HTMLElement}function $(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function N(t){return["table","td","th"].includes(A(t))}function j(t){const e=M(),n=V(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function M(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function W(t){return["html","body","#document"].includes(A(t))}function V(t){return k(t).getComputedStyle(t)}function q(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function I(t){if("html"===A(t))return t;const e=t.assignedSlot||t.parentNode||$(t)&&t.host||C(t);return $(e)?e.host:e}function X(t){const e=I(t);return W(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&H(e)?e:X(e)}function Y(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=X(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),a=k(i);return r?e.concat(a,a.visualViewport||[],H(i)?i:[],a.frameElement&&n?Y(a.frameElement):[]):e.concat(i,Y(i,[],n))}function _(t){const e=V(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=B(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function G(t){return F(t)?t:t.contextElement}function J(t){const e=G(t);if(!B(e))return h(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=_(e);let a=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const K=h(0);function Q(t){const e=k(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:K}function U(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=G(t);let a=h(1);e&&(o?F(o)&&(a=J(o)):a=J(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(r,n,o)?Q(r):h(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,u=i.height/a.y;if(r){const t=k(r),e=o&&F(o)?k(o):o;let n=t,i=n.frameElement;for(;i&&o&&e!==n;){const t=J(i),e=i.getBoundingClientRect(),o=V(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,u*=t.y,l+=r,c+=a,n=k(i),i=n.frameElement}}return S({width:f,height:u,x:l,y:c})}const Z=[":popover-open",":modal"];function tt(t){return Z.some((e=>{try{return t.matches(e)}catch{return!1}}))}function et(t){return U(C(t)).left+q(t).scrollLeft}function nt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=C(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=M();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=C(t),n=q(t),o=t.ownerDocument.body,i=c(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=c(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+et(t);const s=-n.scrollTop;return"rtl"===V(o).direction&&(a+=c(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(C(t));else if(F(e))o=function(t,e){const n=U(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?J(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=Q(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return S(o)}function ot(t,e){const n=I(t);return!(n===e||!F(n)||W(n))&&("fixed"===V(n).position||ot(n,e))}function it(t,e){const n=e.get(t);if(n)return n;let o=Y(t,[],!1).filter((t=>F(t)&&"body"!==A(t))),i=null;const r="fixed"===V(t).position;let a=r?I(t):t;for(;F(a)&&!W(a);){const e=V(a),n=j(a);!n&&"fixed"===e.position&&(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(a)&&!n&&ot(t,a))?o=o.filter((t=>t!==a)):i=e,a=I(a)}return e.set(t,o),o}function rt(t,e,n){const o=B(e),i=C(e),r="fixed"===n,a=U(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(o||!o&&!r)if(("body"!==A(e)||H(i))&&(s=q(e)),o){const t=U(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=et(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function at(t,e){return B(t)&&"fixed"!==V(t).position?e?e(t):t.offsetParent:null}function st(t,e){const n=k(t);if(!B(t)||tt(t))return n;let o=at(t,e);for(;o&&N(o)&&"static"===V(o).position;)o=at(o,e);return o&&("html"===A(o)||"body"===A(o)&&"static"===V(o).position&&!j(o))?n:o||function(t){let e=I(t);for(;B(e)&&!W(e);){if(j(e))return e;e=I(e)}return null}(t)||n}const lt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,a=C(o),s=!!e&&tt(e.floating);if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=h(1);const f=h(0),u=B(o);if((u||!u&&!r)&&(("body"!==A(o)||H(a))&&(l=q(o)),B(o))){const t=U(o);c=J(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x,y:n.y*c.y-l.scrollTop*c.y+f.y}},getDocumentElement:C,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?it(e,this._c):[].concat(n),o],a=r[0],s=r.reduce(((t,n)=>{const o=nt(e,n,i);return t.top=c(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=c(o.left,t.left),t}),nt(e,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:st,getElementRects:async function(t){const e=this.getOffsetParent||st,n=this.getDimensions;return{reference:rt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=_(t);return{width:e,height:n}},getScale:J,isElement:F,isRTL:function(t){return"rtl"===V(t).direction}};const ct=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),f=await T(e,s),u=g(n),h=w(n),p="y"===x(n),{width:d,height:m}=o.floating;let b,v;"top"===u||"bottom"===u?(b=u,v=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(v=u,b="end"===h?"top":"bottom");const P=m-f[b],E=d-f[v],z=!e.middlewareData.shift;let R=P,S=E;if(p){const t=d-f.left-f.right;S=h||z?l(E,t):t}else{const t=m-f.top-f.bottom;R=h||z?l(P,t):t}if(z&&!h){const t=c(f.left,0),e=c(f.right,0),n=c(f.top,0),o=c(f.bottom,0);p?S=d-2*(0!==t||0!==e?t+e:c(f.left,f.right)):R=m-2*(0!==n||0!==o?n+o:c(f.top,f.bottom))}await a({...e,availableWidth:S,availableHeight:R});const O=await i.getDimensions(r.floating);return d!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};var ft=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,ht=(t,e,n,o)=>{for(var i,r=o>1?void 0:o?ut(e,n):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o?i(e,n,r):i(r))||r);return o&&r&&ft(e,n,r),r};let pt=class extends t{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver((t=>this.handleCurrentPlacementChange(t))),this.mutationObserver.observe(this,{attributes:!0})}handleCurrentPlacementChange(t){return t.forEach((t=>{if("data-current-placement"===t.attributeName){const t=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:t})}}))}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=G(t),p=i||r?[...h?Y(h):[],...Y(e)]:[];p.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const d=h&&s?function(t,e){let n,o=null;const i=C(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function a(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const{left:h,top:p,width:d,height:m}=t.getBoundingClientRect();if(s||e(),!d||!m)return;const y={rootMargin:-u(p)+"px "+-u(i.clientWidth-(h+d))+"px "+-u(i.clientHeight-(p+m))+"px "+-u(h)+"px",threshold:c(0,l(1,f))||1};let g=!0;function w(t){const e=t[0].intersectionRatio;if(e!==f){if(!g)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}g=!1}try{o=new IntersectionObserver(w,{...y,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,y)}o.observe(t)}(!0),r}(h,n):null;let m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let g,w=f?U(t):null;return f&&function e(){const o=U(t);w&&(o.x!==w.x||o.y!==w.y||o.width!==w.width||o.height!==w.height)&&n(),w=o,g=requestAnimationFrame(e)}(),n(),()=>{var t;p.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==d||d(),null==(t=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(g)}}(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[L({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(ct({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...b}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=g(i),R=g(s)===s,S=await(null==l.isRTL?void 0:l.isRTL(c.floating)),O=h||(R||!m?[z(s)]:function(t){const e=z(t);return[E(t),e,E(e)]}(s));!h&&"none"!==d&&O.push(...function(t,e,n,o){const i=w(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(s,m,d,S));const L=[s,...O],A=await T(e,b),k=[];let C=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&k.push(A[x]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=w(t),i=P(t),r=v(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=z(a)),[a,z(a)]}(i,a,S);k.push(A[t[0]],A[t[1]])}if(C=[...C,{placement:i,overflows:k}],!k.every((t=>t<=0))){var D,F;const t=((null==(D=r.flip)?void 0:D.index)||0)+1,e=L[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(F=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:F.placement;if(!n)switch(p){case"bestFit":{var B;const t=null==(B=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}}({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:o},f=await T(e,l),u=x(g(i)),h=b(u);let p=c[h],d=c[u];if(r){const t="y"===h?"bottom":"right";p=m(p+f["y"===h?"top":"left"],p,p-f[t])}if(a){const t="y"===u?"bottom":"right";d=m(d+f["y"===u?"top":"left"],d,d-f[t])}const w=s.fn({...e,[h]:p,[u]:d});return{...w,data:{x:w.x-n,y:w.y-o}}}}}({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(ct({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:f,padding:u=0}=y(t,e)||{};if(null==f)return{};const h=R(u),p={x:n,y:o},d=P(i),g=v(d),b=await a.getDimensions(f),x="y"===d,E=x?"top":"left",z=x?"bottom":"right",S=x?"clientHeight":"clientWidth",O=r.reference[g]+r.reference[d]-p[d]-r.floating[g],T=p[d]-r.reference[d],L=await(null==a.getOffsetParent?void 0:a.getOffsetParent(f));let A=L?L[S]:0;(!A||!await(null==a.isElement?void 0:a.isElement(L)))&&(A=s.floating[S]||r.floating[g]);const k=O/2-T/2,C=A/2-b[g]/2-1,D=l(h[E],C),F=l(h[z],C),B=D,$=A-b[g]-F,H=A/2-b[g]/2+k,N=m(B,H,$),j=!c.arrow&&null!=w(i)&&H!==N&&r.reference[g]/2-(H<B?D:F)-b[g]/2<0,M=j?H<B?H-B:H-$:0;return{[d]:p[d]+M,data:{[d]:N,centerOffset:H-N-M,...j&&{alignmentOffset:M}},reset:j}}}))({element:this.arrowEl,padding:this.arrowPadding})),((t,e,n)=>{const o=new Map,i={platform:lt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=O(c,o,l),h=o,p={},d=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:g,data:w,reset:b}=await m({x:f,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});f=y??f,u=g??u,p={...p,[r]:{...p[r],...w}},b&&d<=50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=O(c,h,l))),n=-1)}return{x:f,y:u,placement:h,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})})(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy}).then((({x:t,y:e,middlewareData:n,placement:o})=>{const i="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let o="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?n:"",l=i?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":n,l=i?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sd-reposition")}render(){return e`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${s("isolate","fixed"!==this.strategy?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?e`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};pt.styles=[t.styles,a,n`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}[part=arrow]{width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);background:var(--arrow-color)}`],ht([r('[part="popup"]')],pt.prototype,"popup",2),ht([r('[part="arrow"]')],pt.prototype,"arrowEl",2),ht([o()],pt.prototype,"anchor",2),ht([o({type:Boolean,reflect:!0})],pt.prototype,"active",2),ht([o({reflect:!0})],pt.prototype,"placement",2),ht([o({reflect:!0})],pt.prototype,"strategy",2),ht([o({type:Number})],pt.prototype,"distance",2),ht([o({type:Number})],pt.prototype,"skidding",2),ht([o({type:Boolean})],pt.prototype,"arrow",2),ht([o({attribute:"arrow-placement"})],pt.prototype,"arrowPlacement",2),ht([o({attribute:"arrow-padding",type:Number})],pt.prototype,"arrowPadding",2),ht([o({type:Boolean})],pt.prototype,"flip",2),ht([o({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],pt.prototype,"flipFallbackPlacements",2),ht([o({attribute:"flip-fallback-strategy"})],pt.prototype,"flipFallbackStrategy",2),ht([o({type:Object})],pt.prototype,"flipBoundary",2),ht([o({attribute:"flip-padding",type:Number})],pt.prototype,"flipPadding",2),ht([o({type:Boolean})],pt.prototype,"shift",2),ht([o({type:Object})],pt.prototype,"shiftBoundary",2),ht([o({attribute:"shift-padding",type:Number})],pt.prototype,"shiftPadding",2),ht([o({attribute:"auto-size"})],pt.prototype,"autoSize",2),ht([o()],pt.prototype,"sync",2),ht([o({type:Object})],pt.prototype,"autoSizeBoundary",2),ht([o({attribute:"auto-size-padding",type:Number})],pt.prototype,"autoSizePadding",2),pt=ht([i("sd-3-4-0-popup")],pt);export{pt as default};
|
|
1
|
+
import{S as t,x as e,i as n,n as o,c as i}from"./solid-element.js";import{e as r}from"./query.js";import{c as a}from"./component.styles.js";import{t as s}from"./classix.js";const l=Math.min,c=Math.max,f=Math.round,u=Math.floor,h=t=>({x:t,y:t}),p={left:"right",right:"left",bottom:"top",top:"bottom"},d={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function w(t){return t.split("-")[1]}function b(t){return"x"===t?"y":"x"}function v(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(g(t))?"y":"x"}function P(t){return b(x(t))}function E(t){return t.replace(/start|end/g,(t=>d[t]))}function z(t){return t.replace(/left|right|bottom|top/g,(t=>p[t]))}function R(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function S(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function O(t,e,n){let{reference:o,floating:i}=t;const r=x(e),a=P(e),s=v(a),l=g(e),c="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let p;switch(l){case"top":p={x:f,y:o.y-i.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(w(e)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1)}return p}async function T(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=y(e,t),d=R(p),m=s[h?"floating"===u?"reference":"floating":u],g=S(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),w="floating"===u?{...a.floating,x:o,y:i}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},x=S(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+d.top)/v.y,bottom:(x.bottom-g.bottom+d.bottom)/v.y,left:(g.left-x.left+d.left)/v.x,right:(x.right-g.right+d.right)/v.x}}const L=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=e,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=g(n),s=w(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,f=r&&l?-1:1,u=y(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:d}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return s&&"number"==typeof d&&(p="end"===s?-1*d:d),l?{x:p*f,y:h*c}:{x:h*c,y:p*f}}(e,t);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}};function A(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function C(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return t instanceof Node||t instanceof k(t).Node}function F(t){return t instanceof Element||t instanceof k(t).Element}function B(t){return t instanceof HTMLElement||t instanceof k(t).HTMLElement}function $(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function N(t){return["table","td","th"].includes(A(t))}function j(t){const e=M(),n=V(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function M(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function W(t){return["html","body","#document"].includes(A(t))}function V(t){return k(t).getComputedStyle(t)}function q(t){return F(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function I(t){if("html"===A(t))return t;const e=t.assignedSlot||t.parentNode||$(t)&&t.host||C(t);return $(e)?e.host:e}function X(t){const e=I(t);return W(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&H(e)?e:X(e)}function Y(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=X(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),a=k(i);return r?e.concat(a,a.visualViewport||[],H(i)?i:[],a.frameElement&&n?Y(a.frameElement):[]):e.concat(i,Y(i,[],n))}function _(t){const e=V(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=B(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function G(t){return F(t)?t:t.contextElement}function J(t){const e=G(t);if(!B(e))return h(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=_(e);let a=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const K=h(0);function Q(t){const e=k(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:K}function U(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=G(t);let a=h(1);e&&(o?F(o)&&(a=J(o)):a=J(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(r,n,o)?Q(r):h(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,u=i.height/a.y;if(r){const t=k(r),e=o&&F(o)?k(o):o;let n=t,i=n.frameElement;for(;i&&o&&e!==n;){const t=J(i),e=i.getBoundingClientRect(),o=V(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,u*=t.y,l+=r,c+=a,n=k(i),i=n.frameElement}}return S({width:f,height:u,x:l,y:c})}const Z=[":popover-open",":modal"];function tt(t){return Z.some((e=>{try{return t.matches(e)}catch{return!1}}))}function et(t){return U(C(t)).left+q(t).scrollLeft}function nt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=C(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=M();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=C(t),n=q(t),o=t.ownerDocument.body,i=c(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=c(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+et(t);const s=-n.scrollTop;return"rtl"===V(o).direction&&(a+=c(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(C(t));else if(F(e))o=function(t,e){const n=U(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?J(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=Q(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return S(o)}function ot(t,e){const n=I(t);return!(n===e||!F(n)||W(n))&&("fixed"===V(n).position||ot(n,e))}function it(t,e){const n=e.get(t);if(n)return n;let o=Y(t,[],!1).filter((t=>F(t)&&"body"!==A(t))),i=null;const r="fixed"===V(t).position;let a=r?I(t):t;for(;F(a)&&!W(a);){const e=V(a),n=j(a);!n&&"fixed"===e.position&&(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(a)&&!n&&ot(t,a))?o=o.filter((t=>t!==a)):i=e,a=I(a)}return e.set(t,o),o}function rt(t,e,n){const o=B(e),i=C(e),r="fixed"===n,a=U(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(o||!o&&!r)if(("body"!==A(e)||H(i))&&(s=q(e)),o){const t=U(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=et(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function at(t,e){return B(t)&&"fixed"!==V(t).position?e?e(t):t.offsetParent:null}function st(t,e){const n=k(t);if(!B(t)||tt(t))return n;let o=at(t,e);for(;o&&N(o)&&"static"===V(o).position;)o=at(o,e);return o&&("html"===A(o)||"body"===A(o)&&"static"===V(o).position&&!j(o))?n:o||function(t){let e=I(t);for(;B(e)&&!W(e);){if(j(e))return e;e=I(e)}return null}(t)||n}const lt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,a=C(o),s=!!e&&tt(e.floating);if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=h(1);const f=h(0),u=B(o);if((u||!u&&!r)&&(("body"!==A(o)||H(a))&&(l=q(o)),B(o))){const t=U(o);c=J(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x,y:n.y*c.y-l.scrollTop*c.y+f.y}},getDocumentElement:C,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?it(e,this._c):[].concat(n),o],a=r[0],s=r.reduce(((t,n)=>{const o=nt(e,n,i);return t.top=c(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=c(o.left,t.left),t}),nt(e,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:st,getElementRects:async function(t){const e=this.getOffsetParent||st,n=this.getDimensions;return{reference:rt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=_(t);return{width:e,height:n}},getScale:J,isElement:F,isRTL:function(t){return"rtl"===V(t).direction}};const ct=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),f=await T(e,s),u=g(n),h=w(n),p="y"===x(n),{width:d,height:m}=o.floating;let b,v;"top"===u||"bottom"===u?(b=u,v=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(v=u,b="end"===h?"top":"bottom");const P=m-f[b],E=d-f[v],z=!e.middlewareData.shift;let R=P,S=E;if(p){const t=d-f.left-f.right;S=h||z?l(E,t):t}else{const t=m-f.top-f.bottom;R=h||z?l(P,t):t}if(z&&!h){const t=c(f.left,0),e=c(f.right,0),n=c(f.top,0),o=c(f.bottom,0);p?S=d-2*(0!==t||0!==e?t+e:c(f.left,f.right)):R=m-2*(0!==n||0!==o?n+o:c(f.top,f.bottom))}await a({...e,availableWidth:S,availableHeight:R});const O=await i.getDimensions(r.floating);return d!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};var ft=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,ht=(t,e,n,o)=>{for(var i,r=o>1?void 0:o?ut(e,n):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o?i(e,n,r):i(r))||r);return o&&r&&ft(e,n,r),r};let pt=class extends t{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver((t=>this.handleCurrentPlacementChange(t))),this.mutationObserver.observe(this,{attributes:!0})}handleCurrentPlacementChange(t){return t.forEach((t=>{if("data-current-placement"===t.attributeName){const t=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:t})}}))}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=G(t),p=i||r?[...h?Y(h):[],...Y(e)]:[];p.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const d=h&&s?function(t,e){let n,o=null;const i=C(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function a(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const{left:h,top:p,width:d,height:m}=t.getBoundingClientRect();if(s||e(),!d||!m)return;const y={rootMargin:-u(p)+"px "+-u(i.clientWidth-(h+d))+"px "+-u(i.clientHeight-(p+m))+"px "+-u(h)+"px",threshold:c(0,l(1,f))||1};let g=!0;function w(t){const e=t[0].intersectionRatio;if(e!==f){if(!g)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}g=!1}try{o=new IntersectionObserver(w,{...y,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,y)}o.observe(t)}(!0),r}(h,n):null;let m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let g,w=f?U(t):null;return f&&function e(){const o=U(t);w&&(o.x!==w.x||o.y!==w.y||o.width!==w.width||o.height!==w.height)&&n(),w=o,g=requestAnimationFrame(e)}(),n(),()=>{var t;p.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==d||d(),null==(t=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(g)}}(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[L({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(ct({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...b}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=g(i),R=g(s)===s,S=await(null==l.isRTL?void 0:l.isRTL(c.floating)),O=h||(R||!m?[z(s)]:function(t){const e=z(t);return[E(t),e,E(e)]}(s));!h&&"none"!==d&&O.push(...function(t,e,n,o){const i=w(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(s,m,d,S));const L=[s,...O],A=await T(e,b),k=[];let C=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&k.push(A[x]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=w(t),i=P(t),r=v(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=z(a)),[a,z(a)]}(i,a,S);k.push(A[t[0]],A[t[1]])}if(C=[...C,{placement:i,overflows:k}],!k.every((t=>t<=0))){var D,F;const t=((null==(D=r.flip)?void 0:D.index)||0)+1,e=L[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(F=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:F.placement;if(!n)switch(p){case"bestFit":{var B;const t=null==(B=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}}({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:o},f=await T(e,l),u=x(g(i)),h=b(u);let p=c[h],d=c[u];if(r){const t="y"===h?"bottom":"right";p=m(p+f["y"===h?"top":"left"],p,p-f[t])}if(a){const t="y"===u?"bottom":"right";d=m(d+f["y"===u?"top":"left"],d,d-f[t])}const w=s.fn({...e,[h]:p,[u]:d});return{...w,data:{x:w.x-n,y:w.y-o}}}}}({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(ct({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:f,padding:u=0}=y(t,e)||{};if(null==f)return{};const h=R(u),p={x:n,y:o},d=P(i),g=v(d),b=await a.getDimensions(f),x="y"===d,E=x?"top":"left",z=x?"bottom":"right",S=x?"clientHeight":"clientWidth",O=r.reference[g]+r.reference[d]-p[d]-r.floating[g],T=p[d]-r.reference[d],L=await(null==a.getOffsetParent?void 0:a.getOffsetParent(f));let A=L?L[S]:0;(!A||!await(null==a.isElement?void 0:a.isElement(L)))&&(A=s.floating[S]||r.floating[g]);const k=O/2-T/2,C=A/2-b[g]/2-1,D=l(h[E],C),F=l(h[z],C),B=D,$=A-b[g]-F,H=A/2-b[g]/2+k,N=m(B,H,$),j=!c.arrow&&null!=w(i)&&H!==N&&r.reference[g]/2-(H<B?D:F)-b[g]/2<0,M=j?H<B?H-B:H-$:0;return{[d]:p[d]+M,data:{[d]:N,centerOffset:H-N-M,...j&&{alignmentOffset:M}},reset:j}}}))({element:this.arrowEl,padding:this.arrowPadding})),((t,e,n)=>{const o=new Map,i={platform:lt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=O(c,o,l),h=o,p={},d=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:g,data:w,reset:b}=await m({x:f,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});f=y??f,u=g??u,p={...p,[r]:{...p[r],...w}},b&&d<=50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=O(c,h,l))),n=-1)}return{x:f,y:u,placement:h,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})})(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy}).then((({x:t,y:e,middlewareData:n,placement:o})=>{const i="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let o="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?n:"",l=i?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":n,l=i?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sd-reposition")}render(){return e`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${s("isolate","fixed"!==this.strategy?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?e`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};pt.styles=[t.styles,a,n`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}[part=arrow]{width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);background:var(--arrow-color)}`],ht([r('[part="popup"]')],pt.prototype,"popup",2),ht([r('[part="arrow"]')],pt.prototype,"arrowEl",2),ht([o()],pt.prototype,"anchor",2),ht([o({type:Boolean,reflect:!0})],pt.prototype,"active",2),ht([o({reflect:!0})],pt.prototype,"placement",2),ht([o({reflect:!0})],pt.prototype,"strategy",2),ht([o({type:Number})],pt.prototype,"distance",2),ht([o({type:Number})],pt.prototype,"skidding",2),ht([o({type:Boolean})],pt.prototype,"arrow",2),ht([o({attribute:"arrow-placement"})],pt.prototype,"arrowPlacement",2),ht([o({attribute:"arrow-padding",type:Number})],pt.prototype,"arrowPadding",2),ht([o({type:Boolean})],pt.prototype,"flip",2),ht([o({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],pt.prototype,"flipFallbackPlacements",2),ht([o({attribute:"flip-fallback-strategy"})],pt.prototype,"flipFallbackStrategy",2),ht([o({type:Object})],pt.prototype,"flipBoundary",2),ht([o({attribute:"flip-padding",type:Number})],pt.prototype,"flipPadding",2),ht([o({type:Boolean})],pt.prototype,"shift",2),ht([o({type:Object})],pt.prototype,"shiftBoundary",2),ht([o({attribute:"shift-padding",type:Number})],pt.prototype,"shiftPadding",2),ht([o({attribute:"auto-size"})],pt.prototype,"autoSize",2),ht([o()],pt.prototype,"sync",2),ht([o({type:Object})],pt.prototype,"autoSizeBoundary",2),ht([o({attribute:"auto-size-padding",type:Number})],pt.prototype,"autoSizePadding",2),pt=ht([i("sd-3-6-0-popup")],pt);export{pt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as t,x as e,i as s,n as r,c as o}from"./solid-element.js";import{H as i}from"./slot.js";import{o as a}from"./if-defined.js";import{r as n}from"./state.js";import{e as d}from"./query.js";import{w as l}from"./watch.js";import{c as u}from"./component.styles.js";import{t as h}from"./classix.js";var c=Object.defineProperty,b=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?b(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&c(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new i(this,"[default]","icon"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="lg"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),s=this.hasSlotController.test("icon"),r=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${h("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",s&&"button--has-icon flex gap-2",r)}" aria-disabled="${this.disabled}" type="button" value="${a(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${h(s&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!s}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,u,s`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-3-
|
|
1
|
+
import{S as t,x as e,i as s,n as r,c as o}from"./solid-element.js";import{H as i}from"./slot.js";import{o as a}from"./if-defined.js";import{r as n}from"./state.js";import{e as d}from"./query.js";import{w as l}from"./watch.js";import{c as u}from"./component.styles.js";import{t as h}from"./classix.js";var c=Object.defineProperty,b=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?b(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&c(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new i(this,"[default]","icon"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="lg"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),s=this.hasSlotController.test("icon"),r=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${h("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",s&&"button--has-icon flex gap-2",r)}" aria-disabled="${this.disabled}" type="button" value="${a(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${h(s&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!s}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,u,s`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-3-6-0-button-group__button--first:not(.sd-3-6-0-button-group__button--last)) button{border-top-right-radius:var(--sd-border-radius-none,0);border-bottom-right-radius:var(--sd-border-radius-none,0)}:host(.sd-3-6-0-button-group__button--inner) button{border-radius:var(--sd-border-radius-none,0)}:host(.sd-3-6-0-button-group__button--last:not(.sd-3-6-0-button-group__button--first)) button{border-top-left-radius:var(--sd-border-radius-none,0);border-bottom-left-radius:var(--sd-border-radius-none,0)}:host(.sd-3-6-0-button-group__button:not(.sd-3-6-0-button-group__button--first)){margin-inline-start:-1px}:host(.sd-3-6-0-button-group__button--hover){z-index:10}:host(.sd-3-6-0-button-group__button--focus),:host(.sd-3-6-0-button-group__button[checked]){z-index:20}`],p([d(".button")],m.prototype,"input",2),p([d(".hidden-input")],m.prototype,"hiddenInput",2),p([n()],m.prototype,"hasFocus",2),p([r({type:Boolean,reflect:!0})],m.prototype,"checked",2),p([r()],m.prototype,"value",2),p([r({type:Boolean,reflect:!0})],m.prototype,"disabled",2),p([r({reflect:!0})],m.prototype,"size",2),p([l("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),m=p([o("sd-3-6-0-radio-button")],m);export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t,n as e,S as o,x as s,c as i}from"./solid-element.js";import{F as a,c as l,a as r,v as n}from"./form.js";import{H as d}from"./slot.js";import{r as h}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as p}from"./component.styles.js";import{t as m}from"./classix.js";import g from"./radio.js";const b=t`${p}:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`;var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?v(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&f(e,o,a),a};let C=class extends o{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=w(t.target);null==e||e.classList.add("sd-3-
|
|
1
|
+
import{i as t,n as e,S as o,x as s,c as i}from"./solid-element.js";import{F as a,c as l,a as r,v as n}from"./form.js";import{H as d}from"./slot.js";import{r as h}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as p}from"./component.styles.js";import{t as m}from"./classix.js";import g from"./radio.js";const b=t`${p}:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`;var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?v(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&f(e,o,a),a};let C=class extends o{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=w(t.target);null==e||e.classList.add("sd-3-6-0-button-group__button--focus")}handleBlur(t){const e=w(t.target);null==e||e.classList.remove("sd-3-6-0-button-group__button--focus")}handleMouseOver(t){const e=w(t.target);null==e||e.classList.add("sd-3-6-0-button-group__button--hover")}handleMouseOut(t){const e=w(t.target);null==e||e.classList.remove("sd-3-6-0-button-group__button--hover")}handleSlotChange(){const t=[...this.defaultSlot.assignedElements({flatten:!0})];t.forEach((e=>{const o=t.indexOf(e),s=w(e);null!==s&&(s.classList.add("sd-3-6-0-button-group__button"),s.classList.toggle("sd-3-6-0-button-group__button--first",0===o),s.classList.toggle("sd-3-6-0-button-group__button--inner",o>0&&o<t.length-1),s.classList.toggle("sd-3-6-0-button-group__button--last",o===t.length-1),s.classList.toggle("sd-3-6-0-button-group__button--radio","sd-3-6-0-radio-button"===s.tagName.toLowerCase()))}))}render(){return s`<slot part="base" class="button-group" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}" @slotchange="${this.handleSlotChange}"></slot>`}};function w(t){const e="sd-3-6-0-button, sd-3-6-0-radio-button";return t.closest(e)??t.querySelector(e)}C.styles=b,y([u("slot")],C.prototype,"defaultSlot",2),y([h()],C.prototype,"disableRole",2),y([e()],C.prototype,"label",2),C=y([i("sd-3-6-0-button-group")],C);var x=Object.defineProperty,R=Object.getOwnPropertyDescriptor,k=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?R(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&x(e,o,a),a};let I=class extends o{constructor(){super(...arguments),this.formControlController=new a(this),this.hasSlotController=new d(this,"label","error-text"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.showInvalidStyle=!1,this.label="",this.boldLabel=!1,this.name="option",this.value="",this.size="lg",this.form="",this.required=!1,this.orientation="vertical"}get validity(){const t=this.required&&!this.value;return""!==this.customValidityMessage?l:t?r:n}get validationMessage(){const t=this.required&&!this.value;return""!==this.customValidityMessage?this.customValidityMessage:t?this.validationInput.validationMessage:""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value}firstUpdated(){this.formControlController.updateValidity()}getAllRadios(){return[...this.querySelectorAll("sd-3-6-0-radio, sd-3-6-0-radio-button")]}handleRadioClick(t){const e=t.target.closest("sd-3-6-0-radio, sd-3-6-0-radio-button"),o=this.getAllRadios(),s=this.value;e.disabled||(this.value=e.value,o.forEach((t=>t.checked=t===e)),this.value!==s&&(this.emit("sd-change"),this.emit("sd-input")))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),o=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,i=this.value;let a=e.indexOf(o)+s;a<0&&(a=e.length-1),a>e.length-1&&(a=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[a].value,e[a].checked=!0,this.hasButtonGroup?e[a].shadowRoot.querySelector("button").focus():(e[a].tabIndex=0,e[a].focus()),this.value!==i&&(this.emit("sd-change"),this.emit("sd-input")),t.preventDefault()}focus(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}async syncRadioElements(){var t,e;const o=this.getAllRadios();if(await Promise.all(o.map((async t=>{await t.updateComplete,t.checked=t.value===this.value,t.size=this.size,t instanceof g&&(t.invalid=this.showInvalidStyle)}))),this.hasButtonGroup=o.some((t=>"sd-3-6-0-radio-button"===t.tagName.toLowerCase())),!o.some((t=>t.checked)))if(this.hasButtonGroup){const e=null==(t=o[0].shadowRoot)?void 0:t.querySelector("button");e&&(e.tabIndex=0)}else o[0].tabIndex=0;if(this.hasButtonGroup){const t=null==(e=this.shadowRoot)?void 0:e.querySelector("sd-3-6-0-button-group");t&&(t.disableRole=!0)}}syncRadios(){customElements.get("sd-3-6-0-radio")&&customElements.get("sd-3-6-0-radio-button")?this.syncRadioElements():(customElements.get("sd-3-6-0-radio")?this.syncRadioElements():customElements.whenDefined("sd-3-6-0-radio").then((()=>this.syncRadios())),customElements.get("sd-3-6-0-radio-button")?this.syncRadioElements():customElements.whenDefined("sd-3-6-0-radio-button").then((()=>this.syncRadios())))}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value)),this.formControlController.setValidity(this.validity.valid)}handleSizeChange(){this.syncRadios()}handleInvalidChange(){this.syncRadios()}handleValueChange(){this.hasUpdated&&(this.updateCheckedRadio(),this.reportValidity())}checkValidity(){const t=this.required&&!this.value,e=""!==this.customValidityMessage;return!t&&!e||(this.formControlController.emitInvalidEvent(),!1)}getForm(){return this.formControlController.getForm()}reportValidity(){const t=this.validity.valid;return this.formControlController.setValidity(t),this.validationInput.hidden=!0,clearTimeout(this.validationTimeout),this.formControlController.fakeUserInteraction(),t||(this.validationInput.hidden=!1,this.validationInput.reportValidity(),this.validationTimeout=setTimeout((()=>this.validationInput.hidden=!0),1e4)),t}setCustomValidity(t=""){this.customValidityMessage=t,this.validationInput.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=!!this.label||!!t,o=s`<slot @slotchange="${this.syncRadios}" @click="${this.handleRadioClick}" @keydown="${this.handleKeyDown}"></slot>`;return s`<fieldset part="form-control" class="${m("border-0 p-0 m-0 flex flex-col",{sm:"text-sm",lg:"text-base"}[this.size])}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="${m("mb-2 p-0 leading-normal text-black text-left",!e&&"hidden",this.boldLabel&&"font-bold")}" @click="${this.focus}" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${m("flex",{vertical:"flex-col",horizontal:"flex-row"}[this.orientation])}"><div class="sr-only"><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${this.hasButtonGroup?s`<sd-3-6-0-button-group part="button-group" exportparts="base:button-group__base" role="presentation">${o}</sd-3-6-0-button-group>`:o}</div></fieldset>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-3-6-0-button-group":C},I.styles=[p,o.styles,t`:host{display:block}:host([orientation=vertical]) ::slotted(sd-3-6-0-radio){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-3-6-0-radio:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-3-6-0-radio){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-3-6-0-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-6-0-radio){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-6-0-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([required]) #label::after{content:' *'}`],k([u("slot:not([name])")],I.prototype,"defaultSlot",2),k([u("#validation-input")],I.prototype,"validationInput",2),k([u("#invalid-message")],I.prototype,"invalidMessage",2),k([h()],I.prototype,"hasButtonGroup",2),k([h()],I.prototype,"defaultValue",2),k([h()],I.prototype,"showInvalidStyle",2),k([e()],I.prototype,"label",2),k([e({type:Boolean,reflect:!0})],I.prototype,"boldLabel",2),k([e()],I.prototype,"name",2),k([e({reflect:!0})],I.prototype,"value",2),k([e({reflect:!0})],I.prototype,"size",2),k([e({reflect:!0})],I.prototype,"form",2),k([e({type:Boolean,reflect:!0})],I.prototype,"required",2),k([e({reflect:!0})],I.prototype,"orientation",2),k([c("size",{waitUntilFirstUpdate:!0})],I.prototype,"handleSizeChange",1),k([c("showInvalidStyle",{waitUntilFirstUpdate:!0})],I.prototype,"handleInvalidChange",1),k([c("value")],I.prototype,"handleValueChange",1),I=k([i("sd-3-6-0-radio-group")],I);export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as e,x as t,i as s,n as i,c as r}from"./solid-element.js";import{r as l}from"./state.js";import{w as a}from"./watch.js";import{t as o}from"./classix.js";var n=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(e,t,s,i)=>{for(var r,l=i>1?void 0:i?h(t,s):t,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(i?r(t,s,l):r(l))||l);return i&&l&&n(t,s,l),l};let c=class extends e{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.invalid=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return t`<span part="base" class="${o("sd-3-
|
|
1
|
+
import"./icon.js";import{S as e,x as t,i as s,n as i,c as r}from"./solid-element.js";import{r as l}from"./state.js";import{w as a}from"./watch.js";import{t as o}from"./classix.js";var n=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(e,t,s,i)=>{for(var r,l=i>1?void 0:i?h(t,s):t,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(i?r(t,s,l):r(l))||l);return i&&l&&n(t,s,l),l};let c=class extends e{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.invalid=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return t`<span part="base" class="${o("sd-3-6-0-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",this.disabled&&"hover:cursor-not-allowed",{sm:"small-size text-sm",lg:"text-base"}[this.size])}"><span part="${this.checked?"control--checked":"control--unchecked"}" class="${o("flex-initial shrink-0 relative inline-flex items-center justify-center border rounded-full bg-white h-4 w-4",this.disabled?"border-neutral-500":this.invalid?"border-error hover:border-error-400 group-hover:border-error-400":this.checked?"border-accent hover:border-accent-550 group-hover:border-accent-550":"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200")}">${this.checked?t`<span part="checked" class="${o("rounded-full inline-flex text-white border bg-accent h-2.5 w-2.5",this.disabled?"bg-neutral-500":this.invalid?"bg-error hover:bg-error-400 group-hover:bg-error-400":this.checked?"bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"bg-neutral-800")}"></span>`:""}</span><slot part="label" class="${o("ml-2 select-none inline-block",this.disabled?"text-neutral-500":this.invalid?"text-error":"text-black")}"></slot></span>`}};c.styles=[e.styles,s`:host{display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:rgb(var(--sd-color-primary,0 53 142) / 1)}`],d([l()],c.prototype,"checked",2),d([l()],c.prototype,"hasFocus",2),d([i({reflect:!0})],c.prototype,"size",2),d([i({type:Boolean,reflect:!0})],c.prototype,"invalid",2),d([i({type:Boolean,reflect:!0})],c.prototype,"disabled",2),d([i()],c.prototype,"value",2),d([a("checked")],c.prototype,"handleCheckedChange",1),d([a("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",1),c=d([r("sd-3-6-0-radio")],c);export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as t,x as l,r as o,i as e,n as r,c as s}from"./solid-element.js";import{r as i}from"./state.js";import{c as n}from"./component.styles.js";import{t as a}from"./classix.js";import{I as c}from"./interactive.js";var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,b=(t,l,o,e)=>{for(var r,s=e>1?void 0:e?h(l,o):l,i=t.length-1;i>=0;i--)(r=t[i])&&(s=(e?r(l,o,s):r(s))||s);return e&&s&&d(l,o,s),s};let u=class extends t{constructor(){super(...arguments),this.orientation="horizontal",this.buttons=!1,this.step=150,this.scrollbars=!1,this.shadows=!1,this.inset=!1,this.canScroll={left:!1,right:!1,up:!1,down:!1},this.isScrollHorizontalEnabled=!1,this.isScrollVerticalEnabled=!1,this.scrollContainer=null}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollIndicatorVisibility()})),this.updateComplete.then((()=>{this.scrollContainer=this.renderRoot.querySelector(".scroll-container"),this.scrollContainer&&this.resizeObserver.observe(this.scrollContainer)}))}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer&&this.resizeObserver.unobserve(this.scrollContainer)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.updateScrollIndicatorVisibility())}updateScrollEnabledFlags(){const t=this.orientation;this.isScrollHorizontalEnabled="horizontal"===t||"auto"===t,this.isScrollVerticalEnabled="vertical"===t||"auto"===t}get container(){return this.renderRoot.querySelector(".scroll-container")}updateScrollIndicatorVisibility(){const t=this.container;if(t){const l=this.isScrollHorizontalEnabled&&t.scrollLeft>0,o=this.isScrollHorizontalEnabled&&t.scrollLeft+t.clientWidth<t.scrollWidth-1,e=this.isScrollVerticalEnabled&&t.scrollTop>0,r=this.isScrollVerticalEnabled&&t.scrollTop+t.clientHeight<t.scrollHeight-1;this.canScroll={left:l,right:o,up:e,down:r},(l||e)&&this.dispatchEvent(new CustomEvent("start")),(o||r)&&this.dispatchEvent(new CustomEvent("end"))}}handleScroll(t){var l;const o="left"===t||"up"===t?-this.step:this.step,e={behavior:"smooth"};e["left"===t||"right"===t?"left":"top"]=o,null==(l=this.scrollContainer)||l.scrollBy(e);const r=`button-${t}`;this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0}))}render(){const t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",o="scroll-shadow absolute z-10 pointer-events-none";return l`<div part="base" class="${a("scroll-container flex overflow-hidden flex-1","horizontal"===this.orientation&&"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden","vertical"===this.orientation&&"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden","auto"===this.orientation&&"scroll-auto overflow-auto",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset?"p-4":"")}" @scroll="${this.updateScrollIndicatorVisibility}"><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?l`${this.isScrollHorizontalEnabled?l`${this.canScroll.left?l`<div part="button-left" class="absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8"><button part="button-start" class="${a(t)}" @click="${()=>this.handleScroll("left")}"><slot name="icon-start"><sd-3-
|
|
1
|
+
import{S as t,x as l,r as o,i as e,n as r,c as s}from"./solid-element.js";import{r as i}from"./state.js";import{c as n}from"./component.styles.js";import{t as a}from"./classix.js";import{I as c}from"./interactive.js";var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,b=(t,l,o,e)=>{for(var r,s=e>1?void 0:e?h(l,o):l,i=t.length-1;i>=0;i--)(r=t[i])&&(s=(e?r(l,o,s):r(s))||s);return e&&s&&d(l,o,s),s};let u=class extends t{constructor(){super(...arguments),this.orientation="horizontal",this.buttons=!1,this.step=150,this.scrollbars=!1,this.shadows=!1,this.inset=!1,this.canScroll={left:!1,right:!1,up:!1,down:!1},this.isScrollHorizontalEnabled=!1,this.isScrollVerticalEnabled=!1,this.scrollContainer=null}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollIndicatorVisibility()})),this.updateComplete.then((()=>{this.scrollContainer=this.renderRoot.querySelector(".scroll-container"),this.scrollContainer&&this.resizeObserver.observe(this.scrollContainer)}))}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer&&this.resizeObserver.unobserve(this.scrollContainer)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.updateScrollIndicatorVisibility())}updateScrollEnabledFlags(){const t=this.orientation;this.isScrollHorizontalEnabled="horizontal"===t||"auto"===t,this.isScrollVerticalEnabled="vertical"===t||"auto"===t}get container(){return this.renderRoot.querySelector(".scroll-container")}updateScrollIndicatorVisibility(){const t=this.container;if(t){const l=this.isScrollHorizontalEnabled&&t.scrollLeft>0,o=this.isScrollHorizontalEnabled&&t.scrollLeft+t.clientWidth<t.scrollWidth-1,e=this.isScrollVerticalEnabled&&t.scrollTop>0,r=this.isScrollVerticalEnabled&&t.scrollTop+t.clientHeight<t.scrollHeight-1;this.canScroll={left:l,right:o,up:e,down:r},(l||e)&&this.dispatchEvent(new CustomEvent("start")),(o||r)&&this.dispatchEvent(new CustomEvent("end"))}}handleScroll(t){var l;const o="left"===t||"up"===t?-this.step:this.step,e={behavior:"smooth"};e["left"===t||"right"===t?"left":"top"]=o,null==(l=this.scrollContainer)||l.scrollBy(e);const r=`button-${t}`;this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0}))}render(){const t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",o="scroll-shadow absolute z-10 pointer-events-none";return l`<div part="base" class="${a("scroll-container flex overflow-hidden flex-1","horizontal"===this.orientation&&"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden","vertical"===this.orientation&&"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden","auto"===this.orientation&&"scroll-auto overflow-auto",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset?"p-4":"")}" @scroll="${this.updateScrollIndicatorVisibility}"><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?l`${this.isScrollHorizontalEnabled?l`${this.canScroll.left?l`<div part="button-left" class="absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8"><button part="button-start" class="${a(t)}" @click="${()=>this.handleScroll("left")}"><slot name="icon-start"><sd-3-6-0-icon library="system" name="chevron-up" class="rotate-[-90deg]"></sd-3-6-0-icon></slot></button></div>`:null} ${this.canScroll.right?l`<div part="button-right" class="absolute z-10 flex items-center justify-center top-0 right-0 h-full w-8"><button part="button-end" class="${a(t)}" @click="${()=>this.handleScroll("right")}"><slot name="icon-end"><sd-3-6-0-icon library="system" name="chevron-down" class="rotate-[-90deg]"></sd-3-6-0-icon></slot></button></div>`:null}`:null} ${this.isScrollVerticalEnabled?l`${this.canScroll.up?l`<div part="button-top" class="absolute z-10 flex items-center justify-center top-0 left-0 w-full h-8"><button part="button-start" class="${a(t)}" @click="${()=>this.handleScroll("up")}"><slot name="icon-start"><sd-3-6-0-icon library="system" name="chevron-up"></sd-3-6-0-icon></slot></button></div>`:null} ${this.canScroll.down?l`<div part="button-bottom" class="absolute z-10 flex items-center justify-center bottom-0 left-0 w-full h-8"><button part="button-end" class="${a(t)}" @click="${()=>this.handleScroll("down")}"><slot name="icon-end"><sd-3-6-0-icon library="system" name="chevron-down"></sd-3-6-0-icon></slot></button></div>`:null}`:null}`:null} ${this.shadows?l`${this.isScrollHorizontalEnabled?l`${this.canScroll.left?l`<div part="shadow-left" class="${o} left top-0 left-0 w-[6px] h-full"></div>`:null} ${this.canScroll.right?l`<div part="shadow-right" class="${o} right top-0 right-0 w-[6px] h-full"></div>`:null}`:null} ${this.isScrollVerticalEnabled?l`${this.canScroll.up?l`<div part="shadow-top" class="${o} top top-0 left-0 w-full h-[6px]"></div>`:null} ${this.canScroll.down?l`<div part="shadow-bottom" class="${o} bottom bottom-0 left-0 w-full h-[6px]"></div>`:null}`:null}`:null}`}};u.styles=[t.styles,o(c),n,e`:host{--gradient-color:rgba(255, 255, 255, 0);--gradient:var(--gradient-color) 0%,#fff 80%,#fff 100%;position:relative;display:flex;overflow:hidden}.hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}.hide-scrollbars::-webkit-scrollbar{display:none}.scroll-container::-webkit-scrollbar-thumb{background-color:transparent}.scroll-container:hover::-webkit-scrollbar-thumb{background:var(--background-neutral-400,#c3c3c3);border-radius:var(--sd-border-radius-sm,.125rem)}.scroll-container::-webkit-scrollbar{height:var(--sd-spacing-1,.25rem);width:var(--sd-spacing-1,.25rem)}.scroll-auto{overflow:auto}[part=button-left]{background:linear-gradient(270deg,var(--gradient))}[part=button-right]{background:linear-gradient(90deg,var(--gradient))}[part=button-top]{background:linear-gradient(0deg,var(--gradient))}[part=button-bottom]{background:linear-gradient(180deg,var(--gradient))}[part=shadow-left]{background:linear-gradient(270deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}[part=shadow-right]{background:linear-gradient(90deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}[part=shadow-top]{background:linear-gradient(0deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}[part=shadow-bottom]{background:linear-gradient(180deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}.sd-3-6-0-icon--top{align-self:flex-start}.sd-3-6-0-icon--down{align-self:flex-end}`],b([r({type:String,reflect:!0})],u.prototype,"orientation",2),b([r({type:Boolean,reflect:!0})],u.prototype,"buttons",2),b([r({type:Number,reflect:!0})],u.prototype,"step",2),b([r({type:Boolean,reflect:!0})],u.prototype,"scrollbars",2),b([r({type:Boolean,reflect:!0})],u.prototype,"shadows",2),b([r({type:Boolean,reflect:!0})],u.prototype,"inset",2),b([i()],u.prototype,"canScroll",2),b([i()],u.prototype,"isScrollHorizontalEnabled",2),b([i()],u.prototype,"isScrollVerticalEnabled",2),u=b([s("sd-3-6-0-scrollable")],u);export{u as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{s as t,a as e,w as s}from"./event.js";import{S as i,x as o,i as l,n as a,c as n}from"./solid-element.js";import{d as r}from"./default-value.js";import{F as h}from"./form.js";import{g as p,s as d}from"./animation-registry.js";import{H as c}from"./slot.js";import{L as u}from"./solid-components2.js";import{r as m}from"./state.js";import{e as y}from"./query.js";import{o as b}from"./query-assigned-elements.js";import{s as v}from"./scroll.js";import{o as f,S as g}from"./icon.js";import{w as x}from"./watch.js";import{c as w}from"./component.styles.js";import{t as O}from"./classix.js";import C from"./popup.js";import S from"./tag.js";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?k(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&$(e,s,l),l};let I=class extends i{constructor(){super(...arguments),this.formControlController=new h(this,{assumeInteractionOn:["sd-blur","sd-3-
|
|
1
|
+
import{s as t,a as e,w as s}from"./event.js";import{S as i,x as o,i as l,n as a,c as n}from"./solid-element.js";import{d as r}from"./default-value.js";import{F as h}from"./form.js";import{g as p,s as d}from"./animation-registry.js";import{H as c}from"./slot.js";import{L as u}from"./solid-components2.js";import{r as m}from"./state.js";import{e as y}from"./query.js";import{o as b}from"./query-assigned-elements.js";import{s as v}from"./scroll.js";import{o as f,S as g}from"./icon.js";import{w as x}from"./watch.js";import{c as w}from"./component.styles.js";import{t as O}from"./classix.js";import C from"./popup.js";import S from"./tag.js";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?k(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&$(e,s,l),l};let I=class extends i{constructor(){super(...arguments),this.formControlController=new h(this,{assumeInteractionOn:["sd-blur","sd-3-6-0-input"]}),this.hasSlotController=new c(this,"help-text","label"),this.localize=new u(this),this.typeToSelectString="",this.hasHover=!1,this.displayLabel="",this.hasFocus=!1,this.selectedOptions=[],this.showValidStyle=!1,this.showInvalidStyle=!1,this.defaultValue="",this.open=!1,this.size="lg",this.label="",this.placeholder=this.localize.term("selectDefaultPlaceholder"),this.helpText="",this.placement="bottom",this.currentPlacement=this.placement,this.clearable=!1,this.disabled=!1,this.multiple=!1,this.useTags=!1,this.maxOptionsVisible=3,this.form="",this.name="",this.value="",this.required=!1,this.styleOnValid=!1,this.hoist=!1,this.getTag=t=>o`<sd-3-6-0-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
2
2
|
base:tag__base,
|
|
3
3
|
content:tag__content,
|
|
4
4
|
removable-indicator:tag__removable-indicator,
|
|
5
|
-
" size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-3-4-0-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-3-4-0-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-3-4-0-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-3-4-0-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-3-4-0-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-3-4-0-option")]}getFirstOption(){return this.querySelector("sd-3-4-0-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?f(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-3-4-0-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-3-4-0-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-3-4-0-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=p(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&v(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=p(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,s(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,s(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,l=this.clearable&&!this.disabled&&this.value.length>0,a=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",n=this.disabled?"cursor-not-allowed":"cursor-pointer",r={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],h={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${O("relative text-left",n,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${s&&"inline-block mb-2"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${O("relative w-full bg-white",{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[a])}"><div part="border" class="${O("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-3-4-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${O("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
5
|
+
" size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-3-6-0-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-3-6-0-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-3-6-0-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-3-6-0-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-3-6-0-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-3-6-0-option")]}getFirstOption(){return this.querySelector("sd-3-6-0-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?f(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-3-6-0-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-3-6-0-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-3-6-0-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=p(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&v(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=p(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,s(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,s(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,l=this.clearable&&!this.disabled&&this.value.length>0,a=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",n=this.disabled?"cursor-not-allowed":"cursor-pointer",r={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],h={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${O("relative text-left",n,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${s&&"inline-block mb-2"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${O("relative w-full bg-white",{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[a])}"><div part="border" class="${O("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-3-6-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${O("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
6
6
|
popup:popup__content,
|
|
7
|
-
"><div part="combobox" class="${O("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${O("appearance-none outline-none flex-grow bg-transparent w-full",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${O("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?o`<button part="clear-button" class="${O("select__clear flex justify-center",r)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-
|
|
7
|
+
"><div part="combobox" class="${O("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${O("appearance-none outline-none flex-grow bg-transparent w-full",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${O("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?o`<button part="clear-button" class="${O("select__clear flex justify-center",r)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-6-0-icon class="${O("text-neutral-500",h)}" library="system" name="closing-round"></sd-3-6-0-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-3-6-0-icon part="invalid-icon" class="${O(r,h)}" library="system" name="risk"></sd-3-6-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-3-6-0-icon part="valid-icon" class="${O("flex-shrink-0",r,h)}" library="system" name="status-check"></sd-3-6-0-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${O("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",this.disabled?"text-neutral-500":"text-primary",h)}"><sd-3-6-0-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-3-6-0-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${O("bg-white px-2 py-3 relative border-primary",this.open&&"shadow","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-3-6-0-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-3-6-0-icon":g,"sd-3-6-0-popup":C,"sd-3-6-0-tag":S},I.styles=[w,i.styles,l`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-3-6-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll}sd-3-6-0-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-3-6-0-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-3-6-0-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],D([b({selector:"sd-3-6-0-option"})],I.prototype,"_optionsInDefaultSlot",2),D([y("sd-3-6-0-popup")],I.prototype,"popup",2),D([y('[part="combobox"]')],I.prototype,"combobox",2),D([y('[part="display-input"]')],I.prototype,"displayInput",2),D([y(".value-input")],I.prototype,"valueInput",2),D([y('[part="listbox"]')],I.prototype,"listbox",2),D([y("#invalid-message")],I.prototype,"invalidMessage",2),D([m()],I.prototype,"hasHover",2),D([m()],I.prototype,"displayLabel",2),D([m()],I.prototype,"hasFocus",2),D([m()],I.prototype,"currentOption",2),D([m()],I.prototype,"selectedOptions",2),D([m()],I.prototype,"showValidStyle",2),D([m()],I.prototype,"showInvalidStyle",2),D([r()],I.prototype,"defaultValue",2),D([a({type:Boolean,reflect:!0})],I.prototype,"open",2),D([a({reflect:!0})],I.prototype,"size",2),D([a()],I.prototype,"label",2),D([a()],I.prototype,"placeholder",2),D([a({attribute:"help-text"})],I.prototype,"helpText",2),D([a({reflect:!0})],I.prototype,"placement",2),D([m()],I.prototype,"currentPlacement",2),D([a({type:Boolean})],I.prototype,"clearable",2),D([a({type:Boolean,reflect:!0})],I.prototype,"disabled",2),D([a({type:Boolean,reflect:!0})],I.prototype,"multiple",2),D([a({type:Boolean,reflect:!0})],I.prototype,"useTags",2),D([a({attribute:"max-options-visible",type:Number})],I.prototype,"maxOptionsVisible",2),D([a({reflect:!0})],I.prototype,"form",2),D([a()],I.prototype,"name",2),D([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],I.prototype,"value",2),D([a({type:Boolean,reflect:!0})],I.prototype,"required",2),D([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],I.prototype,"styleOnValid",2),D([a({type:Boolean})],I.prototype,"hoist",2),D([a()],I.prototype,"getTag",2),D([x("useTags",{waitUntilFirstUpdate:!0})],I.prototype,"handleUseTagsChange",1),D([x("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"handleDisabledChange",1),D([x("open",{waitUntilFirstUpdate:!0})],I.prototype,"handleOpenChange",1),D([x("size",{waitUntilFirstUpdate:!0})],I.prototype,"applySizeToOptions",1),D([x("value",{waitUntilFirstUpdate:!0})],I.prototype,"handleValueChange",1),I=D([n("sd-3-6-0-select")],I),d("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={name:"default",resolver:t=>{const o=t.split("/");return("content"===o[0]||"system"===o[0])&&(t="union-investment/"+t),`https://fe-celum-icons-prod.azureedge.net/${t}.svg`},mutator:t=>{const o={currentColorFills:[],currentColorStrokes:[],greenFills:[],greenStrokes:[]};return o.currentColorFills=t.querySelectorAll('[fill="#00358e" i]'),o.currentColorStrokes=t.querySelectorAll('[stroke="#00358e" i]'),o.greenFills=t.querySelectorAll('[fill="#43b02a" i]'),o.greenStrokes=t.querySelectorAll('[stroke="#43b02a" i]'),o.currentColorFills.forEach((t=>{t.setAttribute("fill","currentColor")})),o.currentColorStrokes.forEach((t=>{t.setAttribute("stroke","currentColor")})),o.greenFills.forEach((t=>{t.setAttribute("fill","rgb(var(--sd-color-accent, 67 176 42) / var(--tw-bg-opacity, 1))")})),o.greenStrokes.forEach((t=>{t.setAttribute("stroke","rgb(var(--sd-color-accent, 67 176 42) / var(--tw-bg-opacity, 1))")})),t}},o=Object.freeze(Object.defineProperty({__proto__:null,default:t},Symbol.toStringTag,{value:"Module"})),e={calendar:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21 2H3a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1ZM6 4v1.667a1 1 0 0 0 2 0V4h8v1.667a1 1 0 0 0 2 0V4h2v4H4V4h2ZM4 20V10h16v10H4Z"/>\n <path d="m7.603 13.263.597.81.31-.25c.31-.25.593-.49.733-.63h.017c-.017.333-.033 1.14-.033 1.647V18h1.223v-6.03H9.353l-1.75 1.293ZM14.667 11.867c-1.543 0-2.26 1-2.26 3.163 0 1.9.667 3.063 2.217 3.063s2.193-1.18 2.193-3.13c-.017-2.063-.743-3.097-2.15-3.097v.001Zm-.044 5.333c-.647 0-1-.76-1-2.28 0-1.44.353-2.173 1-2.173s1 .743 1 2.233c0 1.49-.387 2.227-1.017 2.227l.017-.007Z"/>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>\n </svg>\n ',"chevron-up":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>\n </svg>\n ',clock:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M13 11.587V8a1 1 0 0 0-2 0v4c0 .07.007.138.021.203l-.001-.006a.855.855 0 0 0 .029.093l-.002-.006c0 .033 0 .067.03.1a.709.709 0 0 0 .055.103l-.002-.003.037.07c.04.057.081.107.127.153l2.827 2.83a1.002 1.002 0 0 0 1.417-1.417L13 11.587Z"/>\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n </svg>\n ',close:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>\n </svg>\n ',"closing-round":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n <path d="M16.373 7.627a1 1 0 0 0-1.414 0l-2.96 2.96-2.96-2.96a1 1 0 0 0-1.413 1.414l-.001-.001 2.96 2.96-2.96 2.96a1 1 0 0 0 1.414 1.414l2.96-2.96 2.96 2.96a1 1 0 0 0 1.414-1.414L13.413 12l2.96-2.96a1 1 0 0 0 0-1.414v.001Z"/>\n </svg>',confirm:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.528 2.167a1 1 0 0 0-1.384.277l-.002.004-11.333 17-5.127-5.153a1 1 0 0 0-1.413 1.414l-.001-.001 6 6a.997.997 0 0 0 .707.293h.1c.307-.032.57-.199.731-.44l.002-.004 12-18a1 1 0 0 0-.276-1.388l-.004-.002Z"/>\n </svg>\n ',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n </svg>\n ',"eye-crossed-out":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M3 22a1 1 0 0 1-.707-1.707l18-18a1 1 0 0 1 1.414 1.414l-18 18A.991.991 0 0 1 3 22Z"/>\n </svg>\n ',"info-circle":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M13.333 7.833a1.5 1.5 0 1 1-3.001-.001 1.5 1.5 0 0 1 3.001.001ZM13 11.667a1 1 0 0 0-1-1h-1a1 1 0 0 0 0 2v2.667h2v-3.667Z"/><path d="M11 16.333v-1h-1a1 1 0 0 0 0 2h2a1 1 0 0 1-1-1Zm3-1h-1v1a1 1 0 0 1-1 1h2a1 1 0 0 0 0-2Z"/><path d="M13 16.333v-1h-2v1a1 1 0 0 0 2 0Z"/></svg>',"status-hook":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none">\n <path fill="currentColor" d="m9.947 1.138-.005.008-.001.003-5.56 8.34-2.434-2.447-.004-.004a.648.648 0 0 0-1.093.475c0 .172.066.328.175.444l.003.004 3 2.999c.117.117.28.19.46.19h.065c.2-.021.37-.13.475-.286l.005-.008.001-.002 5.994-8.992a.65.65 0 0 0-.18-.902l-.007-.005-.002-.002a.65.65 0 0 0-.892.185Z"/>\n </svg>\n ',"status-minus":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">\n <path d="M10 5.375H2C1.65496 5.375 1.375 5.65496 1.375 6C1.375 6.34504 1.65496 6.625 2 6.625H10C10.345 6.625 10.625 6.34504 10.625 6C10.625 5.65496 10.345 5.375 10 5.375Z" fill="currentColor"/>\n </svg>\n ',pause:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>\n </svg>\n ',risk:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.893 2.553a1.002 1.002 0 0 0-1.784-.006L2.106 20.553A1 1 0 0 0 3 22h18a1 1 0 0 0 .891-1.452l.003.006-9.001-18.001ZM4.617 20 12 5.237 19.383 20H4.617Z"/>\n <path d="M11 10.667V15a1 1 0 0 0 2 0v-4.333a1 1 0 0 0-2 0ZM13 18a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>\n </svg>\n ',start:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>\n </svg>\n ',"confirm-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M15.843 7.473a.999.999 0 0 0-1.367.329l-.002.004-3.667 6.223-1.757-1.753a1 1 0 0 0-1.413 1.414l-.001-.001 2.667 2.667a.997.997 0 0 0 .695.31h.128c.314-.042.578-.223.731-.479l.003-.005 4.333-7.333a1 1 0 0 0-.345-1.374l-.005-.003v.001Z"/></svg>',warning:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.893 2.55295C12.725 2.22395 12.388 2.00195 12 2.00195C11.612 2.00195 11.275 2.22295 11.109 2.54695L2.10598 20.553C2.03998 20.683 2.00098 20.837 2.00098 21C2.00098 21.552 2.44798 21.999 2.99998 22H21C21.552 21.999 21.999 21.552 21.999 21C21.999 20.837 21.96 20.683 21.891 20.548L21.894 20.554L12.893 2.55295ZM4.61698 20L12 5.23695L19.383 20H4.61698Z"/><path d="M11 10.667V15C11 15.552 11.448 16 12 16C12.552 16 13 15.552 13 15V10.667C13 10.115 12.552 9.66695 12 9.66695C11.448 9.66695 11 10.115 11 10.667Z"/><path d="M13 18C13 18.552 12.552 19 12 19C11.448 19 11 18.552 11 18C11 17.448 11.448 17 12 17C12.552 17 13 17.448 13 18Z"/></svg>',"exclamation-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 17C13 17.552 12.552 18 12 18C11.448 18 11 17.552 11 17C11 16.448 11.448 16 12 16C12.552 16 13 16.448 13 17Z"/><path d="M12 6C11.448 6 11 6.448 11 7V13C11 13.552 11.448 14 12 14C12.552 14 13 13.552 13 13V7C13 6.448 12.552 6 12 6Z"/><path d="M12 2C6.477 2 2 6.477 2 12C2 17.523 6.477 22 12 22C17.523 22 22 17.523 22 12C22 6.477 17.523 2 12 2ZM12 20C7.582 20 4 16.418 4 12C4 7.582 7.582 4 12 4C16.418 4 20 7.582 20 12C20 16.418 16.418 20 12 20Z"/></svg>',"magnifying-glass":'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M21.707 20.293l-6.967-6.96c-0.046-0.046-0.096-0.087-0.15-0.124l-0.004-0.002c0.882-1.162 1.413-2.632 1.413-4.227 0-3.881-3.146-7.027-7.027-7.027s-7.027 3.146-7.027 7.027c0 3.881 3.146 7.027 7.027 7.027 1.594 0 3.065-0.531 4.244-1.426l-0.017 0.013c0.039 0.057 0.081 0.107 0.127 0.153l6.967 6.967c0.181 0.181 0.431 0.292 0.707 0.292s0.526-0.112 0.707-0.292v0c0.183-0.181 0.296-0.432 0.296-0.71s-0.113-0.529-0.296-0.71l-0-0zM9 14c-2.761 0-5-2.239-5-5s2.239-5 5-5c2.761 0 5 2.239 5 5v0c0 2.761-2.239 5-5 5v0z"></path></svg>'},r={name:"system",resolver:t=>t in e?`data:image/svg+xml,${encodeURIComponent(e[t])}`:"",mutator:t=>t.setAttribute("fill","currentColor")},n=Object.freeze(Object.defineProperty({__proto__:null,default:r,icons:e},Symbol.toStringTag,{value:"Module"}));let s=[r,t],a=[];function l(t){a.push(t)}function i(t){a=a.filter((o=>o!==t))}function c(t){return s.find((o=>o.name===t))}function p(t,o){d(t),s.push({name:t,resolver:o.resolver,mutator:o.mutator}),a.forEach((o=>{o.library===t&&o.setIcon()}))}function d(t){s=s.filter((o=>o.name!==t))}const u=Object.freeze(Object.defineProperty({__proto__:null,getIconLibrary:c,registerIconLibrary:p,unregisterIconLibrary:d,unwatchIcon:i,watchIcon:l},Symbol.toStringTag,{value:"Module"})),m=new Set,g=new MutationObserver(y),v=new Map;let h,w=document.documentElement.dir||"ltr",b=document.documentElement.lang||navigator.language;function f(...t){t.map((t=>{const o=t.$code.toLowerCase();v.has(o)?v.set(o,Object.assign(Object.assign({},v.get(o)),t)):v.set(o,t),h||(h=t)})),y()}function y(){w=document.documentElement.dir||"ltr",b=document.documentElement.lang||navigator.language,[...m.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}g.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let S=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){m.add(this.host)}hostDisconnected(){m.delete(this.host)}dir(){return`${this.host.dir||w}`.toLowerCase()}lang(){return`${this.host.lang||b}`.toLowerCase()}getTranslationData(t){var o,e;const r=new Intl.Locale(t.replace(/_/g,"-")),n=null==r?void 0:r.language.toLowerCase(),s=null!==(e=null===(o=null==r?void 0:r.region)||void 0===o?void 0:o.toLowerCase())&&void 0!==e?e:"";return{locale:r,language:n,region:s,primary:v.get(`${n}-${s}`),secondary:v.get(n)}}exists(t,o){var e;const{primary:r,secondary:n}=this.getTranslationData(null!==(e=o.lang)&&void 0!==e?e:this.lang());return o=Object.assign({includeFallback:!1},o),!!(r&&r[t]||n&&n[t]||o.includeFallback&&h&&h[t])}term(t,...o){const{primary:e,secondary:r}=this.getTranslationData(this.lang());let n;if(e&&e[t])n=e[t];else if(r&&r[t])n=r[t];else{if(!h||!h[t])return console.error(`No translation found for: ${String(t)}`),String(t);n=h[t]}return"function"==typeof n?n(...o):n}date(t,o){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),o).format(t)}number(t,o){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),o).format(t)}relativeTime(t,o,e){return new Intl.RelativeTimeFormat(this.lang(),e).format(t,o)}};f({$code:"de",$name:"Deutsch",$dir:"ltr",carousel:"Karussell",clearEntry:"Eingabe löschen",close:"Schließen",copy:"Kopieren",numOptionsSelected:t=>0===t?"":`Optionen ausgewählt (${t})`,previousSlide:"Vorherige Folie",currentValue:"Aktueller Wert",goToSlide:(t,o)=>`Zu Folie ${t} von ${o} gehen`,hidePassword:"Passwort verbergen",loading:"Wird geladen",nextSlide:"Nächste Folie",progress:"Fortschritt",remove:"Entfernen",resize:"Größe ändern",scrollToEnd:"Zum Ende scrollen",scrollToStart:"Zum Anfang scrollen",selectAColorFromTheScreen:"Farbe vom Bildschirm auswählen",selectDefaultPlaceholder:"Bitte auswählen",showPassword:"Passwort anzeigen",slideNum:t=>`Folie ${t}`,toggleColorFormat:"Farbformat umschalten"}),f({$code:"en",$name:"English",$dir:"ltr",clearEntry:"Clear entry",close:"Close",copy:"Copy",numOptionsSelected:t=>0===t?"":`Options Selected (${t})`,currentValue:"Current value",hidePassword:"Hide password",loading:"Loading",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",selectDefaultPlaceholder:"Please select",showPassword:"Show password",toggleColorFormat:"Toggle color format",carousel:"Carousel",nextSlide:"Next slide",previousSlide:"Previous slide",goToSlide:(t,o)=>`Go to slide ${t} of ${o}`,slideNum:t=>`Slide ${t}`});class C extends S{}function x(t,{setValueOnSelection:o,scrollSelectionIntoView:e}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){const r=t?"string"==typeof t?document.querySelector(t):t:document.querySelector("#autoComplete"),n=r.shadowRoot.querySelector("input"),s=t=>t[0];return n.addEventListener("init",(()=>{var t,o;const e=null==(t=r.shadowRoot)?void 0:t.querySelector("ul");null==e||e.setAttribute("part","listbox");const n=document.createElement("sd-3-4-0-popup");n.appendChild(e),null==(o=r.shadowRoot)||o.appendChild(n),null==n||n.setAttribute("exportparts","popup__content"),n&&(n.active=!1,n.autoSize="vertical",n.autoSizePadding=16,n.placement="bottom-start",n.anchor=r,n.sync="width");const a=s`sd-3-4-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll;border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-width:2px;border-top-width:0;--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255) / var(--tw-bg-opacity));padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem);padding-top:var(--sd-spacing-3,.75rem);padding-bottom:var(--sd-spacing-3,.75rem);--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-3-4-0-popup li{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}sd-3-4-0-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246) / var(--tw-bg-opacity))}sd-3-4-0-popup li{list-style-type:''}sd-3-4-0-popup li mark{background-color:transparent;font-weight:700}sd-3-4-0-popup li:not(:has(sd-3-4-0-option)){cursor:pointer;padding-left:var(--sd-spacing-4,1rem);padding-right:var(--sd-spacing-4,1rem);padding-top:var(--sd-spacing-3,.75rem);padding-bottom:var(--sd-spacing-3,.75rem);font-size:var(--sd-font-size-base,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24) / var(--tw-text-opacity))}sd-3-4-0-popup li:not(:has(sd-3-4-0-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233) / var(--tw-bg-opacity))}sd-3-4-0-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233) / var(--tw-bg-opacity))}`,l=new CSSStyleSheet;l.replaceSync(a),r.shadowRoot.adoptedStyleSheets=[...r.shadowRoot.adoptedStyleSheets,l]})),o&&n.addEventListener("selection",(t=>{var o;r.value=null==(o=null==t?void 0:t.detail)?void 0:o.selection.value})),n.addEventListener("open",(()=>{var t,o,e,n,s,a;null==(o=null==(t=r.shadowRoot)?void 0:t.querySelector("sd-3-4-0-popup"))||o.setAttribute("active","true"),null==(n=null==(e=r.shadowRoot)?void 0:e.querySelector('[part="border"]'))||n.classList.add("rounded-b-none"),null==(a=null==(s=r.shadowRoot)?void 0:s.querySelector('[part="form-control"]'))||a.classList.add("z-50")})),n.addEventListener("close",(()=>{var t,o,e,n,s,a;null==(o=null==(t=r.shadowRoot)?void 0:t.querySelector("sd-3-4-0-popup"))||o.removeAttribute("active"),null==(n=null==(e=r.shadowRoot)?void 0:e.querySelector('[part="border"]'))||n.classList.remove("rounded-b-none"),null==(a=null==(s=r.shadowRoot)?void 0:s.querySelector('[part="form-control"]'))||a.classList.remove("z-50")})),e&&n.addEventListener("navigate",(()=>{const t=r.shadowRoot.querySelector('[aria-selected="true"]');null==t||t.scrollIntoView({block:"nearest"})})),{config:{selector:()=>n,resultsList:{tag:"ul"},wrapper:!1}}}const Z=Object.assign({"./components/accordion-group/accordion-group.ts":()=>import("./accordion-group.js"),"./components/accordion/accordion.ts":()=>import("./accordion.js"),"./components/badge/badge.ts":()=>import("./badge.js"),"./components/brandshape/brandshape.ts":()=>import("./brandshape.js"),"./components/button/button.ts":()=>import("./button.js"),"./components/carousel-item/carousel-item.ts":()=>import("./carousel-item.js"),"./components/carousel/autoplay-controller.ts":()=>import("./autoplay-controller.js"),"./components/carousel/carousel.ts":()=>import("./carousel.js"),"./components/carousel/scroll-controller.ts":()=>import("./scroll-controller.js"),"./components/checkbox-group/checkbox-group.ts":()=>import("./checkbox-group.js"),"./components/checkbox/checkbox.ts":()=>import("./checkbox.js"),"./components/dialog/dialog.ts":()=>import("./dialog.js"),"./components/divider/divider.ts":()=>import("./divider.js"),"./components/drawer/drawer.ts":()=>import("./drawer.js"),"./components/dropdown/dropdown.ts":()=>import("./dropdown.js"),"./components/header/header.ts":()=>import("./header.js"),"./components/icon/icon.ts":()=>import("./icon.js").then((t=>t.i)),"./components/icon/library.default.ts":()=>Promise.resolve().then((()=>o)),"./components/icon/library.system.ts":()=>Promise.resolve().then((()=>n)),"./components/icon/library.ts":()=>Promise.resolve().then((()=>u)),"./components/icon/request.ts":()=>import("./request.js"),"./components/include/include.ts":()=>import("./include.js"),"./components/include/request.ts":()=>import("./request2.js"),"./components/input/input.ts":()=>import("./input.js"),"./components/link/link.ts":()=>import("./link.js"),"./components/map-marker/map-marker.ts":()=>import("./map-marker.js"),"./components/navigation-item/navigation-item.ts":()=>import("./navigation-item.js"),"./components/notification/notification.ts":()=>import("./notification.js"),"./components/option/option.ts":()=>import("./option.js"),"./components/popup/popup.ts":()=>import("./popup.js"),"./components/radio-button/radio-button.ts":()=>import("./radio-button.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.js"),"./components/scrollable/scrollable.ts":()=>import("./scrollable.js"),"./components/select/select.ts":()=>import("./select.js"),"./components/spinner/spinner.ts":()=>import("./spinner.js"),"./components/switch/switch.ts":()=>import("./switch.js"),"./components/tab-group/tab-group.ts":()=>import("./tab-group.js"),"./components/tab-panel/tab-panel.ts":()=>import("./tab-panel.js"),"./components/tab/tab.ts":()=>import("./tab.js"),"./components/tag/tag.ts":()=>import("./tag.js"),"./components/teaser-media/teaser-media.ts":()=>import("./teaser-media.js"),"./components/teaser/teaser.ts":()=>import("./teaser.js"),"./components/textarea/textarea.ts":()=>import("./textarea.js"),"./components/tooltip/tooltip.ts":()=>import("./tooltip.js"),"./components/video/video.ts":()=>import("./video.js")});Object.keys(Z).forEach((t=>{Z[t]()}));export{C as L,d as a,c as g,p as r,x as s,i as u,l as w};
|
|
1
|
+
const t={name:"default",resolver:t=>{const o=t.split("/");return("content"===o[0]||"system"===o[0])&&(t="union-investment/"+t),`https://fe-celum-icons-prod.azureedge.net/${t}.svg`},mutator:t=>{const o={currentColorFills:[],currentColorStrokes:[],greenFills:[],greenStrokes:[]};return o.currentColorFills=t.querySelectorAll('[fill="#00358e" i]'),o.currentColorStrokes=t.querySelectorAll('[stroke="#00358e" i]'),o.greenFills=t.querySelectorAll('[fill="#43b02a" i]'),o.greenStrokes=t.querySelectorAll('[stroke="#43b02a" i]'),o.currentColorFills.forEach((t=>{t.setAttribute("fill","currentColor")})),o.currentColorStrokes.forEach((t=>{t.setAttribute("stroke","currentColor")})),o.greenFills.forEach((t=>{t.setAttribute("fill","rgb(var(--sd-color-accent, 67 176 42) / var(--tw-bg-opacity, 1))")})),o.greenStrokes.forEach((t=>{t.setAttribute("stroke","rgb(var(--sd-color-accent, 67 176 42) / var(--tw-bg-opacity, 1))")})),t}},o=Object.freeze(Object.defineProperty({__proto__:null,default:t},Symbol.toStringTag,{value:"Module"})),e={calendar:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21 2H3a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1ZM6 4v1.667a1 1 0 0 0 2 0V4h8v1.667a1 1 0 0 0 2 0V4h2v4H4V4h2ZM4 20V10h16v10H4Z"/>\n <path d="m7.603 13.263.597.81.31-.25c.31-.25.593-.49.733-.63h.017c-.017.333-.033 1.14-.033 1.647V18h1.223v-6.03H9.353l-1.75 1.293ZM14.667 11.867c-1.543 0-2.26 1-2.26 3.163 0 1.9.667 3.063 2.217 3.063s2.193-1.18 2.193-3.13c-.017-2.063-.743-3.097-2.15-3.097v.001Zm-.044 5.333c-.647 0-1-.76-1-2.28 0-1.44.353-2.173 1-2.173s1 .743 1 2.233c0 1.49-.387 2.227-1.017 2.227l.017-.007Z"/>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>\n </svg>\n ',"chevron-up":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>\n </svg>\n ',clock:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M13 11.587V8a1 1 0 0 0-2 0v4c0 .07.007.138.021.203l-.001-.006a.855.855 0 0 0 .029.093l-.002-.006c0 .033 0 .067.03.1a.709.709 0 0 0 .055.103l-.002-.003.037.07c.04.057.081.107.127.153l2.827 2.83a1.002 1.002 0 0 0 1.417-1.417L13 11.587Z"/>\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n </svg>\n ',close:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>\n </svg>\n ',"closing-round":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n <path d="M16.373 7.627a1 1 0 0 0-1.414 0l-2.96 2.96-2.96-2.96a1 1 0 0 0-1.413 1.414l-.001-.001 2.96 2.96-2.96 2.96a1 1 0 0 0 1.414 1.414l2.96-2.96 2.96 2.96a1 1 0 0 0 1.414-1.414L13.413 12l2.96-2.96a1 1 0 0 0 0-1.414v.001Z"/>\n </svg>',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n </svg>\n ',"eye-crossed-out":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M3 22a1 1 0 0 1-.707-1.707l18-18a1 1 0 0 1 1.414 1.414l-18 18A.991.991 0 0 1 3 22Z"/>\n </svg>\n ',"info-circle":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M13.333 7.833a1.5 1.5 0 1 1-3.001-.001 1.5 1.5 0 0 1 3.001.001ZM13 11.667a1 1 0 0 0-1-1h-1a1 1 0 0 0 0 2v2.667h2v-3.667Z"/><path d="M11 16.333v-1h-1a1 1 0 0 0 0 2h2a1 1 0 0 1-1-1Zm3-1h-1v1a1 1 0 0 1-1 1h2a1 1 0 0 0 0-2Z"/><path d="M13 16.333v-1h-2v1a1 1 0 0 0 2 0Z"/></svg>',"status-check":'\n <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 12 13">\n <path fill="currentColor" d="m9.947 1.138-.005.008-.001.003-5.56 8.34-2.434-2.447-.004-.004a.648.648 0 0 0-1.093.475c0 .172.066.328.175.444l.003.004 3 2.999c.117.117.28.19.46.19h.065c.2-.021.37-.13.475-.286l.005-.008.001-.002 5.994-8.992a.65.65 0 0 0-.18-.902l-.007-.005-.002-.002a.65.65 0 0 0-.892.185Z"/>\n </svg>\n ',"status-minus":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">\n <path d="M10 5.375H2C1.65496 5.375 1.375 5.65496 1.375 6C1.375 6.34504 1.65496 6.625 2 6.625H10C10.345 6.625 10.625 6.34504 10.625 6C10.625 5.65496 10.345 5.375 10 5.375Z" fill="currentColor"/>\n </svg>\n ',pause:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>\n </svg>\n ',risk:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.893 2.553a1.002 1.002 0 0 0-1.784-.006L2.106 20.553A1 1 0 0 0 3 22h18a1 1 0 0 0 .891-1.452l.003.006-9.001-18.001ZM4.617 20 12 5.237 19.383 20H4.617Z"/>\n <path d="M11 10.667V15a1 1 0 0 0 2 0v-4.333a1 1 0 0 0-2 0ZM13 18a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>\n </svg>\n ',start:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>\n </svg>\n ',"confirm-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M15.843 7.473a.999.999 0 0 0-1.367.329l-.002.004-3.667 6.223-1.757-1.753a1 1 0 0 0-1.413 1.414l-.001-.001 2.667 2.667a.997.997 0 0 0 .695.31h.128c.314-.042.578-.223.731-.479l.003-.005 4.333-7.333a1 1 0 0 0-.345-1.374l-.005-.003v.001Z"/></svg>',warning:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.893 2.55295C12.725 2.22395 12.388 2.00195 12 2.00195C11.612 2.00195 11.275 2.22295 11.109 2.54695L2.10598 20.553C2.03998 20.683 2.00098 20.837 2.00098 21C2.00098 21.552 2.44798 21.999 2.99998 22H21C21.552 21.999 21.999 21.552 21.999 21C21.999 20.837 21.96 20.683 21.891 20.548L21.894 20.554L12.893 2.55295ZM4.61698 20L12 5.23695L19.383 20H4.61698Z"/><path d="M11 10.667V15C11 15.552 11.448 16 12 16C12.552 16 13 15.552 13 15V10.667C13 10.115 12.552 9.66695 12 9.66695C11.448 9.66695 11 10.115 11 10.667Z"/><path d="M13 18C13 18.552 12.552 19 12 19C11.448 19 11 18.552 11 18C11 17.448 11.448 17 12 17C12.552 17 13 17.448 13 18Z"/></svg>',"exclamation-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 17C13 17.552 12.552 18 12 18C11.448 18 11 17.552 11 17C11 16.448 11.448 16 12 16C12.552 16 13 16.448 13 17Z"/><path d="M12 6C11.448 6 11 6.448 11 7V13C11 13.552 11.448 14 12 14C12.552 14 13 13.552 13 13V7C13 6.448 12.552 6 12 6Z"/><path d="M12 2C6.477 2 2 6.477 2 12C2 17.523 6.477 22 12 22C17.523 22 22 17.523 22 12C22 6.477 17.523 2 12 2ZM12 20C7.582 20 4 16.418 4 12C4 7.582 7.582 4 12 4C16.418 4 20 7.582 20 12C20 16.418 16.418 20 12 20Z"/></svg>',"magnifying-glass":'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M21.707 20.293l-6.967-6.96c-0.046-0.046-0.096-0.087-0.15-0.124l-0.004-0.002c0.882-1.162 1.413-2.632 1.413-4.227 0-3.881-3.146-7.027-7.027-7.027s-7.027 3.146-7.027 7.027c0 3.881 3.146 7.027 7.027 7.027 1.594 0 3.065-0.531 4.244-1.426l-0.017 0.013c0.039 0.057 0.081 0.107 0.127 0.153l6.967 6.967c0.181 0.181 0.431 0.292 0.707 0.292s0.526-0.112 0.707-0.292v0c0.183-0.181 0.296-0.432 0.296-0.71s-0.113-0.529-0.296-0.71l-0-0zM9 14c-2.761 0-5-2.239-5-5s2.239-5 5-5c2.761 0 5 2.239 5 5v0c0 2.761-2.239 5-5 5v0z"></path></svg>'},r={name:"system",resolver:t=>t in e?`data:image/svg+xml,${encodeURIComponent(e[t])}`:"",mutator:t=>t.setAttribute("fill","currentColor")},n=Object.freeze(Object.defineProperty({__proto__:null,default:r,icons:e},Symbol.toStringTag,{value:"Module"}));let s=[r,t],a=[];function l(t){a.push(t)}function i(t){a=a.filter((o=>o!==t))}function c(t){return s.find((o=>o.name===t))}function p(t,o){d(t),s.push({name:t,resolver:o.resolver,mutator:o.mutator}),a.forEach((o=>{o.library===t&&o.setIcon()}))}function d(t){s=s.filter((o=>o.name!==t))}const u=Object.freeze(Object.defineProperty({__proto__:null,getIconLibrary:c,registerIconLibrary:p,unregisterIconLibrary:d,unwatchIcon:i,watchIcon:l},Symbol.toStringTag,{value:"Module"})),m=new Set,g=new MutationObserver(y),v=new Map;let h,w=document.documentElement.dir||"ltr",b=document.documentElement.lang||navigator.language;function f(...t){t.map((t=>{const o=t.$code.toLowerCase();v.has(o)?v.set(o,Object.assign(Object.assign({},v.get(o)),t)):v.set(o,t),h||(h=t)})),y()}function y(){w=document.documentElement.dir||"ltr",b=document.documentElement.lang||navigator.language,[...m.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}g.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let S=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){m.add(this.host)}hostDisconnected(){m.delete(this.host)}dir(){return`${this.host.dir||w}`.toLowerCase()}lang(){return`${this.host.lang||b}`.toLowerCase()}getTranslationData(t){var o,e;const r=new Intl.Locale(t.replace(/_/g,"-")),n=null==r?void 0:r.language.toLowerCase(),s=null!==(e=null===(o=null==r?void 0:r.region)||void 0===o?void 0:o.toLowerCase())&&void 0!==e?e:"";return{locale:r,language:n,region:s,primary:v.get(`${n}-${s}`),secondary:v.get(n)}}exists(t,o){var e;const{primary:r,secondary:n}=this.getTranslationData(null!==(e=o.lang)&&void 0!==e?e:this.lang());return o=Object.assign({includeFallback:!1},o),!!(r&&r[t]||n&&n[t]||o.includeFallback&&h&&h[t])}term(t,...o){const{primary:e,secondary:r}=this.getTranslationData(this.lang());let n;if(e&&e[t])n=e[t];else if(r&&r[t])n=r[t];else{if(!h||!h[t])return console.error(`No translation found for: ${String(t)}`),String(t);n=h[t]}return"function"==typeof n?n(...o):n}date(t,o){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),o).format(t)}number(t,o){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),o).format(t)}relativeTime(t,o,e){return new Intl.RelativeTimeFormat(this.lang(),e).format(t,o)}};f({$code:"de",$name:"Deutsch",$dir:"ltr",carousel:"Karussell",clearEntry:"Eingabe löschen",close:"Schließen",copy:"Kopieren",numOptionsSelected:t=>0===t?"":`Optionen ausgewählt (${t})`,previousSlide:"Vorherige Folie",currentValue:"Aktueller Wert",goToSlide:(t,o)=>`Zu Folie ${t} von ${o} gehen`,hidePassword:"Passwort verbergen",loading:"Wird geladen",nextSlide:"Nächste Folie",progress:"Fortschritt",remove:"Entfernen",resize:"Größe ändern",scrollToEnd:"Zum Ende scrollen",scrollToStart:"Zum Anfang scrollen",selectAColorFromTheScreen:"Farbe vom Bildschirm auswählen",selectDefaultPlaceholder:"Bitte auswählen",showPassword:"Passwort anzeigen",slideNum:t=>`Folie ${t}`,toggleColorFormat:"Farbformat umschalten"}),f({$code:"en",$name:"English",$dir:"ltr",clearEntry:"Clear entry",close:"Close",copy:"Copy",numOptionsSelected:t=>0===t?"":`Options Selected (${t})`,currentValue:"Current value",hidePassword:"Hide password",loading:"Loading",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",selectDefaultPlaceholder:"Please select",showPassword:"Show password",toggleColorFormat:"Toggle color format",carousel:"Carousel",nextSlide:"Next slide",previousSlide:"Previous slide",goToSlide:(t,o)=>`Go to slide ${t} of ${o}`,slideNum:t=>`Slide ${t}`});class C extends S{}function x(t,{setValueOnSelection:o,scrollSelectionIntoView:e}={setValueOnSelection:!0,scrollSelectionIntoView:!0}){const r=t?"string"==typeof t?document.querySelector(t):t:document.querySelector("#autoComplete"),n=r.shadowRoot.querySelector("input"),s=t=>t[0];return n.addEventListener("init",(()=>{var t,o;const e=null==(t=r.shadowRoot)?void 0:t.querySelector("ul");null==e||e.setAttribute("part","listbox");const n=document.createElement("sd-3-6-0-popup");n.appendChild(e),null==(o=r.shadowRoot)||o.appendChild(n),null==n||n.setAttribute("exportparts","popup__content"),n&&(n.active=!1,n.autoSize="vertical",n.autoSizePadding=16,n.placement="bottom-start",n.anchor=r,n.sync="width");const a=s`sd-3-6-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll;border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-width:2px;border-top-width:0;--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255) / var(--tw-bg-opacity));padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem);padding-top:var(--sd-spacing-3,.75rem);padding-bottom:var(--sd-spacing-3,.75rem);--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-3-6-0-popup li{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}sd-3-6-0-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246) / var(--tw-bg-opacity))}sd-3-6-0-popup li{list-style-type:''}sd-3-6-0-popup li mark{background-color:transparent;font-weight:700}sd-3-6-0-popup li:not(:has(sd-3-6-0-option)){cursor:pointer;padding-left:var(--sd-spacing-4,1rem);padding-right:var(--sd-spacing-4,1rem);padding-top:var(--sd-spacing-3,.75rem);padding-bottom:var(--sd-spacing-3,.75rem);font-size:var(--sd-font-size-base,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24) / var(--tw-text-opacity))}sd-3-6-0-popup li:not(:has(sd-3-6-0-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233) / var(--tw-bg-opacity))}sd-3-6-0-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233) / var(--tw-bg-opacity))}`,l=new CSSStyleSheet;l.replaceSync(a),r.shadowRoot.adoptedStyleSheets=[...r.shadowRoot.adoptedStyleSheets,l]})),o&&n.addEventListener("selection",(t=>{var o;r.value=null==(o=null==t?void 0:t.detail)?void 0:o.selection.value})),n.addEventListener("open",(()=>{var t,o,e,n,s,a;null==(o=null==(t=r.shadowRoot)?void 0:t.querySelector("sd-3-6-0-popup"))||o.setAttribute("active","true"),null==(n=null==(e=r.shadowRoot)?void 0:e.querySelector('[part="border"]'))||n.classList.add("rounded-b-none"),null==(a=null==(s=r.shadowRoot)?void 0:s.querySelector('[part="form-control"]'))||a.classList.add("z-50")})),n.addEventListener("close",(()=>{var t,o,e,n,s,a;null==(o=null==(t=r.shadowRoot)?void 0:t.querySelector("sd-3-6-0-popup"))||o.removeAttribute("active"),null==(n=null==(e=r.shadowRoot)?void 0:e.querySelector('[part="border"]'))||n.classList.remove("rounded-b-none"),null==(a=null==(s=r.shadowRoot)?void 0:s.querySelector('[part="form-control"]'))||a.classList.remove("z-50")})),e&&n.addEventListener("navigate",(()=>{const t=r.shadowRoot.querySelector('[aria-selected="true"]');null==t||t.scrollIntoView({block:"nearest"})})),{config:{selector:()=>n,resultsList:{tag:"ul"},wrapper:!1}}}const j=Object.assign({"./components/accordion-group/accordion-group.ts":()=>import("./accordion-group.js"),"./components/accordion/accordion.ts":()=>import("./accordion.js"),"./components/badge/badge.ts":()=>import("./badge.js"),"./components/brandshape/brandshape.ts":()=>import("./brandshape.js"),"./components/button/button.ts":()=>import("./button.js"),"./components/carousel-item/carousel-item.ts":()=>import("./carousel-item.js"),"./components/carousel/autoplay-controller.ts":()=>import("./autoplay-controller.js"),"./components/carousel/carousel.ts":()=>import("./carousel.js"),"./components/carousel/scroll-controller.ts":()=>import("./scroll-controller.js"),"./components/checkbox-group/checkbox-group.ts":()=>import("./checkbox-group.js"),"./components/checkbox/checkbox.ts":()=>import("./checkbox.js"),"./components/dialog/dialog.ts":()=>import("./dialog.js"),"./components/divider/divider.ts":()=>import("./divider.js"),"./components/drawer/drawer.ts":()=>import("./drawer.js"),"./components/dropdown/dropdown.ts":()=>import("./dropdown.js"),"./components/header/header.ts":()=>import("./header.js"),"./components/icon/icon.ts":()=>import("./icon.js").then((t=>t.i)),"./components/icon/library.default.ts":()=>Promise.resolve().then((()=>o)),"./components/icon/library.system.ts":()=>Promise.resolve().then((()=>n)),"./components/icon/library.ts":()=>Promise.resolve().then((()=>u)),"./components/icon/request.ts":()=>import("./request.js"),"./components/include/include.ts":()=>import("./include.js"),"./components/include/request.ts":()=>import("./request2.js"),"./components/input/input.ts":()=>import("./input.js"),"./components/link/link.ts":()=>import("./link.js"),"./components/map-marker/map-marker.ts":()=>import("./map-marker.js"),"./components/navigation-item/navigation-item.ts":()=>import("./navigation-item.js"),"./components/notification/notification.ts":()=>import("./notification.js"),"./components/option/option.ts":()=>import("./option.js"),"./components/popup/popup.ts":()=>import("./popup.js"),"./components/radio-button/radio-button.ts":()=>import("./radio-button.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.js"),"./components/scrollable/scrollable.ts":()=>import("./scrollable.js"),"./components/select/select.ts":()=>import("./select.js"),"./components/spinner/spinner.ts":()=>import("./spinner.js"),"./components/step-group/step-group.ts":()=>import("./step-group.js"),"./components/step/step.ts":()=>import("./step.js"),"./components/switch/switch.ts":()=>import("./switch.js"),"./components/tab-group/tab-group.ts":()=>import("./tab-group.js"),"./components/tab-panel/tab-panel.ts":()=>import("./tab-panel.js"),"./components/tab/tab.ts":()=>import("./tab.js"),"./components/tag/tag.ts":()=>import("./tag.js"),"./components/teaser-media/teaser-media.ts":()=>import("./teaser-media.js"),"./components/teaser/teaser.ts":()=>import("./teaser.js"),"./components/textarea/textarea.ts":()=>import("./textarea.js"),"./components/tooltip/tooltip.ts":()=>import("./tooltip.js"),"./components/video/video.ts":()=>import("./video.js")});Object.keys(j).forEach((t=>{j[t]()}));export{C as L,d as a,c as g,p as r,x as s,i as u,l as w};
|