@helvetia-design/core 0.0.6 → 0.1.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/README.md +10 -10
- package/components/ds-accordion.js +1 -1
- package/components/ds-app-footer.js +1 -1
- package/components/ds-app-navbar.js +1 -1
- package/components/ds-badge.js +1 -1
- package/components/ds-brand-icon.js +1 -1
- package/components/ds-button.js +1 -1
- package/components/ds-card-subtitle.js +1 -1
- package/components/ds-card-title.js +1 -1
- package/components/ds-carousel.js +1 -1
- package/components/ds-checkbox-group.js +1 -1
- package/components/ds-close.js +1 -1
- package/components/ds-content.js +1 -1
- package/components/ds-counter.js +1 -1
- package/components/ds-data-item.js +1 -1
- package/components/ds-datepicker.js +1 -1
- package/components/ds-divider.js +1 -1
- package/components/ds-drawer.js +1 -1
- package/components/ds-file-upload.js +1 -1
- package/components/ds-heading.js +1 -1
- package/components/ds-hint.js +1 -1
- package/components/ds-icon.js +1 -1
- package/components/ds-input.js +1 -1
- package/components/ds-item.js +1 -1
- package/components/ds-modal.js +1 -1
- package/components/ds-notification.js +1 -1
- package/components/ds-number-input.js +1 -1
- package/components/ds-pagination.js +1 -1
- package/components/ds-phone-input.js +1 -1
- package/components/ds-popup.js +1 -1
- package/components/ds-radio-group.js +1 -1
- package/components/ds-segment.js +1 -1
- package/components/ds-select.js +1 -1
- package/components/ds-slider.js +1 -1
- package/components/ds-snackbar.js +1 -1
- package/components/ds-stack.js +1 -1
- package/components/ds-step.js +1 -1
- package/components/ds-tabs.js +1 -1
- package/components/ds-tag.js +1 -1
- package/components/ds-textarea.js +1 -1
- package/components/ds-toast.js +1 -1
- package/components/ds-toggle.js +1 -1
- package/components/{p-BWrjPWjt.js → p-B0Z95Hj1.js} +1 -1
- package/components/p-B9El_sPq.js +1 -1
- package/components/p-BB4SRrRj.js +4 -0
- package/components/{p-B3VN_5Hp.js → p-BPtibja3.js} +1 -1
- package/components/{p-B1celIGd.js → p-C0OHfTQ0.js} +1 -1
- package/components/{p-BJ2D8QfA.js → p-CTSANrsO.js} +1 -1
- package/components/{p-DgLUmdPH.js → p-CjK_T5vp.js} +1 -1
- package/components/p-DBqTFl8O.js +4 -0
- package/components/p-DFgZk16R.js +6 -0
- package/components/{p-Ce1uMkAI.js → p-DO00xKgx.js} +1 -1
- package/components/{p-CJycEnj5.js → p-Dj9PaUM0.js} +1 -1
- package/components/{p-Bd5NhwlZ.js → p-DyfdPmyS.js} +1 -1
- package/components/p-V50XCJTN.js +4 -0
- package/components/{p-BJK2OSM1.js → p-hhVbp_AN.js} +1 -1
- package/components/{p-D6jvX9E6.js → p-qIRMq8Bl.js} +1 -1
- package/components/{p-CsftG7WI.js → p-xUHc9oRK.js} +1 -1
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/ds-badge.cjs.entry.js +1 -1
- package/dist/cjs/ds-brand-icon_3.cjs.entry.js +17 -3
- package/dist/cjs/ds-card-subtitle.cjs.entry.js +3 -11
- package/dist/cjs/ds-card-title.cjs.entry.js +1 -1
- package/dist/cjs/ds-content_2.cjs.entry.js +9 -7
- package/dist/cjs/ds-counter.cjs.entry.js +4 -4
- package/dist/cjs/ds-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/ds-divider_2.cjs.entry.js +3 -3
- package/dist/cjs/ds-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/ds-heading.cjs.entry.js +5 -24
- package/dist/cjs/ds-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/ds-input.cjs.entry.js +2 -2
- package/dist/cjs/ds-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ds-phone-input.cjs.entry.js +1 -1
- package/dist/cjs/ds-select.cjs.entry.js +1 -1
- package/dist/cjs/ds-slider.cjs.entry.js +1 -1
- package/dist/cjs/ds-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/ds-tag.cjs.entry.js +1 -1
- package/dist/cjs/ds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ds-toast.cjs.entry.js +1 -1
- package/dist/cjs/ds-toggle.cjs.entry.js +1 -1
- package/dist/cjs/{heading.interfaces-C-G-ZqUa.js → heading.interfaces-BGskP9PB.js} +0 -2
- package/dist/cjs/index-CyaxwkZQ.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{svg-Cs3pO28w.js → svg-CH7qWfV-.js} +272 -195
- package/dist/cjs/{t-shirt-DWHArrUC.js → t-shirt-DqirWTL2.js} +2 -6
- package/dist/collection/components/actions/button/button.js +36 -2
- package/dist/collection/components/actions/button/test/button.component.play.js +53 -0
- package/dist/collection/components/forms/counter/counter.host.css +1 -1
- package/dist/collection/components/forms/counter/counter.js +5 -3
- package/dist/collection/components/forms/datepicker/datepicker.host.css +1 -1
- package/dist/collection/components/forms/file-upload/file-upload.host.css +1 -1
- package/dist/collection/components/forms/input/input.host.css +1 -1
- package/dist/collection/components/forms/input/input.js +3 -1
- package/dist/collection/components/forms/number-input/number-input.host.css +1 -1
- package/dist/collection/components/forms/phone-input/phone-input.host.css +1 -1
- package/dist/collection/components/forms/select/select.host.css +1 -1
- package/dist/collection/components/forms/slider/slider.host.css +1 -1
- package/dist/collection/components/forms/textarea/textarea.host.css +1 -1
- package/dist/collection/components/forms/toggle/toggle.host.css +1 -1
- package/dist/collection/components/structure/card/card-subtitle/card-subtitle.js +5 -37
- package/dist/collection/components/structure/content/content.js +3 -3
- package/dist/collection/components/structure/divider/divider.js +3 -3
- package/dist/collection/components/structure/heading/heading.const.js +0 -8
- package/dist/collection/components/structure/heading/heading.host.css +1 -1
- package/dist/collection/components/structure/heading/heading.interfaces.js +0 -1
- package/dist/collection/components/structure/heading/heading.js +5 -42
- package/dist/collection/components/structure/heading/test/heading.a11y.play.js +3 -8
- package/dist/collection/components/structure/stack/stack.interfaces.js +2 -2
- package/dist/collection/components/structure/stack/stack.js +10 -8
- package/dist/collection/components/structure/stack/test/stack.component.play.js +27 -1
- package/dist/collection/foundation/normalize.component.play.js +39 -0
- package/dist/collection/global/constants/version.constant.js +1 -1
- package/dist/collection/utils/t-shirt.js +7 -6
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-f67413bb28.entry.js → p-083f25371d.entry.js} +1 -1
- package/dist/design-system/{p-89418d345c.entry.js → p-1ca8c93650.entry.js} +1 -1
- package/dist/design-system/{p-6c9ebf73a3.entry.js → p-2b04230249.entry.js} +1 -1
- package/dist/design-system/p-3790705fde.entry.js +4 -0
- package/dist/design-system/{p-6b6fdc57c1.entry.js → p-4722d55123.entry.js} +1 -1
- package/dist/design-system/p-49ec36993d.entry.js +4 -0
- package/dist/design-system/{p-94a2067cb2.entry.js → p-68c0b49d0f.entry.js} +1 -1
- package/dist/design-system/{p-870e3c0138.entry.js → p-6d133bb1c4.entry.js} +1 -1
- package/dist/design-system/{p-65913aa877.entry.js → p-707ddadb07.entry.js} +1 -1
- package/dist/design-system/{p-a6709bd6a4.entry.js → p-812fca6694.entry.js} +1 -1
- package/dist/design-system/{p-1832a8b10c.entry.js → p-8d919b39a2.entry.js} +1 -1
- package/dist/design-system/p-9705c44121.entry.js +4 -0
- package/dist/design-system/{p-42bc0ecdea.entry.js → p-98a83e848d.entry.js} +1 -1
- package/dist/design-system/{p-B3VN_5Hp.js → p-BPtibja3.js} +1 -1
- package/dist/design-system/p-BZEWgXed.js +1 -1
- package/dist/design-system/p-CZXt-zTQ.js +4 -0
- package/dist/design-system/p-DFgZk16R.js +6 -0
- package/dist/design-system/{p-03f71b802d.entry.js → p-a2921f8048.entry.js} +1 -1
- package/dist/design-system/{p-68f1c98ef3.entry.js → p-a3755079c9.entry.js} +1 -1
- package/dist/design-system/{p-d5c0b5ddf3.entry.js → p-a99f6b63d3.entry.js} +1 -1
- package/dist/design-system/{p-76551271c7.entry.js → p-ac0d1f82c0.entry.js} +1 -1
- package/dist/design-system/{p-8c18e03816.entry.js → p-ba7800f8e6.entry.js} +1 -1
- package/dist/design-system/p-d2c33fa11f.entry.js +4 -0
- package/dist/design-system/{p-d12febf08e.entry.js → p-d85136052d.entry.js} +1 -1
- package/dist/design-system/{p-af756319ff.entry.js → p-f799b1412c.entry.js} +1 -1
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/ds-badge.entry.js +1 -1
- package/dist/esm/ds-brand-icon_3.entry.js +17 -3
- package/dist/esm/ds-card-subtitle.entry.js +3 -11
- package/dist/esm/ds-card-title.entry.js +1 -1
- package/dist/esm/ds-content_2.entry.js +9 -7
- package/dist/esm/ds-counter.entry.js +4 -4
- package/dist/esm/ds-datepicker.entry.js +1 -1
- package/dist/esm/ds-divider_2.entry.js +3 -3
- package/dist/esm/ds-file-upload.entry.js +1 -1
- package/dist/esm/ds-heading.entry.js +5 -24
- package/dist/esm/ds-icon_2.entry.js +2 -2
- package/dist/esm/ds-input.entry.js +2 -2
- package/dist/esm/ds-number-input.entry.js +1 -1
- package/dist/esm/ds-phone-input.entry.js +1 -1
- package/dist/esm/ds-select.entry.js +1 -1
- package/dist/esm/ds-slider.entry.js +1 -1
- package/dist/esm/ds-snackbar.entry.js +1 -1
- package/dist/esm/ds-tag.entry.js +1 -1
- package/dist/esm/ds-textarea.entry.js +1 -1
- package/dist/esm/ds-toast.entry.js +1 -1
- package/dist/esm/ds-toggle.entry.js +1 -1
- package/dist/esm/{heading.interfaces-QyQjrb1P.js → heading.interfaces-CZXt-zTQ.js} +1 -2
- package/dist/esm/index-BZEWgXed.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{svg-BNUaCToz.js → svg-DFgZk16R.js} +272 -195
- package/dist/esm/{t-shirt-B3VN_5Hp.js → t-shirt-BPtibja3.js} +2 -6
- package/dist/types/components/actions/button/button.d.ts +4 -0
- package/dist/types/components/forms/counter/counter.d.ts +2 -0
- package/dist/types/components/forms/input/input.d.ts +2 -0
- package/dist/types/components/structure/card/card-subtitle/card-subtitle.d.ts +1 -6
- package/dist/types/components/structure/content/content.d.ts +1 -1
- package/dist/types/components/structure/divider/divider.d.ts +1 -1
- package/dist/types/components/structure/heading/heading.const.d.ts +0 -3
- package/dist/types/components/structure/heading/heading.d.ts +1 -6
- package/dist/types/components/structure/heading/heading.interfaces.d.ts +0 -2
- package/dist/types/components/structure/stack/stack.interfaces.d.ts +2 -2
- package/dist/types/components.d.ts +21 -28
- package/dist/types/foundation/normalize.component.play.d.ts +1 -0
- package/dist/types/utils/t-shirt.d.ts +5 -0
- package/docs/cem.json +50 -76
- package/docs/components.json +103 -134
- package/docs/html.html-data.json +25 -45
- package/hydrate/index.js +350 -283
- package/hydrate/index.mjs +350 -283
- package/package.json +6 -6
- package/sbom.cdx.json +9610 -9319
- package/components/p-B4PwKlaW.js +0 -4
- package/components/p-BNUaCToz.js +0 -6
- package/components/p-QyQjrb1P.js +0 -4
- package/components/p-VnJFXLI2.js +0 -4
- package/components/p-kwr2iIN4.js +0 -4
- package/dist/design-system/p-199e5794f9.entry.js +0 -4
- package/dist/design-system/p-97670520d2.entry.js +0 -4
- package/dist/design-system/p-BNUaCToz.js +0 -6
- package/dist/design-system/p-QyQjrb1P.js +0 -4
- package/dist/design-system/p-bee20202e4.entry.js +0 -4
- package/dist/design-system/p-d65c14d35e.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Helvetia Design System https://helvetia-design.vercel.app/ - Apache License 2.0
|
|
3
3
|
*/
|
|
4
|
-
import{p as i,H as o,e as n,h as t,c as a,t as e}from"./p-DOP4fM2o.js";import{_ as c,L as d,a as r}from"./p-C8OqQuJ7.js";import{d as f,b as s}from"./p-BbGwCnDa.js";import{s as l}from"./p-El2snbN5.js";import{h}from"./p-CEPnyz7c.js";import{d as m}from"./p-Bd5NhwlZ.js";import{d as g}from"./p-VnJFXLI2.js";import{d as v}from"./p-BJK2OSM1.js";import{d as u}from"./p-BWrjPWjt.js";import{d as p}from"./p-D8RaAucx.js";import{T as b}from"./p-DEnVBHne.js";import{O as y}from"./p-DaqLtBr3.js";const w=i(class extends o{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.dsCloseClick=n(this,"dsCloseClick"),this.dsDidLoad=n(this,"dsDidLoad"),this.didLoad=!1,this.hasBrandIcon=!1,this.alert=!1,this.closable=!1,this.closeHandler=()=>{},this.heading="",this.noIcon=!1,this.updateHasBrandIcon=()=>{this.hasBrandIcon=f(this.el,s("DS-BRAND-ICON")).length>0}}createLogger(i){this.log=i}componentDidLoad(){this.updateHasBrandIcon(),this.didLoad=!0,this.dsDidLoad.emit()}async close(){this.dsCloseClick.emit(),this.closeHandler()}render(){const i=this.size||"";return t(a,Object.assign({key:"83980a557445d4d8784d0af1ab76b69aa7a1758a"},this.alert?{role:"alert","aria-live":"assertive","aria-atomic":"true"}:{role:"status","aria-live":"polite","aria-atomic":"true"},{class:{"has-no-icon":this.noIcon,"has-brand-icon":this.hasBrandIcon,["is-"+this.color]:h(this.color),["is-"+i]:h(this.size)}}),t("section",{key:"43e4193118d3f03858a31b0be6626036bb7453df",id:"notification",part:"section"},this.closable&&t("ds-close",{key:"c8ede2917fb199a6afacd072f9800cfbb3e89d97",part:"close",onClick:i=>{l(i),this.close()}}),h(this.heading)&&t("h2",{key:"5244c63219eea139ddf23c922e152bf55689953b",part:"heading"},this.heading),t("span",{key:"f390a6797968c49399e747778462e29267c26b3f"},t("slot",{key:"f3af4e56e3df538384c5a3a8bacc3ad4983a2ae9",onSlotchange:this.updateHasBrandIcon}))))}get el(){return this}static get style(){return':host{--_notification-position:var(--notification-position, var(--mod-notification-position, static));--_notification-top:var(--notification-top, var(--mod-notification-top));--_notification-right:var(--notification-right, var(--mod-notification-right));--_notification-bottom:var(--notification-bottom, var(--mod-notification-bottom));--_notification-left:var(--notification-left, var(--mod-notification-left));position:var(--_notification-position);top:var(--_notification-top);right:var(--_notification-right);bottom:var(--_notification-bottom);left:var(--_notification-left);--_notification-m:var(--notification-m, var(--mod-notification-m, 0));--_notification-my:var(--notification-my, var(--mod-notification-my));--_notification-mx:var(--notification-mx, var(--mod-notification-mx));--_notification-ml:var(--notification-ml, var(--mod-notification-ml));--_notification-mr:var(--notification-mr, var(--mod-notification-mr));--_notification-mt:var(--notification-mt, var(--mod-notification-mt));--_notification-mb:var(--notification-mb, var(--mod-notification-mb));margin:var(--_notification-m);margin-inline:var(--_notification-mx);margin-block:var(--_notification-my);margin-left:var(--_notification-ml);margin-right:var(--_notification-mr);margin-top:var(--_notification-mt);margin-bottom:var(--_notification-mb);--_notification-radius:var(--notification-radius, var(--mod-notification-radius, var(--ds-notification-radius)));--_notification-color-background:var(--notification-color-background, var(--mod-notification-color-background, var(--ds-notification-default-color-background)));--_notification-border:var(--notification-border, var(--mod-notification-border, var(--ds-notification-default-border)));--_notification-color-text:var(--notification-color-text, var(--mod-notification-color-text, var(--ds-notification-default-color-text)));--_notification-color-heading:var(--notification-color-heading, var(--mod-notification-color-heading, var(--ds-notification-default-color-heading)));--_notification-heading-family:var(--notification-heading-family, var(--mod-notification-heading-family, var(--ds-notification-default-heading-font-family)));--_notification-heading-weight:var(--notification-heading-weight, var(--mod-notification-heading-weight, var(--ds-notification-default-heading-font-weight)));--_notification-heading-size:var(--notification-heading-size, var(--mod-notification-heading-size, var(--ds-notification-default-heading-font-size)));--_notification-heading-line-height:var(--notification-heading-line-height, var(--mod-notification-heading-line-height, var(--ds-notification-default-heading-line-height)));--_notification-content-family:var(--notification-content-family, var(--mod-notification-content-family, var(--ds-notification-default-body-font-family)));--_notification-content-weight:var(--notification-content-weight, var(--mod-notification-content-weight, var(--ds-notification-default-body-font-weight)));--_notification-content-size:var(--notification-content-size, var(--mod-notification-content-size, var(--ds-notification-default-body-font-size)));--_notification-content-line-height:var(--notification-content-line-height, var(--mod-notification-content-line-height, var(--ds-notification-default-body-line-height)));--_notification-icon:var(--notification-icon, var(--mod-notification-icon, var(--ds-notification-default-icon)));--_notification-icon-display:var(--notification-icon-display, var(--mod-notification-icon-display, block));--_notification-p:var(--notification-p, var(--mod-notification-p, var(--ds-card-padding-base, 1.5rem)));--_notification-icon-size:var(--notification-icon-size, var(--mod-notification-icon-size, 1.5rem));--_notification-close-offset:var(--notification-close-offset, var(--mod-notification-close-offset, 2rem));--_notification-gap:var(--notification-gap, var(--mod-notification-gap, 0.125rem));--_notification-close-position:var(--notification-close-position, var(--mod-notification-close-position, absolute));--_notification-close-right:var(--notification-close-right, var(--mod-notification-close-right, var(--_notification-p)));--_notification-close-top:var(--notification-close-top, var(--mod-notification-close-top, var(--_notification-p)));--_notification-animation-start-opacity:var(--notification-animation-start-opacity, var(--mod-notification-animation-start-opacity, 1));--_notification-animation-start-transform:var(--notification-animation-start-transform, var(--mod-notification-animation-start-transform, none));--_notification-animation-transition:var(--notification-animation-transition, var(--mod-notification-animation-transition, none));--_notification-animation-end-opacity:var(--notification-animation-end-opacity, var(--mod-notification-animation-end-opacity, 1));--_notification-animation-end-transform:var(--notification-animation-end-transform, var(--mod-notification-animation-end-transform, none))}#notification{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-ms-flex:1;flex:1;position:relative;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border:var(--_notification-border);border-radius:var(--_notification-radius);background:var(--_notification-color-background);color:var(--_notification-color-text);padding-top:var(--_notification-p);padding-right:var(--_notification-p);padding-bottom:var(--_notification-p);padding-left:calc(var(--_notification-p) + var(--_notification-icon-size));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--_notification-gap)}#notification ds-close,#notification .ds-close{position:var(--_notification-close-position);top:var(--_notification-close-top);right:var(--_notification-close-right)}#notification>h2{font-family:var(--_notification-heading-family);font-weight:var(--_notification-heading-weight);line-height:var(--_notification-heading-line-height);font-size:var(--_notification-heading-size);color:var(--_notification-color-heading);margin:0 !important}#notification:has(.ds-close)>h2::before,#notification:has(ds-close)>h2::before{content:"";float:right;width:24px;height:calc(var(--_notification-heading-line-height)*16px)}#notification>span,#notification>p{font-family:var(--_notification-content-family);font-size:var(--_notification-content-size);font-weight:var(--_notification-content-weight);line-height:var(--_notification-content-line-height);margin:0 !important}#notification::before{display:var(--_notification-icon-display);background-color:currentColor;color:var(--_notification-color-heading);forced-color-adjust:preserve-parent-color;position:absolute;height:1.5rem;width:1.5rem;left:calc(var(--_notification-p)/4*-1);top:var(--_notification-p);-webkit-transform:translateX(var(--_notification-p));transform:translateX(var(--_notification-p));content:"";-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;mask-image:var(--_notification-icon);-webkit-mask-image:var(--_notification-icon)}:host(.has-no-icon){--mod-notification-icon-display:none;--mod-notification-icon-size:0rem}:host(.has-brand-icon){--mod-notification-icon-size:var(--ds-brand-icon-size-base)}::slotted(ds-brand-icon){position:absolute;top:calc(var(--_notification-p)/2);left:calc(var(--_notification-p)/2);margin-top:calc(var(--_notification-p)/8*-1)}:host(.is-info){--mod-notification-color-text:var(--ds-notification-info-color-text);--mod-notification-color-background:var(--ds-notification-info-color-background);--mod-notification-color-heading:var(--ds-notification-info-color-heading);--mod-notification-icon:var(--ds-notification-info-icon);--mod-notification-heading-family:var(--ds-notification-info-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-info-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-info-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-info-heading-line-height);--mod-notification-content-family:var(--ds-notification-info-body-font-family);--mod-notification-content-weight:var(--ds-notification-info-body-font-weight);--mod-notification-content-size:var(--ds-notification-info-body-font-size);--mod-notification-content-line-height:var(--ds-notification-info-body-line-height);--mod-notification-border:var(--ds-notification-info-border)}:host(.is-success){--mod-notification-color-text:var(--ds-notification-success-color-text);--mod-notification-color-background:var(--ds-notification-success-color-background);--mod-notification-color-heading:var(--ds-notification-success-color-heading);--mod-notification-icon:var(--ds-notification-success-icon);--mod-notification-heading-family:var(--ds-notification-success-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-success-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-success-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-success-heading-line-height);--mod-notification-content-family:var(--ds-notification-success-body-font-family);--mod-notification-content-weight:var(--ds-notification-success-body-font-weight);--mod-notification-content-size:var(--ds-notification-success-body-font-size);--mod-notification-content-line-height:var(--ds-notification-success-body-line-height);--mod-notification-border:var(--ds-notification-success-border)}:host(.is-warning){--mod-notification-color-text:var(--ds-notification-warning-color-text);--mod-notification-color-background:var(--ds-notification-warning-color-background);--mod-notification-color-heading:var(--ds-notification-warning-color-heading);--mod-notification-icon:var(--ds-notification-warning-icon);--mod-notification-heading-family:var(--ds-notification-warning-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-warning-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-warning-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-warning-heading-line-height);--mod-notification-content-family:var(--ds-notification-warning-body-font-family);--mod-notification-content-weight:var(--ds-notification-warning-body-font-weight);--mod-notification-content-size:var(--ds-notification-warning-body-font-size);--mod-notification-content-line-height:var(--ds-notification-warning-body-line-height);--mod-notification-border:var(--ds-notification-warning-border)}:host(.is-danger){--mod-notification-color-text:var(--ds-notification-danger-color-text);--mod-notification-color-background:var(--ds-notification-danger-color-background);--mod-notification-color-heading:var(--ds-notification-danger-color-heading);--mod-notification-icon:var(--ds-notification-danger-icon);--mod-notification-heading-family:var(--ds-notification-danger-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-danger-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-danger-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-danger-heading-line-height);--mod-notification-content-family:var(--ds-notification-danger-body-font-family);--mod-notification-content-weight:var(--ds-notification-danger-body-font-weight);--mod-notification-content-size:var(--ds-notification-danger-body-font-size);--mod-notification-content-line-height:var(--ds-notification-danger-body-line-height);--mod-notification-border:var(--ds-notification-danger-border)}:host(.is-outline-default){--mod-notification-color-text:var(--ds-notification-outline-default-color-text);--mod-notification-color-background:var(--ds-notification-outline-default-color-background);--mod-notification-color-heading:var(--ds-notification-outline-default-color-heading);--mod-notification-icon:var(--ds-notification-outline-default-icon);--mod-notification-heading-family:var(--ds-notification-outline-default-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-default-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-default-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-default-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-default-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-default-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-default-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-default-body-line-height);--mod-notification-border:var(--ds-notification-outline-default-border)}:host(.is-outline-purple){--mod-notification-color-text:var(--ds-notification-outline-purple-color-text);--mod-notification-color-background:var(--ds-notification-outline-purple-color-background);--mod-notification-color-heading:var(--ds-notification-outline-purple-color-heading);--mod-notification-icon:var(--ds-notification-outline-purple-icon);--mod-notification-heading-family:var(--ds-notification-outline-purple-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-purple-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-purple-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-purple-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-purple-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-purple-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-purple-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-purple-body-line-height);--mod-notification-border:var(--ds-notification-outline-purple-border)}:host(.is-outline-green){--mod-notification-color-text:var(--ds-notification-outline-green-color-text);--mod-notification-color-background:var(--ds-notification-outline-green-color-background);--mod-notification-color-heading:var(--ds-notification-outline-green-color-heading);--mod-notification-icon:var(--ds-notification-outline-green-icon);--mod-notification-heading-family:var(--ds-notification-outline-green-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-green-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-green-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-green-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-green-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-green-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-green-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-green-body-line-height);--mod-notification-border:var(--ds-notification-outline-green-border)}:host(.is-outline-yellow){--mod-notification-color-text:var(--ds-notification-outline-yellow-color-text);--mod-notification-color-background:var(--ds-notification-outline-yellow-color-background);--mod-notification-color-heading:var(--ds-notification-outline-yellow-color-heading);--mod-notification-icon:var(--ds-notification-outline-yellow-icon);--mod-notification-heading-family:var(--ds-notification-outline-yellow-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-yellow-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-yellow-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-yellow-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-yellow-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-yellow-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-yellow-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-yellow-body-line-height);--mod-notification-border:var(--ds-notification-outline-yellow-border)}:host(.is-outline-red){--mod-notification-color-text:var(--ds-notification-outline-red-color-text);--mod-notification-color-background:var(--ds-notification-outline-red-color-background);--mod-notification-color-heading:var(--ds-notification-outline-red-color-heading);--mod-notification-icon:var(--ds-notification-outline-red-icon);--mod-notification-heading-family:var(--ds-notification-outline-red-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-red-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-red-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-red-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-red-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-red-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-red-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-red-body-line-height);--mod-notification-border:var(--ds-notification-outline-red-border)}:host(.is-sm){--mod-notification-p:var(--ds-card-padding-sm)}:host{display:block}'}},[257,"ds-notification",{alert:[4],closable:[4],closeHandler:[16],color:[1],heading:[1],noIcon:[4,"no-icon"],size:[1],didLoad:[32],hasBrandIcon:[32],close:[64]}]);c([d("notification"),r("design:type",Function),r("design:paramtypes",[Function]),r("design:returntype",void 0)],w.prototype,"createLogger",null),c([b("boolean"),r("design:type",Boolean)],w.prototype,"alert",void 0),c([b("boolean"),r("design:type",Boolean)],w.prototype,"closable",void 0),c([y(["default","info","success","warning","danger","outline-default","outline-purple","outline-green","outline-yellow","outline-red"]),r("design:type",String)],w.prototype,"color",void 0),c([b("string"),r("design:type",String)],w.prototype,"heading",void 0),c([b("boolean"),r("design:type",Boolean)],w.prototype,"noIcon",void 0),c([y(["sm"]),r("design:type",String)],w.prototype,"size",void 0);const _=w,z=function(){"undefined"!=typeof customElements&&["ds-notification","ds-brand-icon","ds-button","ds-close","ds-icon","ds-spinner"].forEach((i=>{switch(i){case"ds-notification":customElements.get(e(i))||customElements.define(e(i),w);break;case"ds-brand-icon":customElements.get(e(i))||m();break;case"ds-button":customElements.get(e(i))||g();break;case"ds-close":customElements.get(e(i))||v();break;case"ds-icon":customElements.get(e(i))||u();break;case"ds-spinner":customElements.get(e(i))||p()}}))};export{_ as DsNotification,z as defineCustomElement}
|
|
4
|
+
import{p as i,H as o,e as n,h as t,c as a,t as e}from"./p-DOP4fM2o.js";import{_ as c,L as d,a as f}from"./p-C8OqQuJ7.js";import{d as r,b as s}from"./p-BbGwCnDa.js";import{s as l}from"./p-El2snbN5.js";import{h}from"./p-CEPnyz7c.js";import{d as m}from"./p-DyfdPmyS.js";import{d as g}from"./p-BB4SRrRj.js";import{d as v}from"./p-hhVbp_AN.js";import{d as u}from"./p-B0Z95Hj1.js";import{d as p}from"./p-D8RaAucx.js";import{T as b}from"./p-DEnVBHne.js";import{O as y}from"./p-DaqLtBr3.js";const _=i(class extends o{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.dsCloseClick=n(this,"dsCloseClick"),this.dsDidLoad=n(this,"dsDidLoad"),this.didLoad=!1,this.hasBrandIcon=!1,this.alert=!1,this.closable=!1,this.closeHandler=()=>{},this.heading="",this.noIcon=!1,this.updateHasBrandIcon=()=>{this.hasBrandIcon=r(this.el,s("DS-BRAND-ICON")).length>0}}createLogger(i){this.log=i}componentDidLoad(){this.updateHasBrandIcon(),this.didLoad=!0,this.dsDidLoad.emit()}async close(){this.dsCloseClick.emit(),this.closeHandler()}render(){const i=this.size||"";return t(a,Object.assign({key:"83980a557445d4d8784d0af1ab76b69aa7a1758a"},this.alert?{role:"alert","aria-live":"assertive","aria-atomic":"true"}:{role:"status","aria-live":"polite","aria-atomic":"true"},{class:{"has-no-icon":this.noIcon,"has-brand-icon":this.hasBrandIcon,["is-"+this.color]:h(this.color),["is-"+i]:h(this.size)}}),t("section",{key:"43e4193118d3f03858a31b0be6626036bb7453df",id:"notification",part:"section"},this.closable&&t("ds-close",{key:"c8ede2917fb199a6afacd072f9800cfbb3e89d97",part:"close",onClick:i=>{l(i),this.close()}}),h(this.heading)&&t("h2",{key:"5244c63219eea139ddf23c922e152bf55689953b",part:"heading"},this.heading),t("span",{key:"f390a6797968c49399e747778462e29267c26b3f"},t("slot",{key:"f3af4e56e3df538384c5a3a8bacc3ad4983a2ae9",onSlotchange:this.updateHasBrandIcon}))))}get el(){return this}static get style(){return':host{--_notification-position:var(--notification-position, var(--mod-notification-position, static));--_notification-top:var(--notification-top, var(--mod-notification-top));--_notification-right:var(--notification-right, var(--mod-notification-right));--_notification-bottom:var(--notification-bottom, var(--mod-notification-bottom));--_notification-left:var(--notification-left, var(--mod-notification-left));position:var(--_notification-position);top:var(--_notification-top);right:var(--_notification-right);bottom:var(--_notification-bottom);left:var(--_notification-left);--_notification-m:var(--notification-m, var(--mod-notification-m, 0));--_notification-my:var(--notification-my, var(--mod-notification-my));--_notification-mx:var(--notification-mx, var(--mod-notification-mx));--_notification-ml:var(--notification-ml, var(--mod-notification-ml));--_notification-mr:var(--notification-mr, var(--mod-notification-mr));--_notification-mt:var(--notification-mt, var(--mod-notification-mt));--_notification-mb:var(--notification-mb, var(--mod-notification-mb));margin:var(--_notification-m);margin-inline:var(--_notification-mx);margin-block:var(--_notification-my);margin-left:var(--_notification-ml);margin-right:var(--_notification-mr);margin-top:var(--_notification-mt);margin-bottom:var(--_notification-mb);--_notification-radius:var(--notification-radius, var(--mod-notification-radius, var(--ds-notification-radius)));--_notification-color-background:var(--notification-color-background, var(--mod-notification-color-background, var(--ds-notification-default-color-background)));--_notification-border:var(--notification-border, var(--mod-notification-border, var(--ds-notification-default-border)));--_notification-color-text:var(--notification-color-text, var(--mod-notification-color-text, var(--ds-notification-default-color-text)));--_notification-color-heading:var(--notification-color-heading, var(--mod-notification-color-heading, var(--ds-notification-default-color-heading)));--_notification-heading-family:var(--notification-heading-family, var(--mod-notification-heading-family, var(--ds-notification-default-heading-font-family)));--_notification-heading-weight:var(--notification-heading-weight, var(--mod-notification-heading-weight, var(--ds-notification-default-heading-font-weight)));--_notification-heading-size:var(--notification-heading-size, var(--mod-notification-heading-size, var(--ds-notification-default-heading-font-size)));--_notification-heading-line-height:var(--notification-heading-line-height, var(--mod-notification-heading-line-height, var(--ds-notification-default-heading-line-height)));--_notification-content-family:var(--notification-content-family, var(--mod-notification-content-family, var(--ds-notification-default-body-font-family)));--_notification-content-weight:var(--notification-content-weight, var(--mod-notification-content-weight, var(--ds-notification-default-body-font-weight)));--_notification-content-size:var(--notification-content-size, var(--mod-notification-content-size, var(--ds-notification-default-body-font-size)));--_notification-content-line-height:var(--notification-content-line-height, var(--mod-notification-content-line-height, var(--ds-notification-default-body-line-height)));--_notification-icon:var(--notification-icon, var(--mod-notification-icon, var(--ds-notification-default-icon)));--_notification-icon-display:var(--notification-icon-display, var(--mod-notification-icon-display, block));--_notification-p:var(--notification-p, var(--mod-notification-p, var(--ds-card-padding-base, 1.5rem)));--_notification-icon-size:var(--notification-icon-size, var(--mod-notification-icon-size, 1.5rem));--_notification-close-offset:var(--notification-close-offset, var(--mod-notification-close-offset, 2rem));--_notification-gap:var(--notification-gap, var(--mod-notification-gap, 0.125rem));--_notification-close-position:var(--notification-close-position, var(--mod-notification-close-position, absolute));--_notification-close-right:var(--notification-close-right, var(--mod-notification-close-right, var(--_notification-p)));--_notification-close-top:var(--notification-close-top, var(--mod-notification-close-top, var(--_notification-p)));--_notification-animation-start-opacity:var(--notification-animation-start-opacity, var(--mod-notification-animation-start-opacity, 1));--_notification-animation-start-transform:var(--notification-animation-start-transform, var(--mod-notification-animation-start-transform, none));--_notification-animation-transition:var(--notification-animation-transition, var(--mod-notification-animation-transition, none));--_notification-animation-end-opacity:var(--notification-animation-end-opacity, var(--mod-notification-animation-end-opacity, 1));--_notification-animation-end-transform:var(--notification-animation-end-transform, var(--mod-notification-animation-end-transform, none))}#notification{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-ms-flex:1;flex:1;position:relative;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border:var(--_notification-border);border-radius:var(--_notification-radius);background:var(--_notification-color-background);color:var(--_notification-color-text);padding-top:var(--_notification-p);padding-right:var(--_notification-p);padding-bottom:var(--_notification-p);padding-left:calc(var(--_notification-p) + var(--_notification-icon-size));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--_notification-gap)}#notification ds-close,#notification .ds-close{position:var(--_notification-close-position);top:var(--_notification-close-top);right:var(--_notification-close-right)}#notification>h2{font-family:var(--_notification-heading-family);font-weight:var(--_notification-heading-weight);line-height:var(--_notification-heading-line-height);font-size:var(--_notification-heading-size);color:var(--_notification-color-heading);margin:0 !important}#notification:has(.ds-close)>h2::before,#notification:has(ds-close)>h2::before{content:"";float:right;width:24px;height:calc(var(--_notification-heading-line-height)*16px)}#notification>span,#notification>p{font-family:var(--_notification-content-family);font-size:var(--_notification-content-size);font-weight:var(--_notification-content-weight);line-height:var(--_notification-content-line-height);margin:0 !important}#notification::before{display:var(--_notification-icon-display);background-color:currentColor;color:var(--_notification-color-heading);forced-color-adjust:preserve-parent-color;position:absolute;height:1.5rem;width:1.5rem;left:calc(var(--_notification-p)/4*-1);top:var(--_notification-p);-webkit-transform:translateX(var(--_notification-p));transform:translateX(var(--_notification-p));content:"";-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;mask-image:var(--_notification-icon);-webkit-mask-image:var(--_notification-icon)}:host(.has-no-icon){--mod-notification-icon-display:none;--mod-notification-icon-size:0rem}:host(.has-brand-icon){--mod-notification-icon-size:var(--ds-brand-icon-size-base)}::slotted(ds-brand-icon){position:absolute;top:calc(var(--_notification-p)/2);left:calc(var(--_notification-p)/2);margin-top:calc(var(--_notification-p)/8*-1)}:host(.is-info){--mod-notification-color-text:var(--ds-notification-info-color-text);--mod-notification-color-background:var(--ds-notification-info-color-background);--mod-notification-color-heading:var(--ds-notification-info-color-heading);--mod-notification-icon:var(--ds-notification-info-icon);--mod-notification-heading-family:var(--ds-notification-info-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-info-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-info-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-info-heading-line-height);--mod-notification-content-family:var(--ds-notification-info-body-font-family);--mod-notification-content-weight:var(--ds-notification-info-body-font-weight);--mod-notification-content-size:var(--ds-notification-info-body-font-size);--mod-notification-content-line-height:var(--ds-notification-info-body-line-height);--mod-notification-border:var(--ds-notification-info-border)}:host(.is-success){--mod-notification-color-text:var(--ds-notification-success-color-text);--mod-notification-color-background:var(--ds-notification-success-color-background);--mod-notification-color-heading:var(--ds-notification-success-color-heading);--mod-notification-icon:var(--ds-notification-success-icon);--mod-notification-heading-family:var(--ds-notification-success-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-success-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-success-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-success-heading-line-height);--mod-notification-content-family:var(--ds-notification-success-body-font-family);--mod-notification-content-weight:var(--ds-notification-success-body-font-weight);--mod-notification-content-size:var(--ds-notification-success-body-font-size);--mod-notification-content-line-height:var(--ds-notification-success-body-line-height);--mod-notification-border:var(--ds-notification-success-border)}:host(.is-warning){--mod-notification-color-text:var(--ds-notification-warning-color-text);--mod-notification-color-background:var(--ds-notification-warning-color-background);--mod-notification-color-heading:var(--ds-notification-warning-color-heading);--mod-notification-icon:var(--ds-notification-warning-icon);--mod-notification-heading-family:var(--ds-notification-warning-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-warning-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-warning-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-warning-heading-line-height);--mod-notification-content-family:var(--ds-notification-warning-body-font-family);--mod-notification-content-weight:var(--ds-notification-warning-body-font-weight);--mod-notification-content-size:var(--ds-notification-warning-body-font-size);--mod-notification-content-line-height:var(--ds-notification-warning-body-line-height);--mod-notification-border:var(--ds-notification-warning-border)}:host(.is-danger){--mod-notification-color-text:var(--ds-notification-danger-color-text);--mod-notification-color-background:var(--ds-notification-danger-color-background);--mod-notification-color-heading:var(--ds-notification-danger-color-heading);--mod-notification-icon:var(--ds-notification-danger-icon);--mod-notification-heading-family:var(--ds-notification-danger-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-danger-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-danger-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-danger-heading-line-height);--mod-notification-content-family:var(--ds-notification-danger-body-font-family);--mod-notification-content-weight:var(--ds-notification-danger-body-font-weight);--mod-notification-content-size:var(--ds-notification-danger-body-font-size);--mod-notification-content-line-height:var(--ds-notification-danger-body-line-height);--mod-notification-border:var(--ds-notification-danger-border)}:host(.is-outline-default){--mod-notification-color-text:var(--ds-notification-outline-default-color-text);--mod-notification-color-background:var(--ds-notification-outline-default-color-background);--mod-notification-color-heading:var(--ds-notification-outline-default-color-heading);--mod-notification-icon:var(--ds-notification-outline-default-icon);--mod-notification-heading-family:var(--ds-notification-outline-default-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-default-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-default-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-default-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-default-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-default-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-default-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-default-body-line-height);--mod-notification-border:var(--ds-notification-outline-default-border)}:host(.is-outline-purple){--mod-notification-color-text:var(--ds-notification-outline-purple-color-text);--mod-notification-color-background:var(--ds-notification-outline-purple-color-background);--mod-notification-color-heading:var(--ds-notification-outline-purple-color-heading);--mod-notification-icon:var(--ds-notification-outline-purple-icon);--mod-notification-heading-family:var(--ds-notification-outline-purple-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-purple-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-purple-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-purple-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-purple-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-purple-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-purple-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-purple-body-line-height);--mod-notification-border:var(--ds-notification-outline-purple-border)}:host(.is-outline-green){--mod-notification-color-text:var(--ds-notification-outline-green-color-text);--mod-notification-color-background:var(--ds-notification-outline-green-color-background);--mod-notification-color-heading:var(--ds-notification-outline-green-color-heading);--mod-notification-icon:var(--ds-notification-outline-green-icon);--mod-notification-heading-family:var(--ds-notification-outline-green-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-green-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-green-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-green-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-green-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-green-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-green-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-green-body-line-height);--mod-notification-border:var(--ds-notification-outline-green-border)}:host(.is-outline-yellow){--mod-notification-color-text:var(--ds-notification-outline-yellow-color-text);--mod-notification-color-background:var(--ds-notification-outline-yellow-color-background);--mod-notification-color-heading:var(--ds-notification-outline-yellow-color-heading);--mod-notification-icon:var(--ds-notification-outline-yellow-icon);--mod-notification-heading-family:var(--ds-notification-outline-yellow-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-yellow-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-yellow-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-yellow-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-yellow-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-yellow-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-yellow-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-yellow-body-line-height);--mod-notification-border:var(--ds-notification-outline-yellow-border)}:host(.is-outline-red){--mod-notification-color-text:var(--ds-notification-outline-red-color-text);--mod-notification-color-background:var(--ds-notification-outline-red-color-background);--mod-notification-color-heading:var(--ds-notification-outline-red-color-heading);--mod-notification-icon:var(--ds-notification-outline-red-icon);--mod-notification-heading-family:var(--ds-notification-outline-red-heading-font-family);--mod-notification-heading-weight:var(--ds-notification-outline-red-heading-font-weight);--mod-notification-heading-size:var(--ds-notification-outline-red-heading-font-size);--mod-notification-heading-line-height:var(--ds-notification-outline-red-heading-line-height);--mod-notification-content-family:var(--ds-notification-outline-red-body-font-family);--mod-notification-content-weight:var(--ds-notification-outline-red-body-font-weight);--mod-notification-content-size:var(--ds-notification-outline-red-body-font-size);--mod-notification-content-line-height:var(--ds-notification-outline-red-body-line-height);--mod-notification-border:var(--ds-notification-outline-red-border)}:host(.is-sm){--mod-notification-p:var(--ds-card-padding-sm)}:host{display:block}'}},[257,"ds-notification",{alert:[4],closable:[4],closeHandler:[16],color:[1],heading:[1],noIcon:[4,"no-icon"],size:[1],didLoad:[32],hasBrandIcon:[32],close:[64]}]);c([d("notification"),f("design:type",Function),f("design:paramtypes",[Function]),f("design:returntype",void 0)],_.prototype,"createLogger",null),c([b("boolean"),f("design:type",Boolean)],_.prototype,"alert",void 0),c([b("boolean"),f("design:type",Boolean)],_.prototype,"closable",void 0),c([y(["default","info","success","warning","danger","outline-default","outline-purple","outline-green","outline-yellow","outline-red"]),f("design:type",String)],_.prototype,"color",void 0),c([b("string"),f("design:type",String)],_.prototype,"heading",void 0),c([b("boolean"),f("design:type",Boolean)],_.prototype,"noIcon",void 0),c([y(["sm"]),f("design:type",String)],_.prototype,"size",void 0);const w=_,z=function(){"undefined"!=typeof customElements&&["ds-notification","ds-brand-icon","ds-button","ds-close","ds-icon","ds-spinner"].forEach((i=>{switch(i){case"ds-notification":customElements.get(e(i))||customElements.define(e(i),_);break;case"ds-brand-icon":customElements.get(e(i))||m();break;case"ds-button":customElements.get(e(i))||g();break;case"ds-close":customElements.get(e(i))||v();break;case"ds-icon":customElements.get(e(i))||u();break;case"ds-spinner":customElements.get(e(i))||p()}}))};export{w as DsNotification,z as defineCustomElement}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Helvetia Design System https://helvetia-design.vercel.app/ - Apache License 2.0
|
|
3
3
|
*/
|
|
4
|
-
import{p as r,H as o,e,h as i,t}from"./p-DOP4fM2o.js";import{_ as n,L as a,a as s}from"./p-C8OqQuJ7.js";import{g as d}from"./p-DPo2awvS.js";import{e as l,g as c,b as h,f as m,c as f,d as u,h as p}from"./p-CWwurS05.js";import{b as v}from"./p-DOuBxwgh.js";import{i as b}from"./p-IVIyviB0.js";import{i as g}from"./p-BSalDUrg.js";import{i as y}from"./p-ChyhE5ro.js";import{F as _,s as w}from"./p-El2snbN5.js";import{n as k}from"./p-Dbt7_-_D.js";import{w as x}from"./p-CHZn7ODg.js";import{N as j,A as z}from"./p-Bb2t2bOa.js";import{g as C,a as B,b as S,f as I}from"./p-BLExC8Zo.js";import{F as D}from"./p-vUPe8Qmy.js";import{I as E}from"./p-DaVRO74A.js";import{d as O}from"./p-BWrjPWjt.js";import{d as P}from"./p-D8RaAucx.js";import{d as F}from"./p-CKMUtsmn.js";import{T}from"./p-DEnVBHne.js";import{O as K}from"./p-DaqLtBr3.js";import{L}from"./p-B9OReveE.js";var V,q,N=d(function(){if(q)return V;q=1;var r=l(),o=c(),e=h(),i=v(),t=m(),n=f(),a=p(),s=u(),d=Object.prototype.hasOwnProperty;return V=function(l){if(null==l)return!0;if(t(l)&&(i(l)||"string"==typeof l||"function"==typeof l.splice||n(l)||s(l)||e(l)))return!l.length;var c=o(l);if("[object Map]"==c||"[object Set]"==c)return!l.size;if(a(l))return!r(l).length;for(var h in l)if(d.call(l,h))return!1;return!0}}());function M(r){return"string"==typeof r&&"."!==S()}function R(r){const o=parseFloat(r);return"number"==typeof o&&!b(o)}function A(r,o=0){let e=r;if(""!==e&&null!=e&&!b(e)&&e!==C()&&e!==B()&&R(e))return M(e)&&(e=e.split(S()).join("").split("`").join("").split("'").join("")),"string"==typeof e&&(e=e.replace(B(),".")),0===o?parseInt(e,10):parseFloat(e)}function U(r){return r.replace(".",B())}function W(r,o=0,e=""){if(g(r))return"";r.charAt(0)===B()&&(r="0"+r);const i=0===o?parseInt(r,10):parseFloat(r),t=""!==e?" "+e.trim():"";return b(i)?"":I(i,o)+t}const H=r(class extends o{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.dsInput=e(this,"dsInput"),this.dsChange=e(this,"dsChange"),this.dsBlur=e(this,"dsBlur"),this.dsFocus=e(this,"dsFocus"),this.dsClick=e(this,"dsClick"),this.dsKeyPress=e(this,"dsKeyPress"),this.internals=this.attachInternals(),this.numberInputId="ds-number-input-"+Q++,this.inheritedAttributes={},this.control=new _(this),this.lastValue="",this.focused=!1,this.hasInvalidTextSlotContent=!1,this.language=F.language,this.region=F.region,this.nativeInputValue="",this.inputPattern="",this.autoInvalidOff=!1,this.color="primary",this.debounce=0,this.decimal=0,this.description="",this.disabled=!1,this.exactNumber=!1,this.invalid=!1,this.invalidText="",this.label="",this.max="",this.min="",this.name=this.numberInputId,this.onlyPositive=!1,this.pattern="",this.placeholder="",this.readonly=!1,this.required=!0,this.suffix="",this.value=null,this.handleInput=()=>{var r,o;if(this.nativeInput&&function(r){return!R(r)&&""!==r&&r!==C()&&r!==B()}(this.nativeInput.value))return void(this.nativeInputValue=this.lastValue||"");this.lastValue=(null===(r=this.nativeInput)||void 0===r?void 0:r.value)||"";const e=null!==(o=A(this.lastValue,this.decimal))&&void 0!==o?o:null;this.control.inputValue=e,this.dsInput.emit(e)},this.handleFocus=r=>{this.control.onFocus(r),this.nativeInputValue=U(this.lastValue||""),clearTimeout(this.selectTimeout),this.selectTimeout=setTimeout((()=>{var r;return null===(r=this.nativeInput)||void 0===r?void 0:r.select()}))},this.handleBlur=r=>{var o;this.lastValue=function(r,o=0){let e=r;if(g(e))return"";M(e)&&(e=e.split(S()).join("").split("`").join("").split("'").join("")),e.charAt(0)===B()&&(e="0"+e);const i=0===o?parseInt(e,10):parseFloat(e.replace(B(),"."));return b(i)?"":i.toFixed(o)}(this.lastValueGetter,this.decimal),this.nativeInputValue=W(this.lastValueGetter,this.decimal,this.suffix),this.nativeInput&&(this.nativeInput.value=this.nativeInputValue),this.control.inputValue=null!==(o=A(this.lastValueGetter,this.decimal))&&void 0!==o?o:null,this.control.onBlur(r)},this.handleKeydown=r=>{var o;if(!this.nativeInput)return;const e=this.nativeInput.value||"",i=null!==(o=this.nativeInput.selectionStart)&&void 0!==o?o:0,t=e.slice(0,i)+r.key+e.slice(i);return function({key:r,ctrlKey:o,metaKey:e,selectionStart:i,selectionEnd:t,newValue:n,decimal:a,onlyPositive:s}){if(["a","c","v"].includes(r)&&(o||e))return!0;if(!r||"Unidentified"===r||"Dead"===r||"Process"===r)return!0;if(r===C()){if(s)return!1;if(i&&i>0&&t&&t>0)return!1}const d=function(r){return r===B()||"."===r}(r);if(d){if(0===a)return!1;if((r=>{const o=B();return("."===o?[o]:[o,"."]).reduce(((o,e)=>o+((r.split(e)||[]).length-1||0)),0)})(n)>1)return!1}if(!d&&![...j,...z,C()].includes(r))return!1;if(0!==a&&j.includes(r)){const r=Math.max(n.lastIndexOf(B()),n.lastIndexOf("."));if(-1!==r&&n.slice(r+1).length>a)return!1}return!0}({key:r.key,ctrlKey:r.ctrlKey,metaKey:r.metaKey,decimal:this.decimal,newValue:t,selectionStart:this.nativeInput.selectionStart,selectionEnd:this.nativeInput.selectionEnd,onlyPositive:this.onlyPositive})?void 0:w(r)}}createLogger(r){this.log=r}debounceChanged(){this.dsChange=k(this.dsChange,this.debounce)}valueChanged(r){const o=null===r||b(r)?this.exactNumber?"0":"":r.toFixed(this.decimal);this.lastValue=o,this.nativeInputValue=this.focused?U(o):W(o,this.decimal,this.suffix)}connectedCallback(){this.debounceChanged(),this.control.connectedCallback(),this.disconnectInvalidTextSlotWatcher=x(this.el,(r=>{this.hasInvalidTextSlotContent=r}))}disconnectedCallback(){var r;null===(r=this.disconnectInvalidTextSlotWatcher)||void 0===r||r.call(this)}componentWillLoad(){this.inheritedAttributes=y(this.el,["aria-label","tabindex","title"]),this.inputPattern=this.createPattern(),this.valueChanged(this.value)}componentDidLoad(){this.control.componentDidLoad()}listenToClick(r){this.control.listenOnClick(r)}listenToReset(r){const o=r.target;(null==o?void 0:o.contains(this.el))&&this.control.setValue(this.control.initialValue)}async configChanged(r){this.language=r.language,this.region=r.region,this.inputPattern=this.createPattern(),this.nativeInput&&(this.nativeInputValue=this.focused?U(this.lastValue):W(this.lastValue,this.decimal,this.suffix))}async setFocus(){return this.control.setFocus()}async setBlur(){return this.control.setBlur()}async getInputElement(){return this.nativeInput}get nativeInput(){return this.control.nativeEl}get lastValueGetter(){return this.exactNumber&&(g(this.lastValue)||N(this.lastValue))?"0":this.lastValue}createPattern(){return this.pattern}render(){const r=this.invalid||this.hasInvalidTextSlotContent;return i(D,{key:"7b1c9504dc98f921b619676a000bae2edd338aec",disabled:this.disabled,color:this.color,invalid:r,label:this.label,description:this.description,invalidText:this.invalidText,required:this.required,language:this.language},i("input",Object.assign({key:"16ca58bb9a791e79b30a9981fc34da843d580e61",id:"input",part:"input",type:"text",inputMode:"decimal",pattern:this.inputPattern||void 0,ref:r=>this.control.nativeEl=r,"aria-describedby":"description","aria-invalid":r?"true":"false",name:this.name,disabled:this.disabled,placeholder:this.placeholder||"",readonly:this.readonly,required:this.required,min:this.min,max:this.max,value:this.nativeInputValue,onInput:r=>this.handleInput(r),onFocus:r=>this.handleFocus(r),onBlur:r=>this.handleBlur(r),onClick:r=>this.control.onClick(r),onKeyDown:r=>this.handleKeydown(r),onKeyPress:r=>this.dsKeyPress.emit(r)},this.inheritedAttributes)))}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{debounce:[{debounceChanged:0}],value:[{valueChanged:1}]}}static get style(){return":host{--_form-field-gap:var(--form-field-gap, var(--mod-form-field-gap, 0.25rem));--_form-container-background:var(--form-container-background, var(--mod-form-container-background, var(--ds-form-default-container-background)));--_form-container-border:var(--form-container-border, var(--mod-form-container-border, var(--ds-form-default-container-border)));--_form-container-radius:var(--form-container-radius, var(--mod-form-container-radius, var(--ds-form-container-radius)));--_form-container-hover-background:var(--form-container-hover-background, var(--mod-form-container-hover-background, var(--ds-form-hover-container-background)));--_form-container-active-background:var(--form-container-active-background, var(--mod-form-container-active-background, var(--ds-form-active-container-background)));--_form-container-focus-background:var(--form-container-focus-background, var(--mod-form-container-focus-background, var(--ds-form-focus-container-background)));--_form-container-hover-border:var(--form-container-hover-border, var(--mod-form-container-hover-border, var(--ds-form-hover-container-border)));--_form-container-active-border:var(--form-container-active-border, var(--mod-form-container-active-border, var(--ds-form-active-container-border)));--_form-container-focus-border:var(--form-container-focus-border, var(--mod-form-container-focus-border, var(--ds-form-focus-container-border)));--_form-label-color:var(--form-label-color, var(--mod-form-label-color, var(--ds-form-default-label-color)));--_form-label-family:var(--form-label-family, var(--mod-form-label-family, var(--ds-form-default-label-typo-font-family)));--_form-label-weight:var(--form-label-weight, var(--mod-form-label-weight, var(--ds-form-default-label-typo-font-weight)));--_form-label-line-height:var(--form-label-line-height, var(--mod-form-label-line-height, var(--ds-form-default-label-typo-line-height)));--_form-label-size:var(--form-label-size, var(--mod-form-label-size, var(--ds-form-default-label-typo-font-size)));--_form-description-color:var(--form-description-color, var(--mod-form-description-color, var(--ds-form-default-description-color)));--_form-description-family:var(--form-description-family, var(--mod-form-description-family, var(--ds-form-default-description-typo-font-family)));--_form-description-weight:var(--form-description-weight, var(--mod-form-description-weight, var(--ds-form-default-description-typo-font-weight)));--_form-description-line-height:var(--form-description-line-height, var(--mod-form-description-line-height, var(--ds-form-default-description-typo-line-height)));--_form-description-size:var(--form-description-size, var(--mod-form-description-size, var(--ds-form-default-description-typo-font-size)));--_input-family:var(--input-family, var(--mod-input-family, var(--ds-form-default-control-typo-font-family)));--_input-weight:var(--input-weight, var(--mod-input-weight, var(--ds-form-default-control-typo-font-weight)));--_input-line-height:var(--input-line-height, var(--mod-input-line-height, var(--ds-form-default-control-typo-line-height)));--_input-size:var(--input-size, var(--mod-input-size, var(--ds-form-default-control-typo-font-size)));--_input-color:var(--input-color, var(--mod-input-color, var(--ds-form-default-control-value-color)));--_input-placeholder:var(--input-placeholder, var(--mod-input-placeholder, var(--ds-form-default-control-placeholder-color)))}:host{position:relative;display:grid;gap:var(--_form-field-gap)}:host #container{-webkit-box-sizing:border-box;box-sizing:border-box;clear:both;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;min-height:3rem;gap:.25rem;padding-inline:.5rem;background:var(--_form-container-background);border:var(--_form-container-border);border-radius:var(--_form-container-radius)}@media (hover: hover)and (pointer: fine){:host #container:hover,:host #container.is-hovered{background:var(--_form-container-hover-background);border:var(--_form-container-hover-border)}}:host #container:active,:host #container.is-pressed{background:var(--_form-container-active-background);border:var(--_form-container-active-border)}:host #container:focus-within:not(:active),:host #container.is-focused:not(:active){background:var(--_form-container-focus-background);border:var(--_form-container-focus-border)}:host :where(fieldset){margin:0;padding:0;border:none}:host :where(legend){padding:0;float:left;width:100%}:host label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-wrap:balance;min-width:0;color:var(--_form-label-color);font-family:var(--_form-label-family);font-weight:var(--_form-label-weight);font-size:var(--_form-label-size);line-height:var(--_form-label-line-height)}:host #description{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-wrap:balance;min-width:0;gap:.25rem;min-height:1.125rem;color:var(--_form-description-color);font-family:var(--_form-description-family);font-weight:var(--_form-description-weight);font-size:var(--_form-description-size);line-height:var(--_form-description-line-height)}:host #description ds-icon{--icon-color:var(--_form-description-color)}:host #input{border:none;outline:none;-webkit-box-shadow:none;box-shadow:none;position:relative;background:inherit;-ms-flex:1;flex:1;color:var(--_input-color);font-family:var(--_input-family);font-weight:var(--_input-weight);font-size:var(--_input-size);line-height:var(--_input-line-height);border-radius:var(--_input-container-radius)}:host #input::-webkit-input-placeholder{color:var(--_input-placeholder)}:host #input::-moz-placeholder{color:var(--_input-placeholder)}:host #input:-ms-input-placeholder{color:var(--_input-placeholder)}:host #input::-ms-input-placeholder{color:var(--_input-placeholder)}:host #input::placeholder{color:var(--_input-placeholder)}:host #input::-moz-placeholder{color:var(--_input-placeholder)}:host #input::-webkit-input-placeholder{color:var(--_input-placeholder)}:host #input:-moz-placeholder{color:var(--_input-placeholder)}:host #input:-ms-input-placeholder{color:var(--_input-placeholder)}:host #inner{position:relative;display:grid;gap:var(--_form-field-gap)}:host(.is-danger){--mod-form-container-border:var(--ds-form-danger-container-border);--mod-form-description-color:var(--ds-form-danger-description-color);--mod-form-container-hover-border:var(--ds-form-danger-container-border);--mod-form-container-active-border:var(--ds-form-danger-container-border)}:host(.is-success){--mod-form-container-border:var(--ds-form-success-container-border);--mod-form-description-color:var(--ds-form-success-description-color);--mod-form-container-hover-border:var(--ds-form-success-container-border);--mod-form-container-active-border:var(--ds-form-success-container-border)}:host(.is-warning){--mod-form-container-border:var(--ds-form-warning-container-border);--mod-form-description-color:var(--ds-form-warning-description-color);--mod-form-container-hover-border:var(--ds-form-warning-container-border);--mod-form-container-active-border:var(--ds-form-warning-container-border)}:host(.is-disabled),:host(.is-disabled) #label,:host(.is-disabled) #description,:host(.is-disabled) #input{pointer-events:none;cursor:default}:host(.is-disabled){--mod-form-container-background:var(--ds-form-disabled-container-background);--mod-form-container-border:var(--ds-form-disabled-container-border);--mod-form-label-color:var(--ds-form-disabled-label-color);--mod-form-description-color:var(--ds-form-disabled-description-color);--mod-input-color:var(--ds-form-disabled-control-value-color);--mod-input-placeholder:var(--ds-form-disabled-control-placeholder-color)}"}},[65,"ds-number-input",{autoInvalidOff:[516,"auto-invalid-off"],color:[1],debounce:[2],decimal:[2],description:[1],disabled:[516],exactNumber:[4,"exact-number"],invalid:[516],invalidText:[1,"invalid-text"],label:[1],max:[1],min:[1],name:[513],onlyPositive:[4,"only-positive"],pattern:[1],placeholder:[1],readonly:[516],required:[516],suffix:[1],value:[1538],focused:[32],hasInvalidTextSlotContent:[32],language:[32],region:[32],nativeInputValue:[32],inputPattern:[32],configChanged:[64],setFocus:[64],setBlur:[64],getInputElement:[64]},[[6,"click","listenToClick"],[6,"reset","listenToReset"]],{debounce:[{debounceChanged:0}],value:[{valueChanged:1}]}]);n([a("number-input"),s("design:type",Function),s("design:paramtypes",[Function]),s("design:returntype",void 0)],H.prototype,"createLogger",null),n([T("boolean"),s("design:type",Boolean)],H.prototype,"autoInvalidOff",void 0),n([K(E),s("design:type",String)],H.prototype,"color",void 0),n([T("number"),s("design:type",Number)],H.prototype,"debounce",void 0),n([T("number"),s("design:type",Number)],H.prototype,"decimal",void 0),n([T("string"),s("design:type",String)],H.prototype,"description",void 0),n([T("boolean"),s("design:type",Boolean)],H.prototype,"disabled",void 0),n([T("boolean"),s("design:type",Boolean)],H.prototype,"exactNumber",void 0),n([T("boolean"),s("design:type",Boolean)],H.prototype,"invalid",void 0),n([T("string"),s("design:type",String)],H.prototype,"invalidText",void 0),n([T("string"),s("design:type",String)],H.prototype,"label",void 0),n([T("string"),s("design:type",String)],H.prototype,"max",void 0),n([T("string"),s("design:type",String)],H.prototype,"min",void 0),n([T("string"),s("design:type",String)],H.prototype,"name",void 0),n([T("boolean"),s("design:type",Boolean)],H.prototype,"onlyPositive",void 0),n([T("string"),s("design:type",String)],H.prototype,"pattern",void 0),n([T("string"),s("design:type",String)],H.prototype,"placeholder",void 0),n([T("boolean"),s("design:type",Boolean)],H.prototype,"readonly",void 0),n([T("boolean"),s("design:type",Boolean)],H.prototype,"required",void 0),n([T("string"),s("design:type",String)],H.prototype,"suffix",void 0),n([T("number"),s("design:type",Object)],H.prototype,"value",void 0),n([L(),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype",Promise)],H.prototype,"configChanged",null);let Q=0;const Z=H,G=function(){"undefined"!=typeof customElements&&["ds-number-input","ds-icon","ds-spinner"].forEach((r=>{switch(r){case"ds-number-input":customElements.get(t(r))||customElements.define(t(r),H);break;case"ds-icon":customElements.get(t(r))||O();break;case"ds-spinner":customElements.get(t(r))||P()}}))};export{Z as DsNumberInput,G as defineCustomElement}
|
|
4
|
+
import{p as r,H as o,e as i,h as e,t}from"./p-DOP4fM2o.js";import{_ as n,L as a,a as s}from"./p-C8OqQuJ7.js";import{g as d}from"./p-DPo2awvS.js";import{e as l,g as c,b as h,f as m,c as f,d as u,h as p}from"./p-CWwurS05.js";import{b as v}from"./p-DOuBxwgh.js";import{i as b}from"./p-IVIyviB0.js";import{i as g}from"./p-BSalDUrg.js";import{i as y}from"./p-ChyhE5ro.js";import{F as _,s as w}from"./p-El2snbN5.js";import{n as k}from"./p-Dbt7_-_D.js";import{w as x}from"./p-CHZn7ODg.js";import{N as z,A as j}from"./p-Bb2t2bOa.js";import{g as C,a as B,b as S,f as I}from"./p-BLExC8Zo.js";import{F as D}from"./p-vUPe8Qmy.js";import{I as E}from"./p-DaVRO74A.js";import{d as O}from"./p-B0Z95Hj1.js";import{d as F}from"./p-D8RaAucx.js";import{d as P}from"./p-CKMUtsmn.js";import{T}from"./p-DEnVBHne.js";import{O as K}from"./p-DaqLtBr3.js";import{L}from"./p-B9OReveE.js";var V,q,N=d(function(){if(q)return V;q=1;var r=l(),o=c(),i=h(),e=v(),t=m(),n=f(),a=p(),s=u(),d=Object.prototype.hasOwnProperty;return V=function(l){if(null==l)return!0;if(t(l)&&(e(l)||"string"==typeof l||"function"==typeof l.splice||n(l)||s(l)||i(l)))return!l.length;var c=o(l);if("[object Map]"==c||"[object Set]"==c)return!l.size;if(a(l))return!r(l).length;for(var h in l)if(d.call(l,h))return!1;return!0}}());function M(r){return"string"==typeof r&&"."!==S()}function R(r){const o=parseFloat(r);return"number"==typeof o&&!b(o)}function A(r,o=0){let i=r;if(""!==i&&null!=i&&!b(i)&&i!==C()&&i!==B()&&R(i))return M(i)&&(i=i.split(S()).join("").split("`").join("").split("'").join("")),"string"==typeof i&&(i=i.replace(B(),".")),0===o?parseInt(i,10):parseFloat(i)}function U(r){return r.replace(".",B())}function H(r,o=0,i=""){if(g(r))return"";r.charAt(0)===B()&&(r="0"+r);const e=0===o?parseInt(r,10):parseFloat(r),t=""!==i?" "+i.trim():"";return b(e)?"":I(e,o)+t}const Z=r(class extends o{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.dsInput=i(this,"dsInput"),this.dsChange=i(this,"dsChange"),this.dsBlur=i(this,"dsBlur"),this.dsFocus=i(this,"dsFocus"),this.dsClick=i(this,"dsClick"),this.dsKeyPress=i(this,"dsKeyPress"),this.internals=this.attachInternals(),this.numberInputId="ds-number-input-"+Q++,this.inheritedAttributes={},this.control=new _(this),this.lastValue="",this.focused=!1,this.hasInvalidTextSlotContent=!1,this.language=P.language,this.region=P.region,this.nativeInputValue="",this.inputPattern="",this.autoInvalidOff=!1,this.color="primary",this.debounce=0,this.decimal=0,this.description="",this.disabled=!1,this.exactNumber=!1,this.invalid=!1,this.invalidText="",this.label="",this.max="",this.min="",this.name=this.numberInputId,this.onlyPositive=!1,this.pattern="",this.placeholder="",this.readonly=!1,this.required=!0,this.suffix="",this.value=null,this.handleInput=()=>{var r,o;if(this.nativeInput&&function(r){return!R(r)&&""!==r&&r!==C()&&r!==B()}(this.nativeInput.value))return void(this.nativeInputValue=this.lastValue||"");this.lastValue=(null===(r=this.nativeInput)||void 0===r?void 0:r.value)||"";const i=null!==(o=A(this.lastValue,this.decimal))&&void 0!==o?o:null;this.control.inputValue=i,this.dsInput.emit(i)},this.handleFocus=r=>{this.control.onFocus(r),this.nativeInputValue=U(this.lastValue||""),clearTimeout(this.selectTimeout),this.selectTimeout=setTimeout((()=>{var r;return null===(r=this.nativeInput)||void 0===r?void 0:r.select()}))},this.handleBlur=r=>{var o;this.lastValue=function(r,o=0){let i=r;if(g(i))return"";M(i)&&(i=i.split(S()).join("").split("`").join("").split("'").join("")),i.charAt(0)===B()&&(i="0"+i);const e=0===o?parseInt(i,10):parseFloat(i.replace(B(),"."));return b(e)?"":e.toFixed(o)}(this.lastValueGetter,this.decimal),this.nativeInputValue=H(this.lastValueGetter,this.decimal,this.suffix),this.nativeInput&&(this.nativeInput.value=this.nativeInputValue),this.control.inputValue=null!==(o=A(this.lastValueGetter,this.decimal))&&void 0!==o?o:null,this.control.onBlur(r)},this.handleKeydown=r=>{var o;if(!this.nativeInput)return;const i=this.nativeInput.value||"",e=null!==(o=this.nativeInput.selectionStart)&&void 0!==o?o:0,t=i.slice(0,e)+r.key+i.slice(e);return function({key:r,ctrlKey:o,metaKey:i,selectionStart:e,selectionEnd:t,newValue:n,decimal:a,onlyPositive:s}){if(["a","c","v"].includes(r)&&(o||i))return!0;if(!r||"Unidentified"===r||"Dead"===r||"Process"===r)return!0;if(r===C()){if(s)return!1;if(e&&e>0&&t&&t>0)return!1}const d=function(r){return r===B()||"."===r}(r);if(d){if(0===a)return!1;if((r=>{const o=B();return("."===o?[o]:[o,"."]).reduce(((o,i)=>o+((r.split(i)||[]).length-1||0)),0)})(n)>1)return!1}if(!d&&![...z,...j,C()].includes(r))return!1;if(0!==a&&z.includes(r)){const r=Math.max(n.lastIndexOf(B()),n.lastIndexOf("."));if(-1!==r&&n.slice(r+1).length>a)return!1}return!0}({key:r.key,ctrlKey:r.ctrlKey,metaKey:r.metaKey,decimal:this.decimal,newValue:t,selectionStart:this.nativeInput.selectionStart,selectionEnd:this.nativeInput.selectionEnd,onlyPositive:this.onlyPositive})?void 0:w(r)}}createLogger(r){this.log=r}debounceChanged(){this.dsChange=k(this.dsChange,this.debounce)}valueChanged(r){const o=null===r||b(r)?this.exactNumber?"0":"":r.toFixed(this.decimal);this.lastValue=o,this.nativeInputValue=this.focused?U(o):H(o,this.decimal,this.suffix)}connectedCallback(){this.debounceChanged(),this.control.connectedCallback(),this.disconnectInvalidTextSlotWatcher=x(this.el,(r=>{this.hasInvalidTextSlotContent=r}))}disconnectedCallback(){var r;null===(r=this.disconnectInvalidTextSlotWatcher)||void 0===r||r.call(this)}componentWillLoad(){this.inheritedAttributes=y(this.el,["aria-label","tabindex","title"]),this.inputPattern=this.createPattern(),this.valueChanged(this.value)}componentDidLoad(){this.control.componentDidLoad()}listenToClick(r){this.control.listenOnClick(r)}listenToReset(r){const o=r.target;(null==o?void 0:o.contains(this.el))&&this.control.setValue(this.control.initialValue)}async configChanged(r){this.language=r.language,this.region=r.region,this.inputPattern=this.createPattern(),this.nativeInput&&(this.nativeInputValue=this.focused?U(this.lastValue):H(this.lastValue,this.decimal,this.suffix))}async setFocus(){return this.control.setFocus()}async setBlur(){return this.control.setBlur()}async getInputElement(){return this.nativeInput}get nativeInput(){return this.control.nativeEl}get lastValueGetter(){return this.exactNumber&&(g(this.lastValue)||N(this.lastValue))?"0":this.lastValue}createPattern(){return this.pattern}render(){const r=this.invalid||this.hasInvalidTextSlotContent;return e(D,{key:"7b1c9504dc98f921b619676a000bae2edd338aec",disabled:this.disabled,color:this.color,invalid:r,label:this.label,description:this.description,invalidText:this.invalidText,required:this.required,language:this.language},e("input",Object.assign({key:"16ca58bb9a791e79b30a9981fc34da843d580e61",id:"input",part:"input",type:"text",inputMode:"decimal",pattern:this.inputPattern||void 0,ref:r=>this.control.nativeEl=r,"aria-describedby":"description","aria-invalid":r?"true":"false",name:this.name,disabled:this.disabled,placeholder:this.placeholder||"",readonly:this.readonly,required:this.required,min:this.min,max:this.max,value:this.nativeInputValue,onInput:r=>this.handleInput(r),onFocus:r=>this.handleFocus(r),onBlur:r=>this.handleBlur(r),onClick:r=>this.control.onClick(r),onKeyDown:r=>this.handleKeydown(r),onKeyPress:r=>this.dsKeyPress.emit(r)},this.inheritedAttributes)))}static get formAssociated(){return!0}get el(){return this}static get watchers(){return{debounce:[{debounceChanged:0}],value:[{valueChanged:1}]}}static get style(){return":host{--_form-field-gap:var(--form-field-gap, var(--mod-form-field-gap, 0.25rem));--_form-container-background:var(--form-container-background, var(--mod-form-container-background, var(--ds-form-default-container-background)));--_form-container-border:var(--form-container-border, var(--mod-form-container-border, var(--ds-form-default-container-border)));--_form-container-radius:var(--form-container-radius, var(--mod-form-container-radius, var(--ds-form-container-radius)));--_form-container-hover-background:var(--form-container-hover-background, var(--mod-form-container-hover-background, var(--ds-form-hover-container-background)));--_form-container-active-background:var(--form-container-active-background, var(--mod-form-container-active-background, var(--ds-form-active-container-background)));--_form-container-focus-background:var(--form-container-focus-background, var(--mod-form-container-focus-background, var(--ds-form-focus-container-background)));--_form-container-hover-border:var(--form-container-hover-border, var(--mod-form-container-hover-border, var(--ds-form-hover-container-border)));--_form-container-active-border:var(--form-container-active-border, var(--mod-form-container-active-border, var(--ds-form-active-container-border)));--_form-container-focus-border:var(--form-container-focus-border, var(--mod-form-container-focus-border, var(--ds-form-focus-container-border)));--_form-label-color:var(--form-label-color, var(--mod-form-label-color, var(--ds-form-default-label-color)));--_form-label-family:var(--form-label-family, var(--mod-form-label-family, var(--ds-form-default-label-typo-font-family)));--_form-label-weight:var(--form-label-weight, var(--mod-form-label-weight, var(--ds-form-default-label-typo-font-weight)));--_form-label-line-height:var(--form-label-line-height, var(--mod-form-label-line-height, var(--ds-form-default-label-typo-line-height)));--_form-label-size:var(--form-label-size, var(--mod-form-label-size, var(--ds-form-default-label-typo-font-size)));--_form-description-color:var(--form-description-color, var(--mod-form-description-color, var(--ds-form-default-description-color)));--_form-description-family:var(--form-description-family, var(--mod-form-description-family, var(--ds-form-default-description-typo-font-family)));--_form-description-weight:var(--form-description-weight, var(--mod-form-description-weight, var(--ds-form-default-description-typo-font-weight)));--_form-description-line-height:var(--form-description-line-height, var(--mod-form-description-line-height, var(--ds-form-default-description-typo-line-height)));--_form-description-size:var(--form-description-size, var(--mod-form-description-size, var(--ds-form-default-description-typo-font-size)));--_input-family:var(--input-family, var(--mod-input-family, var(--ds-form-default-control-typo-font-family)));--_input-weight:var(--input-weight, var(--mod-input-weight, var(--ds-form-default-control-typo-font-weight)));--_input-line-height:var(--input-line-height, var(--mod-input-line-height, var(--ds-form-default-control-typo-line-height)));--_input-size:var(--input-size, var(--mod-input-size, var(--ds-form-default-control-typo-font-size)));--_input-color:var(--input-color, var(--mod-input-color, var(--ds-form-default-control-value-color)));--_input-placeholder:var(--input-placeholder, var(--mod-input-placeholder, var(--ds-form-default-control-placeholder-color)))}:host{position:relative;display:grid;grid-template-columns:minmax(0, 1fr);gap:var(--_form-field-gap)}:host #container{-webkit-box-sizing:border-box;box-sizing:border-box;clear:both;display:-ms-flexbox;display:flex;width:100%;min-width:0;-ms-flex-align:center;align-items:center;min-height:3rem;gap:.25rem;padding-inline:.5rem;background:var(--_form-container-background);border:var(--_form-container-border);border-radius:var(--_form-container-radius)}@media (hover: hover)and (pointer: fine){:host #container:hover,:host #container.is-hovered{background:var(--_form-container-hover-background);border:var(--_form-container-hover-border)}}:host #container:active,:host #container.is-pressed{background:var(--_form-container-active-background);border:var(--_form-container-active-border)}:host #container:focus-within:not(:active),:host #container.is-focused:not(:active){background:var(--_form-container-focus-background);border:var(--_form-container-focus-border)}:host :where(fieldset){margin:0;padding:0;border:none}:host :where(legend){padding:0;float:left;width:100%}:host label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-wrap:balance;min-width:0;color:var(--_form-label-color);font-family:var(--_form-label-family);font-weight:var(--_form-label-weight);font-size:var(--_form-label-size);line-height:var(--_form-label-line-height)}:host #description{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-wrap:balance;min-width:0;gap:.25rem;min-height:1.125rem;color:var(--_form-description-color);font-family:var(--_form-description-family);font-weight:var(--_form-description-weight);font-size:var(--_form-description-size);line-height:var(--_form-description-line-height)}:host #description ds-icon{--icon-color:var(--_form-description-color)}:host #input{border:none;outline:none;-webkit-box-shadow:none;box-shadow:none;position:relative;background:inherit;-ms-flex:1;flex:1;min-width:0;color:var(--_input-color);font-family:var(--_input-family);font-weight:var(--_input-weight);font-size:var(--_input-size);line-height:var(--_input-line-height);border-radius:var(--_input-container-radius)}:host #input::-webkit-input-placeholder{color:var(--_input-placeholder)}:host #input::-moz-placeholder{color:var(--_input-placeholder)}:host #input:-ms-input-placeholder{color:var(--_input-placeholder)}:host #input::-ms-input-placeholder{color:var(--_input-placeholder)}:host #input::placeholder{color:var(--_input-placeholder)}:host #input::-moz-placeholder{color:var(--_input-placeholder)}:host #input::-webkit-input-placeholder{color:var(--_input-placeholder)}:host #input:-moz-placeholder{color:var(--_input-placeholder)}:host #input:-ms-input-placeholder{color:var(--_input-placeholder)}:host #inner{position:relative;display:grid;grid-template-columns:minmax(0, 1fr);gap:var(--_form-field-gap)}:host(.is-danger){--mod-form-container-border:var(--ds-form-danger-container-border);--mod-form-description-color:var(--ds-form-danger-description-color);--mod-form-container-hover-border:var(--ds-form-danger-container-border);--mod-form-container-active-border:var(--ds-form-danger-container-border)}:host(.is-success){--mod-form-container-border:var(--ds-form-success-container-border);--mod-form-description-color:var(--ds-form-success-description-color);--mod-form-container-hover-border:var(--ds-form-success-container-border);--mod-form-container-active-border:var(--ds-form-success-container-border)}:host(.is-warning){--mod-form-container-border:var(--ds-form-warning-container-border);--mod-form-description-color:var(--ds-form-warning-description-color);--mod-form-container-hover-border:var(--ds-form-warning-container-border);--mod-form-container-active-border:var(--ds-form-warning-container-border)}:host(.is-disabled),:host(.is-disabled) #label,:host(.is-disabled) #description,:host(.is-disabled) #input{pointer-events:none;cursor:default}:host(.is-disabled){--mod-form-container-background:var(--ds-form-disabled-container-background);--mod-form-container-border:var(--ds-form-disabled-container-border);--mod-form-label-color:var(--ds-form-disabled-label-color);--mod-form-description-color:var(--ds-form-disabled-description-color);--mod-input-color:var(--ds-form-disabled-control-value-color);--mod-input-placeholder:var(--ds-form-disabled-control-placeholder-color)}"}},[65,"ds-number-input",{autoInvalidOff:[516,"auto-invalid-off"],color:[1],debounce:[2],decimal:[2],description:[1],disabled:[516],exactNumber:[4,"exact-number"],invalid:[516],invalidText:[1,"invalid-text"],label:[1],max:[1],min:[1],name:[513],onlyPositive:[4,"only-positive"],pattern:[1],placeholder:[1],readonly:[516],required:[516],suffix:[1],value:[1538],focused:[32],hasInvalidTextSlotContent:[32],language:[32],region:[32],nativeInputValue:[32],inputPattern:[32],configChanged:[64],setFocus:[64],setBlur:[64],getInputElement:[64]},[[6,"click","listenToClick"],[6,"reset","listenToReset"]],{debounce:[{debounceChanged:0}],value:[{valueChanged:1}]}]);n([a("number-input"),s("design:type",Function),s("design:paramtypes",[Function]),s("design:returntype",void 0)],Z.prototype,"createLogger",null),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"autoInvalidOff",void 0),n([K(E),s("design:type",String)],Z.prototype,"color",void 0),n([T("number"),s("design:type",Number)],Z.prototype,"debounce",void 0),n([T("number"),s("design:type",Number)],Z.prototype,"decimal",void 0),n([T("string"),s("design:type",String)],Z.prototype,"description",void 0),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"disabled",void 0),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"exactNumber",void 0),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"invalid",void 0),n([T("string"),s("design:type",String)],Z.prototype,"invalidText",void 0),n([T("string"),s("design:type",String)],Z.prototype,"label",void 0),n([T("string"),s("design:type",String)],Z.prototype,"max",void 0),n([T("string"),s("design:type",String)],Z.prototype,"min",void 0),n([T("string"),s("design:type",String)],Z.prototype,"name",void 0),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"onlyPositive",void 0),n([T("string"),s("design:type",String)],Z.prototype,"pattern",void 0),n([T("string"),s("design:type",String)],Z.prototype,"placeholder",void 0),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"readonly",void 0),n([T("boolean"),s("design:type",Boolean)],Z.prototype,"required",void 0),n([T("string"),s("design:type",String)],Z.prototype,"suffix",void 0),n([T("number"),s("design:type",Object)],Z.prototype,"value",void 0),n([L(),s("design:type",Function),s("design:paramtypes",[Object]),s("design:returntype",Promise)],Z.prototype,"configChanged",null);let Q=0;const W=Z,G=function(){"undefined"!=typeof customElements&&["ds-number-input","ds-icon","ds-spinner"].forEach((r=>{switch(r){case"ds-number-input":customElements.get(t(r))||customElements.define(t(r),Z);break;case"ds-icon":customElements.get(t(r))||O();break;case"ds-spinner":customElements.get(t(r))||F()}}))};export{W as DsNumberInput,G as defineCustomElement}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Helvetia Design System https://helvetia-design.vercel.app/ - Apache License 2.0
|
|
3
3
|
*/
|
|
4
|
-
import{P as
|
|
4
|
+
import{P as s,d as o}from"./p-CTSANrsO.js";const r=s,p=o;export{r as DsPagination,p as defineCustomElement}
|