@shrfe/assets 1.0.52 → 1.0.54
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/css/sfe-styles.css +2 -1
- package/js/shrfe-core-umd.js +6 -6
- package/package.json +1 -1
- package/wc-lib/{p-dc1d8c5d.entry.js → p-07bd9e98.entry.js} +1 -1
- package/wc-lib/{p-f6e8903e.entry.js → p-08c14f8b.entry.js} +1 -1
- package/wc-lib/{p-2cf0f722.entry.js → p-35af33a7.entry.js} +1 -1
- package/wc-lib/p-3b601f77.entry.js +1 -0
- package/wc-lib/{p-caf9b7b6.entry.js → p-48b3ca7b.entry.js} +3 -3
- package/wc-lib/{p-3e162ead.entry.js → p-563dbf1d.entry.js} +1 -1
- package/wc-lib/{p-8f3c12cc.entry.js → p-646cfe8c.entry.js} +1 -1
- package/wc-lib/{p-478dccb7.entry.js → p-78b989ac.entry.js} +1 -1
- package/wc-lib/{p-4479f3fa.js → p-78f4c800.js} +1 -1
- package/wc-lib/{p-b954e8ac.entry.js → p-7942b799.entry.js} +1 -1
- package/wc-lib/{p-2e3b332a.entry.js → p-80803b9d.entry.js} +1 -1
- package/wc-lib/{p-c1f1a36a.entry.js → p-f990ce59.entry.js} +1 -1
- package/wc-lib/wc-lib.esm.js +1 -1
- package/wc-lib/p-3e2e0a67.entry.js +0 -1
- /package/wc-lib/{p-DOY8Zr-F.js → p-Dcu5mHhz.js} +0 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,d as t,h as e,H as a}from"./p-sJYf_nlQ.js";import{u as i}from"./p-
|
|
1
|
+
import{r as s,d as t,h as e,H as a}from"./p-sJYf_nlQ.js";import{u as i}from"./p-Dcu5mHhz.js";const c=class{constructor(e){s(this,e),this.dismiss=t(this,"dismiss",7)}instanceId=void 0;dismissible=!1;testId="";dismiss;defaultId=i().generate();get computedComponentId(){return this.instanceId?this.instanceId:this.defaultId}dismissTag=()=>{this.dismissible&&this.dismiss.emit(this.instanceId)};render(){return e(a,{key:"20f77c31c4ecacee6df8a42e89e826c12c7b4a87"},e("span",{key:"e517f4700b3c3104127ff0351e40ced6027a41b2",id:`${this.computedComponentId}`,class:"sfe-tag "+(this.dismissible?"sfe-tag--dismissible":""),"data-testid":`swc-tag-${this.testId}`},e("div",{key:"f7461ca48b5dcb81e45699e2be18470067dce4c7",class:"label-text"},e("slot",{key:"07c3d5635ee90d3bda5cb77c27d3259bba09f6c0"})),this.dismissible&&e("span",{key:"b582894c8671b563de5826932b8e84a0499cfc8b",role:"button",tabindex:"0",class:"dismiss-icon",onClick:this.dismissTag},e("svg",{key:"06109ec62446ecd4c9b53fb62aa6b3522b4ae029",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"408942e777ba58ad46550d72bf079285cab57fda",d:"M2.08859 2.21569L2.14645 2.14645C2.32001 1.97288 2.58944 1.9536 2.78431 2.08859L2.85355 2.14645L6 5.293L9.14645 2.14645C9.34171 1.95118 9.65829 1.95118 9.85355 2.14645C10.0488 2.34171 10.0488 2.65829 9.85355 2.85355L6.707 6L9.85355 9.14645C10.0271 9.32001 10.0464 9.58944 9.91141 9.78431L9.85355 9.85355C9.67999 10.0271 9.41056 10.0464 9.21569 9.91141L9.14645 9.85355L6 6.707L2.85355 9.85355C2.65829 10.0488 2.34171 10.0488 2.14645 9.85355C1.95118 9.65829 1.95118 9.34171 2.14645 9.14645L5.293 6L2.14645 2.85355C1.97288 2.67999 1.9536 2.41056 2.08859 2.21569L2.14645 2.14645L2.08859 2.21569Z",fill:"black","fill-opacity":"0.9"})))))}};c.style='.sc-swc-tag-h .sfe-tag.sc-swc-tag{display:inline-flex;align-items:center;justify-content:center;position:relative;padding-inline:8px;padding-block:7px;flex-shrink:var(--sfe-sizing-gap-null);border-radius:var(--sfe-sizing-radius-small);background:var(--sfe-color-fill-neutral-light);color:var(--sfe-color-non-semantic-content-grey-strong, "Sora");font-family:var(--sfe-typography-font-sans-font, Matter);font-size:var(--sfe-typography-font-size-body-default);font-weight:400;line-height:var(--sfe-typography-line-height-body-small)}.sc-swc-tag-h .sfe-tag.sc-swc-tag .dismiss-icon.sc-swc-tag{display:flex;align-items:center;margin-left:var(--sfe-sizing-gap-small);cursor:pointer;margin-top:var(--sfe-sizing-gap-xsmall)}.sc-swc-tag-h .sfe-tag.sc-swc-tag:hover,.sc-swc-tag-h .sfe-tag.sc-swc-tag:focus{transition:opacity 0.7s;background:var(--sfe-color-fill-neutral-subtle)}';export{c as swc_tag}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,d as s,h as r,H as
|
|
1
|
+
import{r as e,d as s,h as r,H as l}from"./p-sJYf_nlQ.js";import{s as a}from"./p-DFCAnQFT.js";const i=class{constructor(r){e(this,r),this.uploadStart=s(this,"uploadStart",7),this.uploadRetry=s(this,"uploadRetry",7),this.uploadError=s(this,"uploadError",7),this.fileChange=s(this,"fileChange",7)}disabled=!1;extended=!0;thumbnail="file";inverted=!1;hasError=!1;progress=0;multiple=!1;type="draggable";maxFileSize=.5;accepts=[];testId="";uploadStart;uploadRetry;uploadError;fileChange;fileInputRef;files=[];selectedFileIndex=null;get fileDetails(){return this.files.map((e=>({name:e.name,size:(e.size/1024/1024).toFixed(2)})))}get formattedAcceptedFileTypes(){if(!Array.isArray(this.accepts)||0===this.accepts.length)return"";const e=this.accepts.map((e=>e.replace(".","").toUpperCase())),s=e.pop();return 1===this.accepts.length?`${s}.`:`${e.join(", ")} or ${s}.`}get maxFileSizeInfo(){return this.maxFileSize?`Max size of ${this.maxFileSize} MB`:""}resetInputValueToNull=e=>{e.target.value=""};replaceMultipleFile=e=>{const s=e.target,r=s.files?s.files[0]:null;r&&null!==this.selectedFileIndex&&(this.files=this.files.map(((e,s)=>this.selectedFileIndex==s?r:e)),this.selectedFileIndex=null),this.resetInputValueToNull(e),this.checkMaxFileSize()};onChange=e=>{this.uploadStart.emit();const s=this.fileInputRef?.files,r=s?Array.from(s):[];this.multiple&&null!==this.selectedFileIndex&&r.length>0&&this.replaceMultipleFile(e),!this.multiple&&r.length>1&&(this.uploadError.emit("Only one file can be uploaded when multiple is disabled."),a("error","Error","Only one file can be uploaded when multiple is disabled.")),this.files=this.multiple?[...this.files,...r]:r,this.checkMaxFileSize()};triggerFileInput=e=>{e.preventDefault(),this.fileInputRef.click()};dragOver=e=>{e.preventDefault();const s=e.currentTarget;s.classList.contains("sfe-light-blue")||this.disabled||s.classList.add("sfe-light-blue")};dragLeave=e=>{e.preventDefault(),e.currentTarget.classList.remove("sfe-light-blue")};drop=e=>{e.preventDefault(),!this.disabled&&e.dataTransfer&&(this.fileInputRef.files=e.dataTransfer.files,this.onChange(e),e.currentTarget.classList.remove("sfe-light-blue"))};checkMaxFileSize=()=>{if(this.maxFileSize>0){const e=new Set,s=[];this.files.forEach((r=>{r.size/1024/1024>this.maxFileSize?s.push(r):e.add(r)})),s.length>0&&(this.uploadError.emit(`Some files exceed the size limit of ${this.maxFileSize} MB.`),a("error","Error",`The following files exceed the size limit of ${this.maxFileSize} MB: ${s.map((e=>e.name)).join(", ")}`)),this.files=Array.from(e),this.fileChange.emit(this.files)}};removeFile=e=>{const s=e.detail;s>-1&&s<this.files.length&&(this.files=this.files.filter(((e,r)=>r!==s)),this.fileChange.emit(this.files))};handleFileReplace=e=>{const s=e.target;this.selectedFileIndex=e.detail,s.value="",this.triggerFileInput(e)};render(){return r(l,{key:"2594c1fe7c677f7ad125c33e4b024ba77fab07bf"},r("div",{key:"087890f0309fb0efe05766b0ed44a6008aec60ac",class:"d-block","data-testid":`swc-file-uploader-${this.testId}`},r("input",{key:"622be8b818cdb31998708ad9a8d04ade1df3cd79",ref:e=>this.fileInputRef=e,type:"file",multiple:this.multiple,disabled:this.disabled,accept:this.accepts.join(","),style:{display:"none"},onClick:this.resetInputValueToNull,onChange:this.onChange}),(!!this.multiple||0===this.fileDetails.length)&&r("div",{key:"df03d9e8630819dff3c388e6134fa56ea4e0eb15"},"basic"===this.type&&r("button",{key:"e649728d970084860e385aad22271ea70df9d5fc","aria-label":"choose file",disabled:this.disabled,class:{"basic-uploader":!0,"has-error":this.hasError},onClick:this.triggerFileInput},r("span",{key:"a96fd8a8dd2fac751b006114d060e6eff8b6ebc9",class:"chooser d-flex align-items-center"},"Choose file...")),"basic"!==this.type&&r("button",{key:"b31626cbbb4f0b905e86299ebde2e81336d80e16",class:{"drag-area":!0,disabled:this.disabled,"not-extended":!this.extended,"has-error":this.hasError},disabled:this.disabled,onDragOver:this.dragOver,onDragLeave:this.dragLeave,onDrop:this.drop,onClick:this.triggerFileInput},r("div",{key:"08d3c381b1153ca9cea6035681e886771b2fee02"},r("div",{key:"a08bba2608f337f0dc807bbbc441682b9a646a4d",class:"drag-label"},"Drag & Drop or ",r("span",{key:"01812a64e39c87f9b34eeb5679fe470644346521",class:"choose-file"},"Choose file")," to upload"),this.extended&&r("small",{key:"849dca989a0f7adbce7d48a3b32d4447ad03bf7c",class:"formats"},this.formattedAcceptedFileTypes," ",this.maxFileSizeInfo)))),!this.multiple&&this.fileDetails.length>0&&r("swc-single-file",{key:"91d91432ab15e066aa0e9fcfd361f6607621d9c8",inverted:this.inverted,hasError:this.hasError,fileInfo:this.files,extended:this.extended,thumbnail:this.thumbnail,progress:this.progress,onUpdateRemove:this.removeFile,onUpdateReplace:this.triggerFileInput,onUploadRetry:()=>this.uploadRetry.emit()}),this.multiple&&this.fileDetails.length>0&&r("swc-multiple-file",{key:"c19912eea9ee566a36d93b8546d2bf3b424eb41f",inverted:this.inverted,hasError:this.hasError,fileInfo:this.files,progress:this.progress,onUpdateRemove:this.removeFile,onUpdateReplace:this.handleFileReplace,onUploadRetry:()=>this.uploadRetry.emit()})))}};i.style=".sc-swc-file-uploader-h .drag-area.sc-swc-file-uploader{border-radius:var(--sfe-sizing-radius-default, 8px);border:1px dashed var(--sfe-color-border-neutral-subtle, #dee3e7);background-color:var(--sfe-color-fill-backround, #fafbff);color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-style:normal;font-weight:400;display:block;width:100%;height:122px;transition:border-color 0.3s ease}.sc-swc-file-uploader-h .drag-area.sc-swc-file-uploader:hover{border-color:var(--sfe-btn-color-border-solid-brand-hover, #206edd)}.sc-swc-file-uploader-h .drag-area.sc-swc-file-uploader:focus-visible{outline:2px solid var(--sfe-btn-color-border-solid-brand-hover, #206edd);outline-offset:1px}.sc-swc-file-uploader-h .drag-area.disabled.sc-swc-file-uploader{opacity:0.5;border:1px dashed var(--sfe-color-border-neutral-subtle, #dee3e7)}.sc-swc-file-uploader-h .drag-area.has-error.sc-swc-file-uploader{border-radius:var(--sfe-sizing-radius-default, 8px);border:1px dashed var(--sfe-color-border-critical-solid, #a22827) !important;background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-file-uploader-h .drag-area.has-error.sc-swc-file-uploader:focus-visible{outline:2px solid var(--sfe-color-non-semantic-content-blue-subtle, #1e50c0);outline-offset:1px}.sc-swc-file-uploader-h .drag-area.sc-swc-file-uploader div.drag-label.sc-swc-file-uploader{font-size:var(--sfe-typography-font-size-label-default, 0.875rem);line-height:16px;margin-top:16px}.sc-swc-file-uploader-h .drag-area.sc-swc-file-uploader div.drag-label.sc-swc-file-uploader span.choose-file.sc-swc-file-uploader{color:var(--sfe-color-text-default-brand, #004ca6)}.sc-swc-file-uploader-h .drag-area.sc-swc-file-uploader small.formats.sc-swc-file-uploader{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-size:var(--sfe-typography-font-size-label-small, 0.75rem);line-height:14px}.sc-swc-file-uploader-h .drag-area.not-extended.sc-swc-file-uploader{display:flex;align-items:center;justify-content:center;padding:8px 16px;height:36px}.sc-swc-file-uploader-h .drag-area.not-extended.sc-swc-file-uploader div.drag-label.sc-swc-file-uploader{margin-top:0;margin-left:8px;white-space:nowrap}.sc-swc-file-uploader-h .basic-uploader.sc-swc-file-uploader{width:fit-content;height:42px;border-radius:var(--sfe-sizing-radius-default, 8px);border:1px solid var(--sfe-color-border-neutral-subtle, #dee3e7);background:var(--sfe-color-fill-surface, #fff);box-shadow:0 1px 2px 0 rgba(27, 36, 44, 0.12);padding:8px var(--sfe-sizing-gap-large, 16px);transition:border-color 0.5s ease}.sc-swc-file-uploader-h .basic-uploader.sc-swc-file-uploader:focus-visible{outline:2px solid var(--sfe-btn-color-border-solid-brand-hover, #206edd);outline-offset:1px}.sc-swc-file-uploader-h .basic-uploader.sc-swc-file-uploader:hover{border-color:var(--sfe-btn-color-border-solid-brand-hover, #206edd)}.sc-swc-file-uploader-h .basic-uploader.has-error.sc-swc-file-uploader{border:1px solid var(--sfe-color-border-critical-solid, #a22827)}.sc-swc-file-uploader-h .basic-uploader.has-error.sc-swc-file-uploader:focus-visible{outline:2px solid var(--sfe-color-non-semantic-content-blue-subtle, #1e50c0);outline-offset:1px}.sc-swc-file-uploader-h .basic-uploader.sc-swc-file-uploader .chooser.sc-swc-file-uploader{font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-default, 0.875rem);font-style:normal;font-weight:450;line-height:24px;letter-spacing:0.28px;color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8))}.sc-swc-file-uploader-h .sfe-light-blue.sc-swc-file-uploader{border:2px solid var(--sfe-color-border-brand-solid, #0064db);background:var(--sfe-color-fill-neutral-lightest, #f5f7f9)}.sc-swc-file-uploader-h .d-block.sc-swc-file-uploader{display:block}.sc-swc-file-uploader-h .d-flex.sc-swc-file-uploader{display:flex}.sc-swc-file-uploader-h .align-items-center.sc-swc-file-uploader{align-items:center}.sc-swc-file-uploader-h .justify-content-end.sc-swc-file-uploader{justify-content:flex-end}.sc-swc-file-uploader-h .justify-content-between.sc-swc-file-uploader{justify-content:space-between}";export{i as swc_file_uploader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,d as s,h as i,H as l}from"./p-sJYf_nlQ.js";import{u as t}from"./p-DOY8Zr-F.js";const a=e=>e&&e.length>0?e.map(((e,s)=>{const i=e.name;return{id:s,name:i.substring(0,i.lastIndexOf("."))||i,size:`${(e.size/1024/1024).toFixed(2)} MB`}})):[],c=e=>0===Object.keys(e).length&&e.constructor===Object,n=class{constructor(i){e(this,i),this.updateRemove=s(this,"updateRemove",7),this.updateReplace=s(this,"updateReplace",7),this.uploadRetry=s(this,"uploadRetry",7)}fileInfo=[];inverted=!1;hasError=!1;progress=0;uniqueId=`multiple-file-${t().generate()}`;updateRemove;updateReplace;uploadRetry;get fileDetails(){return a(this.fileInfo)}handleUpdateReplace=(e,s)=>{e.preventDefault(),this.updateReplace.emit(s)};handleUpdateRemove=(e,s)=>{e.preventDefault(),this.updateRemove.emit(s)};handleUploadRetry=e=>{e.preventDefault(),this.uploadRetry.emit(null)};render(){return i(l,{key:"2ac121e3a8320c32e694a4e4a684e0527c9ef2db"},i("section",{key:"42e4a20a2b096218b8416e94b9f097ee16de88bd",class:{"multiple-file-choosen":!0,inverted:this.inverted,uploaded:100===this.progress,"has-error":this.hasError}},this.fileDetails.map(((e,s)=>i("div",{class:"multiple-file-choosen__wrapper",key:s},i("div",{class:"multiple-file-choosen__name"},e.name),i("div",{class:"multiple-file-choosen__size"},e.size),i("div",{class:"d-flex align-items-center justify-content-end"},i("swc-button",{size:"lg",intent:"brand",variant:"bare","aria-label":"replace",class:"mr-1",onClick:s=>this.handleUpdateReplace(s,e.id)},i("span",null,"Replace")),i("swc-icon-button",{intent:"neutral",variant:"bare",size:"lg","aria-label":"dismiss",onClick:s=>this.handleUpdateRemove(s,e.id)},i("swc-svg-icon",{name:"Dismiss",size:"16"})))))),this.progress>0&&100!==this.progress&&this.fileDetails.length>0&&!this.hasError&&i("swc-progress",{key:"3216027ca75a018466a9880f45522f24a08a0146",value:this.progress,max:100,class:"mt-2"}),!this.hasError&&this.fileDetails.length>0&&100===this.progress&&i("div",{key:"10e0c220f9d067b3a9fcb4465c774c5080cb6741",class:"d-flex align-items-center mt-2"},i("div",{key:"ae241bc2b77c88476fe00cb42bd2d969bcd074a8",class:"completed"},"Upload completed")),this.hasError&&i("div",{key:"f4145cd6d422f1aad9048c45d6446ab84a79b6df",class:"d-flex justify-content-between align-items-center mt-2"},i("div",{key:"12c0dea427fc9cf00fd181ff38d044f9c4ca9f73",class:"has-error"},i("swc-svg-icon",{key:"afff19f5d66979b48e136ea7b3e60f514f95215b",name:"Warning",size:"20",variant:"filled",color:"#bf3835",opacity:"1"})),i("swc-button",{key:"bfb59f691bb78aaf21d2c129e2bcff7b9dc5266b",size:"lg",intent:"neutral",variant:"bare","aria-label":"dismiss",class:"has-error",onClick:this.handleUploadRetry},i("span",{key:"6b6ef5ee8e0dfa93662b227773e1fc817e6b2fae"},"Retry")))))}};n.style=".sc-swc-multiple-file-h .me-2.sc-swc-multiple-file{margin-right:8px}.sc-swc-multiple-file-h .me-1.sc-swc-multiple-file{margin-right:4px}.sc-swc-multiple-file-h .mt-2.sc-swc-multiple-file{margin-top:8px}.sc-swc-multiple-file-h .d-flex.sc-swc-multiple-file{display:flex}.sc-swc-multiple-file-h .align-items-center.sc-swc-multiple-file{align-items:center}.sc-swc-multiple-file-h .justify-content-end.sc-swc-multiple-file{justify-content:flex-end}.sc-swc-multiple-file-h .justify-content-between.sc-swc-multiple-file{justify-content:space-between}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file{border-radius:var(--sfe-sizing-radius-default, 8px);background:var(--sfe-color-fill-neutral-lightest, #f5f7f9);padding:var(--sfe-sizing-gap-small, 8px) var(--sfe-sizing-gap-large, 16px) !important;margin-top:8px}.sc-swc-multiple-file-h .multiple-file-choosen.uploaded.sc-swc-multiple-file{background:var(--sfe-color-fill-brand-light, #e4edfc) !important}.sc-swc-multiple-file-h .multiple-file-choosen.inverted.sc-swc-multiple-file{border:1px solid var(--sfe-color-border-neutral-subtle, #dee3e7);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-multiple-file-h .multiple-file-choosen.has-error.sc-swc-multiple-file{background:var(--sfe-color-fill-critical-light, #f8e0e0)}.sc-swc-multiple-file-h .multiple-file-choosen.has-error.inverted.sc-swc-multiple-file{border:1px solid var(--sfe-color-border-critical-solid, #a22827);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-multiple-file-h .multiple-file-choosen__wrapper.sc-swc-multiple-file{display:grid;align-items:center;grid-template-columns:2fr 1fr 3fr;gap:22px}.sc-swc-multiple-file-h .multiple-file-choosen__name.sc-swc-multiple-file{color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:3rem}.sc-swc-multiple-file-h .multiple-file-choosen__size.sc-swc-multiple-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;white-space:nowrap}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file div.sc-swc-multiple-file div.completed.sc-swc-multiple-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-small, 0.75rem);font-style:normal;font-weight:400;line-height:14px}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file button.sc-swc-multiple-file span.sc-swc-multiple-file{color:var(--sfe-btn-color-content-bare-brand, #004ca6);font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-default, 0.875rem);font-style:normal;font-weight:400;line-height:16px}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file button.has-error.sc-swc-multiple-file span.sc-swc-multiple-file{color:var(--sfe-btn-color-content-bare-critical, #a22827)}";const f=class{constructor(i){e(this,i),this.updateRemove=s(this,"updateRemove",7),this.updateReplace=s(this,"updateReplace",7),this.uploadRetry=s(this,"uploadRetry",7)}fileInfo=[];extended=!1;thumbnail="file";inverted=!1;hasError=!1;progress=0;uniqueId=`single-file-${t().generate()}`;updateRemove;updateReplace;uploadRetry;get getFileExtension(){if(this.fileInfo.length>0){const e=this.fileInfo[0].name;return e.split(".").pop()?.toUpperCase()||""}return""}get fileExtensionColour(){return"var(--sfe-color-non-semantic-content-violet-subtle, #4E38BC)"}get fileFontSize(){return this.getFileExtension.length<=3?"13px":"10px"}get shouldShowFile(){return"file"===this.thumbnail||"photo"===this.thumbnail&&this.fileInfo.length>0&&!["PNG","JPEG","JPG"].includes(this.getFileExtension)}get createImageUrl(){return this.fileInfo.length>0?URL.createObjectURL(this.fileInfo[0]):""}get fileDetails(){return a(this.fileInfo)[0]}retryUpload=e=>{e.preventDefault(),this.uploadRetry.emit(null)};replaceFile=e=>{e.preventDefault(),this.updateReplace.emit(null)};removeFile=e=>{this.updateRemove.emit(e)};render(){return i(l,{key:"2fab112e5c844fa5f97055b99a0b361eb237dea1"},i("section",{key:"639d461a0e960a6aa07caa6c75fc121e974aa7b3",class:{"single-file-choosen":!0,inverted:this.inverted,uploaded:100===this.progress,"has-error":this.hasError,extended:this.extended}},!this.extended&&i("div",{key:"78f483485b126aba7c9a21eef0f9847886da8e33",class:"single-file-choosen__wrapper"},i("div",{key:"f47b8180558dd71e55526d80ec838b29d3c54ae3",class:"single-file-choosen__wrapper__name"},this.hasError&&i("swc-svg-icon",{key:"e0b2d269e2dd93bdc69bd60d1a40cbceeba15530",class:"me-2",name:"Warning",size:"20",variant:"filled",color:"#bf3835",opacity:"1"}),this.fileDetails.name),i("div",{key:"f14e897a0d73781f2cec35d330856b9ad7b41d53",class:"single-file-choosen__wrapper__size"},this.fileDetails.size),i("div",{key:"fe7ca3a0596fb70e2b176e37afca63a8266e754e"},this.progress>0&&100!==this.progress&&!c(this.fileDetails)&&!this.extended&&!this.hasError&&i("swc-progress",{key:"f44ed4a8b31ef8b0e9642b26c40f8da9e382130e",value:this.progress,max:100})),i("div",{key:"46a166784ebf4e862abb6c1ab0768d87d660c854",class:"d-flex align-items-center justify-content-end"},this.hasError&&!c(this.fileDetails)&&i("swc-button",{key:"2476338915301207f6a5beb8feda23c9e6239482",size:"lg",intent:"neutral",variant:"bare","aria-label":"dismiss",class:"has-error",onClick:this.retryUpload},i("span",{key:"f505613e2e793ab05ee4febff317a44dd0109747",class:"btn-span"},"Retry")),!this.hasError&&!c(this.fileDetails)&&(0===this.progress||100===this.progress)&&i("swc-button",{key:"2b999a7a2145ec98bd5831bede2b8ba44ac101c3",size:"lg",intent:"brand",variant:"bare","aria-label":"replace",class:"me-1",onClick:this.replaceFile},i("span",{key:"2fccac6c8969b39b81ab67d709202144189295aa",class:"btn-span"},"Replace")),i("swc-icon-button",{key:"d3073d0cd23f07dca6536f3f92d51d07f4fbf56e",intent:"neutral",variant:"bare",size:"lg","aria-label":"dismiss",onClick:()=>this.removeFile(this.fileDetails.id)},i("swc-svg-icon",{key:"f38f18b3cc67200a7827c3a7bb33aa3df1f29ba9",name:"Dismiss",size:"16"})))),this.extended&&i("div",{key:"43a8ee67f8ebff72f424f3d440c177d36ee31bcc",class:{"single-file-choosen__extended-wrapper":!0,"no-thumbnail":"none"===this.thumbnail}},"none"!==this.thumbnail&&i("div",{key:"f3f19be181db8ef6814b0730d6f40bcb64f06f91",class:"file__extension"},this.shouldShowFile&&i("div",{key:"4b6f20045850df9b52554096e09c0bcc0e3590ed"},i("svg",{key:"cf71598fbe08e2a3c4ecd1cb826f1283d6df702b",width:"32",height:"40",viewBox:"0 0 32 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"27d711f22f4ec2ac3a9540e74df1abcf4685de72",d:"M1 6C1 3.5 3.5 1 6 1H21.1071C21.9328 1 22.1149 1.10983 22.6954 1.70367C25.2864 4.35425 28.1524 7.58204 30.3895 9.88063C30.9814 10.4888 31 10.6512 31 11.5V33.5C31 36.5 29.5 39 26 39H6C2.5 39 1 36 1 33.5V6Z",fill:"white",stroke:this.fileExtensionColour,"stroke-width":"1.5"})),i("div",{key:"ee837e612c9f033fbcec55ee1ce0950dd3ffd2a8",class:"file-type",style:{color:this.fileExtensionColour,fontSize:this.fileFontSize}},this.getFileExtension)),"photo"===this.thumbnail&&["PNG","JPEG","JPG"].includes(this.getFileExtension)&&!c(this.fileDetails)&&i("div",{key:"32d1563799342b9f2aa8e3ebbac820ceb5f57bfa",class:"file-img"},i("img",{key:"0bc0df2523031afcfaeb54089c11ef08dd50454d",src:this.createImageUrl,alt:this.fileDetails.name}))),i("div",{key:"f279610d5ad3d4c22521a007a840e2506e3cb865",class:{file:!0,"ms-3":"none"!==this.thumbnail}},i("div",{key:"d221185222370b2d54633c065f01871af85c34ed",class:"file__identifier"},i("div",{key:"3d2ff31776de4987d4383bf90fc3c45a89918156",class:"file__identifier__name"},this.fileDetails.name),i("div",{key:"d200b7d35d69e6591f34eb112e308f582dc62973",class:"d-flex align-items-center justify-content-end"},this.hasError&&!c(this.fileDetails)&&i("swc-button",{key:"7be11951f87101f733d5b2f32df3fdcfdee175a0",size:"md",intent:"neutral",variant:"bare","aria-label":"dismiss",class:"has-error",onClick:this.retryUpload},i("span",{key:"b7115268487a3f188a57efeda21236a9954574c1",class:"btn-span"},"Retry")),!this.hasError&&!c(this.fileDetails)&&(0===this.progress||100===this.progress)&&i("swc-button",{key:"d2661388b5050bfdb6a721d92039d67df5159d1a",size:"md",intent:"brand",variant:"bare","aria-label":"replace",class:"me-1",onClick:this.replaceFile},i("span",{key:"8b757acd9f74c3bd294c572c8586b1d4ed92b8b7",class:"btn-span"},"Replace")),i("swc-icon-button",{key:"46274785adfdc8127a6b92ab97732703d439c276",intent:"neutral",variant:"bare",size:"md","aria-label":"dismiss",onClick:()=>this.removeFile(this.fileDetails.id)},i("swc-svg-icon",{key:"1c9bcf75c9fb977a2861d4380a18aa4ce04761ff",name:"Dismiss",size:"16"})))),i("div",{key:"4f07be25cb80a617290097df6848165315dcdaeb",class:"file__identifier__size mt-3 d-flex align-items-center"},this.hasError&&i("div",{key:"05897812cb36ad1ef2c3f9ec93499462347b5855"},i("swc-svg-icon",{key:"4f8468089465ff447a34d5c9c98d4c7549729141","v-if":"hasError",class:"me-2",name:"Warning",size:"20",variant:"filled",color:"#bf3835",opacity:"1"})),i("span",{key:"8b24ca1d228b070f1b9e4b9f2aa7e09e7e5ad379"},this.fileDetails.size)))),this.progress>0&&100!==this.progress&&this.extended&&!c(this.fileDetails)&&!this.hasError&&i("swc-progress",{key:"6fc1066072eed483fcfdd4316cee67e3dce75f95",value:this.progress,max:100})))}};f.style=".sc-swc-single-file-h .single-file-choosen.sc-swc-single-file{border-radius:var(--sfe-sizing-radius-default, 8px);background:var(--sfe-color-fill-neutral-lightest, #f5f7f9);padding:0 var(--sfe-sizing-gap-large, 16px)}.sc-swc-single-file-h .single-file-choosen.uploaded.sc-swc-single-file{background:var(--sfe-color-fill-brand-light, #e4edfc) !important}.sc-swc-single-file-h .single-file-choosen.inverted.sc-swc-single-file{border:1px solid var(--sfe-color-border-neutral-subtle, #dee3e7);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-single-file-h .single-file-choosen.has-error.sc-swc-single-file{background:var(--sfe-color-fill-critical-light, #f8e0e0)}.sc-swc-single-file-h .single-file-choosen.has-error.inverted.sc-swc-single-file{border:1px solid var(--sfe-color-border-critical-solid, #a22827);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-single-file-h .single-file-choosen.extended.sc-swc-single-file{padding:var(--sfe-sizing-gap-large, 16px) !important}.sc-swc-single-file-h .single-file-choosen.sc-swc-single-file .btn-span.sc-swc-single-file{color:var(--sfe-btn-color-content-bare-brand, #004ca6);font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-default, 0.875rem);font-style:normal;font-weight:400;line-height:16px}.sc-swc-single-file-h .single-file-choosen__wrapper.sc-swc-single-file{display:grid;align-items:center;grid-template-columns:2fr 1fr 3fr 1fr;gap:10px}.sc-swc-single-file-h .single-file-choosen__wrapper__name.sc-swc-single-file{color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:4.5rem}.sc-swc-single-file-h .single-file-choosen__wrapper__size.sc-swc-single-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;white-space:nowrap}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file{display:grid;align-items:center;grid-template-columns:1fr 24fr}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.no-thumbnail.sc-swc-single-file{grid-template-columns:1fr}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file{position:relative;width:32px;height:40px}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file .file-type.sc-swc-single-file{position:absolute;transform:translate(-50%, -50%);top:65%;left:50%}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file .file-img.sc-swc-single-file img.sc-swc-single-file{width:32px;height:32px;border-radius:4px}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file:empty{display:none}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__identifier.sc-swc-single-file{display:grid;grid-template-columns:3fr 1fr;align-items:center}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__identifier__name.sc-swc-single-file{color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;min-width:3.4rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__identifier__size.sc-swc-single-file span.sc-swc-single-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;white-space:nowrap}.sc-swc-single-file-h .single-file-choosen.sc-swc-single-file button.has-error.sc-swc-single-file span.sc-swc-single-file{color:var(--sfe-btn-color-content-bare-critical, #a22827)}.sc-swc-single-file-h .me-2.sc-swc-single-file{margin-right:8px}.sc-swc-single-file-h .me-1.sc-swc-single-file{margin-right:4px}.sc-swc-single-file-h .mt-2.sc-swc-single-file{margin-top:8px}.sc-swc-single-file-h .ms-3.sc-swc-single-file{margin-left:16px}.sc-swc-single-file-h .d-flex.sc-swc-single-file{display:flex}.sc-swc-single-file-h .align-items-center.sc-swc-single-file{align-items:center}.sc-swc-single-file-h .justify-content-end.sc-swc-single-file{justify-content:flex-end}.sc-swc-single-file-h .justify-content-between.sc-swc-single-file{justify-content:space-between}";export{n as swc_multiple_file,f as swc_single_file}
|
|
1
|
+
import{r as e,d as s,h as i,H as l}from"./p-sJYf_nlQ.js";import{u as t}from"./p-Dcu5mHhz.js";const c=e=>e&&e.length>0?e.map(((e,s)=>{const i=e.name;return{id:s,name:i.substring(0,i.lastIndexOf("."))||i,size:`${(e.size/1024/1024).toFixed(2)} MB`}})):[],a=e=>0===Object.keys(e).length&&e.constructor===Object,n=class{constructor(i){e(this,i),this.updateRemove=s(this,"updateRemove",7),this.updateReplace=s(this,"updateReplace",7),this.uploadRetry=s(this,"uploadRetry",7)}fileInfo=[];inverted=!1;hasError=!1;progress=0;uniqueId=`multiple-file-${t().generate()}`;updateRemove;updateReplace;uploadRetry;get fileDetails(){return c(this.fileInfo)}handleUpdateReplace=(e,s)=>{e.preventDefault(),this.updateReplace.emit(s)};handleUpdateRemove=(e,s)=>{e.preventDefault(),this.updateRemove.emit(s)};handleUploadRetry=e=>{e.preventDefault(),this.uploadRetry.emit(null)};render(){return i(l,{key:"2ac121e3a8320c32e694a4e4a684e0527c9ef2db"},i("section",{key:"42e4a20a2b096218b8416e94b9f097ee16de88bd",class:{"multiple-file-choosen":!0,inverted:this.inverted,uploaded:100===this.progress,"has-error":this.hasError}},this.fileDetails.map(((e,s)=>i("div",{class:"multiple-file-choosen__wrapper",key:s},i("div",{class:"multiple-file-choosen__name"},e.name),i("div",{class:"multiple-file-choosen__size"},e.size),i("div",{class:"d-flex align-items-center justify-content-end"},i("swc-button",{size:"lg",intent:"brand",variant:"bare","aria-label":"replace",class:"mr-1",onClick:s=>this.handleUpdateReplace(s,e.id)},i("span",null,"Replace")),i("swc-icon-button",{intent:"neutral",variant:"bare",size:"lg","aria-label":"dismiss",onClick:s=>this.handleUpdateRemove(s,e.id)},i("swc-svg-icon",{name:"Dismiss",size:"16"})))))),this.progress>0&&100!==this.progress&&this.fileDetails.length>0&&!this.hasError&&i("swc-progress",{key:"3216027ca75a018466a9880f45522f24a08a0146",value:this.progress,max:100,class:"mt-2"}),!this.hasError&&this.fileDetails.length>0&&100===this.progress&&i("div",{key:"10e0c220f9d067b3a9fcb4465c774c5080cb6741",class:"d-flex align-items-center mt-2"},i("div",{key:"ae241bc2b77c88476fe00cb42bd2d969bcd074a8",class:"completed"},"Upload completed")),this.hasError&&i("div",{key:"f4145cd6d422f1aad9048c45d6446ab84a79b6df",class:"d-flex justify-content-between align-items-center mt-2"},i("div",{key:"12c0dea427fc9cf00fd181ff38d044f9c4ca9f73",class:"has-error"},i("swc-svg-icon",{key:"afff19f5d66979b48e136ea7b3e60f514f95215b",name:"Warning",size:"20",variant:"filled",color:"#bf3835",opacity:"1"})),i("swc-button",{key:"bfb59f691bb78aaf21d2c129e2bcff7b9dc5266b",size:"lg",intent:"neutral",variant:"bare","aria-label":"dismiss",class:"has-error",onClick:this.handleUploadRetry},i("span",{key:"6b6ef5ee8e0dfa93662b227773e1fc817e6b2fae"},"Retry")))))}};n.style=".sc-swc-multiple-file-h .me-2.sc-swc-multiple-file{margin-right:8px}.sc-swc-multiple-file-h .me-1.sc-swc-multiple-file{margin-right:4px}.sc-swc-multiple-file-h .mt-2.sc-swc-multiple-file{margin-top:8px}.sc-swc-multiple-file-h .d-flex.sc-swc-multiple-file{display:flex}.sc-swc-multiple-file-h .align-items-center.sc-swc-multiple-file{align-items:center}.sc-swc-multiple-file-h .justify-content-end.sc-swc-multiple-file{justify-content:flex-end}.sc-swc-multiple-file-h .justify-content-between.sc-swc-multiple-file{justify-content:space-between}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file{border-radius:var(--sfe-sizing-radius-default, 8px);background:var(--sfe-color-fill-neutral-lightest, #f5f7f9);padding:var(--sfe-sizing-gap-small, 8px) var(--sfe-sizing-gap-large, 16px) !important;margin-top:8px}.sc-swc-multiple-file-h .multiple-file-choosen.uploaded.sc-swc-multiple-file{background:var(--sfe-color-fill-brand-light, #e4edfc) !important}.sc-swc-multiple-file-h .multiple-file-choosen.inverted.sc-swc-multiple-file{border:1px solid var(--sfe-color-border-neutral-subtle, #dee3e7);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-multiple-file-h .multiple-file-choosen.has-error.sc-swc-multiple-file{background:var(--sfe-color-fill-critical-light, #f8e0e0)}.sc-swc-multiple-file-h .multiple-file-choosen.has-error.inverted.sc-swc-multiple-file{border:1px solid var(--sfe-color-border-critical-solid, #a22827);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-multiple-file-h .multiple-file-choosen__wrapper.sc-swc-multiple-file{display:grid;align-items:center;grid-template-columns:2fr 1fr 3fr;gap:22px}.sc-swc-multiple-file-h .multiple-file-choosen__name.sc-swc-multiple-file{color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:3rem}.sc-swc-multiple-file-h .multiple-file-choosen__size.sc-swc-multiple-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;white-space:nowrap}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file div.sc-swc-multiple-file div.completed.sc-swc-multiple-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-small, 0.75rem);font-style:normal;font-weight:400;line-height:14px}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file button.sc-swc-multiple-file span.sc-swc-multiple-file{color:var(--sfe-btn-color-content-bare-brand, #004ca6);font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-default, 0.875rem);font-style:normal;font-weight:400;line-height:16px}.sc-swc-multiple-file-h .multiple-file-choosen.sc-swc-multiple-file button.has-error.sc-swc-multiple-file span.sc-swc-multiple-file{color:var(--sfe-btn-color-content-bare-critical, #a22827)}";const f=class{constructor(i){e(this,i),this.updateRemove=s(this,"updateRemove",7),this.updateReplace=s(this,"updateReplace",7),this.uploadRetry=s(this,"uploadRetry",7)}fileInfo=[];extended=!1;thumbnail="file";inverted=!1;hasError=!1;progress=0;uniqueId=`single-file-${t().generate()}`;updateRemove;updateReplace;uploadRetry;get getFileExtension(){if(this.fileInfo.length>0){const e=this.fileInfo[0].name;return e.split(".").pop()?.toUpperCase()||""}return""}get fileExtensionColour(){return"var(--sfe-color-non-semantic-content-violet-subtle, #4E38BC)"}get fileFontSize(){return this.getFileExtension.length<=3?"13px":"10px"}get shouldShowFile(){return"file"===this.thumbnail||"photo"===this.thumbnail&&this.fileInfo.length>0&&!["PNG","JPEG","JPG"].includes(this.getFileExtension)}get createImageUrl(){return this.fileInfo.length>0?URL.createObjectURL(this.fileInfo[0]):""}get fileDetails(){return c(this.fileInfo)[0]}retryUpload=e=>{e.preventDefault(),this.uploadRetry.emit(null)};replaceFile=e=>{e.preventDefault(),this.updateReplace.emit(null)};removeFile=e=>{this.updateRemove.emit(e)};render(){return i(l,{key:"2fab112e5c844fa5f97055b99a0b361eb237dea1"},i("section",{key:"639d461a0e960a6aa07caa6c75fc121e974aa7b3",class:{"single-file-choosen":!0,inverted:this.inverted,uploaded:100===this.progress,"has-error":this.hasError,extended:this.extended}},!this.extended&&i("div",{key:"78f483485b126aba7c9a21eef0f9847886da8e33",class:"single-file-choosen__wrapper"},i("div",{key:"f47b8180558dd71e55526d80ec838b29d3c54ae3",class:"single-file-choosen__wrapper__name"},this.hasError&&i("swc-svg-icon",{key:"e0b2d269e2dd93bdc69bd60d1a40cbceeba15530",class:"me-2",name:"Warning",size:"20",variant:"filled",color:"#bf3835",opacity:"1"}),this.fileDetails.name),i("div",{key:"f14e897a0d73781f2cec35d330856b9ad7b41d53",class:"single-file-choosen__wrapper__size"},this.fileDetails.size),i("div",{key:"fe7ca3a0596fb70e2b176e37afca63a8266e754e"},this.progress>0&&100!==this.progress&&!a(this.fileDetails)&&!this.extended&&!this.hasError&&i("swc-progress",{key:"f44ed4a8b31ef8b0e9642b26c40f8da9e382130e",value:this.progress,max:100})),i("div",{key:"46a166784ebf4e862abb6c1ab0768d87d660c854",class:"d-flex align-items-center justify-content-end"},this.hasError&&!a(this.fileDetails)&&i("swc-button",{key:"2476338915301207f6a5beb8feda23c9e6239482",size:"lg",intent:"neutral",variant:"bare","aria-label":"dismiss",class:"has-error",onClick:this.retryUpload},i("span",{key:"f505613e2e793ab05ee4febff317a44dd0109747",class:"btn-span"},"Retry")),!this.hasError&&!a(this.fileDetails)&&(0===this.progress||100===this.progress)&&i("swc-button",{key:"2b999a7a2145ec98bd5831bede2b8ba44ac101c3",size:"lg",intent:"brand",variant:"bare","aria-label":"replace",class:"me-1",onClick:this.replaceFile},i("span",{key:"2fccac6c8969b39b81ab67d709202144189295aa",class:"btn-span"},"Replace")),i("swc-icon-button",{key:"d3073d0cd23f07dca6536f3f92d51d07f4fbf56e",intent:"neutral",variant:"bare",size:"lg","aria-label":"dismiss",onClick:()=>this.removeFile(this.fileDetails.id)},i("swc-svg-icon",{key:"f38f18b3cc67200a7827c3a7bb33aa3df1f29ba9",name:"Dismiss",size:"16"})))),this.extended&&i("div",{key:"43a8ee67f8ebff72f424f3d440c177d36ee31bcc",class:{"single-file-choosen__extended-wrapper":!0,"no-thumbnail":"none"===this.thumbnail}},"none"!==this.thumbnail&&i("div",{key:"f3f19be181db8ef6814b0730d6f40bcb64f06f91",class:"file__extension"},this.shouldShowFile&&i("div",{key:"4b6f20045850df9b52554096e09c0bcc0e3590ed"},i("svg",{key:"cf71598fbe08e2a3c4ecd1cb826f1283d6df702b",width:"32",height:"40",viewBox:"0 0 32 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"27d711f22f4ec2ac3a9540e74df1abcf4685de72",d:"M1 6C1 3.5 3.5 1 6 1H21.1071C21.9328 1 22.1149 1.10983 22.6954 1.70367C25.2864 4.35425 28.1524 7.58204 30.3895 9.88063C30.9814 10.4888 31 10.6512 31 11.5V33.5C31 36.5 29.5 39 26 39H6C2.5 39 1 36 1 33.5V6Z",fill:"white",stroke:this.fileExtensionColour,"stroke-width":"1.5"})),i("div",{key:"ee837e612c9f033fbcec55ee1ce0950dd3ffd2a8",class:"file-type",style:{color:this.fileExtensionColour,fontSize:this.fileFontSize}},this.getFileExtension)),"photo"===this.thumbnail&&["PNG","JPEG","JPG"].includes(this.getFileExtension)&&!a(this.fileDetails)&&i("div",{key:"32d1563799342b9f2aa8e3ebbac820ceb5f57bfa",class:"file-img"},i("img",{key:"0bc0df2523031afcfaeb54089c11ef08dd50454d",src:this.createImageUrl,alt:this.fileDetails.name}))),i("div",{key:"f279610d5ad3d4c22521a007a840e2506e3cb865",class:{file:!0,"ms-3":"none"!==this.thumbnail}},i("div",{key:"d221185222370b2d54633c065f01871af85c34ed",class:"file__identifier"},i("div",{key:"3d2ff31776de4987d4383bf90fc3c45a89918156",class:"file__identifier__name"},this.fileDetails.name),i("div",{key:"d200b7d35d69e6591f34eb112e308f582dc62973",class:"d-flex align-items-center justify-content-end"},this.hasError&&!a(this.fileDetails)&&i("swc-button",{key:"7be11951f87101f733d5b2f32df3fdcfdee175a0",size:"md",intent:"neutral",variant:"bare","aria-label":"dismiss",class:"has-error",onClick:this.retryUpload},i("span",{key:"b7115268487a3f188a57efeda21236a9954574c1",class:"btn-span"},"Retry")),!this.hasError&&!a(this.fileDetails)&&(0===this.progress||100===this.progress)&&i("swc-button",{key:"d2661388b5050bfdb6a721d92039d67df5159d1a",size:"md",intent:"brand",variant:"bare","aria-label":"replace",class:"me-1",onClick:this.replaceFile},i("span",{key:"8b757acd9f74c3bd294c572c8586b1d4ed92b8b7",class:"btn-span"},"Replace")),i("swc-icon-button",{key:"46274785adfdc8127a6b92ab97732703d439c276",intent:"neutral",variant:"bare",size:"md","aria-label":"dismiss",onClick:()=>this.removeFile(this.fileDetails.id)},i("swc-svg-icon",{key:"1c9bcf75c9fb977a2861d4380a18aa4ce04761ff",name:"Dismiss",size:"16"})))),i("div",{key:"4f07be25cb80a617290097df6848165315dcdaeb",class:"file__identifier__size mt-3 d-flex align-items-center"},this.hasError&&i("div",{key:"05897812cb36ad1ef2c3f9ec93499462347b5855"},i("swc-svg-icon",{key:"4f8468089465ff447a34d5c9c98d4c7549729141","v-if":"hasError",class:"me-2",name:"Warning",size:"20",variant:"filled",color:"#bf3835",opacity:"1"})),i("span",{key:"8b24ca1d228b070f1b9e4b9f2aa7e09e7e5ad379"},this.fileDetails.size)))),this.progress>0&&100!==this.progress&&this.extended&&!a(this.fileDetails)&&!this.hasError&&i("swc-progress",{key:"6fc1066072eed483fcfdd4316cee67e3dce75f95",value:this.progress,max:100})))}};f.style=".sc-swc-single-file-h .single-file-choosen.sc-swc-single-file{border-radius:var(--sfe-sizing-radius-default, 8px);background:var(--sfe-color-fill-neutral-lightest, #f5f7f9);padding:0 var(--sfe-sizing-gap-large, 16px)}.sc-swc-single-file-h .single-file-choosen.uploaded.sc-swc-single-file{background:var(--sfe-color-fill-brand-light, #e4edfc) !important}.sc-swc-single-file-h .single-file-choosen.inverted.sc-swc-single-file{border:1px solid var(--sfe-color-border-neutral-subtle, #dee3e7);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-single-file-h .single-file-choosen.has-error.sc-swc-single-file{background:var(--sfe-color-fill-critical-light, #f8e0e0)}.sc-swc-single-file-h .single-file-choosen.has-error.inverted.sc-swc-single-file{border:1px solid var(--sfe-color-border-critical-solid, #a22827);background:var(--sfe-color-fill-backround, #fafbff)}.sc-swc-single-file-h .single-file-choosen.extended.sc-swc-single-file{padding:var(--sfe-sizing-gap-large, 16px) !important}.sc-swc-single-file-h .single-file-choosen.sc-swc-single-file .btn-span.sc-swc-single-file{color:var(--sfe-btn-color-content-bare-brand, #004ca6);font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-default, 0.875rem);font-style:normal;font-weight:400;line-height:16px}.sc-swc-single-file-h .single-file-choosen__wrapper.sc-swc-single-file{display:grid;align-items:center;grid-template-columns:2fr 1fr 3fr 1fr;gap:10px}.sc-swc-single-file-h .single-file-choosen__wrapper__name.sc-swc-single-file{color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:4.5rem}.sc-swc-single-file-h .single-file-choosen__wrapper__size.sc-swc-single-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;white-space:nowrap}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file{display:grid;align-items:center;grid-template-columns:1fr 24fr}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.no-thumbnail.sc-swc-single-file{grid-template-columns:1fr}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file{position:relative;width:32px;height:40px}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file .file-type.sc-swc-single-file{position:absolute;transform:translate(-50%, -50%);top:65%;left:50%}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file .file-img.sc-swc-single-file img.sc-swc-single-file{width:32px;height:32px;border-radius:4px}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__extension.sc-swc-single-file:empty{display:none}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__identifier.sc-swc-single-file{display:grid;grid-template-columns:3fr 1fr;align-items:center}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__identifier__name.sc-swc-single-file{color:var(--sfe-color-text-default-primary, rgba(0, 0, 0, 0.95));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;min-width:3.4rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sc-swc-single-file-h .single-file-choosen__extended-wrapper.sc-swc-single-file .file__identifier__size.sc-swc-single-file span.sc-swc-single-file{color:var(--sfe-color-text-default-secondary, rgba(0, 0, 0, 0.8));font-family:var(--sfe-typography-font-serif-font, Sora);font-size:var(--sfe-typography-font-size-label-large, 1rem);font-style:normal;font-weight:400;line-height:20px;white-space:nowrap}.sc-swc-single-file-h .single-file-choosen.sc-swc-single-file button.has-error.sc-swc-single-file span.sc-swc-single-file{color:var(--sfe-btn-color-content-bare-critical, #a22827)}.sc-swc-single-file-h .me-2.sc-swc-single-file{margin-right:8px}.sc-swc-single-file-h .me-1.sc-swc-single-file{margin-right:4px}.sc-swc-single-file-h .mt-2.sc-swc-single-file{margin-top:8px}.sc-swc-single-file-h .ms-3.sc-swc-single-file{margin-left:16px}.sc-swc-single-file-h .d-flex.sc-swc-single-file{display:flex}.sc-swc-single-file-h .align-items-center.sc-swc-single-file{align-items:center}.sc-swc-single-file-h .justify-content-end.sc-swc-single-file{justify-content:flex-end}.sc-swc-single-file-h .justify-content-between.sc-swc-single-file{justify-content:space-between}";export{n as swc_multiple_file,f as swc_single_file}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,d as c,e as s,h as t,H as h}from"./p-sJYf_nlQ.js";import{h as r,u as o}from"./p-Dcu5mHhz.js";const a=class{constructor(s){e(this,s),this.changeGroupCheckbox=c(this,"changeGroupCheckbox",7)}options;direction="row";value=[];testId="";changeGroupCheckbox;checkboxChangeHandler(e){const{value:c,checked:s}=e.detail;switch(s){case!0:if(this.value.includes(c)){const e=[...this.value,c],s=new Set(e);this.value=Array.from(s)}else this.value=[...this.value,c];break;case!1:this.value.includes(c)&&(this.value=this.value.filter((e=>e!==c)))}s&&!this.value.includes(c)&&(this.value=[...this.value,c]),!s&&this.value.includes(c)&&(this.value=this.value.filter((e=>e!==c)))}get hostEl(){return s(this)}valueChangeHandler(e){this.changeGroupCheckbox.emit(e)}render(){const e=r(this.hostEl,"content");return t(h,{key:"eab0f0ce8d7e173620fbe5d895c63178fa68bb05"},t("div",{key:"0c224d5a018fbc8e789012440cc296a41ce0cf29",class:`sfe-checkbox-grp-wrapper sfe-checkbox-grp-wrapper--${this.direction}`,id:o().generate("swc-grp-checkbox"),"data-testid":`swc-grp-checkbox-${this.testId}`},!e&&this.options?.length>0&&this.options.map((e=>t("swc-checkbox",{key:e.value,value:e.value,label:e.label,checked:this.value.includes(e.value)}))),t("slot",{key:"c443149020b8533f38ff79c9bcb8526b6561e8d2",name:"content"})))}static get watchers(){return{value:[{valueChangeHandler:0}]}}};a.style=".sc-swc-checkbox-group-h .sfe-checkbox-grp-wrapper.sc-swc-checkbox-group{display:flex}.sc-swc-checkbox-group-h .sfe-checkbox-grp-wrapper--row.sc-swc-checkbox-group{flex-direction:row;align-items:center;gap:12px}.sc-swc-checkbox-group-h .sfe-checkbox-grp-wrapper--column.sc-swc-checkbox-group{flex-direction:column;gap:12px;justify-content:center}";export{a as swc_checkbox_group}
|