@cupra/ui-kit 2.0.0-canary.86 → 2.0.0-canary.88
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/cjs/components/ds-dialog/ds-dialog.cjs +14 -21
- package/dist/cjs/components/ds-dialog/styles/common.styles.cjs +11 -21
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/esm/components/ds-dialog/ds-dialog.js +88 -87
- package/dist/esm/components/ds-dialog/styles/common.styles.js +12 -22
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/types/components/ds-dialog/ds-dialog.d.ts +7 -4
- package/dist-react/cjs/components/ds-dialog/ds-dialog.cjs +14 -21
- package/dist-react/cjs/components/ds-dialog/styles/common.styles.cjs +11 -21
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/esm/components/ds-dialog/ds-dialog.js +88 -87
- package/dist-react/esm/components/ds-dialog/styles/common.styles.js +12 -22
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/types/components/ds-dialog/ds-dialog.d.ts +7 -4
- package/package.json +1 -1
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),v=require("../../decorators/customUiKitElement.cjs"),h=require("../../utils/booleanConverter.cjs"),
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
?
|
|
12
|
-
data-testid="ds-dialog-container"
|
|
13
|
-
class=${d.classMap(this.dialogClasses)}
|
|
14
|
-
aria-modal="true"
|
|
15
|
-
aria-label=${this.dataAriaLabel||i.nothing}
|
|
16
|
-
aria-description=${this.dataAriaDescription||i.nothing}
|
|
17
|
-
>
|
|
18
|
-
${this.lockClose?i.nothing:i.html`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),v=require("../../decorators/customUiKitElement.cjs"),h=require("../../utils/booleanConverter.cjs"),g=require("../../utils/debounce.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const l=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),D=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),b=require("./styles/common.styles.cjs");var C=Object.defineProperty,y=Object.getOwnPropertyDescriptor,s=(n,e,t,a)=>{for(var i=a>1?void 0:a?y(e,t):e,r=n.length-1,c;r>=0;r--)(c=n[r])&&(i=(a?c(e,t,i):c(i))||i);return a&&i&&C(e,t,i),i};exports.DsDialog=class extends u.UiKitElement{constructor(){super(...arguments),this.lockClose=!1,this.lockScroll=!0,this.open=!1,this.size="medium",this.hasBeenOpened=!1,this.hasScroll=!1,this.debouncedCheckScroll=g.debounce({func:()=>this.checkScroll()}),this.handleCloseButtonClick=()=>{this.handleClose("button")},this.handleDialogClick=e=>{e.target===this.nativeDialog&&this.handleClose("backdrop")},this.handleCancel=e=>{e.preventDefault(),this.lockClose||this.handleClose("escape")},this.handleHostClick=e=>{e.stopPropagation()}}async updated(e){super.updated(e),!this.hasBeenOpened&&e.has("open")&&this.open&&(this.hasBeenOpened=!0),e.has("open")&&(this.handleResizeObserver(),this.syncNativeDialogState()),e.has("open")&&this.open&&(await this.updateComplete,this.requestUpdate())}syncNativeDialogState(){this.nativeDialog&&(this.open?this.openNativeDialog():this.closeNativeDialog())}openNativeDialog(){var e,t;this.nativeDialog.open||(t=(e=this.nativeDialog).showModal)==null||t.call(e)}closeNativeDialog(){var e,t;this.nativeDialog.open&&((t=(e=this.nativeDialog).close)==null||t.call(e))}async handleResizeObserver(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.content&&(this.resizeObserver.observe(this.content),await new Promise(requestAnimationFrame),this.checkScroll())}get panelClasses(){return{panel:!0,"with-scroll":this.open&&this.hasScroll,[this.size]:!!this.size}}dispatchCloseEvents(e){const t=`ds-dialog:close-${e}`;this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("ds-dialog:close",{bubbles:!0,composed:!0}))}handleClose(e){this.lockClose||(this.open=!1,this.dispatchCloseEvents(e))}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(this.debouncedCheckScroll),this.handleResizeObserver(),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),this.removeEventListener("click",this.handleHostClick)}checkScroll(){var e,t;this.hasScroll=((e=this.content)==null?void 0:e.scrollHeight)>((t=this.content)==null?void 0:t.clientHeight)}render(){return!this.hasBeenOpened&&!this.open?o.nothing:o.html`
|
|
2
|
+
<dialog
|
|
3
|
+
class="dialog"
|
|
4
|
+
data-testid="ds-dialog-container"
|
|
5
|
+
aria-label=${this.dataAriaLabel||o.nothing}
|
|
6
|
+
aria-description=${this.dataAriaDescription||o.nothing}
|
|
7
|
+
@cancel=${this.handleCancel}
|
|
8
|
+
@click=${this.handleDialogClick}
|
|
9
|
+
>
|
|
10
|
+
<div class=${D.classMap(this.panelClasses)}>
|
|
11
|
+
${this.lockClose?o.nothing:o.html`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
19
12
|
<div class="content-container">
|
|
20
13
|
<div tabindex="0" class="content ds-scroll">
|
|
21
14
|
<slot @slotchange=${this.handleResizeObserver}></slot>
|
|
22
15
|
</div>
|
|
23
16
|
<slot name="footer"></slot>
|
|
24
17
|
</div>
|
|
25
|
-
</
|
|
26
|
-
</
|
|
27
|
-
`}};exports.DsDialog.styles=[
|
|
18
|
+
</div>
|
|
19
|
+
</dialog>
|
|
20
|
+
`}};exports.DsDialog.styles=[b.commonStyles];s([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-close"})],exports.DsDialog.prototype,"lockClose",2);s([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-scroll"})],exports.DsDialog.prototype,"lockScroll",2);s([l.property({type:Boolean,converter:h.booleanConverter})],exports.DsDialog.prototype,"open",2);s([l.property({type:String})],exports.DsDialog.prototype,"size",2);s([l.property({type:String,attribute:"data-aria-label"})],exports.DsDialog.prototype,"dataAriaLabel",2);s([l.property({type:String,attribute:"data-aria-description"})],exports.DsDialog.prototype,"dataAriaDescription",2);s([p.state()],exports.DsDialog.prototype,"hasBeenOpened",2);s([p.state()],exports.DsDialog.prototype,"hasScroll",2);s([d.query(".content")],exports.DsDialog.prototype,"content",2);s([d.query("dialog")],exports.DsDialog.prototype,"nativeDialog",2);exports.DsDialog=s([v.customUiKitElement("ds-dialog")],exports.DsDialog);
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../utils/cssQueries.cjs");require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../utils/cssQueries.cjs");require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs"),r=e.css`
|
|
2
2
|
:host {
|
|
3
|
-
|
|
3
|
+
display: contents;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
left: 0;
|
|
6
|
+
.dialog[open] {
|
|
7
|
+
max-width: none;
|
|
8
|
+
max-height: none;
|
|
9
|
+
border: none;
|
|
10
|
+
background: transparent;
|
|
11
|
+
overflow: visible;
|
|
15
12
|
width: 100dvw;
|
|
16
13
|
height: 100dvh;
|
|
14
|
+
box-sizing: border-box;
|
|
17
15
|
display: flex;
|
|
18
16
|
justify-content: center;
|
|
19
17
|
align-items: center;
|
|
20
|
-
z-index: var(--ds-z-index-modal);
|
|
21
|
-
transition:
|
|
22
|
-
opacity 0.3s cubic-bezier(0, 0, 0.2, 1),
|
|
23
|
-
display 0.3s cubic-bezier(0, 0, 0.2, 1) allow-discrete;
|
|
24
|
-
opacity: 1;
|
|
25
|
-
@starting-style {
|
|
26
|
-
opacity: 0;
|
|
27
|
-
}
|
|
28
18
|
}
|
|
29
19
|
|
|
30
|
-
.
|
|
20
|
+
.panel {
|
|
31
21
|
padding: 0;
|
|
32
22
|
position: relative;
|
|
33
23
|
}
|
|
@@ -69,4 +59,4 @@
|
|
|
69
59
|
width: 8px;
|
|
70
60
|
}
|
|
71
61
|
}
|
|
72
|
-
`;exports.commonStyles=
|
|
62
|
+
`;exports.commonStyles=r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.88",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.88"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.88"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.88/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const h=s.getInstance();exports.stylesRegistry=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-88"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-88"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -1,56 +1,61 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
1
|
+
import { UiKitElement as m } from "../base/UiKitElement.js";
|
|
2
2
|
import { customUiKitElement as b } from "../../decorators/customUiKitElement.js";
|
|
3
|
-
import { booleanConverter as
|
|
4
|
-
import { debounce as
|
|
3
|
+
import { booleanConverter as p } from "../../utils/booleanConverter.js";
|
|
4
|
+
import { debounce as f } from "../../utils/debounce.js";
|
|
5
5
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
6
|
-
import { nothing as
|
|
6
|
+
import { nothing as n, html as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
7
7
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
8
|
-
import { property as
|
|
9
|
-
import { state as
|
|
10
|
-
import { query as
|
|
11
|
-
import { classMap as
|
|
12
|
-
import { commonStyles as
|
|
13
|
-
var k = Object.defineProperty,
|
|
14
|
-
for (var
|
|
15
|
-
(h = e[c]) && (
|
|
16
|
-
return
|
|
8
|
+
import { property as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
+
import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
10
|
+
import { query as u } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
|
|
11
|
+
import { classMap as C } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
12
|
+
import { commonStyles as g } from "./styles/common.styles.js";
|
|
13
|
+
var k = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, t, r, l) => {
|
|
14
|
+
for (var o = l > 1 ? void 0 : l ? y(t, r) : t, c = e.length - 1, h; c >= 0; c--)
|
|
15
|
+
(h = e[c]) && (o = (l ? h(t, r, o) : h(o)) || o);
|
|
16
|
+
return l && o && k(t, r, o), o;
|
|
17
17
|
};
|
|
18
|
-
let
|
|
18
|
+
let s = class extends m {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll =
|
|
20
|
+
super(...arguments), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll = f({ func: () => this.checkScroll() }), this.handleCloseButtonClick = () => {
|
|
21
21
|
this.handleClose("button");
|
|
22
|
-
}, this.
|
|
23
|
-
this.handleClose("backdrop");
|
|
22
|
+
}, this.handleDialogClick = (e) => {
|
|
23
|
+
e.target === this.nativeDialog && this.handleClose("backdrop");
|
|
24
|
+
}, this.handleCancel = (e) => {
|
|
25
|
+
e.preventDefault(), this.lockClose || this.handleClose("escape");
|
|
24
26
|
}, this.handleHostClick = (e) => {
|
|
25
27
|
e.stopPropagation();
|
|
26
|
-
}, this.handleKeyDown = (e) => {
|
|
27
|
-
this.open && e.key === "Escape" && this.handleClose("escape");
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async updated(e) {
|
|
31
|
-
super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && this.handleResizeObserver(), e.has("open") && this.open && (await this.updateComplete, this.requestUpdate());
|
|
31
|
+
super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && (this.handleResizeObserver(), this.syncNativeDialogState()), e.has("open") && this.open && (await this.updateComplete, this.requestUpdate());
|
|
32
|
+
}
|
|
33
|
+
syncNativeDialogState() {
|
|
34
|
+
this.nativeDialog && (this.open ? this.openNativeDialog() : this.closeNativeDialog());
|
|
35
|
+
}
|
|
36
|
+
openNativeDialog() {
|
|
37
|
+
var e, t;
|
|
38
|
+
this.nativeDialog.open || (t = (e = this.nativeDialog).showModal) == null || t.call(e);
|
|
39
|
+
}
|
|
40
|
+
closeNativeDialog() {
|
|
41
|
+
var e, t;
|
|
42
|
+
this.nativeDialog.open && ((t = (e = this.nativeDialog).close) == null || t.call(e));
|
|
32
43
|
}
|
|
33
44
|
async handleResizeObserver() {
|
|
34
45
|
var e;
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
get containerClasses() {
|
|
38
|
-
return {
|
|
39
|
-
container: !0,
|
|
40
|
-
close: !this.open,
|
|
41
|
-
"with-scroll": this.open && this.hasScroll
|
|
42
|
-
};
|
|
46
|
+
(e = this.resizeObserver) == null || e.disconnect(), this.content && (this.resizeObserver.observe(this.content), await new Promise(requestAnimationFrame), this.checkScroll());
|
|
43
47
|
}
|
|
44
|
-
get
|
|
48
|
+
get panelClasses() {
|
|
45
49
|
return {
|
|
46
|
-
|
|
50
|
+
panel: !0,
|
|
51
|
+
"with-scroll": this.open && this.hasScroll,
|
|
47
52
|
[this.size]: !!this.size
|
|
48
53
|
};
|
|
49
54
|
}
|
|
50
55
|
dispatchCloseEvents(e) {
|
|
51
|
-
const
|
|
56
|
+
const t = `ds-dialog:close-${e}`;
|
|
52
57
|
this.dispatchEvent(
|
|
53
|
-
new Event(
|
|
58
|
+
new Event(t, {
|
|
54
59
|
bubbles: !0,
|
|
55
60
|
composed: !0
|
|
56
61
|
})
|
|
@@ -65,77 +70,73 @@ let t = class extends v {
|
|
|
65
70
|
this.lockClose || (this.open = !1, this.dispatchCloseEvents(e));
|
|
66
71
|
}
|
|
67
72
|
connectedCallback() {
|
|
68
|
-
super.connectedCallback(),
|
|
73
|
+
super.connectedCallback(), this.resizeObserver = new ResizeObserver(this.debouncedCheckScroll), this.handleResizeObserver(), this.addEventListener("click", this.handleHostClick);
|
|
69
74
|
}
|
|
70
75
|
disconnectedCallback() {
|
|
71
76
|
var e;
|
|
72
|
-
super.disconnectedCallback(),
|
|
77
|
+
super.disconnectedCallback(), (e = this.resizeObserver) == null || e.disconnect(), this.removeEventListener("click", this.handleHostClick);
|
|
73
78
|
}
|
|
74
79
|
checkScroll() {
|
|
75
|
-
var e,
|
|
76
|
-
this.hasScroll = ((e = this.content) == null ? void 0 : e.scrollHeight) > ((
|
|
80
|
+
var e, t;
|
|
81
|
+
this.hasScroll = ((e = this.content) == null ? void 0 : e.scrollHeight) > ((t = this.content) == null ? void 0 : t.clientHeight);
|
|
77
82
|
}
|
|
78
83
|
render() {
|
|
79
|
-
return !this.hasBeenOpened && !this.open ?
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
?
|
|
90
|
-
data-testid="ds-dialog-container"
|
|
91
|
-
class=${u(this.dialogClasses)}
|
|
92
|
-
aria-modal="true"
|
|
93
|
-
aria-label=${this.dataAriaLabel || r}
|
|
94
|
-
aria-description=${this.dataAriaDescription || r}
|
|
95
|
-
>
|
|
96
|
-
${this.lockClose ? r : p`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
84
|
+
return !this.hasBeenOpened && !this.open ? n : d`
|
|
85
|
+
<dialog
|
|
86
|
+
class="dialog"
|
|
87
|
+
data-testid="ds-dialog-container"
|
|
88
|
+
aria-label=${this.dataAriaLabel || n}
|
|
89
|
+
aria-description=${this.dataAriaDescription || n}
|
|
90
|
+
@cancel=${this.handleCancel}
|
|
91
|
+
@click=${this.handleDialogClick}
|
|
92
|
+
>
|
|
93
|
+
<div class=${C(this.panelClasses)}>
|
|
94
|
+
${this.lockClose ? n : d`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
97
95
|
<div class="content-container">
|
|
98
96
|
<div tabindex="0" class="content ds-scroll">
|
|
99
97
|
<slot @slotchange=${this.handleResizeObserver}></slot>
|
|
100
98
|
</div>
|
|
101
99
|
<slot name="footer"></slot>
|
|
102
100
|
</div>
|
|
103
|
-
</
|
|
104
|
-
</
|
|
101
|
+
</div>
|
|
102
|
+
</dialog>
|
|
105
103
|
`;
|
|
106
104
|
}
|
|
107
105
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
],
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
],
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
],
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
],
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
],
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
],
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
],
|
|
136
|
-
|
|
106
|
+
s.styles = [g];
|
|
107
|
+
i([
|
|
108
|
+
a({ type: Boolean, converter: p, attribute: "lock-close" })
|
|
109
|
+
], s.prototype, "lockClose", 2);
|
|
110
|
+
i([
|
|
111
|
+
a({ type: Boolean, converter: p, attribute: "lock-scroll" })
|
|
112
|
+
], s.prototype, "lockScroll", 2);
|
|
113
|
+
i([
|
|
114
|
+
a({ type: Boolean, converter: p })
|
|
115
|
+
], s.prototype, "open", 2);
|
|
116
|
+
i([
|
|
117
|
+
a({ type: String })
|
|
118
|
+
], s.prototype, "size", 2);
|
|
119
|
+
i([
|
|
120
|
+
a({ type: String, attribute: "data-aria-label" })
|
|
121
|
+
], s.prototype, "dataAriaLabel", 2);
|
|
122
|
+
i([
|
|
123
|
+
a({ type: String, attribute: "data-aria-description" })
|
|
124
|
+
], s.prototype, "dataAriaDescription", 2);
|
|
125
|
+
i([
|
|
126
|
+
v()
|
|
127
|
+
], s.prototype, "hasBeenOpened", 2);
|
|
128
|
+
i([
|
|
129
|
+
v()
|
|
130
|
+
], s.prototype, "hasScroll", 2);
|
|
131
|
+
i([
|
|
132
|
+
u(".content")
|
|
133
|
+
], s.prototype, "content", 2);
|
|
134
|
+
i([
|
|
135
|
+
u("dialog")
|
|
136
|
+
], s.prototype, "nativeDialog", 2);
|
|
137
|
+
s = i([
|
|
137
138
|
b("ds-dialog")
|
|
138
|
-
],
|
|
139
|
+
], s);
|
|
139
140
|
export {
|
|
140
|
-
|
|
141
|
+
s as DsDialog
|
|
141
142
|
};
|
|
@@ -2,37 +2,27 @@ import { cssQueries as l } from "../../../utils/cssQueries.js";
|
|
|
2
2
|
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
3
3
|
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
4
4
|
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
5
|
-
import { css as
|
|
6
|
-
const
|
|
5
|
+
import { css as o } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
6
|
+
const a = o`
|
|
7
7
|
:host {
|
|
8
|
-
|
|
8
|
+
display: contents;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
position: fixed;
|
|
18
|
-
top: 0;
|
|
19
|
-
left: 0;
|
|
11
|
+
.dialog[open] {
|
|
12
|
+
max-width: none;
|
|
13
|
+
max-height: none;
|
|
14
|
+
border: none;
|
|
15
|
+
background: transparent;
|
|
16
|
+
overflow: visible;
|
|
20
17
|
width: 100dvw;
|
|
21
18
|
height: 100dvh;
|
|
19
|
+
box-sizing: border-box;
|
|
22
20
|
display: flex;
|
|
23
21
|
justify-content: center;
|
|
24
22
|
align-items: center;
|
|
25
|
-
z-index: var(--ds-z-index-modal);
|
|
26
|
-
transition:
|
|
27
|
-
opacity 0.3s cubic-bezier(0, 0, 0.2, 1),
|
|
28
|
-
display 0.3s cubic-bezier(0, 0, 0.2, 1) allow-discrete;
|
|
29
|
-
opacity: 1;
|
|
30
|
-
@starting-style {
|
|
31
|
-
opacity: 0;
|
|
32
|
-
}
|
|
33
23
|
}
|
|
34
24
|
|
|
35
|
-
.
|
|
25
|
+
.panel {
|
|
36
26
|
padding: 0;
|
|
37
27
|
position: relative;
|
|
38
28
|
}
|
|
@@ -76,5 +66,5 @@ const c = i`
|
|
|
76
66
|
}
|
|
77
67
|
`;
|
|
78
68
|
export {
|
|
79
|
-
|
|
69
|
+
a as commonStyles
|
|
80
70
|
};
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.88", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
|
|
58
58
|
if (document.head.querySelector(`link[href="${r}"]`)) t();
|
|
59
59
|
else {
|
|
60
60
|
const e = `ui-kit-theme-${s}`, a = document.getElementById(e), n = document.createElement("link");
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.88"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
package/dist/esm/utils/PubSub.js
CHANGED
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.88"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -7,7 +7,7 @@ class s {
|
|
|
7
7
|
theme: t
|
|
8
8
|
}) => {
|
|
9
9
|
if (!t || !e) return;
|
|
10
|
-
const c = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
10
|
+
const c = `https://ds-assets.cupra.com/2.0.0-canary.88/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
|
|
11
11
|
if (r) return r;
|
|
12
12
|
const i = h(() => this.fetchStyle({ url: c })).then((n) => (n || this.stylePromises.delete(c), n));
|
|
13
13
|
return this.stylePromises.set(c, i), this.stylePromises.get(c);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-88"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-88"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -14,20 +14,23 @@ export declare class DsDialog extends UiKitElement {
|
|
|
14
14
|
hasBeenOpened: boolean;
|
|
15
15
|
hasScroll: boolean;
|
|
16
16
|
protected content: HTMLInputElement;
|
|
17
|
+
private nativeDialog;
|
|
17
18
|
private resizeObserver;
|
|
18
19
|
private debouncedCheckScroll;
|
|
19
20
|
updated(changedProperties: PropertyValues): Promise<void>;
|
|
21
|
+
private syncNativeDialogState;
|
|
22
|
+
private openNativeDialog;
|
|
23
|
+
private closeNativeDialog;
|
|
20
24
|
handleResizeObserver(): Promise<void>;
|
|
21
|
-
private get
|
|
22
|
-
private get dialogClasses();
|
|
25
|
+
private get panelClasses();
|
|
23
26
|
private dispatchCloseEvents;
|
|
24
27
|
private handleClose;
|
|
25
28
|
private handleCloseButtonClick;
|
|
26
|
-
private
|
|
29
|
+
private handleDialogClick;
|
|
30
|
+
private handleCancel;
|
|
27
31
|
connectedCallback(): void;
|
|
28
32
|
disconnectedCallback(): void;
|
|
29
33
|
private handleHostClick;
|
|
30
|
-
private handleKeyDown;
|
|
31
34
|
private checkScroll;
|
|
32
35
|
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
33
36
|
}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),v=require("../../decorators/customUiKitElement.cjs"),h=require("../../utils/booleanConverter.cjs"),
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
?
|
|
12
|
-
data-testid="ds-dialog-container"
|
|
13
|
-
class=${d.classMap(this.dialogClasses)}
|
|
14
|
-
aria-modal="true"
|
|
15
|
-
aria-label=${this.dataAriaLabel||i.nothing}
|
|
16
|
-
aria-description=${this.dataAriaDescription||i.nothing}
|
|
17
|
-
>
|
|
18
|
-
${this.lockClose?i.nothing:i.html`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),v=require("../../decorators/customUiKitElement.cjs"),h=require("../../utils/booleanConverter.cjs"),g=require("../../utils/debounce.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const l=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),D=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),b=require("./styles/common.styles.cjs");var C=Object.defineProperty,y=Object.getOwnPropertyDescriptor,s=(n,e,t,a)=>{for(var i=a>1?void 0:a?y(e,t):e,r=n.length-1,c;r>=0;r--)(c=n[r])&&(i=(a?c(e,t,i):c(i))||i);return a&&i&&C(e,t,i),i};exports.DsDialog=class extends u.UiKitElement{constructor(){super(...arguments),this.lockClose=!1,this.lockScroll=!0,this.open=!1,this.size="medium",this.hasBeenOpened=!1,this.hasScroll=!1,this.debouncedCheckScroll=g.debounce({func:()=>this.checkScroll()}),this.handleCloseButtonClick=()=>{this.handleClose("button")},this.handleDialogClick=e=>{e.target===this.nativeDialog&&this.handleClose("backdrop")},this.handleCancel=e=>{e.preventDefault(),this.lockClose||this.handleClose("escape")},this.handleHostClick=e=>{e.stopPropagation()}}async updated(e){super.updated(e),!this.hasBeenOpened&&e.has("open")&&this.open&&(this.hasBeenOpened=!0),e.has("open")&&(this.handleResizeObserver(),this.syncNativeDialogState()),e.has("open")&&this.open&&(await this.updateComplete,this.requestUpdate())}syncNativeDialogState(){this.nativeDialog&&(this.open?this.openNativeDialog():this.closeNativeDialog())}openNativeDialog(){var e,t;this.nativeDialog.open||(t=(e=this.nativeDialog).showModal)==null||t.call(e)}closeNativeDialog(){var e,t;this.nativeDialog.open&&((t=(e=this.nativeDialog).close)==null||t.call(e))}async handleResizeObserver(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.content&&(this.resizeObserver.observe(this.content),await new Promise(requestAnimationFrame),this.checkScroll())}get panelClasses(){return{panel:!0,"with-scroll":this.open&&this.hasScroll,[this.size]:!!this.size}}dispatchCloseEvents(e){const t=`ds-dialog:close-${e}`;this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("ds-dialog:close",{bubbles:!0,composed:!0}))}handleClose(e){this.lockClose||(this.open=!1,this.dispatchCloseEvents(e))}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(this.debouncedCheckScroll),this.handleResizeObserver(),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),this.removeEventListener("click",this.handleHostClick)}checkScroll(){var e,t;this.hasScroll=((e=this.content)==null?void 0:e.scrollHeight)>((t=this.content)==null?void 0:t.clientHeight)}render(){return!this.hasBeenOpened&&!this.open?o.nothing:o.html`
|
|
2
|
+
<dialog
|
|
3
|
+
class="dialog"
|
|
4
|
+
data-testid="ds-dialog-container"
|
|
5
|
+
aria-label=${this.dataAriaLabel||o.nothing}
|
|
6
|
+
aria-description=${this.dataAriaDescription||o.nothing}
|
|
7
|
+
@cancel=${this.handleCancel}
|
|
8
|
+
@click=${this.handleDialogClick}
|
|
9
|
+
>
|
|
10
|
+
<div class=${D.classMap(this.panelClasses)}>
|
|
11
|
+
${this.lockClose?o.nothing:o.html`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
19
12
|
<div class="content-container">
|
|
20
13
|
<div tabindex="0" class="content ds-scroll">
|
|
21
14
|
<slot @slotchange=${this.handleResizeObserver}></slot>
|
|
22
15
|
</div>
|
|
23
16
|
<slot name="footer"></slot>
|
|
24
17
|
</div>
|
|
25
|
-
</
|
|
26
|
-
</
|
|
27
|
-
`}};exports.DsDialog.styles=[
|
|
18
|
+
</div>
|
|
19
|
+
</dialog>
|
|
20
|
+
`}};exports.DsDialog.styles=[b.commonStyles];s([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-close"})],exports.DsDialog.prototype,"lockClose",2);s([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-scroll"})],exports.DsDialog.prototype,"lockScroll",2);s([l.property({type:Boolean,converter:h.booleanConverter})],exports.DsDialog.prototype,"open",2);s([l.property({type:String})],exports.DsDialog.prototype,"size",2);s([l.property({type:String,attribute:"data-aria-label"})],exports.DsDialog.prototype,"dataAriaLabel",2);s([l.property({type:String,attribute:"data-aria-description"})],exports.DsDialog.prototype,"dataAriaDescription",2);s([p.state()],exports.DsDialog.prototype,"hasBeenOpened",2);s([p.state()],exports.DsDialog.prototype,"hasScroll",2);s([d.query(".content")],exports.DsDialog.prototype,"content",2);s([d.query("dialog")],exports.DsDialog.prototype,"nativeDialog",2);exports.DsDialog=s([v.customUiKitElement("ds-dialog")],exports.DsDialog);
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../utils/cssQueries.cjs");require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../utils/cssQueries.cjs");require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs"),r=e.css`
|
|
2
2
|
:host {
|
|
3
|
-
|
|
3
|
+
display: contents;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
left: 0;
|
|
6
|
+
.dialog[open] {
|
|
7
|
+
max-width: none;
|
|
8
|
+
max-height: none;
|
|
9
|
+
border: none;
|
|
10
|
+
background: transparent;
|
|
11
|
+
overflow: visible;
|
|
15
12
|
width: 100dvw;
|
|
16
13
|
height: 100dvh;
|
|
14
|
+
box-sizing: border-box;
|
|
17
15
|
display: flex;
|
|
18
16
|
justify-content: center;
|
|
19
17
|
align-items: center;
|
|
20
|
-
z-index: var(--ds-z-index-modal);
|
|
21
|
-
transition:
|
|
22
|
-
opacity 0.3s cubic-bezier(0, 0, 0.2, 1),
|
|
23
|
-
display 0.3s cubic-bezier(0, 0, 0.2, 1) allow-discrete;
|
|
24
|
-
opacity: 1;
|
|
25
|
-
@starting-style {
|
|
26
|
-
opacity: 0;
|
|
27
|
-
}
|
|
28
18
|
}
|
|
29
19
|
|
|
30
|
-
.
|
|
20
|
+
.panel {
|
|
31
21
|
padding: 0;
|
|
32
22
|
position: relative;
|
|
33
23
|
}
|
|
@@ -69,4 +59,4 @@
|
|
|
69
59
|
width: 8px;
|
|
70
60
|
}
|
|
71
61
|
}
|
|
72
|
-
`;exports.commonStyles=
|
|
62
|
+
`;exports.commonStyles=r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.88",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.88"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.88"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.88/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const h=s.getInstance();exports.stylesRegistry=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-88"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-88"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -1,56 +1,61 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
1
|
+
import { UiKitElement as m } from "../base/UiKitElement.js";
|
|
2
2
|
import { customUiKitElement as b } from "../../decorators/customUiKitElement.js";
|
|
3
|
-
import { booleanConverter as
|
|
4
|
-
import { debounce as
|
|
3
|
+
import { booleanConverter as p } from "../../utils/booleanConverter.js";
|
|
4
|
+
import { debounce as f } from "../../utils/debounce.js";
|
|
5
5
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
6
|
-
import { nothing as
|
|
6
|
+
import { nothing as n, html as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
7
7
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
8
|
-
import { property as
|
|
9
|
-
import { state as
|
|
10
|
-
import { query as
|
|
11
|
-
import { classMap as
|
|
12
|
-
import { commonStyles as
|
|
13
|
-
var k = Object.defineProperty,
|
|
14
|
-
for (var
|
|
15
|
-
(h = e[c]) && (
|
|
16
|
-
return
|
|
8
|
+
import { property as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
+
import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
10
|
+
import { query as u } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
|
|
11
|
+
import { classMap as C } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
12
|
+
import { commonStyles as g } from "./styles/common.styles.js";
|
|
13
|
+
var k = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, t, r, l) => {
|
|
14
|
+
for (var o = l > 1 ? void 0 : l ? y(t, r) : t, c = e.length - 1, h; c >= 0; c--)
|
|
15
|
+
(h = e[c]) && (o = (l ? h(t, r, o) : h(o)) || o);
|
|
16
|
+
return l && o && k(t, r, o), o;
|
|
17
17
|
};
|
|
18
|
-
let
|
|
18
|
+
let s = class extends m {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll =
|
|
20
|
+
super(...arguments), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll = f({ func: () => this.checkScroll() }), this.handleCloseButtonClick = () => {
|
|
21
21
|
this.handleClose("button");
|
|
22
|
-
}, this.
|
|
23
|
-
this.handleClose("backdrop");
|
|
22
|
+
}, this.handleDialogClick = (e) => {
|
|
23
|
+
e.target === this.nativeDialog && this.handleClose("backdrop");
|
|
24
|
+
}, this.handleCancel = (e) => {
|
|
25
|
+
e.preventDefault(), this.lockClose || this.handleClose("escape");
|
|
24
26
|
}, this.handleHostClick = (e) => {
|
|
25
27
|
e.stopPropagation();
|
|
26
|
-
}, this.handleKeyDown = (e) => {
|
|
27
|
-
this.open && e.key === "Escape" && this.handleClose("escape");
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async updated(e) {
|
|
31
|
-
super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && this.handleResizeObserver(), e.has("open") && this.open && (await this.updateComplete, this.requestUpdate());
|
|
31
|
+
super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && (this.handleResizeObserver(), this.syncNativeDialogState()), e.has("open") && this.open && (await this.updateComplete, this.requestUpdate());
|
|
32
|
+
}
|
|
33
|
+
syncNativeDialogState() {
|
|
34
|
+
this.nativeDialog && (this.open ? this.openNativeDialog() : this.closeNativeDialog());
|
|
35
|
+
}
|
|
36
|
+
openNativeDialog() {
|
|
37
|
+
var e, t;
|
|
38
|
+
this.nativeDialog.open || (t = (e = this.nativeDialog).showModal) == null || t.call(e);
|
|
39
|
+
}
|
|
40
|
+
closeNativeDialog() {
|
|
41
|
+
var e, t;
|
|
42
|
+
this.nativeDialog.open && ((t = (e = this.nativeDialog).close) == null || t.call(e));
|
|
32
43
|
}
|
|
33
44
|
async handleResizeObserver() {
|
|
34
45
|
var e;
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
get containerClasses() {
|
|
38
|
-
return {
|
|
39
|
-
container: !0,
|
|
40
|
-
close: !this.open,
|
|
41
|
-
"with-scroll": this.open && this.hasScroll
|
|
42
|
-
};
|
|
46
|
+
(e = this.resizeObserver) == null || e.disconnect(), this.content && (this.resizeObserver.observe(this.content), await new Promise(requestAnimationFrame), this.checkScroll());
|
|
43
47
|
}
|
|
44
|
-
get
|
|
48
|
+
get panelClasses() {
|
|
45
49
|
return {
|
|
46
|
-
|
|
50
|
+
panel: !0,
|
|
51
|
+
"with-scroll": this.open && this.hasScroll,
|
|
47
52
|
[this.size]: !!this.size
|
|
48
53
|
};
|
|
49
54
|
}
|
|
50
55
|
dispatchCloseEvents(e) {
|
|
51
|
-
const
|
|
56
|
+
const t = `ds-dialog:close-${e}`;
|
|
52
57
|
this.dispatchEvent(
|
|
53
|
-
new Event(
|
|
58
|
+
new Event(t, {
|
|
54
59
|
bubbles: !0,
|
|
55
60
|
composed: !0
|
|
56
61
|
})
|
|
@@ -65,77 +70,73 @@ let t = class extends v {
|
|
|
65
70
|
this.lockClose || (this.open = !1, this.dispatchCloseEvents(e));
|
|
66
71
|
}
|
|
67
72
|
connectedCallback() {
|
|
68
|
-
super.connectedCallback(),
|
|
73
|
+
super.connectedCallback(), this.resizeObserver = new ResizeObserver(this.debouncedCheckScroll), this.handleResizeObserver(), this.addEventListener("click", this.handleHostClick);
|
|
69
74
|
}
|
|
70
75
|
disconnectedCallback() {
|
|
71
76
|
var e;
|
|
72
|
-
super.disconnectedCallback(),
|
|
77
|
+
super.disconnectedCallback(), (e = this.resizeObserver) == null || e.disconnect(), this.removeEventListener("click", this.handleHostClick);
|
|
73
78
|
}
|
|
74
79
|
checkScroll() {
|
|
75
|
-
var e,
|
|
76
|
-
this.hasScroll = ((e = this.content) == null ? void 0 : e.scrollHeight) > ((
|
|
80
|
+
var e, t;
|
|
81
|
+
this.hasScroll = ((e = this.content) == null ? void 0 : e.scrollHeight) > ((t = this.content) == null ? void 0 : t.clientHeight);
|
|
77
82
|
}
|
|
78
83
|
render() {
|
|
79
|
-
return !this.hasBeenOpened && !this.open ?
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
?
|
|
90
|
-
data-testid="ds-dialog-container"
|
|
91
|
-
class=${u(this.dialogClasses)}
|
|
92
|
-
aria-modal="true"
|
|
93
|
-
aria-label=${this.dataAriaLabel || r}
|
|
94
|
-
aria-description=${this.dataAriaDescription || r}
|
|
95
|
-
>
|
|
96
|
-
${this.lockClose ? r : p`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
84
|
+
return !this.hasBeenOpened && !this.open ? n : d`
|
|
85
|
+
<dialog
|
|
86
|
+
class="dialog"
|
|
87
|
+
data-testid="ds-dialog-container"
|
|
88
|
+
aria-label=${this.dataAriaLabel || n}
|
|
89
|
+
aria-description=${this.dataAriaDescription || n}
|
|
90
|
+
@cancel=${this.handleCancel}
|
|
91
|
+
@click=${this.handleDialogClick}
|
|
92
|
+
>
|
|
93
|
+
<div class=${C(this.panelClasses)}>
|
|
94
|
+
${this.lockClose ? n : d`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
|
|
97
95
|
<div class="content-container">
|
|
98
96
|
<div tabindex="0" class="content ds-scroll">
|
|
99
97
|
<slot @slotchange=${this.handleResizeObserver}></slot>
|
|
100
98
|
</div>
|
|
101
99
|
<slot name="footer"></slot>
|
|
102
100
|
</div>
|
|
103
|
-
</
|
|
104
|
-
</
|
|
101
|
+
</div>
|
|
102
|
+
</dialog>
|
|
105
103
|
`;
|
|
106
104
|
}
|
|
107
105
|
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
],
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
],
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
],
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
],
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
],
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
],
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
],
|
|
136
|
-
|
|
106
|
+
s.styles = [g];
|
|
107
|
+
i([
|
|
108
|
+
a({ type: Boolean, converter: p, attribute: "lock-close" })
|
|
109
|
+
], s.prototype, "lockClose", 2);
|
|
110
|
+
i([
|
|
111
|
+
a({ type: Boolean, converter: p, attribute: "lock-scroll" })
|
|
112
|
+
], s.prototype, "lockScroll", 2);
|
|
113
|
+
i([
|
|
114
|
+
a({ type: Boolean, converter: p })
|
|
115
|
+
], s.prototype, "open", 2);
|
|
116
|
+
i([
|
|
117
|
+
a({ type: String })
|
|
118
|
+
], s.prototype, "size", 2);
|
|
119
|
+
i([
|
|
120
|
+
a({ type: String, attribute: "data-aria-label" })
|
|
121
|
+
], s.prototype, "dataAriaLabel", 2);
|
|
122
|
+
i([
|
|
123
|
+
a({ type: String, attribute: "data-aria-description" })
|
|
124
|
+
], s.prototype, "dataAriaDescription", 2);
|
|
125
|
+
i([
|
|
126
|
+
v()
|
|
127
|
+
], s.prototype, "hasBeenOpened", 2);
|
|
128
|
+
i([
|
|
129
|
+
v()
|
|
130
|
+
], s.prototype, "hasScroll", 2);
|
|
131
|
+
i([
|
|
132
|
+
u(".content")
|
|
133
|
+
], s.prototype, "content", 2);
|
|
134
|
+
i([
|
|
135
|
+
u("dialog")
|
|
136
|
+
], s.prototype, "nativeDialog", 2);
|
|
137
|
+
s = i([
|
|
137
138
|
b("ds-dialog")
|
|
138
|
-
],
|
|
139
|
+
], s);
|
|
139
140
|
export {
|
|
140
|
-
|
|
141
|
+
s as DsDialog
|
|
141
142
|
};
|
|
@@ -2,37 +2,27 @@ import { cssQueries as l } from "../../../utils/cssQueries.js";
|
|
|
2
2
|
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
3
3
|
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
4
4
|
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
5
|
-
import { css as
|
|
6
|
-
const
|
|
5
|
+
import { css as o } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
6
|
+
const a = o`
|
|
7
7
|
:host {
|
|
8
|
-
|
|
8
|
+
display: contents;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
position: fixed;
|
|
18
|
-
top: 0;
|
|
19
|
-
left: 0;
|
|
11
|
+
.dialog[open] {
|
|
12
|
+
max-width: none;
|
|
13
|
+
max-height: none;
|
|
14
|
+
border: none;
|
|
15
|
+
background: transparent;
|
|
16
|
+
overflow: visible;
|
|
20
17
|
width: 100dvw;
|
|
21
18
|
height: 100dvh;
|
|
19
|
+
box-sizing: border-box;
|
|
22
20
|
display: flex;
|
|
23
21
|
justify-content: center;
|
|
24
22
|
align-items: center;
|
|
25
|
-
z-index: var(--ds-z-index-modal);
|
|
26
|
-
transition:
|
|
27
|
-
opacity 0.3s cubic-bezier(0, 0, 0.2, 1),
|
|
28
|
-
display 0.3s cubic-bezier(0, 0, 0.2, 1) allow-discrete;
|
|
29
|
-
opacity: 1;
|
|
30
|
-
@starting-style {
|
|
31
|
-
opacity: 0;
|
|
32
|
-
}
|
|
33
23
|
}
|
|
34
24
|
|
|
35
|
-
.
|
|
25
|
+
.panel {
|
|
36
26
|
padding: 0;
|
|
37
27
|
position: relative;
|
|
38
28
|
}
|
|
@@ -76,5 +66,5 @@ const c = i`
|
|
|
76
66
|
}
|
|
77
67
|
`;
|
|
78
68
|
export {
|
|
79
|
-
|
|
69
|
+
a as commonStyles
|
|
80
70
|
};
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.88", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
|
|
58
58
|
if (document.head.querySelector(`link[href="${r}"]`)) t();
|
|
59
59
|
else {
|
|
60
60
|
const e = `ui-kit-theme-${s}`, a = document.getElementById(e), n = document.createElement("link");
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.88"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.88"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -7,7 +7,7 @@ class s {
|
|
|
7
7
|
theme: t
|
|
8
8
|
}) => {
|
|
9
9
|
if (!t || !e) return;
|
|
10
|
-
const c = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
10
|
+
const c = `https://ds-assets.cupra.com/2.0.0-canary.88/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
|
|
11
11
|
if (r) return r;
|
|
12
12
|
const i = h(() => this.fetchStyle({ url: c })).then((n) => (n || this.stylePromises.delete(c), n));
|
|
13
13
|
return this.stylePromises.set(c, i), this.stylePromises.get(c);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-88"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-88"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -14,20 +14,23 @@ export declare class DsDialog extends UiKitElement {
|
|
|
14
14
|
hasBeenOpened: boolean;
|
|
15
15
|
hasScroll: boolean;
|
|
16
16
|
protected content: HTMLInputElement;
|
|
17
|
+
private nativeDialog;
|
|
17
18
|
private resizeObserver;
|
|
18
19
|
private debouncedCheckScroll;
|
|
19
20
|
updated(changedProperties: PropertyValues): Promise<void>;
|
|
21
|
+
private syncNativeDialogState;
|
|
22
|
+
private openNativeDialog;
|
|
23
|
+
private closeNativeDialog;
|
|
20
24
|
handleResizeObserver(): Promise<void>;
|
|
21
|
-
private get
|
|
22
|
-
private get dialogClasses();
|
|
25
|
+
private get panelClasses();
|
|
23
26
|
private dispatchCloseEvents;
|
|
24
27
|
private handleClose;
|
|
25
28
|
private handleCloseButtonClick;
|
|
26
|
-
private
|
|
29
|
+
private handleDialogClick;
|
|
30
|
+
private handleCancel;
|
|
27
31
|
connectedCallback(): void;
|
|
28
32
|
disconnectedCallback(): void;
|
|
29
33
|
private handleHostClick;
|
|
30
|
-
private handleKeyDown;
|
|
31
34
|
private checkScroll;
|
|
32
35
|
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
33
36
|
}
|