@mozaic-ds/web-components 0.28.1 → 0.29.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/package.json +1 -1
- package/public/adeo/components/autocomplete/Autocomplete.js +1 -1
- package/public/adeo/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/adeo/components/autocomplete/Autocomplete.svelte +41 -21
- package/public/adeo/components/modal/Modal.js +1 -1
- package/public/adeo/components/modal/Modal.js.map +1 -1
- package/public/adeo/components/modal/Modal.svelte +10 -7
- package/public/bricoman/components/autocomplete/Autocomplete.js +1 -1
- package/public/bricoman/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/bricoman/components/autocomplete/Autocomplete.svelte +41 -21
- package/public/bricoman/components/modal/Modal.js +1 -1
- package/public/bricoman/components/modal/Modal.js.map +1 -1
- package/public/bricoman/components/modal/Modal.svelte +10 -7
- package/public/components/autocomplete/Autocomplete.js +1 -1
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.svelte +41 -21
- package/public/components/modal/Modal.js +1 -1
- package/public/components/modal/Modal.js.map +1 -1
- package/public/components/modal/Modal.svelte +10 -7
|
@@ -226,21 +226,22 @@
|
|
|
226
226
|
<div class="mc-autocomplete__main">
|
|
227
227
|
<!-- TAG REMOVABLE -->
|
|
228
228
|
{#if multiple && listboxValue.length > 0 && !alltags}
|
|
229
|
-
<
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
229
|
+
<div class="mc-autocomplete__tag">
|
|
230
|
+
<Tag
|
|
231
|
+
id={tagid ? tagid : `autocompleteTag-${uuid}`}
|
|
232
|
+
label={setTagLabel()}
|
|
233
|
+
size="s"
|
|
234
|
+
type="removable"
|
|
235
|
+
dark={false}
|
|
236
|
+
disabled={false}
|
|
237
|
+
href=""
|
|
238
|
+
name=""
|
|
239
|
+
value=""
|
|
240
|
+
selected={false}
|
|
241
|
+
bind:this={tag}
|
|
242
|
+
on:tag-removed={clearListbox}
|
|
243
|
+
/>
|
|
244
|
+
</div>
|
|
244
245
|
{/if}
|
|
245
246
|
|
|
246
247
|
<!-- TEXT INPUT -->
|
|
@@ -325,19 +326,31 @@
|
|
|
325
326
|
{#if index < maxnumbertoshowtags}
|
|
326
327
|
<div class="tag-selected">
|
|
327
328
|
{#if disabled}
|
|
328
|
-
<
|
|
329
|
-
|
|
330
|
-
id={selectedItem.id}
|
|
329
|
+
<Tag
|
|
330
|
+
id={selectedItem.id || ''}
|
|
331
331
|
label={selectedItem.label}
|
|
332
332
|
size="s"
|
|
333
|
+
type="link"
|
|
333
334
|
dark={true}
|
|
335
|
+
disabled={false}
|
|
336
|
+
href=""
|
|
337
|
+
name=""
|
|
338
|
+
value=""
|
|
339
|
+
selected={false}
|
|
334
340
|
/>
|
|
335
341
|
{:else}
|
|
336
|
-
<
|
|
337
|
-
id={selectedItem.id}
|
|
342
|
+
<Tag
|
|
343
|
+
id={selectedItem.id || ''}
|
|
338
344
|
label={selectedItem.label}
|
|
339
345
|
size="s"
|
|
340
346
|
type="removable"
|
|
347
|
+
dark={false}
|
|
348
|
+
disabled={false}
|
|
349
|
+
href=""
|
|
350
|
+
name=""
|
|
351
|
+
value=""
|
|
352
|
+
selected={false}
|
|
353
|
+
bind:this={tag}
|
|
341
354
|
on:tag-removed={() => removeTagSelected(selectedItem.id)}
|
|
342
355
|
/>
|
|
343
356
|
{/if}
|
|
@@ -347,11 +360,17 @@
|
|
|
347
360
|
{#if listboxValue.length > maxnumbertoshowtags}
|
|
348
361
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
349
362
|
<div class="tag-selected" on:click={() => openLayerFn()}>
|
|
350
|
-
<
|
|
363
|
+
<Tag
|
|
351
364
|
id="id-tag"
|
|
352
365
|
label="({listboxValue.length}) {showmoretagslabel} "
|
|
353
366
|
size="s"
|
|
354
367
|
type="link"
|
|
368
|
+
dark={false}
|
|
369
|
+
disabled={false}
|
|
370
|
+
href=""
|
|
371
|
+
name=""
|
|
372
|
+
value=""
|
|
373
|
+
selected={false}
|
|
355
374
|
/>
|
|
356
375
|
</div>
|
|
357
376
|
{/if}
|
|
@@ -425,6 +444,7 @@
|
|
|
425
444
|
// Selected Tags
|
|
426
445
|
.tags-selected {
|
|
427
446
|
display: flex;
|
|
447
|
+
position: absolute;
|
|
428
448
|
flex-wrap: wrap;
|
|
429
449
|
}
|
|
430
450
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as e,i as t,a as i,b as o,f as a,s,c as n,e as l,v as r,d,n as m,h as c,j as b,k as h,x as p,y as f,l as x,m as g,o as w,q as _,r as u,a9 as y,u as v,K as k}from"../../index-c222d0b7.js";import{E as $}from"../../EventHandler-f7ee47ca.js";function z(e){let t,i;return{c(){t=l("h3"),i=r(e[1]),c(t,"class","mc-modal__heading"),c(t,"id","layerTitle")},m(e,a){o(e,t,a),h(t,i)},p(e,t){2&t&&f(i,e[1])},d(e){e&&g(t)}}}function E(e){let t;return{c(){t=l("footer"),t.innerHTML='<slot name="footer"></slot>',c(t,"class","mc-modal__footer")},m(e,i){o(e,t,i)},d(e){e&&g(t)}}}function j(e){let t,i,a,s,w,_,u,y,v,k,$,j,C,Y,T,q,H,L,S,M,R,A,B,K,O=e[1]&&z(e),D=!e[6]&&E(),F=[{class:L="mc-modal "+(e[7]?" mc-modal--overflow":"")},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":"modalTitle"},{"aria-hidden":S=!e[0]},e[4]],G={};for(let e=0;e<F.length;e+=1)G=n(G,F[e]);return{c(){t=l("div"),i=l("div"),a=l("div"),s=l("header"),w=l("h2"),_=r(e[2]),u=d(),y=l("button"),v=l("span"),k=r(e[3]),$=d(),j=l("main"),C=l("article"),O&&O.c(),Y=d(),T=l("slot"),q=d(),D&&D.c(),M=d(),R=l("div"),this.c=m,c(w,"class","mc-modal__title"),c(w,"id","modalTitle"),c(v,"class","mc-modal__close-text"),c(y,"class","mc-modal__close"),c(y,"type","button"),c(s,"class","mc-modal__header"),c(T,"name","content"),c(C,"class","mc-modal__content"),c(j,"class","mc-modal__body"),c(a,"class",H="mc-modal__dialog "+(e[0]?" is-open":"")),c(a,"role","document"),b(i,G),c(R,"class",A="mc-modal-overlay "+(e[0]?" is-visible":"")),c(R,"tabindex","-1"),c(R,"role","dialog")},m(n,l){o(n,t,l),h(t,i),h(i,a),h(a,s),h(s,w),h(w,_),h(s,u),h(s,y),h(y,v),h(v,k),h(a,$),h(a,j),h(j,C),O&&O.m(C,null),h(C,Y),h(C,T),h(a,q),D&&D.m(a,null),h(t,M),h(t,R),e[11](t),B||(K=p(y,"click",e[10]),B=!0)},p(e,[t]){4&t&&f(_,e[2]),8&t&&f(k,e[3]),e[1]?O?O.p(e,t):(O=z(e),O.c(),O.m(C,Y)):O&&(O.d(1),O=null),e[6]?D&&(D.d(1),D=null):D||(D=E(),D.c(),D.m(a,null)),1&t&&H!==(H="mc-modal__dialog "+(e[0]?" is-open":""))&&c(a,"class",H),b(i,G=x(F,[{class:L},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":"modalTitle"},1&t&&S!==(S=!e[0])&&{"aria-hidden":S},16&t&&e[4]])),1&t&&A!==(A="mc-modal-overlay "+(e[0]?" is-visible":""))&&c(R,"class",A)},i:m,o:m,d(i){i&&g(t),O&&O.d(),D&&D.d(),e[11](null),B=!1,K()}}}function C(e,t,i){let o,a;const s=["title","modaltitle","isopen","closebuttontext","hidefooter"];let l,r=w(t,s),{title:d}=t,{modaltitle:m}=t,{isopen:c}=t,{closebuttontext:b="Close"}=t,{hidefooter:h}=t,p=new $(_(),u());function f(){i(0,c=!1)}y((()=>{const e=l.querySelector(".mc-modal"),t=l.querySelector(".mc-modal__body"),i=l.querySelector(".mc-modal__content"),o=t?t.clientHeight:0;(i?i.scrollHeight:0)>o&&e&&e.classList.add("mc-modal--overflow")}));return e.$$set=e=>{t=n(n({},t),v(e)),i(13,r=w(t,s)),"title"in e&&i(1,d=e.title),"modaltitle"in e&&i(2,m=e.modaltitle),"isopen"in e&&i(0,c=e.isopen),"closebuttontext"in e&&i(3,b=e.closebuttontext),"hidefooter"in e&&i(9,h=e.hidefooter)},e.$$.update=()=>{512&e.$$.dirty&&i(6,o=null!=h&&h),1&e.$$.dirty&&(c?p.dispatch("modal-opened",{}):p.dispatch("modal-closed",{})),i(4,a=Object.assign({},r)),16&e.$$.dirty&&delete a.class},[c,d,m,b,a,l,o,undefined,f,h,()=>f(),function(e){k[e?"unshift":"push"]((()=>{l=e,i(5,l)}))}]}class Y extends e{constructor(e){super();const n=document.createElement("style");n.textContent=".mc-modal{font-family:\"LeroyMerlin\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0;left:0;outline:0;pointer-events:none;position:fixed;right:0;top:0;z-index:var(--modal-z-index, 1999999999);-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;display:-webkit-box;display:-ms-flexbox;display:flex;height:100vh;height:-webkit-fill-available;height:-moz-available;height:stretch;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow-x:hidden;overflow-y:auto;padding:1rem 1.125rem;width:100vw}.mc-modal,.mc-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 680px){.mc-modal{-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0}}.mc-modal__dialog{background:#ffffff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;opacity:0;max-height:100%;position:relative;-webkit-transform:translateY(-25%);-ms-transform:translateY(-25%);transform:translateY(-25%);-webkit-transition:visibility 0s linear 0.4s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0.4s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0.4s, transform 0.4s ease, opacity 0.4s ease;transition:visibility 0s linear 0.4s, transform 0.4s ease, opacity 0.4s ease, -webkit-transform 0.4s ease;visibility:hidden;width:100%}@media screen and (min-width: 680px){.mc-modal__dialog{max-height:50%;max-width:38.5rem}}@media(min-width: 1024px) and (max-width: 1919px){.mc-modal__dialog{max-height:66.6666666667%}}@media screen and (min-width: 1024px){.mc-modal__dialog{max-width:48rem}}@media screen and (min-width: 1280px){.mc-modal__dialog{max-width:50rem}}@media screen and (min-width: 1920px){.mc-modal__dialog{max-width:56.5rem}}.mc-modal__dialog.is-open{opacity:1;pointer-events:all;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition:visibility 0s linear 0s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0s, transform 0.4s ease, opacity 0.4s ease;transition:visibility 0s linear 0s, transform 0.4s ease, opacity 0.4s ease, -webkit-transform 0.4s ease;visibility:visible}.mc-modal__form{display:contents}.mc-modal__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;gap:0.75rem;margin-bottom:1rem;min-height:3.75rem;padding:0.75rem 0.75rem 0.75rem 1rem;position:relative}.mc-modal__header::after{background:#b3b3b3;content:\"\";display:block;margin:0 auto;height:1px;width:100%;bottom:0;left:0;position:absolute}@media screen and (min-width: 680px){.mc-modal__header{padding-top:1rem;padding-right:1rem;padding-left:1.5rem}}.mc-modal__icon{fill:#666666;height:1.5rem;width:1.5rem}.mc-modal__title{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#666666;margin-bottom:0;margin-top:0}.mc-modal__close{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;position:relative;-ms-flex-item-align:start;align-self:flex-start;background:transparent url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23808080'%3E%3Cpath d='M17.41 16l8.8-8.79a1 1 0 10-1.42-1.42L16 14.59l-8.79-8.8a1 1 0 00-1.42 1.42l8.8 8.79-8.8 8.79a1 1 0 000 1.42 1 1 0 001.42 0l8.79-8.8 8.79 8.8a1 1 0 001.42 0 1 1 0 000-1.42z'/%3E%3C/svg%3E\") no-repeat;background-size:contain;cursor:pointer;height:2rem;-ms-flex-negative:0;flex-shrink:0;margin-left:auto;width:2rem}.mc-modal__close::after{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:\"\";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease}.mc-modal__close-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-modal__close:focus::after{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-modal__body{font-size:1rem;line-height:1.375;-webkit-box-flex:1;-ms-flex:1 1;flex:1 1;color:#191919;display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;padding-left:0.5rem;padding-right:0.5rem}@media screen and (min-width: 680px){.mc-modal__body{padding-left:0.75rem;padding-right:1rem}}.mc-modal__content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-height:100%;overflow-y:auto;overflow-x:hidden;scrollbar-color:#666666 #e6e6e6;scrollbar-width:thin;padding-left:0.5rem;padding-right:0.5rem}@media screen and (min-width: 680px){.mc-modal__content{padding-left:0.75rem;padding-right:0.75rem}}.mc-modal__content::-webkit-scrollbar{background-color:#e6e6e6;width:0.25rem}.mc-modal__content::-webkit-scrollbar-thumb{background:#666666}.mc-modal__heading{font-size:1.125rem;line-height:1.3333333333;font-weight:600;color:#000000;margin-bottom:0;margin-top:0}.mc-modal__inner{padding-top:1.5rem;padding-bottom:3rem}.mc-modal__footer{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:1rem}@media screen and (min-width: 680px){.mc-modal__footer{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;padding:1.5rem}}.mc-modal__footer>:first-child:not(:only-child){margin-bottom:0.75rem}@media screen and (min-width: 680px){.mc-modal__footer>:first-child:not(:only-child){margin-bottom:0;margin-right:1rem}}.mc-modal-open{overflow:hidden}.mc-modal-overlay{background-color:rgba(25, 25, 25, 0.7);-webkit-filter:blur(1px);filter:blur(1px);inset:0;opacity:0;position:fixed;pointer-events:none;-webkit-transition:opacity 0.4s ease, visibility 0ms 0.4s;transition:opacity 0.4s ease, visibility 0ms 0.4s;z-index:1999999998}.mc-modal-overlay.is-visible{opacity:1;pointer-events:all;-webkit-transition:opacity 0.4s ease, visibility 0ms;transition:opacity 0.4s ease, visibility 0ms;visibility:visible}",this.shadowRoot.appendChild(n),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},C,j,s,{title:1,modaltitle:2,isopen:0,closebuttontext:3,hidefooter:9},null),e&&(e.target&&o(e.target,this,e.anchor),e.props&&(this.$set(e.props),a()))}static get observedAttributes(){return["title","modaltitle","isopen","closebuttontext","hidefooter"]}get title(){return this.$$.ctx[1]}set title(e){this.$$set({title:e}),a()}get modaltitle(){return this.$$.ctx[2]}set modaltitle(e){this.$$set({modaltitle:e}),a()}get isopen(){return this.$$.ctx[0]}set isopen(e){this.$$set({isopen:e}),a()}get closebuttontext(){return this.$$.ctx[3]}set closebuttontext(e){this.$$set({closebuttontext:e}),a()}get hidefooter(){return this.$$.ctx[9]}set hidefooter(e){this.$$set({hidefooter:e}),a()}}export{Y as default};
|
|
1
|
+
import{S as e,i as t,a as i,b as o,f as a,s,c as l,e as n,v as r,d,n as m,h as c,j as b,k as h,y as p,l as f,m as x,o as g,q as w,r as u,a9 as _,u as y,x as v,K as k}from"../../index-c222d0b7.js";import{E as $}from"../../EventHandler-f7ee47ca.js";function z(e){let t,i,a,s,l;return{c(){t=n("button"),i=n("span"),a=r(e[4]),c(i,"class","mc-modal__close-text"),c(t,"class","mc-modal__close"),c(t,"type","button")},m(n,r){o(n,t,r),h(t,i),h(i,a),s||(l=v(t,"click",e[11]),s=!0)},p(e,t){16&t&&p(a,e[4])},d(e){e&&x(t),s=!1,l()}}}function E(e){let t,i;return{c(){t=n("h3"),i=r(e[1]),c(t,"class","mc-modal__heading"),c(t,"id","layerTitle")},m(e,a){o(e,t,a),h(t,i)},p(e,t){2&t&&p(i,e[1])},d(e){e&&x(t)}}}function j(e){let t;return{c(){t=n("footer"),t.innerHTML='<slot name="footer"></slot>',c(t,"class","mc-modal__footer")},m(e,i){o(e,t,i)},d(e){e&&x(t)}}}function C(e){let t,i,a,s,g,w,u,_,y,v,k,$,C,Y,T,q,H,L,S,M=e[3]&&z(e),R=e[1]&&E(e),A=!e[7]&&j(),B=[{class:T="mc-modal "+(e[8]?" mc-modal--overflow":"")},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":"modalTitle"},{"aria-hidden":q=!e[0]},e[5]],K={};for(let e=0;e<B.length;e+=1)K=l(K,B[e]);return{c(){t=n("div"),i=n("div"),a=n("div"),s=n("header"),g=n("h2"),w=r(e[2]),u=d(),M&&M.c(),_=d(),y=n("main"),v=n("article"),R&&R.c(),k=d(),$=n("slot"),C=d(),A&&A.c(),H=d(),L=n("div"),this.c=m,c(g,"class","mc-modal__title"),c(g,"id","modalTitle"),c(s,"class","mc-modal__header"),c($,"name","content"),c(v,"class","mc-modal__content"),c(y,"class","mc-modal__body"),c(a,"class",Y="mc-modal__dialog "+(e[0]?" is-open":"")),c(a,"role","document"),b(i,K),c(L,"class",S="mc-modal-overlay "+(e[0]?" is-visible":"")),c(L,"tabindex","-1"),c(L,"role","dialog")},m(l,n){o(l,t,n),h(t,i),h(i,a),h(a,s),h(s,g),h(g,w),h(s,u),M&&M.m(s,null),h(a,_),h(a,y),h(y,v),R&&R.m(v,null),h(v,k),h(v,$),h(a,C),A&&A.m(a,null),h(t,H),h(t,L),e[12](t)},p(e,[t]){4&t&&p(w,e[2]),e[3]?M?M.p(e,t):(M=z(e),M.c(),M.m(s,null)):M&&(M.d(1),M=null),e[1]?R?R.p(e,t):(R=E(e),R.c(),R.m(v,k)):R&&(R.d(1),R=null),e[7]?A&&(A.d(1),A=null):A||(A=j(),A.c(),A.m(a,null)),1&t&&Y!==(Y="mc-modal__dialog "+(e[0]?" is-open":""))&&c(a,"class",Y),b(i,K=f(B,[{class:T},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":"modalTitle"},1&t&&q!==(q=!e[0])&&{"aria-hidden":q},32&t&&e[5]])),1&t&&S!==(S="mc-modal-overlay "+(e[0]?" is-visible":""))&&c(L,"class",S)},i:m,o:m,d(i){i&&x(t),M&&M.d(),R&&R.d(),A&&A.d(),e[12](null)}}}function Y(e,t,i){let o,a;const s=["title","modaltitle","isopen","closable","closebuttontext","hidefooter"];let n,r=g(t,s),{title:d}=t,{modaltitle:m}=t,{isopen:c}=t,{closable:b=!0}=t,{closebuttontext:h="Close"}=t,{hidefooter:p}=t,f=new $(w(),u());function x(){i(0,c=!1)}_((()=>{const e=n.querySelector(".mc-modal"),t=n.querySelector(".mc-modal__body"),i=n.querySelector(".mc-modal__content"),o=t?t.clientHeight:0;(i?i.scrollHeight:0)>o&&e&&e.classList.add("mc-modal--overflow")}));return e.$$set=e=>{t=l(l({},t),y(e)),i(14,r=g(t,s)),"title"in e&&i(1,d=e.title),"modaltitle"in e&&i(2,m=e.modaltitle),"isopen"in e&&i(0,c=e.isopen),"closable"in e&&i(3,b=e.closable),"closebuttontext"in e&&i(4,h=e.closebuttontext),"hidefooter"in e&&i(10,p=e.hidefooter)},e.$$.update=()=>{1024&e.$$.dirty&&i(7,o=null!=p&&p),1&e.$$.dirty&&(c?f.dispatch("modal-opened",{}):f.dispatch("modal-closed",{})),i(5,a=Object.assign({},r)),32&e.$$.dirty&&delete a.class},[c,d,m,b,h,a,n,o,undefined,x,p,()=>x(),function(e){k[e?"unshift":"push"]((()=>{n=e,i(6,n)}))}]}class T extends e{constructor(e){super();const l=document.createElement("style");l.textContent=".mc-modal{font-family:\"LeroyMerlin\", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0;left:0;outline:0;pointer-events:none;position:fixed;right:0;top:0;z-index:var(--modal-z-index, 1999999999);-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;display:-webkit-box;display:-ms-flexbox;display:flex;height:100vh;height:-webkit-fill-available;height:-moz-available;height:stretch;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow-x:hidden;overflow-y:auto;padding:1rem 1.125rem;width:100vw}.mc-modal,.mc-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (min-width: 680px){.mc-modal{-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0}}.mc-modal__dialog{background:#ffffff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;opacity:0;max-height:100%;position:relative;-webkit-transform:translateY(-25%);-ms-transform:translateY(-25%);transform:translateY(-25%);-webkit-transition:visibility 0s linear 0.4s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0.4s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0.4s, transform 0.4s ease, opacity 0.4s ease;transition:visibility 0s linear 0.4s, transform 0.4s ease, opacity 0.4s ease, -webkit-transform 0.4s ease;visibility:hidden;width:100%}@media screen and (min-width: 680px){.mc-modal__dialog{max-height:50%;max-width:38.5rem}}@media(min-width: 1024px) and (max-width: 1919px){.mc-modal__dialog{max-height:66.6666666667%}}@media screen and (min-width: 1024px){.mc-modal__dialog{max-width:48rem}}@media screen and (min-width: 1280px){.mc-modal__dialog{max-width:50rem}}@media screen and (min-width: 1920px){.mc-modal__dialog{max-width:56.5rem}}.mc-modal__dialog.is-open{opacity:1;pointer-events:all;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition:visibility 0s linear 0s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0s, opacity 0.4s ease, -webkit-transform 0.4s ease;transition:visibility 0s linear 0s, transform 0.4s ease, opacity 0.4s ease;transition:visibility 0s linear 0s, transform 0.4s ease, opacity 0.4s ease, -webkit-transform 0.4s ease;visibility:visible}.mc-modal__form{display:contents}.mc-modal__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;gap:0.75rem;margin-bottom:1rem;min-height:3.75rem;padding:0.75rem 0.75rem 0.75rem 1rem;position:relative}.mc-modal__header::after{background:#b3b3b3;content:\"\";display:block;margin:0 auto;height:1px;width:100%;bottom:0;left:0;position:absolute}@media screen and (min-width: 680px){.mc-modal__header{padding-top:1rem;padding-right:1rem;padding-left:1.5rem}}.mc-modal__icon{fill:#666666;height:1.5rem;width:1.5rem}.mc-modal__title{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#666666;margin-bottom:0;margin-top:0}.mc-modal__close{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;position:relative;-ms-flex-item-align:start;align-self:flex-start;background:transparent url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='2rem' width='2rem' viewBox='0 0 32 32' fill='%23808080'%3E%3Cpath d='M17.41 16l8.8-8.79a1 1 0 10-1.42-1.42L16 14.59l-8.79-8.8a1 1 0 00-1.42 1.42l8.8 8.79-8.8 8.79a1 1 0 000 1.42 1 1 0 001.42 0l8.79-8.8 8.79 8.8a1 1 0 001.42 0 1 1 0 000-1.42z'/%3E%3C/svg%3E\") no-repeat;background-size:contain;cursor:pointer;height:2rem;-ms-flex-negative:0;flex-shrink:0;margin-left:auto;width:2rem}.mc-modal__close::after{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:\"\";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease}.mc-modal__close-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-modal__close:focus::after{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}.mc-modal__body{font-size:1rem;line-height:1.375;-webkit-box-flex:1;-ms-flex:1 1;flex:1 1;color:#191919;display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;padding-left:0.5rem;padding-right:0.5rem}@media screen and (min-width: 680px){.mc-modal__body{padding-left:0.75rem;padding-right:1rem}}.mc-modal__content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-height:100%;overflow-y:auto;overflow-x:hidden;scrollbar-color:#666666 #e6e6e6;scrollbar-width:thin;padding-left:0.5rem;padding-right:0.5rem}@media screen and (min-width: 680px){.mc-modal__content{padding-left:0.75rem;padding-right:0.75rem}}.mc-modal__content::-webkit-scrollbar{background-color:#e6e6e6;width:0.25rem}.mc-modal__content::-webkit-scrollbar-thumb{background:#666666}.mc-modal__heading{font-size:1.125rem;line-height:1.3333333333;font-weight:600;color:#000000;margin-bottom:0;margin-top:0}.mc-modal__inner{padding-top:1.5rem;padding-bottom:3rem}.mc-modal__footer{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:1rem}@media screen and (min-width: 680px){.mc-modal__footer{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;padding:1.5rem}}.mc-modal__footer>:first-child:not(:only-child){margin-bottom:0.75rem}@media screen and (min-width: 680px){.mc-modal__footer>:first-child:not(:only-child){margin-bottom:0;margin-right:1rem}}.mc-modal-open{overflow:hidden}.mc-modal-overlay{background-color:rgba(25, 25, 25, 0.7);-webkit-filter:blur(1px);filter:blur(1px);inset:0;opacity:0;position:fixed;pointer-events:none;-webkit-transition:opacity 0.4s ease, visibility 0ms 0.4s;transition:opacity 0.4s ease, visibility 0ms 0.4s;z-index:1999999998}.mc-modal-overlay.is-visible{opacity:1;pointer-events:all;-webkit-transition:opacity 0.4s ease, visibility 0ms;transition:opacity 0.4s ease, visibility 0ms;visibility:visible}",this.shadowRoot.appendChild(l),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},Y,C,s,{title:1,modaltitle:2,isopen:0,closable:3,closebuttontext:4,hidefooter:10},null),e&&(e.target&&o(e.target,this,e.anchor),e.props&&(this.$set(e.props),a()))}static get observedAttributes(){return["title","modaltitle","isopen","closable","closebuttontext","hidefooter"]}get title(){return this.$$.ctx[1]}set title(e){this.$$set({title:e}),a()}get modaltitle(){return this.$$.ctx[2]}set modaltitle(e){this.$$set({modaltitle:e}),a()}get isopen(){return this.$$.ctx[0]}set isopen(e){this.$$set({isopen:e}),a()}get closable(){return this.$$.ctx[3]}set closable(e){this.$$set({closable:e}),a()}get closebuttontext(){return this.$$.ctx[4]}set closebuttontext(e){this.$$set({closebuttontext:e}),a()}get hidefooter(){return this.$$.ctx[10]}set hidefooter(e){this.$$set({hidefooter:e}),a()}}export{T as default};
|
|
2
2
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import {\n afterUpdate,\n get_current_component,\n createEventDispatcher,\n } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n export let title: string;\n export let modaltitle: string;\n export let isopen: boolean;\n export let closebuttontext = 'Close';\n export let hidefooter: boolean;\n\n $: hideFooter = hidefooter ?? false;\n\n $: isopen\n ? eventHandler.dispatch('modal-opened', {})\n : eventHandler.dispatch('modal-closed', {});\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n let scrollable: boolean;\n\n let root: HTMLElement;\n let eventHandler = new EventHandler(\n get_current_component(),\n createEventDispatcher(),\n );\n\n afterUpdate(() => {\n const modal = root.querySelector('.mc-modal');\n const body = root.querySelector('.mc-modal__body');\n const content = root.querySelector('.mc-modal__content');\n\n const bodyHeight = body ? body.clientHeight : 0;\n const contentHeight = content ? content.scrollHeight : 0;\n\n if (contentHeight > bodyHeight && modal) {\n modal.classList.add('mc-modal--overflow');\n }\n });\n\n function onClose(): void {\n isopen = false;\n }\n</script>\n\n<div bind:this={root}>\n <div\n class=\"mc-modal {scrollable ? ' mc-modal--overflow' : ''}\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"modalTitle\"\n aria-hidden={!isopen}\n {...attributes}\n >\n <div class=\"mc-modal__dialog {isopen ? ' is-open' : ''}\" role=\"document\">\n <header class=\"mc-modal__header\">\n <h2 class=\"mc-modal__title\" id=\"modalTitle\">{modaltitle}</h2>\n <button\n
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../src/components/modal/Modal.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import {\n afterUpdate,\n get_current_component,\n createEventDispatcher,\n } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n export let title: string;\n export let modaltitle: string;\n export let isopen: boolean;\n export let closable: boolean = true;\n export let closebuttontext = 'Close';\n export let hidefooter: boolean;\n\n $: hideFooter = hidefooter ?? false;\n\n $: isopen\n ? eventHandler.dispatch('modal-opened', {})\n : eventHandler.dispatch('modal-closed', {});\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n let scrollable: boolean;\n\n let root: HTMLElement;\n let eventHandler = new EventHandler(\n get_current_component(),\n createEventDispatcher(),\n );\n\n afterUpdate(() => {\n const modal = root.querySelector('.mc-modal');\n const body = root.querySelector('.mc-modal__body');\n const content = root.querySelector('.mc-modal__content');\n\n const bodyHeight = body ? body.clientHeight : 0;\n const contentHeight = content ? content.scrollHeight : 0;\n\n if (contentHeight > bodyHeight && modal) {\n modal.classList.add('mc-modal--overflow');\n }\n });\n\n function onClose(): void {\n isopen = false;\n }\n</script>\n\n<div bind:this={root}>\n <div\n class=\"mc-modal {scrollable ? ' mc-modal--overflow' : ''}\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"modalTitle\"\n aria-hidden={!isopen}\n {...attributes}\n >\n <div class=\"mc-modal__dialog {isopen ? ' is-open' : ''}\" role=\"document\">\n <header class=\"mc-modal__header\">\n <h2 class=\"mc-modal__title\" id=\"modalTitle\">{modaltitle}</h2>\n {#if closable}\n <button\n class=\"mc-modal__close\"\n type=\"button\"\n on:click={() => onClose()}\n >\n <span class=\"mc-modal__close-text\">{closebuttontext}</span>\n </button>\n {/if}\n </header>\n <main class=\"mc-modal__body\">\n <article class=\"mc-modal__content\">\n {#if title}\n <h3 class=\"mc-modal__heading\" id=\"layerTitle\">{title}</h3>\n {/if}\n <slot name=\"content\" />\n </article>\n </main>\n {#if !hideFooter}\n <footer class=\"mc-modal__footer\">\n <slot name=\"footer\" />\n </footer>\n {/if}\n </div>\n </div>\n <div\n class=\"mc-modal-overlay {isopen ? ' is-visible' : ''}\"\n tabindex=\"-1\"\n role=\"dialog\"\n />\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.modal';\n</style>\n"],"names":["ctx","insert","target","button","anchor","append","span","h3","footer","create_if_block_2","create_if_block_1","create_if_block","div3","div1","div0","header","h2","main","article","slot","div2","div1_aria_hidden_value","root","title","$$props","modaltitle","isopen","closable","closebuttontext","hidefooter","eventHandler","EventHandler","get_current_component","createEventDispatcher","onClose","$$invalidate","afterUpdate","modal","querySelector","body","content","bodyHeight","clientHeight","scrollHeight","classList","add","hideFooter","dispatch","attributes","Object","assign","$$restProps","class","scrollable","$$value"],"mappings":"4TAmEgDA,EAAe,oGALrDC,EAMQC,EAAAC,EAAAC,GADNC,EAA0DF,EAAAG,2DAAtBN,EAAe,4EAOJA,EAAK,oEAApDC,EAAyDC,EAAAK,EAAAH,2BAAVJ,EAAK,mJAMxDC,EAEQC,EAAAM,EAAAJ,6EArBHJ,EAAQ,IAAAS,EAAAT,KAYNA,EAAK,IAAAU,EAAAV,MAMRA,EAAU,IAAAW,6BA5BDX,EAAU,GAAG,sBAAwB,wFAIxCA,EAAM,IAChBA,EAAU,yHAImCA,EAAU,sUAF7BA,EAAM,GAAG,WAAa,sEA6B3BA,EAAM,GAAG,cAAgB,uDAtCtDC,EA0CKC,EAAAU,EAAAR,GAzCHC,EAmCKO,EAAAC,GA3BHR,EA0BKQ,EAAAC,GAzBHT,EAWQS,EAAAC,GAVNV,EAA4DU,EAAAC,uCAW9DX,EAOMS,EAAAG,GANJZ,EAKSY,EAAAC,yBADPb,EAAsBa,EAAAC,gCAU9Bd,EAICO,EAAAQ,+BA9BkDpB,EAAU,IAClDA,EAAQ,4DAYNA,EAAK,yDAMRA,EAAU,oFArBYA,EAAM,GAAG,WAAa,wHAHtCA,EAAM,KAAA,CAAA,cAAAqB,SAChBrB,EAAU,uCA+BWA,EAAM,GAAG,cAAgB,oMA9DhDsB,kBAhBOC,GAAaC,cACbC,GAAkBD,UAClBE,GAAeF,GACfG,SAAAA,GAAoB,GAAIH,GACxBI,gBAAAA,EAAkB,SAAOJ,cACzBK,GAAmBL,EAY1BM,EAAmB,IAAAC,EACrBC,IACAC,cAgBOC,IACPC,EAAA,EAAAT,GAAS,GAdXU,GAAW,KACH,MAAAC,EAAQf,EAAKgB,cAAc,aAC3BC,EAAOjB,EAAKgB,cAAc,mBAC1BE,EAAUlB,EAAKgB,cAAc,sBAE7BG,EAAaF,EAAOA,EAAKG,aAAe,GACxBF,EAAUA,EAAQG,aAAe,GAEnCF,GAAcJ,GAChCA,EAAMO,UAAUC,IAAI,yUAxBvBV,EAAA,EAAEW,EAAajB,SAAAA,kBAEbH,EACCI,EAAaiB,SAAS,eAAc,IACpCjB,EAAaiB,SAAS,eAAc,CAAA,QACrCC,EAALC,OAAAC,UAAuBC,0BACXH,EAAWI,wBACjBC,kBA0CsBnB,4CAhBZZ,EAAIgC"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export let title: string;
|
|
11
11
|
export let modaltitle: string;
|
|
12
12
|
export let isopen: boolean;
|
|
13
|
+
export let closable: boolean = true;
|
|
13
14
|
export let closebuttontext = 'Close';
|
|
14
15
|
export let hidefooter: boolean;
|
|
15
16
|
|
|
@@ -58,13 +59,15 @@
|
|
|
58
59
|
<div class="mc-modal__dialog {isopen ? ' is-open' : ''}" role="document">
|
|
59
60
|
<header class="mc-modal__header">
|
|
60
61
|
<h2 class="mc-modal__title" id="modalTitle">{modaltitle}</h2>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
{#if closable}
|
|
63
|
+
<button
|
|
64
|
+
class="mc-modal__close"
|
|
65
|
+
type="button"
|
|
66
|
+
on:click={() => onClose()}
|
|
67
|
+
>
|
|
68
|
+
<span class="mc-modal__close-text">{closebuttontext}</span>
|
|
69
|
+
</button>
|
|
70
|
+
{/if}
|
|
68
71
|
</header>
|
|
69
72
|
<main class="mc-modal__body">
|
|
70
73
|
<article class="mc-modal__content">
|