@spscommerce/ds-web-components 7.13.0 → 7.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/components/file-upload/mime-type.enum.d.ts +1 -0
- package/dist/lib/index.cjs.js +8 -8
- package/dist/lib/index.es.js +26 -26
- package/dist/package.json +1 -1
- package/lib/components/file-upload/mime-type.enum.d.ts +1 -0
- package/lib/index.cjs.js +8 -8
- package/lib/index.es.js +26 -26
- package/package.json +4 -4
package/dist/lib/index.cjs.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
44
|
* See the License for the specific language governing permissions and
|
|
45
45
|
* limitations under the License.
|
|
46
|
-
*/function rt(e){if(e.lastIndexOf("xml:",0)===0)return"http://www.w3.org/XML/1998/namespace";if(e.lastIndexOf("xlink:",0)===0)return"http://www.w3.org/1999/xlink"}function Ee(e,t,n){if(n==null)e.removeAttribute(t);else{var s=rt(t);s?e.setAttributeNS(s,t,String(n)):e.setAttribute(t,String(n))}}function Ie(e,t,n){e[t]=n}function at(e,t,n){t.indexOf("-")>=0?e.setProperty(t,n):e[t]=n}function ot(e,t,n){if(typeof n=="string")e.style.cssText=n;else{e.style.cssText="";var s=e.style;for(var i in n)it(n,i)&&at(s,i,n[i])}}function lt(e,t,n){var s=typeof n;s==="object"||s==="function"?Ie(e,t,n):Ee(e,t,n)}var $=Pe();$[ue.default]=lt;$.style=ot;function
|
|
46
|
+
*/function rt(e){if(e.lastIndexOf("xml:",0)===0)return"http://www.w3.org/XML/1998/namespace";if(e.lastIndexOf("xlink:",0)===0)return"http://www.w3.org/1999/xlink"}function Ee(e,t,n){if(n==null)e.removeAttribute(t);else{var s=rt(t);s?e.setAttributeNS(s,t,String(n)):e.setAttribute(t,String(n))}}function Ie(e,t,n){e[t]=n}function at(e,t,n){t.indexOf("-")>=0?e.setProperty(t,n):e[t]=n}function ot(e,t,n){if(typeof n=="string")e.style.cssText=n;else{e.style.cssText="";var s=e.style;for(var i in n)it(n,i)&&at(s,i,n[i])}}function lt(e,t,n){var s=typeof n;s==="object"||s==="function"?Ie(e,t,n):Ee(e,t,n)}var $=Pe();$[ue.default]=lt;$.style=ot;function B(e,t,n){var s=$[t]||$[ue.default];s(e,t,n)}/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
49
49
|
*
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
76
76
|
* See the License for the specific language governing permissions and
|
|
77
77
|
* limitations under the License.
|
|
78
|
-
*/var
|
|
78
|
+
*/var T={nodesCreated:null,nodesDeleted:null};/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
81
81
|
*
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
91
91
|
* See the License for the specific language governing permissions and
|
|
92
92
|
* limitations under the License.
|
|
93
|
-
*/var mt=function(){function e(){this.created=[],this.deleted=[]}return e.prototype.markCreated=function(t){this.created.push(t)},e.prototype.markDeleted=function(t){this.deleted.push(t)},e.prototype.notifyChanges=function(){
|
|
93
|
+
*/var mt=function(){function e(){this.created=[],this.deleted=[]}return e.prototype.markCreated=function(t){this.created.push(t)},e.prototype.markDeleted=function(t){this.deleted.push(t)},e.prototype.notifyChanges=function(){T.nodesCreated&&this.created.length>0&&T.nodesCreated(this.created),T.nodesDeleted&&this.deleted.length>0&&T.nodesDeleted(this.deleted)},e}();/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
96
96
|
*
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
121
121
|
* See the License for the specific language governing permissions and
|
|
122
122
|
* limitations under the License.
|
|
123
|
-
*/var Nt=function(){function e(t,n,s){this._attrsArr=null,this.staticsApplied=!1,this.nameOrCtor=t,this.key=n,this.text=s}return e.prototype.hasEmptyAttrsArr=function(){var t=this._attrsArr;return!t||!t.length},e.prototype.getAttrsArr=function(t){return this._attrsArr||(this._attrsArr=new Array(t))},e}();function ge(e,t,n,s){var i=new Nt(t,n,s);return e.__incrementalDOMData=i,i}function
|
|
123
|
+
*/var Nt=function(){function e(t,n,s){this._attrsArr=null,this.staticsApplied=!1,this.nameOrCtor=t,this.key=n,this.text=s}return e.prototype.hasEmptyAttrsArr=function(){var t=this._attrsArr;return!t||!t.length},e.prototype.getAttrsArr=function(t){return this._attrsArr||(this._attrsArr=new Array(t))},e}();function ge(e,t,n,s){var i=new Nt(t,n,s);return e.__incrementalDOMData=i,i}function R(e,t){return Le(e,t)}function xt(e){return Boolean(e.__incrementalDOMData)}function yt(e){return ee(e.__incrementalDOMData),R(e).key}function Le(e,t){if(e.__incrementalDOMData)return e.__incrementalDOMData;var n=ae(e)?e.localName:e.nodeName,s=ae(e)?e.getAttribute("key")||t:null,i=vt(e)?e.data:void 0,r=ge(e,n,s,i);return ae(e)&&At(e,r),r}function Re(e){Le(e);for(var t=e.firstChild;t;t=t.nextSibling)Re(t)}function Te(e){e.__incrementalDOMData=null;for(var t=e.firstChild;t;t=t.nextSibling)Te(t)}function At(e,t){var n=e.attributes,s=n.length;if(!!s)for(var i=t.getAttrsArr(s),r=0,l=0;r<s;r+=1,l+=2){var d=n[r],f=d.name,m=d.value;i[l]=f,i[l+1]=m}}/**
|
|
124
124
|
* @license
|
|
125
125
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
126
126
|
*
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
136
136
|
* See the License for the specific language governing permissions and
|
|
137
137
|
* limitations under the License.
|
|
138
|
-
*/function Ot(e,t){return e==="svg"?"http://www.w3.org/2000/svg":e==="math"?"http://www.w3.org/1998/Math/MathML":t==null||
|
|
138
|
+
*/function Ot(e,t){return e==="svg"?"http://www.w3.org/2000/svg":e==="math"?"http://www.w3.org/1998/Math/MathML":t==null||R(t).nameOrCtor==="foreignObject"?null:t.namespaceURI}function Dt(e,t,n,s){var i;if(typeof n=="function")i=new n;else{var r=Ot(n,t);r?i=e.createElementNS(r,n):i=e.createElement(n)}return ge(i,n,s),i}function Pt(e){var t=e.createTextNode("");return ge(t,"#text",null),t}/**
|
|
139
139
|
* @license
|
|
140
140
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
141
141
|
*
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
151
151
|
* See the License for the specific language governing permissions and
|
|
152
152
|
* limitations under the License.
|
|
153
|
-
*/var k=null,u=null,C=null,D=null,Q=[],Z=[];function te(){return Z}function
|
|
153
|
+
*/var k=null,u=null,C=null,D=null,Q=[],Z=[];function te(){return Z}function Be(e){var t=function(n,s,i){var r=k,l=D,d=Q,f=Z,m=u,b=C,N=!1,W=!1;k=new mt,D=n.ownerDocument,Z=[],C=n.parentNode,Q=_t(n,C),process.env.NODE_ENV!=="production"&&(N=J(!1),W=Y(!1));try{var Me=e(n,s,i);return process.env.NODE_ENV!=="production"&&dt(),Me}finally{D=l,Z=f,u=m,C=b,Q=d,k.notifyChanges(),J(N),Y(W),k=r}};return t}var Ue=Be(function(e,t,n){return u=e,ze(),t(n),We(),process.env.NODE_ENV!=="production"&&ct(u,e),e}),Et=Be(function(e,t,n){var s={nextSibling:e},i=null,r=null;return process.env.NODE_ENV!=="production"&&(i=e.nextSibling,r=e.previousSibling),u=s,t(n),process.env.NODE_ENV!=="production"&&(pt(C),ft(s,u,i,r)),C&&je(C,ne(),e.nextSibling),s===u?null:u});function Ne(e,t,n){var s=R(e,n);return t==s.nameOrCtor&&n==s.key}function It(e,t,n){if(!e)return null;if(Ne(e,t,n))return e;if(n){for(;e=e.nextSibling;)if(Ne(e,t,n))return e}return null}function Ft(e,t){var n;return e==="#text"?n=Pt(D):n=Dt(D,C,e,t),k.markCreated(n),n}function $e(e,t){var n=It(u,e,t),s=n||Ft(e,t);s!==u&&(Q.indexOf(s)>=0?St(C,s,u):C.insertBefore(s,u),u=s)}function je(e,t,n){for(var s=e,i=t;i!==n;){var r=i.nextSibling;s.removeChild(i),k.markDeleted(i),i=r}}function ze(){C=u,u=null}function ne(){return u?u.nextSibling:C.firstChild}function ve(){u=ne()}function We(){je(C,ne(),null),u=C,C=C.parentNode}function He(e,t){return ve(),$e(e,t),ze(),C}function Ve(){return process.env.NODE_ENV!=="production"&&Y(!1),We(),u}function kt(){return ve(),$e("#text",null),u}function Lt(){return process.env.NODE_ENV!=="production"&&(Fe("currentElement",D),L("currentElement")),C}function Rt(){return process.env.NODE_ENV!=="production"&&(Fe("currentPointer",D),L("currentPointer")),ne()}function Tt(){process.env.NODE_ENV!=="production"&&(ut("skip",u),Y(!0)),u=C.lastChild}/**
|
|
154
154
|
* @license
|
|
155
155
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
156
156
|
*
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
166
166
|
* See the License for the specific language governing permissions and
|
|
167
167
|
* limitations under the License.
|
|
168
|
-
*/var xe=3,S=Pe();function
|
|
168
|
+
*/var xe=3,S=Pe();function Bt(e,t,n){if(t.staticsApplied=!0,!(!n||!n.length)){if(t.hasEmptyAttrsArr()){for(var s=0;s<n.length;s+=2)B(e,n[s],n[s+1]);return}for(var s=0;s<n.length;s+=2)S[n[s]]=s+1;for(var i=t.getAttrsArr(0),r=0,s=0;s<i.length;s+=2){var l=i[s],d=i[s+1],f=S[l];if(f){n[f]===d&&delete S[l];continue}i[r]=l,i[r+1]=d,r+=2}fe(i,r);for(var l in S)B(e,l,n[S[l]]),delete S[l]}}function Ce(e,t,n){process.env.NODE_ENV!=="production"&&(L("elementOpen"),ke("elementOpen"));var s=He(e,t),i=R(s);i.staticsApplied||Bt(s,i,n);var r=Math.max(0,arguments.length-xe),l=i.hasEmptyAttrsArr();if(!r&&l)return s;for(var d=i.getAttrsArr(r),f=xe,m=0;f<arguments.length;f+=2,m+=2){var b=arguments[f];if(l)d[m]=b;else if(d[m]!==b)break;var N=arguments[f+1];(l||d[m+1]!==N)&&(d[m+1]=N,B(s,b,N))}if(f<arguments.length||m<d.length){for(var W=m;m<d.length;m+=2)S[d[m]]=d[m+1];for(m=W;f<arguments.length;f+=2,m+=2){var b=arguments[f],N=arguments[f+1];S[b]!==N&&B(s,b,N),d[m]=b,d[m+1]=N,delete S[b]}fe(d,m);for(var b in S)B(s,b,void 0),delete S[b]}return s}function Ut(e,t,n){var s=te();process.env.NODE_ENV!=="production"&&(L("elementOpenStart"),J(!0)),s[0]=e,s[1]=t,s[2]=n}function $t(e){var t=te();process.env.NODE_ENV!=="production"&&(me("key"),ee(t)),t[1]=e}function jt(e,t){var n=te();process.env.NODE_ENV!=="production"&&me("attr"),n.push(e),n.push(t)}function zt(){var e=te();process.env.NODE_ENV!=="production"&&(me("elementOpenEnd"),J(!1)),ee(e);var t=Ce.apply(null,e);return fe(e,0),t}function qe(e){process.env.NODE_ENV!=="production"&&L("elementClose");var t=Ve();return process.env.NODE_ENV!=="production"&&ht(R(t).nameOrCtor,e),t}function Wt(e,t,n){return Ce.apply(null,arguments),qe(e)}function Ht(e){process.env.NODE_ENV!=="production"&&(L("text"),ke("text"));var t=kt(),n=R(t);if(n.text!==e){n.text=e;for(var s=e,i=1;i<arguments.length;i+=1){var r=arguments[i];s=r(s)}t.data=s}return t}/**
|
|
169
169
|
* @license
|
|
170
170
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
171
171
|
*
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
181
181
|
* See the License for the specific language governing permissions and
|
|
182
182
|
* limitations under the License.
|
|
183
|
-
*/h.applyAttr=Ee;h.applyProp=Ie;h.attributes=$;h.close=Ve;var be=h.currentElement=Lt,le=h.currentPointer=Tt;h.open=He;var Vt=h.patch=Ue;h.patchInner=Ue;h.patchOuter=Et;h.skip=Bt;var ce=h.skipNode=ve;h.getKey=yt;h.clearCache=Be;h.importNode=Te;h.isDataInitialized=xt;h.notifications=B;h.symbols=ue;var ye=h.attr=jt,qt=h.elementClose=qe;h.elementOpen=Ce;var Gt=h.elementOpenEnd=zt,Xt=h.elementOpenStart=Ut;h.elementVoid=Wt;var Kt=h.text=Ht;h.key=$t;function Ae(e){let t=le();return t instanceof Comment&&t.data!==e?t.data=e:(t=document.createComment(e),be().appendChild(t)),ce(),t}let Ge=U.noI18nI18n;function Qt(e){Ge=e}function Zt(){return Ge}const O=Symbol("ComponentMetadata"),_=Object.freeze({has(e,t){return Boolean(e[O]&&Object.prototype.hasOwnProperty.call(e[O],t))},add(e,t){e[O]?Object.assign(e[O],t):e[O]=t},get(e,t,n){return e[O]&&e[O][t]||n}}),Oe=Symbol("ds-web-components:pragma:listeners-attached"),Xe="idom-pragma:content-begin",pe="idom-pragma:content-end";function de(e){for(const t of e)if(typeof t=="function")t();else if(typeof t=="string")Kt(t);else if(t instanceof Set)de(Array.from(t));else if(Array.isArray(t)&&t.length>0){let n=le();if(Ae(Xe),n===null){const s=be();for(let i=0;i<t.length;i+=1)s.contains(t[i])||s.appendChild(t[i]),ce()}for(;n&&n.data!==pe;)ce(),n=le();Ae(pe)}}function o(e,t,...n){if(t){for(const s of Object.keys(t))if(s.toUpperCase()==="DATA-FRAGMENT")return()=>de(n)}return()=>{Xt(e);const s=[];if(t)for(const r of Object.keys(t))r.toUpperCase()==="CLASSNAME"?ye("class",t[r]):/^on[A-Z]/.test(r)?s.push(r):ye(r,t[r]);Gt(e);const i=be();if(!i[Oe]){for(const r of s)i.addEventListener(r.substr(2).toLowerCase(),t[r]);i[Oe]=!0}de(n),qt(e)}}function Ke(e,t){customElements.get(e)||customElements.define(e,t)}function Jt(...e){for(const t of e)Ke(_.get(t,"tag"),t)}function Yt(e){return function(...n){for(const s of n){const i=`${e}${_.get(s,"tag").substr(3)}`;Ke(i,s)}}}const he=Symbol("Component Attribute Bindings"),P=Symbol("Component Class Bindings"),M=Symbol("Component Style Bindings"),Mt={__initialized:!1,__observer:null,__queuedUpdate:null,__managedClasses:new Set,__updateHostBindings(){const e=this;for(const t of Object.keys(e[he]||{}))e.setAttribute(t,e[he][t]);for(const t of Object.keys(e[M]||{}))e.style[t]=e[M][t];for(const t of e.__managedClasses)e.classList.remove(t);for(const t of(e[P]||[]).filter(Boolean))e.__managedClasses.add(t),e.classList.add(t);for(const t of(e.getAttribute("classname")||"").split(/\w+/).filter(Boolean))e.classList.add(t)},__updateChildQueries(e){const t=this;for(const n of _.get(t.constructor,"childQueries",[]))if(!e||e&&n.refresh){const s=n.all?t.querySelectorAll:t.querySelector;t[n.key]=s.call(t,n.selector)}},__gatherChildren(){const e=this;let t=Array.from(e.childNodes),n=null,s=t.length;for(let i=0;i<t.length;i+=1){const r=t[i];r instanceof Comment&&(r.data===Xe?n=i+1:r.data===pe&&(s=i-1))}if(n===null)for(const i of t)i.parentNode.removeChild(i);else t=t.slice(n,s);_.has(e.constructor,"contentProp")&&(e[_.get(e.constructor,"contentProp")]=t)},__startMutObs(){const e=this;e.__observer||(e.__observer=new MutationObserver(()=>{e.contentChangedCallback&&e.contentChangedCallback(),e.__gatherChildren(),e.update()})),e.__observer.observe(e,{childList:!0})},__stopMutObs(){const e=this;e.__observer&&e.__observer.disconnect()},__doRender(){const e=this;e.__stopMutObs(),Vt(e,e.render(Zt())),e.__startMutObs()},update(){const e=this;e.__initialized&&!e.__queuedUpdate&&(e.__queuedUpdate=window.requestAnimationFrame(()=>{e.__doRender(),setTimeout(()=>{e.__updateChildQueries(!0),e.__updateHostBindings()},0),e.__queuedUpdate=null}))},attributeChangedCallback(e,t,n){const s=this,i=n===""?!0:n;i!==t&&(s.__cbAttributeChanged&&s.__cbAttributeChanged(e,s[e],i),e!=="style"&&(s[e]=i),s.__initialized&&s.update())},connectedCallback(){const e=this;e.__cbConnected&&e.__cbConnected();const t=_.get(e.constructor,"eventListeners",[]);setTimeout(()=>{if(!e.__initialized){e.__gatherChildren();for(const[,n]of t)e[n]=e[n].bind(e);e.__initialized=!0}for(const[n,s]of t)e.addEventListener(n,e[s]);e.__doRender(),setTimeout(()=>{e.__updateChildQueries(),e.__updateHostBindings()},0)},0)},disconnectedCallback(){const e=this;e.__cbDisconnected&&e.__cbDisconnected();for(const[t,n]of _.get(e.constructor,"eventListeners",[]))e.removeEventListener(t,e[n]);e.__stopMutObs()}};function E(e){return t=>{_.add(t,e),Object.assign(t.prototype,{__cbAttributeChanged:t.prototype.attributeChangedCallback,__cbConnected:t.prototype.connectedCallback,__cbDisconnected:t.prototype.disconnectedCallback},Mt)}}function se(){return(e,t)=>{_.add(e.constructor,{contentProp:t})}}function ie(e){return(t,n)=>{Object.defineProperty(t,n,{get(){return Object.defineProperty(this,n,{value:{dispatch:s=>{const i=new CustomEvent(e||n,{detail:s});return this.dispatchEvent(i),i}}}),this[n]},configurable:!0})}}function z(e){return(t,n)=>{const s=_.get(t.constructor,"eventListeners",[]);s.push([e,n]),_.add(t.constructor,{eventListeners:s})}}function p(e){return(t,n)=>{const s=t.constructor,i=n.toLowerCase();if(s.observedAttributes=s.observedAttributes||["classname","className","style"],s.observedAttributes.push(n),s.observedAttributes.push(i),i!==n&&Object.defineProperty(t,n,{get(){return this[i]},set(r){this[i]=r}}),e){const r=Symbol.for(n);Object.defineProperty(t,i,{get(){return this[r]},set(l){let d=l;e===Boolean&&typeof l=="string"&&l.toLowerCase()==="false"?d=!1:d=e(l),this[r]=d}})}}}function Qe(e,t,n){return(s,i)=>{const r=_.get(s.constructor,"childQueries",[]);r.push({key:i,selector:e,all:n,refresh:t.refresh}),_.add(s.constructor,{childQueries:r})}}function re(e,t={}){return Qe(e,t)}function Ze(e,t={}){return Qe(e,t,!0)}function we(){return(e,t)=>{const n=Symbol(t);Object.defineProperties(e,{[n]:{writable:!0,enumerable:!1,configurable:!1,value:e[t]},[t]:{get(){return this[n]},set(s){this[n]!==s&&(this[n]=s,this.update())}}})}}var _e=(e=>(e["7Z"]="application/x-7z-compressed",e.AAC="audio/aac",e.ABW="application/x-abiword",e.ARC="application/octet-stream",e.AVI="video/x-msvideo",e.AZW="application/vnd.amazon.ebook",e.BIN="application/octet-stream",e.BMP="image/bmp",e.BZ="application/x-bzip",e.BZ2="application/x-bzip2",e.CSH="application/x-csh",e.CSS="text/css",e.CSV="text/csv,application/vnd.ms-excel",e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.EOT="application/vnd.ms-fontobject",e.EPUB="application/epub+zip",e.ES="application/ecmascript",e.FLV="video/x-flv",e.GIF="image/gif",e.GZ="application/x-gzip",e.HTM="text/html",e.HTML="text/html",e.ICO="image/x-icon",e.ICS="text/calendar",e.JAR="application/java-archive",e.JPEG="image/jpeg",e.JPG="image/jpeg",e.JS="application/javascript",e.JSON="application/json",e.M3U="audio/x-mpequrl",e.MID="audio/midi",e.MIDI="audio/midi",e.MOV="video/quicktime",e.MP3="audio/mpeg3",e.MP4="video/mp4",e.MPEG="video/mpeg",e.MPKG="application/vnd.apple.installer+xml",e.ODP="application/vnd.oasis.opendocument.presentation",e.ODS="application/vnd.oasis.opendocument.spreadsheet",e.ODT="application/vnd.oasis.opendocument.text",e.OGA="audio/ogg",e.OGV="video/ogg",e.OGX="application/ogg",e.OTF="font/otf",e.PNG="image/png",e.PDF="application/pdf",e.PPT="application/vnd.ms-powerpoint",e.PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",e.RAR="application/x-rar-compressed",e.RTF="application/rtf",e.SH="application/x-sh",e.SVG="image/svg+xml",e.SWF="application/x-shockwave-flash",e.TAR="application/x-tar",e.TIF="image/tiff",e.TIFF="image/tiff",e.TS="application/typescript",e.TTF="font/ttf",e.TXT="text/plain",e.VSD="application/vnd.visio",e.WAV="audio/wav",e.WEBA="audio/webm",e.WEBM="video/webm",e.WEBP="image/webp",e.WOFF="font/woff",e.WOFF2="font/woff2",e.XHTML="application/xhtml+xml",e.XLS="application/vnd.ms-excel",e.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.XML="application/xml",e.XUL="application/vnd.mozilla.xul+xml",e.ZIP="application/zip",e))(_e||{}),en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,v=(e,t,n,s)=>{for(var i=s>1?void 0:s?tn(t,n):t,r=e.length-1,l;r>=0;r--)(l=e[r])&&(i=(s?l(t,n,i):l(i))||i);return s&&i&&en(t,n,i),i};const g="sps-file-upload";var H;exports.SpsFileUploadComponent=(H=class extends HTMLElement{constructor(){super();a(this,"description");a(this,"multiple");a(this,"shown",!0);a(this,"dismissable");a(this,"processing");a(this,"mini");a(this,"constrainContentWidth");a(this,"downloadLabel");a(this,"acceptExtensions");a(this,"maxSize");a(this,"customRequirement");a(this,"selection");a(this,"dismissal");a(this,"download");a(this,"fileInput");a(this,"files",[]);a(this,"accept");a(this,"acceptMIMETypes",new Set);a(this,"acceptExtensionsDescription");a(this,"maxSizeBytes");a(this,"active",!1);a(this,"error",!1);a(this,"namesOfUnsupportedFiles",[]);this.handleBrowseLinkClick=this.handleBrowseLinkClick.bind(this),this.handleDownloadButtonClick=this.handleDownloadButtonClick.bind(this),this.handleFileInputChange=this.handleFileInputChange.bind(this),this.dismiss=this.dismiss.bind(this)}get[P](){return[g,this.active&&`${g}--active`,this.error&&`${g}--error`,!this.shown&&`${g}--hidden`,this.mini&&`${g}--mini`,this.constrainContentWidth&&`${g}--constrained-content-width`]}connectedCallback(){this.description=this.description||(this.multiple?"Files":"File"),this.acceptExtensions&&this.processAcceptExtensions(this.acceptExtensions),this.maxSize&&this.parseAndValidateMaxSize(this.maxSize)}attributeChangedCallback(t,n,s){t==="acceptExtensions"&&this.processAcceptExtensions(s),t==="maxSize"&&this.parseAndValidateMaxSize(s)}dismiss(){this.dismissable&&(this.shown=!1,this.update(),this.dismissal.dispatch())}show(){this.dismissable&&(this.shown=!0,this.update())}render({t}){const n=this.error?U.SpsIcon.EXCLAMATION_CIRCLE:U.SpsIcon.UPLOAD_CLOUD,s=(this.multiple?t("design-system:fileUpload.instructions_plural"):t("design-system:fileUpload.instructions")).split("|");return o("div",{"data-fragment":!0},o("div",{className:`${g}__content`},this.processing?o("div",{"data-fragment":!0},o("i",{className:"sps-spinner sps-spinner--medium","aria-hidden":"true"}),o("div",{className:`${g}__instructions`},t("design-system:fileUpload.processing"))):o("div",{"data-fragment":!0},o("i",{className:`sps-icon sps-icon-${n} ${g}__icon-primary`,"aria-hidden":"true"}),o("div",{className:`${g}__title`},this.error?o("div",{"data-fragment":!0},t(this.namesOfUnsupportedFiles.length>1?"design-system:fileUpload.cancelled_plural":"design-system:fileUpload.cancelled")):o("div",{"data-fragment":!0},t("design-system:fileUpload.title",{description:this.description}))),this.error?o("div",{className:`${g}__errored-files`},new Set(this.namesOfUnsupportedFiles.map((i,r)=>{const l=Math.floor(i.length/2);return o("div",{className:`${g}__errored-filename`,key:i},o("span",{className:`${g}__errored-filename-segment`},i.substr(0,l)),o("div",{className:`${g}__errored-filename-segment`},o("span",null,i.substr(l))),r<this.namesOfUnsupportedFiles.length-1?",":"")}))):o("span",null),o("div",{className:`${g}__instructions`},o("div",{"data-fragment":!0},o("span",null,s[0]),o("a",{href:"",onClick:this.handleBrowseLinkClick},s[1]),o("span",null,s[2]))),o("div",{className:`${g}__requirements`},this.acceptExtensions?o("span",null,"("," ",t("design-system:fileUpload.acceptedTypes",{fileTypes:this.acceptExtensionsDescription})," ",")"):"",this.maxSize?o("span",null,"("," ",t("design-system:fileUpload.maximumSize",{size:this.maxSize})," ",")"):"",this.customRequirement?o("span",null," ",this.customRequirement," "):""),this.downloadLabel&&o("div",{className:`sps-button sps-button--link ${g}__download-button`,onClick:this.handleDownloadButtonClick},o("button",{type:"button"},o("i",{className:"sps-icon sps-icon-download-cloud","aria-hidden":"true"})," ",this.downloadLabel)))),this.dismissable&&!this.processing&&o("div",{className:`sps-button sps-button--icon ${g}__close-button`,onClick:this.dismiss},o("button",{type:"button",title:t("design-system:fileUpload.close")},o("i",{className:"sps-icon sps-icon-x","aria-hidden":"true"}))),o("form",null,o("input",{type:"file",accept:this.accept||"*/*",multiple:this.multiple||null,onChange:this.handleFileInputChange})))}parseAndValidateMaxSize(t){try{this.maxSizeBytes=c.parseFileSize(t)}catch{throw new Error(`Could not parse "${t}" as a file size.`)}}processAcceptExtensions(t){const s=(Array.isArray(t)?t:t.trim().split(/\s?,\s?/)).map(r=>r.replace(/^\./,"")),i=s.map(r=>`.${r}`.toLowerCase());this.acceptExtensionsDescription=i.map((r,l)=>l>0&&l===i.length-1?`or ${r}`:r).join(i.length>2?", ":" "),this.acceptMIMETypes.clear();for(const r of s)for(const l of _e[r.toUpperCase()].split(","))this.acceptMIMETypes.add(l);this.accept=i.concat(Array.from(this.acceptMIMETypes)).join(",")}selectFiles(t){this.namesOfUnsupportedFiles=[];const n=Array.from(t);for(const s of n)this.acceptExtensions&&!this.acceptMIMETypes.has(s.type)&&this.namesOfUnsupportedFiles.push(s.name),this.maxSize&&s.size>this.maxSizeBytes&&this.namesOfUnsupportedFiles.indexOf(s.name)===-1&&this.namesOfUnsupportedFiles.push(s.name);this.namesOfUnsupportedFiles.length?(this.error=!0,this.fileInput.value=null,this.update()):(this.files=n,this.selection.dispatch(n))}handleDragOver(t){t.preventDefault(),t.stopPropagation()}handleDragEnter(t){t.preventDefault(),this.active=!0,this.error=!1,this.update()}handleDragLeave(t){t.preventDefault(),this.active=!1,this.update()}handleDrop(t){t.preventDefault(),t.stopPropagation(),this.active=!1,t.dataTransfer.items?this.selectFiles(Array.from(t.dataTransfer.items).map(n=>n.getAsFile())):this.selectFiles(t.dataTransfer.files),this.update()}handleBrowseLinkClick(t){t.preventDefault(),this.error=!1,this.update(),this.fileInput.click()}handleDownloadButtonClick(){this.download.dispatch()}handleFileInputChange(t){t.stopPropagation(),this.selectFiles(t.target.files)}},a(H,"displayName",g),a(H,"props",{description:"string",multiple:"boolean",dismissable:"boolean",processing:"boolean",mini:"boolean",downloadLabel:"string",acceptExtensions:"Array<string> | string",maxSize:"string",customRequirement:"string",selection:{event:!0,type:"CustomEvent<Array<File>>"},dismissal:{event:!0,type:"CustomEvent<void>"},download:{event:!0,type:"CustomEvent<void>"}}),H);v([p()],exports.SpsFileUploadComponent.prototype,"description",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"multiple",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"shown",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"dismissable",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"processing",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"mini",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"constrainContentWidth",2);v([p()],exports.SpsFileUploadComponent.prototype,"downloadLabel",2);v([p()],exports.SpsFileUploadComponent.prototype,"acceptExtensions",2);v([p()],exports.SpsFileUploadComponent.prototype,"maxSize",2);v([p()],exports.SpsFileUploadComponent.prototype,"customRequirement",2);v([ie()],exports.SpsFileUploadComponent.prototype,"selection",2);v([ie()],exports.SpsFileUploadComponent.prototype,"dismissal",2);v([ie()],exports.SpsFileUploadComponent.prototype,"download",2);v([re("input[type='file']")],exports.SpsFileUploadComponent.prototype,"fileInput",2);v([z("dragover")],exports.SpsFileUploadComponent.prototype,"handleDragOver",1);v([z("dragenter")],exports.SpsFileUploadComponent.prototype,"handleDragEnter",1);v([z("dragleave")],exports.SpsFileUploadComponent.prototype,"handleDragLeave",1);v([z("drop")],exports.SpsFileUploadComponent.prototype,"handleDrop",1);exports.SpsFileUploadComponent=v([E({tag:g})],exports.SpsFileUploadComponent);const nn={basic:{label:"Basic File Upload",description:c.code`
|
|
183
|
+
*/h.applyAttr=Ee;h.applyProp=Ie;h.attributes=$;h.close=Ve;var be=h.currentElement=Lt,le=h.currentPointer=Rt;h.open=He;var Vt=h.patch=Ue;h.patchInner=Ue;h.patchOuter=Et;h.skip=Tt;var ce=h.skipNode=ve;h.getKey=yt;h.clearCache=Te;h.importNode=Re;h.isDataInitialized=xt;h.notifications=T;h.symbols=ue;var ye=h.attr=jt,qt=h.elementClose=qe;h.elementOpen=Ce;var Gt=h.elementOpenEnd=zt,Xt=h.elementOpenStart=Ut;h.elementVoid=Wt;var Kt=h.text=Ht;h.key=$t;function Ae(e){let t=le();return t instanceof Comment&&t.data!==e?t.data=e:(t=document.createComment(e),be().appendChild(t)),ce(),t}let Ge=U.noI18nI18n;function Qt(e){Ge=e}function Zt(){return Ge}const O=Symbol("ComponentMetadata"),_=Object.freeze({has(e,t){return Boolean(e[O]&&Object.prototype.hasOwnProperty.call(e[O],t))},add(e,t){e[O]?Object.assign(e[O],t):e[O]=t},get(e,t,n){return e[O]&&e[O][t]||n}}),Oe=Symbol("ds-web-components:pragma:listeners-attached"),Xe="idom-pragma:content-begin",pe="idom-pragma:content-end";function de(e){for(const t of e)if(typeof t=="function")t();else if(typeof t=="string")Kt(t);else if(t instanceof Set)de(Array.from(t));else if(Array.isArray(t)&&t.length>0){let n=le();if(Ae(Xe),n===null){const s=be();for(let i=0;i<t.length;i+=1)s.contains(t[i])||s.appendChild(t[i]),ce()}for(;n&&n.data!==pe;)ce(),n=le();Ae(pe)}}function o(e,t,...n){if(t){for(const s of Object.keys(t))if(s.toUpperCase()==="DATA-FRAGMENT")return()=>de(n)}return()=>{Xt(e);const s=[];if(t)for(const r of Object.keys(t))r.toUpperCase()==="CLASSNAME"?ye("class",t[r]):/^on[A-Z]/.test(r)?s.push(r):ye(r,t[r]);Gt(e);const i=be();if(!i[Oe]){for(const r of s)i.addEventListener(r.substr(2).toLowerCase(),t[r]);i[Oe]=!0}de(n),qt(e)}}function Ke(e,t){customElements.get(e)||customElements.define(e,t)}function Jt(...e){for(const t of e)Ke(_.get(t,"tag"),t)}function Yt(e){return function(...n){for(const s of n){const i=`${e}${_.get(s,"tag").substr(3)}`;Ke(i,s)}}}const he=Symbol("Component Attribute Bindings"),P=Symbol("Component Class Bindings"),M=Symbol("Component Style Bindings"),Mt={__initialized:!1,__observer:null,__queuedUpdate:null,__managedClasses:new Set,__updateHostBindings(){const e=this;for(const t of Object.keys(e[he]||{}))e.setAttribute(t,e[he][t]);for(const t of Object.keys(e[M]||{}))e.style[t]=e[M][t];for(const t of e.__managedClasses)e.classList.remove(t);for(const t of(e[P]||[]).filter(Boolean))e.__managedClasses.add(t),e.classList.add(t);for(const t of(e.getAttribute("classname")||"").split(/\w+/).filter(Boolean))e.classList.add(t)},__updateChildQueries(e){const t=this;for(const n of _.get(t.constructor,"childQueries",[]))if(!e||e&&n.refresh){const s=n.all?t.querySelectorAll:t.querySelector;t[n.key]=s.call(t,n.selector)}},__gatherChildren(){const e=this;let t=Array.from(e.childNodes),n=null,s=t.length;for(let i=0;i<t.length;i+=1){const r=t[i];r instanceof Comment&&(r.data===Xe?n=i+1:r.data===pe&&(s=i-1))}if(n===null)for(const i of t)i.parentNode.removeChild(i);else t=t.slice(n,s);_.has(e.constructor,"contentProp")&&(e[_.get(e.constructor,"contentProp")]=t)},__startMutObs(){const e=this;e.__observer||(e.__observer=new MutationObserver(()=>{e.contentChangedCallback&&e.contentChangedCallback(),e.__gatherChildren(),e.update()})),e.__observer.observe(e,{childList:!0})},__stopMutObs(){const e=this;e.__observer&&e.__observer.disconnect()},__doRender(){const e=this;e.__stopMutObs(),Vt(e,e.render(Zt())),e.__startMutObs()},update(){const e=this;e.__initialized&&!e.__queuedUpdate&&(e.__queuedUpdate=window.requestAnimationFrame(()=>{e.__doRender(),setTimeout(()=>{e.__updateChildQueries(!0),e.__updateHostBindings()},0),e.__queuedUpdate=null}))},attributeChangedCallback(e,t,n){const s=this,i=n===""?!0:n;i!==t&&(s.__cbAttributeChanged&&s.__cbAttributeChanged(e,s[e],i),e!=="style"&&(s[e]=i),s.__initialized&&s.update())},connectedCallback(){const e=this;e.__cbConnected&&e.__cbConnected();const t=_.get(e.constructor,"eventListeners",[]);setTimeout(()=>{if(!e.__initialized){e.__gatherChildren();for(const[,n]of t)e[n]=e[n].bind(e);e.__initialized=!0}for(const[n,s]of t)e.addEventListener(n,e[s]);e.__doRender(),setTimeout(()=>{e.__updateChildQueries(),e.__updateHostBindings()},0)},0)},disconnectedCallback(){const e=this;e.__cbDisconnected&&e.__cbDisconnected();for(const[t,n]of _.get(e.constructor,"eventListeners",[]))e.removeEventListener(t,e[n]);e.__stopMutObs()}};function E(e){return t=>{_.add(t,e),Object.assign(t.prototype,{__cbAttributeChanged:t.prototype.attributeChangedCallback,__cbConnected:t.prototype.connectedCallback,__cbDisconnected:t.prototype.disconnectedCallback},Mt)}}function se(){return(e,t)=>{_.add(e.constructor,{contentProp:t})}}function ie(e){return(t,n)=>{Object.defineProperty(t,n,{get(){return Object.defineProperty(this,n,{value:{dispatch:s=>{const i=new CustomEvent(e||n,{detail:s});return this.dispatchEvent(i),i}}}),this[n]},configurable:!0})}}function z(e){return(t,n)=>{const s=_.get(t.constructor,"eventListeners",[]);s.push([e,n]),_.add(t.constructor,{eventListeners:s})}}function p(e){return(t,n)=>{const s=t.constructor,i=n.toLowerCase();if(s.observedAttributes=s.observedAttributes||["classname","className","style"],s.observedAttributes.push(n),s.observedAttributes.push(i),i!==n&&Object.defineProperty(t,n,{get(){return this[i]},set(r){this[i]=r}}),e){const r=Symbol.for(n);Object.defineProperty(t,i,{get(){return this[r]},set(l){let d=l;e===Boolean&&typeof l=="string"&&l.toLowerCase()==="false"?d=!1:d=e(l),this[r]=d}})}}}function Qe(e,t,n){return(s,i)=>{const r=_.get(s.constructor,"childQueries",[]);r.push({key:i,selector:e,all:n,refresh:t.refresh}),_.add(s.constructor,{childQueries:r})}}function re(e,t={}){return Qe(e,t)}function Ze(e,t={}){return Qe(e,t,!0)}function we(){return(e,t)=>{const n=Symbol(t);Object.defineProperties(e,{[n]:{writable:!0,enumerable:!1,configurable:!1,value:e[t]},[t]:{get(){return this[n]},set(s){this[n]!==s&&(this[n]=s,this.update())}}})}}var _e=(e=>(e["7Z"]="application/x-7z-compressed",e.AAC="audio/aac",e.ABW="application/x-abiword",e.ARC="application/octet-stream",e.AVI="video/x-msvideo",e.AZW="application/vnd.amazon.ebook",e.BIN="application/octet-stream",e.BMP="image/bmp",e.BZ="application/x-bzip",e.BZ2="application/x-bzip2",e.CER="application/pkix-cert",e.CSH="application/x-csh",e.CSS="text/css",e.CSV="text/csv,application/vnd.ms-excel",e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.EOT="application/vnd.ms-fontobject",e.EPUB="application/epub+zip",e.ES="application/ecmascript",e.FLV="video/x-flv",e.GIF="image/gif",e.GZ="application/x-gzip",e.HTM="text/html",e.HTML="text/html",e.ICO="image/x-icon",e.ICS="text/calendar",e.JAR="application/java-archive",e.JPEG="image/jpeg",e.JPG="image/jpeg",e.JS="application/javascript",e.JSON="application/json",e.M3U="audio/x-mpequrl",e.MID="audio/midi",e.MIDI="audio/midi",e.MOV="video/quicktime",e.MP3="audio/mpeg3",e.MP4="video/mp4",e.MPEG="video/mpeg",e.MPKG="application/vnd.apple.installer+xml",e.ODP="application/vnd.oasis.opendocument.presentation",e.ODS="application/vnd.oasis.opendocument.spreadsheet",e.ODT="application/vnd.oasis.opendocument.text",e.OGA="audio/ogg",e.OGV="video/ogg",e.OGX="application/ogg",e.OTF="font/otf",e.PNG="image/png",e.PDF="application/pdf",e.PPT="application/vnd.ms-powerpoint",e.PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",e.RAR="application/x-rar-compressed",e.RTF="application/rtf",e.SH="application/x-sh",e.SVG="image/svg+xml",e.SWF="application/x-shockwave-flash",e.TAR="application/x-tar",e.TIF="image/tiff",e.TIFF="image/tiff",e.TS="application/typescript",e.TTF="font/ttf",e.TXT="text/plain",e.VSD="application/vnd.visio",e.WAV="audio/wav",e.WEBA="audio/webm",e.WEBM="video/webm",e.WEBP="image/webp",e.WOFF="font/woff",e.WOFF2="font/woff2",e.XHTML="application/xhtml+xml",e.XLS="application/vnd.ms-excel",e.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.XML="application/xml",e.XUL="application/vnd.mozilla.xul+xml",e.ZIP="application/zip",e))(_e||{}),en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,v=(e,t,n,s)=>{for(var i=s>1?void 0:s?tn(t,n):t,r=e.length-1,l;r>=0;r--)(l=e[r])&&(i=(s?l(t,n,i):l(i))||i);return s&&i&&en(t,n,i),i};const g="sps-file-upload";var H;exports.SpsFileUploadComponent=(H=class extends HTMLElement{constructor(){super();a(this,"description");a(this,"multiple");a(this,"shown",!0);a(this,"dismissable");a(this,"processing");a(this,"mini");a(this,"constrainContentWidth");a(this,"downloadLabel");a(this,"acceptExtensions");a(this,"maxSize");a(this,"customRequirement");a(this,"selection");a(this,"dismissal");a(this,"download");a(this,"fileInput");a(this,"files",[]);a(this,"accept");a(this,"acceptMIMETypes",new Set);a(this,"acceptExtensionsDescription");a(this,"maxSizeBytes");a(this,"active",!1);a(this,"error",!1);a(this,"namesOfUnsupportedFiles",[]);this.handleBrowseLinkClick=this.handleBrowseLinkClick.bind(this),this.handleDownloadButtonClick=this.handleDownloadButtonClick.bind(this),this.handleFileInputChange=this.handleFileInputChange.bind(this),this.dismiss=this.dismiss.bind(this)}get[P](){return[g,this.active&&`${g}--active`,this.error&&`${g}--error`,!this.shown&&`${g}--hidden`,this.mini&&`${g}--mini`,this.constrainContentWidth&&`${g}--constrained-content-width`]}connectedCallback(){this.description=this.description||(this.multiple?"Files":"File"),this.acceptExtensions&&this.processAcceptExtensions(this.acceptExtensions),this.maxSize&&this.parseAndValidateMaxSize(this.maxSize)}attributeChangedCallback(t,n,s){t==="acceptExtensions"&&this.processAcceptExtensions(s),t==="maxSize"&&this.parseAndValidateMaxSize(s)}dismiss(){this.dismissable&&(this.shown=!1,this.update(),this.dismissal.dispatch())}show(){this.dismissable&&(this.shown=!0,this.update())}render({t}){const n=this.error?U.SpsIcon.EXCLAMATION_CIRCLE:U.SpsIcon.UPLOAD_CLOUD,s=(this.multiple?t("design-system:fileUpload.instructions_plural"):t("design-system:fileUpload.instructions")).split("|");return o("div",{"data-fragment":!0},o("div",{className:`${g}__content`},this.processing?o("div",{"data-fragment":!0},o("i",{className:"sps-spinner sps-spinner--medium","aria-hidden":"true"}),o("div",{className:`${g}__instructions`},t("design-system:fileUpload.processing"))):o("div",{"data-fragment":!0},o("i",{className:`sps-icon sps-icon-${n} ${g}__icon-primary`,"aria-hidden":"true"}),o("div",{className:`${g}__title`},this.error?o("div",{"data-fragment":!0},t(this.namesOfUnsupportedFiles.length>1?"design-system:fileUpload.cancelled_plural":"design-system:fileUpload.cancelled")):o("div",{"data-fragment":!0},t("design-system:fileUpload.title",{description:this.description}))),this.error?o("div",{className:`${g}__errored-files`},new Set(this.namesOfUnsupportedFiles.map((i,r)=>{const l=Math.floor(i.length/2);return o("div",{className:`${g}__errored-filename`,key:i},o("span",{className:`${g}__errored-filename-segment`},i.substr(0,l)),o("div",{className:`${g}__errored-filename-segment`},o("span",null,i.substr(l))),r<this.namesOfUnsupportedFiles.length-1?",":"")}))):o("span",null),o("div",{className:`${g}__instructions`},o("div",{"data-fragment":!0},o("span",null,s[0]),o("a",{href:"",onClick:this.handleBrowseLinkClick},s[1]),o("span",null,s[2]))),o("div",{className:`${g}__requirements`},this.acceptExtensions?o("span",null,"("," ",t("design-system:fileUpload.acceptedTypes",{fileTypes:this.acceptExtensionsDescription})," ",")"):"",this.maxSize?o("span",null,"("," ",t("design-system:fileUpload.maximumSize",{size:this.maxSize})," ",")"):"",this.customRequirement?o("span",null," ",this.customRequirement," "):""),this.downloadLabel&&o("div",{className:`sps-button sps-button--link ${g}__download-button`,onClick:this.handleDownloadButtonClick},o("button",{type:"button"},o("i",{className:"sps-icon sps-icon-download-cloud","aria-hidden":"true"})," ",this.downloadLabel)))),this.dismissable&&!this.processing&&o("div",{className:`sps-button sps-button--icon ${g}__close-button`,onClick:this.dismiss},o("button",{type:"button",title:t("design-system:fileUpload.close")},o("i",{className:"sps-icon sps-icon-x","aria-hidden":"true"}))),o("form",null,o("input",{type:"file",accept:this.accept||"*/*",multiple:this.multiple||null,onChange:this.handleFileInputChange})))}parseAndValidateMaxSize(t){try{this.maxSizeBytes=c.parseFileSize(t)}catch{throw new Error(`Could not parse "${t}" as a file size.`)}}processAcceptExtensions(t){const s=(Array.isArray(t)?t:t.trim().split(/\s?,\s?/)).map(r=>r.replace(/^\./,"")),i=s.map(r=>`.${r}`.toLowerCase());this.acceptExtensionsDescription=i.map((r,l)=>l>0&&l===i.length-1?`or ${r}`:r).join(i.length>2?", ":" "),this.acceptMIMETypes.clear();for(const r of s)for(const l of _e[r.toUpperCase()].split(","))this.acceptMIMETypes.add(l);this.accept=i.concat(Array.from(this.acceptMIMETypes)).join(",")}selectFiles(t){this.namesOfUnsupportedFiles=[];const n=Array.from(t);for(const s of n)this.acceptExtensions&&!this.acceptMIMETypes.has(s.type)&&this.namesOfUnsupportedFiles.push(s.name),this.maxSize&&s.size>this.maxSizeBytes&&this.namesOfUnsupportedFiles.indexOf(s.name)===-1&&this.namesOfUnsupportedFiles.push(s.name);this.namesOfUnsupportedFiles.length?(this.error=!0,this.fileInput.value=null,this.update()):(this.files=n,this.selection.dispatch(n))}handleDragOver(t){t.preventDefault(),t.stopPropagation()}handleDragEnter(t){t.preventDefault(),this.active=!0,this.error=!1,this.update()}handleDragLeave(t){t.preventDefault(),this.active=!1,this.update()}handleDrop(t){t.preventDefault(),t.stopPropagation(),this.active=!1,t.dataTransfer.items?this.selectFiles(Array.from(t.dataTransfer.items).map(n=>n.getAsFile())):this.selectFiles(t.dataTransfer.files),this.update()}handleBrowseLinkClick(t){t.preventDefault(),this.error=!1,this.update(),this.fileInput.click()}handleDownloadButtonClick(){this.download.dispatch()}handleFileInputChange(t){t.stopPropagation(),this.selectFiles(t.target.files)}},a(H,"displayName",g),a(H,"props",{description:"string",multiple:"boolean",dismissable:"boolean",processing:"boolean",mini:"boolean",downloadLabel:"string",acceptExtensions:"Array<string> | string",maxSize:"string",customRequirement:"string",selection:{event:!0,type:"CustomEvent<Array<File>>"},dismissal:{event:!0,type:"CustomEvent<void>"},download:{event:!0,type:"CustomEvent<void>"}}),H);v([p()],exports.SpsFileUploadComponent.prototype,"description",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"multiple",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"shown",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"dismissable",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"processing",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"mini",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"constrainContentWidth",2);v([p()],exports.SpsFileUploadComponent.prototype,"downloadLabel",2);v([p()],exports.SpsFileUploadComponent.prototype,"acceptExtensions",2);v([p()],exports.SpsFileUploadComponent.prototype,"maxSize",2);v([p()],exports.SpsFileUploadComponent.prototype,"customRequirement",2);v([ie()],exports.SpsFileUploadComponent.prototype,"selection",2);v([ie()],exports.SpsFileUploadComponent.prototype,"dismissal",2);v([ie()],exports.SpsFileUploadComponent.prototype,"download",2);v([re("input[type='file']")],exports.SpsFileUploadComponent.prototype,"fileInput",2);v([z("dragover")],exports.SpsFileUploadComponent.prototype,"handleDragOver",1);v([z("dragenter")],exports.SpsFileUploadComponent.prototype,"handleDragEnter",1);v([z("dragleave")],exports.SpsFileUploadComponent.prototype,"handleDragLeave",1);v([z("drop")],exports.SpsFileUploadComponent.prototype,"handleDrop",1);exports.SpsFileUploadComponent=v([E({tag:g})],exports.SpsFileUploadComponent);const nn={basic:{label:"Basic File Upload",description:c.code`
|
|
184
184
|
<p>Simply allow the user to drag-and-drop or select either a single file or multiple files at once.</p>
|
|
185
185
|
`,examples:{single:{description:"<p>Single file upload</p>",react:c.code`
|
|
186
186
|
function Component() {
|
package/dist/lib/index.es.js
CHANGED
|
@@ -319,7 +319,7 @@ function ve(e, t, s, n) {
|
|
|
319
319
|
return e.__incrementalDOMData = i, i;
|
|
320
320
|
}
|
|
321
321
|
function $(e, t) {
|
|
322
|
-
return
|
|
322
|
+
return je(e, t);
|
|
323
323
|
}
|
|
324
324
|
function It(e) {
|
|
325
325
|
return Boolean(e.__incrementalDOMData);
|
|
@@ -327,16 +327,16 @@ function It(e) {
|
|
|
327
327
|
function kt(e) {
|
|
328
328
|
return se(e.__incrementalDOMData), $(e).key;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function je(e, t) {
|
|
331
331
|
if (e.__incrementalDOMData)
|
|
332
332
|
return e.__incrementalDOMData;
|
|
333
333
|
var s = ae(e) ? e.localName : e.nodeName, n = ae(e) ? e.getAttribute("key") || t : null, i = yt(e) ? e.data : void 0, r = ve(e, s, n, i);
|
|
334
334
|
return ae(e) && Lt(e, r), r;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
|
|
336
|
+
function Te(e) {
|
|
337
|
+
je(e);
|
|
338
338
|
for (var t = e.firstChild; t; t = t.nextSibling)
|
|
339
|
-
|
|
339
|
+
Te(t);
|
|
340
340
|
}
|
|
341
341
|
function Ue(e) {
|
|
342
342
|
e.__incrementalDOMData = null;
|
|
@@ -427,7 +427,7 @@ function Oe(e, t, s) {
|
|
|
427
427
|
var n = $(e, s);
|
|
428
428
|
return t == n.nameOrCtor && s == n.key;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function jt(e, t, s) {
|
|
431
431
|
if (!e)
|
|
432
432
|
return null;
|
|
433
433
|
if (Oe(e, t, s))
|
|
@@ -439,12 +439,12 @@ function Tt(e, t, s) {
|
|
|
439
439
|
}
|
|
440
440
|
return null;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function Tt(e, t) {
|
|
443
443
|
var s;
|
|
444
444
|
return e === "#text" ? s = Bt(k) : s = Rt(k, C, e, t), R.markCreated(s), s;
|
|
445
445
|
}
|
|
446
446
|
function He(e, t) {
|
|
447
|
-
var s =
|
|
447
|
+
var s = jt(u, e, t), n = s || Tt(e, t);
|
|
448
448
|
n !== u && (J.indexOf(n) >= 0 ? Pt(C, n, u) : C.insertBefore(n, u), u = n);
|
|
449
449
|
}
|
|
450
450
|
function Ve(e, t, s) {
|
|
@@ -619,7 +619,7 @@ h.skip = Ht;
|
|
|
619
619
|
var ce = h.skipNode = be;
|
|
620
620
|
h.getKey = kt;
|
|
621
621
|
h.clearCache = Ue;
|
|
622
|
-
h.importNode =
|
|
622
|
+
h.importNode = Te;
|
|
623
623
|
h.isDataInitialized = It;
|
|
624
624
|
h.notifications = U;
|
|
625
625
|
h.symbols = fe;
|
|
@@ -710,7 +710,7 @@ function ys(e) {
|
|
|
710
710
|
}
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
const Ie = Symbol("Component Attribute Bindings"),
|
|
713
|
+
const Ie = Symbol("Component Attribute Bindings"), j = Symbol("Component Class Bindings"), he = Symbol("Component Style Bindings"), ns = {
|
|
714
714
|
__initialized: !1,
|
|
715
715
|
__observer: null,
|
|
716
716
|
__queuedUpdate: null,
|
|
@@ -723,7 +723,7 @@ const Ie = Symbol("Component Attribute Bindings"), T = Symbol("Component Class B
|
|
|
723
723
|
e.style[t] = e[he][t];
|
|
724
724
|
for (const t of e.__managedClasses)
|
|
725
725
|
e.classList.remove(t);
|
|
726
|
-
for (const t of (e[
|
|
726
|
+
for (const t of (e[j] || []).filter(Boolean))
|
|
727
727
|
e.__managedClasses.add(t), e.classList.add(t);
|
|
728
728
|
for (const t of (e.getAttribute("classname") || "").split(/\w+/).filter(Boolean))
|
|
729
729
|
e.classList.add(t);
|
|
@@ -802,7 +802,7 @@ const Ie = Symbol("Component Attribute Bindings"), T = Symbol("Component Class B
|
|
|
802
802
|
e.__stopMutObs();
|
|
803
803
|
}
|
|
804
804
|
};
|
|
805
|
-
function
|
|
805
|
+
function T(e) {
|
|
806
806
|
return (t) => {
|
|
807
807
|
N.add(t, e), Object.assign(t.prototype, {
|
|
808
808
|
__cbAttributeChanged: t.prototype.attributeChangedCallback,
|
|
@@ -905,7 +905,7 @@ function et() {
|
|
|
905
905
|
});
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
|
-
var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, b = (e, t, s, n) => {
|
|
908
|
+
var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CER = "application/pkix-cert", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, b = (e, t, s, n) => {
|
|
909
909
|
for (var i = n > 1 ? void 0 : n ? as(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
910
910
|
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
911
911
|
return n && i && rs(t, s, i), i;
|
|
@@ -940,7 +940,7 @@ let f = (q = class extends HTMLElement {
|
|
|
940
940
|
a(this, "namesOfUnsupportedFiles", []);
|
|
941
941
|
this.handleBrowseLinkClick = this.handleBrowseLinkClick.bind(this), this.handleDownloadButtonClick = this.handleDownloadButtonClick.bind(this), this.handleFileInputChange = this.handleFileInputChange.bind(this), this.dismiss = this.dismiss.bind(this);
|
|
942
942
|
}
|
|
943
|
-
get [
|
|
943
|
+
get [j]() {
|
|
944
944
|
return [
|
|
945
945
|
v,
|
|
946
946
|
this.active && `${v}--active`,
|
|
@@ -1150,7 +1150,7 @@ b([
|
|
|
1150
1150
|
re("drop")
|
|
1151
1151
|
], f.prototype, "handleDrop", 1);
|
|
1152
1152
|
f = b([
|
|
1153
|
-
|
|
1153
|
+
T({ tag: v })
|
|
1154
1154
|
], f);
|
|
1155
1155
|
const Ss = {
|
|
1156
1156
|
basic: {
|
|
@@ -1492,7 +1492,7 @@ let y = (G = class extends HTMLElement {
|
|
|
1492
1492
|
a(this, "content");
|
|
1493
1493
|
a(this, "detail");
|
|
1494
1494
|
}
|
|
1495
|
-
get [
|
|
1495
|
+
get [j]() {
|
|
1496
1496
|
return [
|
|
1497
1497
|
_,
|
|
1498
1498
|
`${_}--${this.kind}`,
|
|
@@ -1567,7 +1567,7 @@ O([
|
|
|
1567
1567
|
xe(`.${_}__detail`)
|
|
1568
1568
|
], y.prototype, "detail", 2);
|
|
1569
1569
|
y = O([
|
|
1570
|
-
|
|
1570
|
+
T({ tag: _ })
|
|
1571
1571
|
], y);
|
|
1572
1572
|
var cs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, ye = (e, t, s, n) => {
|
|
1573
1573
|
for (var i = n > 1 ? void 0 : n ? ps(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
@@ -1584,7 +1584,7 @@ let te = (X = class extends HTMLElement {
|
|
|
1584
1584
|
a(this, "showAdditionalInsights", !1);
|
|
1585
1585
|
this.toggleAdditionalInsights = this.toggleAdditionalInsights.bind(this);
|
|
1586
1586
|
}
|
|
1587
|
-
get [
|
|
1587
|
+
get [j]() {
|
|
1588
1588
|
return [
|
|
1589
1589
|
D,
|
|
1590
1590
|
this.showAdditionalInsights && `${D}--show-additional`,
|
|
@@ -1615,7 +1615,7 @@ ye([
|
|
|
1615
1615
|
is(".sps-insight-card__detail")
|
|
1616
1616
|
], te.prototype, "details", 2);
|
|
1617
1617
|
te = ye([
|
|
1618
|
-
|
|
1618
|
+
T({ tag: D })
|
|
1619
1619
|
], te);
|
|
1620
1620
|
const Os = {
|
|
1621
1621
|
basic: {
|
|
@@ -1965,7 +1965,7 @@ let P = (K = class extends HTMLElement {
|
|
|
1965
1965
|
a(this, "href");
|
|
1966
1966
|
a(this, "target");
|
|
1967
1967
|
}
|
|
1968
|
-
get [
|
|
1968
|
+
get [j]() {
|
|
1969
1969
|
return [
|
|
1970
1970
|
"sps-tabbed-nav__nav-item",
|
|
1971
1971
|
this.active && "sps-tabbed-nav__nav-item--active"
|
|
@@ -2010,7 +2010,7 @@ L([
|
|
|
2010
2010
|
p()
|
|
2011
2011
|
], P.prototype, "target", 2);
|
|
2012
2012
|
P = L([
|
|
2013
|
-
|
|
2013
|
+
T({ tag: "sps-nav-tab" })
|
|
2014
2014
|
], P);
|
|
2015
2015
|
var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, st = (e, t, s, n) => {
|
|
2016
2016
|
for (var i = n > 1 ? void 0 : n ? fs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
@@ -2032,7 +2032,7 @@ st([
|
|
|
2032
2032
|
_e()
|
|
2033
2033
|
], ue.prototype, "content", 2);
|
|
2034
2034
|
ue = st([
|
|
2035
|
-
|
|
2035
|
+
T({ tag: "sps-nav-tab-set" })
|
|
2036
2036
|
], ue);
|
|
2037
2037
|
const As = {
|
|
2038
2038
|
basic: {
|
|
@@ -2105,7 +2105,7 @@ let A = (Z = class extends HTMLElement {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
}, 1e3 / 60));
|
|
2107
2107
|
}
|
|
2108
|
-
get [
|
|
2108
|
+
get [j]() {
|
|
2109
2109
|
return [
|
|
2110
2110
|
F,
|
|
2111
2111
|
this.fitWidth ? `${F}--fit-width` : `${F}--fit-height`,
|
|
@@ -2170,7 +2170,7 @@ E([
|
|
|
2170
2170
|
xe("img", { refresh: !0 })
|
|
2171
2171
|
], A.prototype, "image", 1);
|
|
2172
2172
|
A = E([
|
|
2173
|
-
|
|
2173
|
+
T({ tag: F })
|
|
2174
2174
|
], A);
|
|
2175
2175
|
const Ds = {
|
|
2176
2176
|
sizing: {
|
|
@@ -2314,8 +2314,8 @@ const Ds = {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
export {
|
|
2316
2316
|
Ie as AttrBindings,
|
|
2317
|
-
|
|
2318
|
-
|
|
2317
|
+
j as ClassBindings,
|
|
2318
|
+
T as Component,
|
|
2319
2319
|
_e as Content,
|
|
2320
2320
|
Ne as EventDispatcher,
|
|
2321
2321
|
re as EventListener,
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-web-components",
|
|
3
3
|
"description": "SPS Design System Native Web Components",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.14.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-web-components",
|
package/lib/index.cjs.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
44
|
* See the License for the specific language governing permissions and
|
|
45
45
|
* limitations under the License.
|
|
46
|
-
*/function rt(e){if(e.lastIndexOf("xml:",0)===0)return"http://www.w3.org/XML/1998/namespace";if(e.lastIndexOf("xlink:",0)===0)return"http://www.w3.org/1999/xlink"}function Ee(e,t,n){if(n==null)e.removeAttribute(t);else{var s=rt(t);s?e.setAttributeNS(s,t,String(n)):e.setAttribute(t,String(n))}}function Ie(e,t,n){e[t]=n}function at(e,t,n){t.indexOf("-")>=0?e.setProperty(t,n):e[t]=n}function ot(e,t,n){if(typeof n=="string")e.style.cssText=n;else{e.style.cssText="";var s=e.style;for(var i in n)it(n,i)&&at(s,i,n[i])}}function lt(e,t,n){var s=typeof n;s==="object"||s==="function"?Ie(e,t,n):Ee(e,t,n)}var $=Pe();$[ue.default]=lt;$.style=ot;function
|
|
46
|
+
*/function rt(e){if(e.lastIndexOf("xml:",0)===0)return"http://www.w3.org/XML/1998/namespace";if(e.lastIndexOf("xlink:",0)===0)return"http://www.w3.org/1999/xlink"}function Ee(e,t,n){if(n==null)e.removeAttribute(t);else{var s=rt(t);s?e.setAttributeNS(s,t,String(n)):e.setAttribute(t,String(n))}}function Ie(e,t,n){e[t]=n}function at(e,t,n){t.indexOf("-")>=0?e.setProperty(t,n):e[t]=n}function ot(e,t,n){if(typeof n=="string")e.style.cssText=n;else{e.style.cssText="";var s=e.style;for(var i in n)it(n,i)&&at(s,i,n[i])}}function lt(e,t,n){var s=typeof n;s==="object"||s==="function"?Ie(e,t,n):Ee(e,t,n)}var $=Pe();$[ue.default]=lt;$.style=ot;function B(e,t,n){var s=$[t]||$[ue.default];s(e,t,n)}/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
49
49
|
*
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
76
76
|
* See the License for the specific language governing permissions and
|
|
77
77
|
* limitations under the License.
|
|
78
|
-
*/var
|
|
78
|
+
*/var T={nodesCreated:null,nodesDeleted:null};/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
81
81
|
*
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
91
91
|
* See the License for the specific language governing permissions and
|
|
92
92
|
* limitations under the License.
|
|
93
|
-
*/var mt=function(){function e(){this.created=[],this.deleted=[]}return e.prototype.markCreated=function(t){this.created.push(t)},e.prototype.markDeleted=function(t){this.deleted.push(t)},e.prototype.notifyChanges=function(){
|
|
93
|
+
*/var mt=function(){function e(){this.created=[],this.deleted=[]}return e.prototype.markCreated=function(t){this.created.push(t)},e.prototype.markDeleted=function(t){this.deleted.push(t)},e.prototype.notifyChanges=function(){T.nodesCreated&&this.created.length>0&&T.nodesCreated(this.created),T.nodesDeleted&&this.deleted.length>0&&T.nodesDeleted(this.deleted)},e}();/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
96
96
|
*
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
121
121
|
* See the License for the specific language governing permissions and
|
|
122
122
|
* limitations under the License.
|
|
123
|
-
*/var Nt=function(){function e(t,n,s){this._attrsArr=null,this.staticsApplied=!1,this.nameOrCtor=t,this.key=n,this.text=s}return e.prototype.hasEmptyAttrsArr=function(){var t=this._attrsArr;return!t||!t.length},e.prototype.getAttrsArr=function(t){return this._attrsArr||(this._attrsArr=new Array(t))},e}();function ge(e,t,n,s){var i=new Nt(t,n,s);return e.__incrementalDOMData=i,i}function
|
|
123
|
+
*/var Nt=function(){function e(t,n,s){this._attrsArr=null,this.staticsApplied=!1,this.nameOrCtor=t,this.key=n,this.text=s}return e.prototype.hasEmptyAttrsArr=function(){var t=this._attrsArr;return!t||!t.length},e.prototype.getAttrsArr=function(t){return this._attrsArr||(this._attrsArr=new Array(t))},e}();function ge(e,t,n,s){var i=new Nt(t,n,s);return e.__incrementalDOMData=i,i}function R(e,t){return Le(e,t)}function xt(e){return Boolean(e.__incrementalDOMData)}function yt(e){return ee(e.__incrementalDOMData),R(e).key}function Le(e,t){if(e.__incrementalDOMData)return e.__incrementalDOMData;var n=ae(e)?e.localName:e.nodeName,s=ae(e)?e.getAttribute("key")||t:null,i=vt(e)?e.data:void 0,r=ge(e,n,s,i);return ae(e)&&At(e,r),r}function Re(e){Le(e);for(var t=e.firstChild;t;t=t.nextSibling)Re(t)}function Te(e){e.__incrementalDOMData=null;for(var t=e.firstChild;t;t=t.nextSibling)Te(t)}function At(e,t){var n=e.attributes,s=n.length;if(!!s)for(var i=t.getAttrsArr(s),r=0,l=0;r<s;r+=1,l+=2){var d=n[r],f=d.name,m=d.value;i[l]=f,i[l+1]=m}}/**
|
|
124
124
|
* @license
|
|
125
125
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
126
126
|
*
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
136
136
|
* See the License for the specific language governing permissions and
|
|
137
137
|
* limitations under the License.
|
|
138
|
-
*/function Ot(e,t){return e==="svg"?"http://www.w3.org/2000/svg":e==="math"?"http://www.w3.org/1998/Math/MathML":t==null||
|
|
138
|
+
*/function Ot(e,t){return e==="svg"?"http://www.w3.org/2000/svg":e==="math"?"http://www.w3.org/1998/Math/MathML":t==null||R(t).nameOrCtor==="foreignObject"?null:t.namespaceURI}function Dt(e,t,n,s){var i;if(typeof n=="function")i=new n;else{var r=Ot(n,t);r?i=e.createElementNS(r,n):i=e.createElement(n)}return ge(i,n,s),i}function Pt(e){var t=e.createTextNode("");return ge(t,"#text",null),t}/**
|
|
139
139
|
* @license
|
|
140
140
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
141
141
|
*
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
151
151
|
* See the License for the specific language governing permissions and
|
|
152
152
|
* limitations under the License.
|
|
153
|
-
*/var k=null,u=null,C=null,D=null,Q=[],Z=[];function te(){return Z}function
|
|
153
|
+
*/var k=null,u=null,C=null,D=null,Q=[],Z=[];function te(){return Z}function Be(e){var t=function(n,s,i){var r=k,l=D,d=Q,f=Z,m=u,b=C,N=!1,W=!1;k=new mt,D=n.ownerDocument,Z=[],C=n.parentNode,Q=_t(n,C),process.env.NODE_ENV!=="production"&&(N=J(!1),W=Y(!1));try{var Me=e(n,s,i);return process.env.NODE_ENV!=="production"&&dt(),Me}finally{D=l,Z=f,u=m,C=b,Q=d,k.notifyChanges(),J(N),Y(W),k=r}};return t}var Ue=Be(function(e,t,n){return u=e,ze(),t(n),We(),process.env.NODE_ENV!=="production"&&ct(u,e),e}),Et=Be(function(e,t,n){var s={nextSibling:e},i=null,r=null;return process.env.NODE_ENV!=="production"&&(i=e.nextSibling,r=e.previousSibling),u=s,t(n),process.env.NODE_ENV!=="production"&&(pt(C),ft(s,u,i,r)),C&&je(C,ne(),e.nextSibling),s===u?null:u});function Ne(e,t,n){var s=R(e,n);return t==s.nameOrCtor&&n==s.key}function It(e,t,n){if(!e)return null;if(Ne(e,t,n))return e;if(n){for(;e=e.nextSibling;)if(Ne(e,t,n))return e}return null}function Ft(e,t){var n;return e==="#text"?n=Pt(D):n=Dt(D,C,e,t),k.markCreated(n),n}function $e(e,t){var n=It(u,e,t),s=n||Ft(e,t);s!==u&&(Q.indexOf(s)>=0?St(C,s,u):C.insertBefore(s,u),u=s)}function je(e,t,n){for(var s=e,i=t;i!==n;){var r=i.nextSibling;s.removeChild(i),k.markDeleted(i),i=r}}function ze(){C=u,u=null}function ne(){return u?u.nextSibling:C.firstChild}function ve(){u=ne()}function We(){je(C,ne(),null),u=C,C=C.parentNode}function He(e,t){return ve(),$e(e,t),ze(),C}function Ve(){return process.env.NODE_ENV!=="production"&&Y(!1),We(),u}function kt(){return ve(),$e("#text",null),u}function Lt(){return process.env.NODE_ENV!=="production"&&(Fe("currentElement",D),L("currentElement")),C}function Rt(){return process.env.NODE_ENV!=="production"&&(Fe("currentPointer",D),L("currentPointer")),ne()}function Tt(){process.env.NODE_ENV!=="production"&&(ut("skip",u),Y(!0)),u=C.lastChild}/**
|
|
154
154
|
* @license
|
|
155
155
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
156
156
|
*
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
166
166
|
* See the License for the specific language governing permissions and
|
|
167
167
|
* limitations under the License.
|
|
168
|
-
*/var xe=3,S=Pe();function
|
|
168
|
+
*/var xe=3,S=Pe();function Bt(e,t,n){if(t.staticsApplied=!0,!(!n||!n.length)){if(t.hasEmptyAttrsArr()){for(var s=0;s<n.length;s+=2)B(e,n[s],n[s+1]);return}for(var s=0;s<n.length;s+=2)S[n[s]]=s+1;for(var i=t.getAttrsArr(0),r=0,s=0;s<i.length;s+=2){var l=i[s],d=i[s+1],f=S[l];if(f){n[f]===d&&delete S[l];continue}i[r]=l,i[r+1]=d,r+=2}fe(i,r);for(var l in S)B(e,l,n[S[l]]),delete S[l]}}function Ce(e,t,n){process.env.NODE_ENV!=="production"&&(L("elementOpen"),ke("elementOpen"));var s=He(e,t),i=R(s);i.staticsApplied||Bt(s,i,n);var r=Math.max(0,arguments.length-xe),l=i.hasEmptyAttrsArr();if(!r&&l)return s;for(var d=i.getAttrsArr(r),f=xe,m=0;f<arguments.length;f+=2,m+=2){var b=arguments[f];if(l)d[m]=b;else if(d[m]!==b)break;var N=arguments[f+1];(l||d[m+1]!==N)&&(d[m+1]=N,B(s,b,N))}if(f<arguments.length||m<d.length){for(var W=m;m<d.length;m+=2)S[d[m]]=d[m+1];for(m=W;f<arguments.length;f+=2,m+=2){var b=arguments[f],N=arguments[f+1];S[b]!==N&&B(s,b,N),d[m]=b,d[m+1]=N,delete S[b]}fe(d,m);for(var b in S)B(s,b,void 0),delete S[b]}return s}function Ut(e,t,n){var s=te();process.env.NODE_ENV!=="production"&&(L("elementOpenStart"),J(!0)),s[0]=e,s[1]=t,s[2]=n}function $t(e){var t=te();process.env.NODE_ENV!=="production"&&(me("key"),ee(t)),t[1]=e}function jt(e,t){var n=te();process.env.NODE_ENV!=="production"&&me("attr"),n.push(e),n.push(t)}function zt(){var e=te();process.env.NODE_ENV!=="production"&&(me("elementOpenEnd"),J(!1)),ee(e);var t=Ce.apply(null,e);return fe(e,0),t}function qe(e){process.env.NODE_ENV!=="production"&&L("elementClose");var t=Ve();return process.env.NODE_ENV!=="production"&&ht(R(t).nameOrCtor,e),t}function Wt(e,t,n){return Ce.apply(null,arguments),qe(e)}function Ht(e){process.env.NODE_ENV!=="production"&&(L("text"),ke("text"));var t=kt(),n=R(t);if(n.text!==e){n.text=e;for(var s=e,i=1;i<arguments.length;i+=1){var r=arguments[i];s=r(s)}t.data=s}return t}/**
|
|
169
169
|
* @license
|
|
170
170
|
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
|
|
171
171
|
*
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
181
181
|
* See the License for the specific language governing permissions and
|
|
182
182
|
* limitations under the License.
|
|
183
|
-
*/h.applyAttr=Ee;h.applyProp=Ie;h.attributes=$;h.close=Ve;var be=h.currentElement=Lt,le=h.currentPointer=Tt;h.open=He;var Vt=h.patch=Ue;h.patchInner=Ue;h.patchOuter=Et;h.skip=Bt;var ce=h.skipNode=ve;h.getKey=yt;h.clearCache=Be;h.importNode=Te;h.isDataInitialized=xt;h.notifications=B;h.symbols=ue;var ye=h.attr=jt,qt=h.elementClose=qe;h.elementOpen=Ce;var Gt=h.elementOpenEnd=zt,Xt=h.elementOpenStart=Ut;h.elementVoid=Wt;var Kt=h.text=Ht;h.key=$t;function Ae(e){let t=le();return t instanceof Comment&&t.data!==e?t.data=e:(t=document.createComment(e),be().appendChild(t)),ce(),t}let Ge=U.noI18nI18n;function Qt(e){Ge=e}function Zt(){return Ge}const O=Symbol("ComponentMetadata"),_=Object.freeze({has(e,t){return Boolean(e[O]&&Object.prototype.hasOwnProperty.call(e[O],t))},add(e,t){e[O]?Object.assign(e[O],t):e[O]=t},get(e,t,n){return e[O]&&e[O][t]||n}}),Oe=Symbol("ds-web-components:pragma:listeners-attached"),Xe="idom-pragma:content-begin",pe="idom-pragma:content-end";function de(e){for(const t of e)if(typeof t=="function")t();else if(typeof t=="string")Kt(t);else if(t instanceof Set)de(Array.from(t));else if(Array.isArray(t)&&t.length>0){let n=le();if(Ae(Xe),n===null){const s=be();for(let i=0;i<t.length;i+=1)s.contains(t[i])||s.appendChild(t[i]),ce()}for(;n&&n.data!==pe;)ce(),n=le();Ae(pe)}}function o(e,t,...n){if(t){for(const s of Object.keys(t))if(s.toUpperCase()==="DATA-FRAGMENT")return()=>de(n)}return()=>{Xt(e);const s=[];if(t)for(const r of Object.keys(t))r.toUpperCase()==="CLASSNAME"?ye("class",t[r]):/^on[A-Z]/.test(r)?s.push(r):ye(r,t[r]);Gt(e);const i=be();if(!i[Oe]){for(const r of s)i.addEventListener(r.substr(2).toLowerCase(),t[r]);i[Oe]=!0}de(n),qt(e)}}function Ke(e,t){customElements.get(e)||customElements.define(e,t)}function Jt(...e){for(const t of e)Ke(_.get(t,"tag"),t)}function Yt(e){return function(...n){for(const s of n){const i=`${e}${_.get(s,"tag").substr(3)}`;Ke(i,s)}}}const he=Symbol("Component Attribute Bindings"),P=Symbol("Component Class Bindings"),M=Symbol("Component Style Bindings"),Mt={__initialized:!1,__observer:null,__queuedUpdate:null,__managedClasses:new Set,__updateHostBindings(){const e=this;for(const t of Object.keys(e[he]||{}))e.setAttribute(t,e[he][t]);for(const t of Object.keys(e[M]||{}))e.style[t]=e[M][t];for(const t of e.__managedClasses)e.classList.remove(t);for(const t of(e[P]||[]).filter(Boolean))e.__managedClasses.add(t),e.classList.add(t);for(const t of(e.getAttribute("classname")||"").split(/\w+/).filter(Boolean))e.classList.add(t)},__updateChildQueries(e){const t=this;for(const n of _.get(t.constructor,"childQueries",[]))if(!e||e&&n.refresh){const s=n.all?t.querySelectorAll:t.querySelector;t[n.key]=s.call(t,n.selector)}},__gatherChildren(){const e=this;let t=Array.from(e.childNodes),n=null,s=t.length;for(let i=0;i<t.length;i+=1){const r=t[i];r instanceof Comment&&(r.data===Xe?n=i+1:r.data===pe&&(s=i-1))}if(n===null)for(const i of t)i.parentNode.removeChild(i);else t=t.slice(n,s);_.has(e.constructor,"contentProp")&&(e[_.get(e.constructor,"contentProp")]=t)},__startMutObs(){const e=this;e.__observer||(e.__observer=new MutationObserver(()=>{e.contentChangedCallback&&e.contentChangedCallback(),e.__gatherChildren(),e.update()})),e.__observer.observe(e,{childList:!0})},__stopMutObs(){const e=this;e.__observer&&e.__observer.disconnect()},__doRender(){const e=this;e.__stopMutObs(),Vt(e,e.render(Zt())),e.__startMutObs()},update(){const e=this;e.__initialized&&!e.__queuedUpdate&&(e.__queuedUpdate=window.requestAnimationFrame(()=>{e.__doRender(),setTimeout(()=>{e.__updateChildQueries(!0),e.__updateHostBindings()},0),e.__queuedUpdate=null}))},attributeChangedCallback(e,t,n){const s=this,i=n===""?!0:n;i!==t&&(s.__cbAttributeChanged&&s.__cbAttributeChanged(e,s[e],i),e!=="style"&&(s[e]=i),s.__initialized&&s.update())},connectedCallback(){const e=this;e.__cbConnected&&e.__cbConnected();const t=_.get(e.constructor,"eventListeners",[]);setTimeout(()=>{if(!e.__initialized){e.__gatherChildren();for(const[,n]of t)e[n]=e[n].bind(e);e.__initialized=!0}for(const[n,s]of t)e.addEventListener(n,e[s]);e.__doRender(),setTimeout(()=>{e.__updateChildQueries(),e.__updateHostBindings()},0)},0)},disconnectedCallback(){const e=this;e.__cbDisconnected&&e.__cbDisconnected();for(const[t,n]of _.get(e.constructor,"eventListeners",[]))e.removeEventListener(t,e[n]);e.__stopMutObs()}};function E(e){return t=>{_.add(t,e),Object.assign(t.prototype,{__cbAttributeChanged:t.prototype.attributeChangedCallback,__cbConnected:t.prototype.connectedCallback,__cbDisconnected:t.prototype.disconnectedCallback},Mt)}}function se(){return(e,t)=>{_.add(e.constructor,{contentProp:t})}}function ie(e){return(t,n)=>{Object.defineProperty(t,n,{get(){return Object.defineProperty(this,n,{value:{dispatch:s=>{const i=new CustomEvent(e||n,{detail:s});return this.dispatchEvent(i),i}}}),this[n]},configurable:!0})}}function z(e){return(t,n)=>{const s=_.get(t.constructor,"eventListeners",[]);s.push([e,n]),_.add(t.constructor,{eventListeners:s})}}function p(e){return(t,n)=>{const s=t.constructor,i=n.toLowerCase();if(s.observedAttributes=s.observedAttributes||["classname","className","style"],s.observedAttributes.push(n),s.observedAttributes.push(i),i!==n&&Object.defineProperty(t,n,{get(){return this[i]},set(r){this[i]=r}}),e){const r=Symbol.for(n);Object.defineProperty(t,i,{get(){return this[r]},set(l){let d=l;e===Boolean&&typeof l=="string"&&l.toLowerCase()==="false"?d=!1:d=e(l),this[r]=d}})}}}function Qe(e,t,n){return(s,i)=>{const r=_.get(s.constructor,"childQueries",[]);r.push({key:i,selector:e,all:n,refresh:t.refresh}),_.add(s.constructor,{childQueries:r})}}function re(e,t={}){return Qe(e,t)}function Ze(e,t={}){return Qe(e,t,!0)}function we(){return(e,t)=>{const n=Symbol(t);Object.defineProperties(e,{[n]:{writable:!0,enumerable:!1,configurable:!1,value:e[t]},[t]:{get(){return this[n]},set(s){this[n]!==s&&(this[n]=s,this.update())}}})}}var _e=(e=>(e["7Z"]="application/x-7z-compressed",e.AAC="audio/aac",e.ABW="application/x-abiword",e.ARC="application/octet-stream",e.AVI="video/x-msvideo",e.AZW="application/vnd.amazon.ebook",e.BIN="application/octet-stream",e.BMP="image/bmp",e.BZ="application/x-bzip",e.BZ2="application/x-bzip2",e.CSH="application/x-csh",e.CSS="text/css",e.CSV="text/csv,application/vnd.ms-excel",e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.EOT="application/vnd.ms-fontobject",e.EPUB="application/epub+zip",e.ES="application/ecmascript",e.FLV="video/x-flv",e.GIF="image/gif",e.GZ="application/x-gzip",e.HTM="text/html",e.HTML="text/html",e.ICO="image/x-icon",e.ICS="text/calendar",e.JAR="application/java-archive",e.JPEG="image/jpeg",e.JPG="image/jpeg",e.JS="application/javascript",e.JSON="application/json",e.M3U="audio/x-mpequrl",e.MID="audio/midi",e.MIDI="audio/midi",e.MOV="video/quicktime",e.MP3="audio/mpeg3",e.MP4="video/mp4",e.MPEG="video/mpeg",e.MPKG="application/vnd.apple.installer+xml",e.ODP="application/vnd.oasis.opendocument.presentation",e.ODS="application/vnd.oasis.opendocument.spreadsheet",e.ODT="application/vnd.oasis.opendocument.text",e.OGA="audio/ogg",e.OGV="video/ogg",e.OGX="application/ogg",e.OTF="font/otf",e.PNG="image/png",e.PDF="application/pdf",e.PPT="application/vnd.ms-powerpoint",e.PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",e.RAR="application/x-rar-compressed",e.RTF="application/rtf",e.SH="application/x-sh",e.SVG="image/svg+xml",e.SWF="application/x-shockwave-flash",e.TAR="application/x-tar",e.TIF="image/tiff",e.TIFF="image/tiff",e.TS="application/typescript",e.TTF="font/ttf",e.TXT="text/plain",e.VSD="application/vnd.visio",e.WAV="audio/wav",e.WEBA="audio/webm",e.WEBM="video/webm",e.WEBP="image/webp",e.WOFF="font/woff",e.WOFF2="font/woff2",e.XHTML="application/xhtml+xml",e.XLS="application/vnd.ms-excel",e.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.XML="application/xml",e.XUL="application/vnd.mozilla.xul+xml",e.ZIP="application/zip",e))(_e||{}),en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,v=(e,t,n,s)=>{for(var i=s>1?void 0:s?tn(t,n):t,r=e.length-1,l;r>=0;r--)(l=e[r])&&(i=(s?l(t,n,i):l(i))||i);return s&&i&&en(t,n,i),i};const g="sps-file-upload";var H;exports.SpsFileUploadComponent=(H=class extends HTMLElement{constructor(){super();a(this,"description");a(this,"multiple");a(this,"shown",!0);a(this,"dismissable");a(this,"processing");a(this,"mini");a(this,"constrainContentWidth");a(this,"downloadLabel");a(this,"acceptExtensions");a(this,"maxSize");a(this,"customRequirement");a(this,"selection");a(this,"dismissal");a(this,"download");a(this,"fileInput");a(this,"files",[]);a(this,"accept");a(this,"acceptMIMETypes",new Set);a(this,"acceptExtensionsDescription");a(this,"maxSizeBytes");a(this,"active",!1);a(this,"error",!1);a(this,"namesOfUnsupportedFiles",[]);this.handleBrowseLinkClick=this.handleBrowseLinkClick.bind(this),this.handleDownloadButtonClick=this.handleDownloadButtonClick.bind(this),this.handleFileInputChange=this.handleFileInputChange.bind(this),this.dismiss=this.dismiss.bind(this)}get[P](){return[g,this.active&&`${g}--active`,this.error&&`${g}--error`,!this.shown&&`${g}--hidden`,this.mini&&`${g}--mini`,this.constrainContentWidth&&`${g}--constrained-content-width`]}connectedCallback(){this.description=this.description||(this.multiple?"Files":"File"),this.acceptExtensions&&this.processAcceptExtensions(this.acceptExtensions),this.maxSize&&this.parseAndValidateMaxSize(this.maxSize)}attributeChangedCallback(t,n,s){t==="acceptExtensions"&&this.processAcceptExtensions(s),t==="maxSize"&&this.parseAndValidateMaxSize(s)}dismiss(){this.dismissable&&(this.shown=!1,this.update(),this.dismissal.dispatch())}show(){this.dismissable&&(this.shown=!0,this.update())}render({t}){const n=this.error?U.SpsIcon.EXCLAMATION_CIRCLE:U.SpsIcon.UPLOAD_CLOUD,s=(this.multiple?t("design-system:fileUpload.instructions_plural"):t("design-system:fileUpload.instructions")).split("|");return o("div",{"data-fragment":!0},o("div",{className:`${g}__content`},this.processing?o("div",{"data-fragment":!0},o("i",{className:"sps-spinner sps-spinner--medium","aria-hidden":"true"}),o("div",{className:`${g}__instructions`},t("design-system:fileUpload.processing"))):o("div",{"data-fragment":!0},o("i",{className:`sps-icon sps-icon-${n} ${g}__icon-primary`,"aria-hidden":"true"}),o("div",{className:`${g}__title`},this.error?o("div",{"data-fragment":!0},t(this.namesOfUnsupportedFiles.length>1?"design-system:fileUpload.cancelled_plural":"design-system:fileUpload.cancelled")):o("div",{"data-fragment":!0},t("design-system:fileUpload.title",{description:this.description}))),this.error?o("div",{className:`${g}__errored-files`},new Set(this.namesOfUnsupportedFiles.map((i,r)=>{const l=Math.floor(i.length/2);return o("div",{className:`${g}__errored-filename`,key:i},o("span",{className:`${g}__errored-filename-segment`},i.substr(0,l)),o("div",{className:`${g}__errored-filename-segment`},o("span",null,i.substr(l))),r<this.namesOfUnsupportedFiles.length-1?",":"")}))):o("span",null),o("div",{className:`${g}__instructions`},o("div",{"data-fragment":!0},o("span",null,s[0]),o("a",{href:"",onClick:this.handleBrowseLinkClick},s[1]),o("span",null,s[2]))),o("div",{className:`${g}__requirements`},this.acceptExtensions?o("span",null,"("," ",t("design-system:fileUpload.acceptedTypes",{fileTypes:this.acceptExtensionsDescription})," ",")"):"",this.maxSize?o("span",null,"("," ",t("design-system:fileUpload.maximumSize",{size:this.maxSize})," ",")"):"",this.customRequirement?o("span",null," ",this.customRequirement," "):""),this.downloadLabel&&o("div",{className:`sps-button sps-button--link ${g}__download-button`,onClick:this.handleDownloadButtonClick},o("button",{type:"button"},o("i",{className:"sps-icon sps-icon-download-cloud","aria-hidden":"true"})," ",this.downloadLabel)))),this.dismissable&&!this.processing&&o("div",{className:`sps-button sps-button--icon ${g}__close-button`,onClick:this.dismiss},o("button",{type:"button",title:t("design-system:fileUpload.close")},o("i",{className:"sps-icon sps-icon-x","aria-hidden":"true"}))),o("form",null,o("input",{type:"file",accept:this.accept||"*/*",multiple:this.multiple||null,onChange:this.handleFileInputChange})))}parseAndValidateMaxSize(t){try{this.maxSizeBytes=c.parseFileSize(t)}catch{throw new Error(`Could not parse "${t}" as a file size.`)}}processAcceptExtensions(t){const s=(Array.isArray(t)?t:t.trim().split(/\s?,\s?/)).map(r=>r.replace(/^\./,"")),i=s.map(r=>`.${r}`.toLowerCase());this.acceptExtensionsDescription=i.map((r,l)=>l>0&&l===i.length-1?`or ${r}`:r).join(i.length>2?", ":" "),this.acceptMIMETypes.clear();for(const r of s)for(const l of _e[r.toUpperCase()].split(","))this.acceptMIMETypes.add(l);this.accept=i.concat(Array.from(this.acceptMIMETypes)).join(",")}selectFiles(t){this.namesOfUnsupportedFiles=[];const n=Array.from(t);for(const s of n)this.acceptExtensions&&!this.acceptMIMETypes.has(s.type)&&this.namesOfUnsupportedFiles.push(s.name),this.maxSize&&s.size>this.maxSizeBytes&&this.namesOfUnsupportedFiles.indexOf(s.name)===-1&&this.namesOfUnsupportedFiles.push(s.name);this.namesOfUnsupportedFiles.length?(this.error=!0,this.fileInput.value=null,this.update()):(this.files=n,this.selection.dispatch(n))}handleDragOver(t){t.preventDefault(),t.stopPropagation()}handleDragEnter(t){t.preventDefault(),this.active=!0,this.error=!1,this.update()}handleDragLeave(t){t.preventDefault(),this.active=!1,this.update()}handleDrop(t){t.preventDefault(),t.stopPropagation(),this.active=!1,t.dataTransfer.items?this.selectFiles(Array.from(t.dataTransfer.items).map(n=>n.getAsFile())):this.selectFiles(t.dataTransfer.files),this.update()}handleBrowseLinkClick(t){t.preventDefault(),this.error=!1,this.update(),this.fileInput.click()}handleDownloadButtonClick(){this.download.dispatch()}handleFileInputChange(t){t.stopPropagation(),this.selectFiles(t.target.files)}},a(H,"displayName",g),a(H,"props",{description:"string",multiple:"boolean",dismissable:"boolean",processing:"boolean",mini:"boolean",downloadLabel:"string",acceptExtensions:"Array<string> | string",maxSize:"string",customRequirement:"string",selection:{event:!0,type:"CustomEvent<Array<File>>"},dismissal:{event:!0,type:"CustomEvent<void>"},download:{event:!0,type:"CustomEvent<void>"}}),H);v([p()],exports.SpsFileUploadComponent.prototype,"description",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"multiple",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"shown",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"dismissable",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"processing",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"mini",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"constrainContentWidth",2);v([p()],exports.SpsFileUploadComponent.prototype,"downloadLabel",2);v([p()],exports.SpsFileUploadComponent.prototype,"acceptExtensions",2);v([p()],exports.SpsFileUploadComponent.prototype,"maxSize",2);v([p()],exports.SpsFileUploadComponent.prototype,"customRequirement",2);v([ie()],exports.SpsFileUploadComponent.prototype,"selection",2);v([ie()],exports.SpsFileUploadComponent.prototype,"dismissal",2);v([ie()],exports.SpsFileUploadComponent.prototype,"download",2);v([re("input[type='file']")],exports.SpsFileUploadComponent.prototype,"fileInput",2);v([z("dragover")],exports.SpsFileUploadComponent.prototype,"handleDragOver",1);v([z("dragenter")],exports.SpsFileUploadComponent.prototype,"handleDragEnter",1);v([z("dragleave")],exports.SpsFileUploadComponent.prototype,"handleDragLeave",1);v([z("drop")],exports.SpsFileUploadComponent.prototype,"handleDrop",1);exports.SpsFileUploadComponent=v([E({tag:g})],exports.SpsFileUploadComponent);const nn={basic:{label:"Basic File Upload",description:c.code`
|
|
183
|
+
*/h.applyAttr=Ee;h.applyProp=Ie;h.attributes=$;h.close=Ve;var be=h.currentElement=Lt,le=h.currentPointer=Rt;h.open=He;var Vt=h.patch=Ue;h.patchInner=Ue;h.patchOuter=Et;h.skip=Tt;var ce=h.skipNode=ve;h.getKey=yt;h.clearCache=Te;h.importNode=Re;h.isDataInitialized=xt;h.notifications=T;h.symbols=ue;var ye=h.attr=jt,qt=h.elementClose=qe;h.elementOpen=Ce;var Gt=h.elementOpenEnd=zt,Xt=h.elementOpenStart=Ut;h.elementVoid=Wt;var Kt=h.text=Ht;h.key=$t;function Ae(e){let t=le();return t instanceof Comment&&t.data!==e?t.data=e:(t=document.createComment(e),be().appendChild(t)),ce(),t}let Ge=U.noI18nI18n;function Qt(e){Ge=e}function Zt(){return Ge}const O=Symbol("ComponentMetadata"),_=Object.freeze({has(e,t){return Boolean(e[O]&&Object.prototype.hasOwnProperty.call(e[O],t))},add(e,t){e[O]?Object.assign(e[O],t):e[O]=t},get(e,t,n){return e[O]&&e[O][t]||n}}),Oe=Symbol("ds-web-components:pragma:listeners-attached"),Xe="idom-pragma:content-begin",pe="idom-pragma:content-end";function de(e){for(const t of e)if(typeof t=="function")t();else if(typeof t=="string")Kt(t);else if(t instanceof Set)de(Array.from(t));else if(Array.isArray(t)&&t.length>0){let n=le();if(Ae(Xe),n===null){const s=be();for(let i=0;i<t.length;i+=1)s.contains(t[i])||s.appendChild(t[i]),ce()}for(;n&&n.data!==pe;)ce(),n=le();Ae(pe)}}function o(e,t,...n){if(t){for(const s of Object.keys(t))if(s.toUpperCase()==="DATA-FRAGMENT")return()=>de(n)}return()=>{Xt(e);const s=[];if(t)for(const r of Object.keys(t))r.toUpperCase()==="CLASSNAME"?ye("class",t[r]):/^on[A-Z]/.test(r)?s.push(r):ye(r,t[r]);Gt(e);const i=be();if(!i[Oe]){for(const r of s)i.addEventListener(r.substr(2).toLowerCase(),t[r]);i[Oe]=!0}de(n),qt(e)}}function Ke(e,t){customElements.get(e)||customElements.define(e,t)}function Jt(...e){for(const t of e)Ke(_.get(t,"tag"),t)}function Yt(e){return function(...n){for(const s of n){const i=`${e}${_.get(s,"tag").substr(3)}`;Ke(i,s)}}}const he=Symbol("Component Attribute Bindings"),P=Symbol("Component Class Bindings"),M=Symbol("Component Style Bindings"),Mt={__initialized:!1,__observer:null,__queuedUpdate:null,__managedClasses:new Set,__updateHostBindings(){const e=this;for(const t of Object.keys(e[he]||{}))e.setAttribute(t,e[he][t]);for(const t of Object.keys(e[M]||{}))e.style[t]=e[M][t];for(const t of e.__managedClasses)e.classList.remove(t);for(const t of(e[P]||[]).filter(Boolean))e.__managedClasses.add(t),e.classList.add(t);for(const t of(e.getAttribute("classname")||"").split(/\w+/).filter(Boolean))e.classList.add(t)},__updateChildQueries(e){const t=this;for(const n of _.get(t.constructor,"childQueries",[]))if(!e||e&&n.refresh){const s=n.all?t.querySelectorAll:t.querySelector;t[n.key]=s.call(t,n.selector)}},__gatherChildren(){const e=this;let t=Array.from(e.childNodes),n=null,s=t.length;for(let i=0;i<t.length;i+=1){const r=t[i];r instanceof Comment&&(r.data===Xe?n=i+1:r.data===pe&&(s=i-1))}if(n===null)for(const i of t)i.parentNode.removeChild(i);else t=t.slice(n,s);_.has(e.constructor,"contentProp")&&(e[_.get(e.constructor,"contentProp")]=t)},__startMutObs(){const e=this;e.__observer||(e.__observer=new MutationObserver(()=>{e.contentChangedCallback&&e.contentChangedCallback(),e.__gatherChildren(),e.update()})),e.__observer.observe(e,{childList:!0})},__stopMutObs(){const e=this;e.__observer&&e.__observer.disconnect()},__doRender(){const e=this;e.__stopMutObs(),Vt(e,e.render(Zt())),e.__startMutObs()},update(){const e=this;e.__initialized&&!e.__queuedUpdate&&(e.__queuedUpdate=window.requestAnimationFrame(()=>{e.__doRender(),setTimeout(()=>{e.__updateChildQueries(!0),e.__updateHostBindings()},0),e.__queuedUpdate=null}))},attributeChangedCallback(e,t,n){const s=this,i=n===""?!0:n;i!==t&&(s.__cbAttributeChanged&&s.__cbAttributeChanged(e,s[e],i),e!=="style"&&(s[e]=i),s.__initialized&&s.update())},connectedCallback(){const e=this;e.__cbConnected&&e.__cbConnected();const t=_.get(e.constructor,"eventListeners",[]);setTimeout(()=>{if(!e.__initialized){e.__gatherChildren();for(const[,n]of t)e[n]=e[n].bind(e);e.__initialized=!0}for(const[n,s]of t)e.addEventListener(n,e[s]);e.__doRender(),setTimeout(()=>{e.__updateChildQueries(),e.__updateHostBindings()},0)},0)},disconnectedCallback(){const e=this;e.__cbDisconnected&&e.__cbDisconnected();for(const[t,n]of _.get(e.constructor,"eventListeners",[]))e.removeEventListener(t,e[n]);e.__stopMutObs()}};function E(e){return t=>{_.add(t,e),Object.assign(t.prototype,{__cbAttributeChanged:t.prototype.attributeChangedCallback,__cbConnected:t.prototype.connectedCallback,__cbDisconnected:t.prototype.disconnectedCallback},Mt)}}function se(){return(e,t)=>{_.add(e.constructor,{contentProp:t})}}function ie(e){return(t,n)=>{Object.defineProperty(t,n,{get(){return Object.defineProperty(this,n,{value:{dispatch:s=>{const i=new CustomEvent(e||n,{detail:s});return this.dispatchEvent(i),i}}}),this[n]},configurable:!0})}}function z(e){return(t,n)=>{const s=_.get(t.constructor,"eventListeners",[]);s.push([e,n]),_.add(t.constructor,{eventListeners:s})}}function p(e){return(t,n)=>{const s=t.constructor,i=n.toLowerCase();if(s.observedAttributes=s.observedAttributes||["classname","className","style"],s.observedAttributes.push(n),s.observedAttributes.push(i),i!==n&&Object.defineProperty(t,n,{get(){return this[i]},set(r){this[i]=r}}),e){const r=Symbol.for(n);Object.defineProperty(t,i,{get(){return this[r]},set(l){let d=l;e===Boolean&&typeof l=="string"&&l.toLowerCase()==="false"?d=!1:d=e(l),this[r]=d}})}}}function Qe(e,t,n){return(s,i)=>{const r=_.get(s.constructor,"childQueries",[]);r.push({key:i,selector:e,all:n,refresh:t.refresh}),_.add(s.constructor,{childQueries:r})}}function re(e,t={}){return Qe(e,t)}function Ze(e,t={}){return Qe(e,t,!0)}function we(){return(e,t)=>{const n=Symbol(t);Object.defineProperties(e,{[n]:{writable:!0,enumerable:!1,configurable:!1,value:e[t]},[t]:{get(){return this[n]},set(s){this[n]!==s&&(this[n]=s,this.update())}}})}}var _e=(e=>(e["7Z"]="application/x-7z-compressed",e.AAC="audio/aac",e.ABW="application/x-abiword",e.ARC="application/octet-stream",e.AVI="video/x-msvideo",e.AZW="application/vnd.amazon.ebook",e.BIN="application/octet-stream",e.BMP="image/bmp",e.BZ="application/x-bzip",e.BZ2="application/x-bzip2",e.CER="application/pkix-cert",e.CSH="application/x-csh",e.CSS="text/css",e.CSV="text/csv,application/vnd.ms-excel",e.DOC="application/msword",e.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.EOT="application/vnd.ms-fontobject",e.EPUB="application/epub+zip",e.ES="application/ecmascript",e.FLV="video/x-flv",e.GIF="image/gif",e.GZ="application/x-gzip",e.HTM="text/html",e.HTML="text/html",e.ICO="image/x-icon",e.ICS="text/calendar",e.JAR="application/java-archive",e.JPEG="image/jpeg",e.JPG="image/jpeg",e.JS="application/javascript",e.JSON="application/json",e.M3U="audio/x-mpequrl",e.MID="audio/midi",e.MIDI="audio/midi",e.MOV="video/quicktime",e.MP3="audio/mpeg3",e.MP4="video/mp4",e.MPEG="video/mpeg",e.MPKG="application/vnd.apple.installer+xml",e.ODP="application/vnd.oasis.opendocument.presentation",e.ODS="application/vnd.oasis.opendocument.spreadsheet",e.ODT="application/vnd.oasis.opendocument.text",e.OGA="audio/ogg",e.OGV="video/ogg",e.OGX="application/ogg",e.OTF="font/otf",e.PNG="image/png",e.PDF="application/pdf",e.PPT="application/vnd.ms-powerpoint",e.PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",e.RAR="application/x-rar-compressed",e.RTF="application/rtf",e.SH="application/x-sh",e.SVG="image/svg+xml",e.SWF="application/x-shockwave-flash",e.TAR="application/x-tar",e.TIF="image/tiff",e.TIFF="image/tiff",e.TS="application/typescript",e.TTF="font/ttf",e.TXT="text/plain",e.VSD="application/vnd.visio",e.WAV="audio/wav",e.WEBA="audio/webm",e.WEBM="video/webm",e.WEBP="image/webp",e.WOFF="font/woff",e.WOFF2="font/woff2",e.XHTML="application/xhtml+xml",e.XLS="application/vnd.ms-excel",e.XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.XML="application/xml",e.XUL="application/vnd.mozilla.xul+xml",e.ZIP="application/zip",e))(_e||{}),en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,v=(e,t,n,s)=>{for(var i=s>1?void 0:s?tn(t,n):t,r=e.length-1,l;r>=0;r--)(l=e[r])&&(i=(s?l(t,n,i):l(i))||i);return s&&i&&en(t,n,i),i};const g="sps-file-upload";var H;exports.SpsFileUploadComponent=(H=class extends HTMLElement{constructor(){super();a(this,"description");a(this,"multiple");a(this,"shown",!0);a(this,"dismissable");a(this,"processing");a(this,"mini");a(this,"constrainContentWidth");a(this,"downloadLabel");a(this,"acceptExtensions");a(this,"maxSize");a(this,"customRequirement");a(this,"selection");a(this,"dismissal");a(this,"download");a(this,"fileInput");a(this,"files",[]);a(this,"accept");a(this,"acceptMIMETypes",new Set);a(this,"acceptExtensionsDescription");a(this,"maxSizeBytes");a(this,"active",!1);a(this,"error",!1);a(this,"namesOfUnsupportedFiles",[]);this.handleBrowseLinkClick=this.handleBrowseLinkClick.bind(this),this.handleDownloadButtonClick=this.handleDownloadButtonClick.bind(this),this.handleFileInputChange=this.handleFileInputChange.bind(this),this.dismiss=this.dismiss.bind(this)}get[P](){return[g,this.active&&`${g}--active`,this.error&&`${g}--error`,!this.shown&&`${g}--hidden`,this.mini&&`${g}--mini`,this.constrainContentWidth&&`${g}--constrained-content-width`]}connectedCallback(){this.description=this.description||(this.multiple?"Files":"File"),this.acceptExtensions&&this.processAcceptExtensions(this.acceptExtensions),this.maxSize&&this.parseAndValidateMaxSize(this.maxSize)}attributeChangedCallback(t,n,s){t==="acceptExtensions"&&this.processAcceptExtensions(s),t==="maxSize"&&this.parseAndValidateMaxSize(s)}dismiss(){this.dismissable&&(this.shown=!1,this.update(),this.dismissal.dispatch())}show(){this.dismissable&&(this.shown=!0,this.update())}render({t}){const n=this.error?U.SpsIcon.EXCLAMATION_CIRCLE:U.SpsIcon.UPLOAD_CLOUD,s=(this.multiple?t("design-system:fileUpload.instructions_plural"):t("design-system:fileUpload.instructions")).split("|");return o("div",{"data-fragment":!0},o("div",{className:`${g}__content`},this.processing?o("div",{"data-fragment":!0},o("i",{className:"sps-spinner sps-spinner--medium","aria-hidden":"true"}),o("div",{className:`${g}__instructions`},t("design-system:fileUpload.processing"))):o("div",{"data-fragment":!0},o("i",{className:`sps-icon sps-icon-${n} ${g}__icon-primary`,"aria-hidden":"true"}),o("div",{className:`${g}__title`},this.error?o("div",{"data-fragment":!0},t(this.namesOfUnsupportedFiles.length>1?"design-system:fileUpload.cancelled_plural":"design-system:fileUpload.cancelled")):o("div",{"data-fragment":!0},t("design-system:fileUpload.title",{description:this.description}))),this.error?o("div",{className:`${g}__errored-files`},new Set(this.namesOfUnsupportedFiles.map((i,r)=>{const l=Math.floor(i.length/2);return o("div",{className:`${g}__errored-filename`,key:i},o("span",{className:`${g}__errored-filename-segment`},i.substr(0,l)),o("div",{className:`${g}__errored-filename-segment`},o("span",null,i.substr(l))),r<this.namesOfUnsupportedFiles.length-1?",":"")}))):o("span",null),o("div",{className:`${g}__instructions`},o("div",{"data-fragment":!0},o("span",null,s[0]),o("a",{href:"",onClick:this.handleBrowseLinkClick},s[1]),o("span",null,s[2]))),o("div",{className:`${g}__requirements`},this.acceptExtensions?o("span",null,"("," ",t("design-system:fileUpload.acceptedTypes",{fileTypes:this.acceptExtensionsDescription})," ",")"):"",this.maxSize?o("span",null,"("," ",t("design-system:fileUpload.maximumSize",{size:this.maxSize})," ",")"):"",this.customRequirement?o("span",null," ",this.customRequirement," "):""),this.downloadLabel&&o("div",{className:`sps-button sps-button--link ${g}__download-button`,onClick:this.handleDownloadButtonClick},o("button",{type:"button"},o("i",{className:"sps-icon sps-icon-download-cloud","aria-hidden":"true"})," ",this.downloadLabel)))),this.dismissable&&!this.processing&&o("div",{className:`sps-button sps-button--icon ${g}__close-button`,onClick:this.dismiss},o("button",{type:"button",title:t("design-system:fileUpload.close")},o("i",{className:"sps-icon sps-icon-x","aria-hidden":"true"}))),o("form",null,o("input",{type:"file",accept:this.accept||"*/*",multiple:this.multiple||null,onChange:this.handleFileInputChange})))}parseAndValidateMaxSize(t){try{this.maxSizeBytes=c.parseFileSize(t)}catch{throw new Error(`Could not parse "${t}" as a file size.`)}}processAcceptExtensions(t){const s=(Array.isArray(t)?t:t.trim().split(/\s?,\s?/)).map(r=>r.replace(/^\./,"")),i=s.map(r=>`.${r}`.toLowerCase());this.acceptExtensionsDescription=i.map((r,l)=>l>0&&l===i.length-1?`or ${r}`:r).join(i.length>2?", ":" "),this.acceptMIMETypes.clear();for(const r of s)for(const l of _e[r.toUpperCase()].split(","))this.acceptMIMETypes.add(l);this.accept=i.concat(Array.from(this.acceptMIMETypes)).join(",")}selectFiles(t){this.namesOfUnsupportedFiles=[];const n=Array.from(t);for(const s of n)this.acceptExtensions&&!this.acceptMIMETypes.has(s.type)&&this.namesOfUnsupportedFiles.push(s.name),this.maxSize&&s.size>this.maxSizeBytes&&this.namesOfUnsupportedFiles.indexOf(s.name)===-1&&this.namesOfUnsupportedFiles.push(s.name);this.namesOfUnsupportedFiles.length?(this.error=!0,this.fileInput.value=null,this.update()):(this.files=n,this.selection.dispatch(n))}handleDragOver(t){t.preventDefault(),t.stopPropagation()}handleDragEnter(t){t.preventDefault(),this.active=!0,this.error=!1,this.update()}handleDragLeave(t){t.preventDefault(),this.active=!1,this.update()}handleDrop(t){t.preventDefault(),t.stopPropagation(),this.active=!1,t.dataTransfer.items?this.selectFiles(Array.from(t.dataTransfer.items).map(n=>n.getAsFile())):this.selectFiles(t.dataTransfer.files),this.update()}handleBrowseLinkClick(t){t.preventDefault(),this.error=!1,this.update(),this.fileInput.click()}handleDownloadButtonClick(){this.download.dispatch()}handleFileInputChange(t){t.stopPropagation(),this.selectFiles(t.target.files)}},a(H,"displayName",g),a(H,"props",{description:"string",multiple:"boolean",dismissable:"boolean",processing:"boolean",mini:"boolean",downloadLabel:"string",acceptExtensions:"Array<string> | string",maxSize:"string",customRequirement:"string",selection:{event:!0,type:"CustomEvent<Array<File>>"},dismissal:{event:!0,type:"CustomEvent<void>"},download:{event:!0,type:"CustomEvent<void>"}}),H);v([p()],exports.SpsFileUploadComponent.prototype,"description",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"multiple",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"shown",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"dismissable",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"processing",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"mini",2);v([p(Boolean)],exports.SpsFileUploadComponent.prototype,"constrainContentWidth",2);v([p()],exports.SpsFileUploadComponent.prototype,"downloadLabel",2);v([p()],exports.SpsFileUploadComponent.prototype,"acceptExtensions",2);v([p()],exports.SpsFileUploadComponent.prototype,"maxSize",2);v([p()],exports.SpsFileUploadComponent.prototype,"customRequirement",2);v([ie()],exports.SpsFileUploadComponent.prototype,"selection",2);v([ie()],exports.SpsFileUploadComponent.prototype,"dismissal",2);v([ie()],exports.SpsFileUploadComponent.prototype,"download",2);v([re("input[type='file']")],exports.SpsFileUploadComponent.prototype,"fileInput",2);v([z("dragover")],exports.SpsFileUploadComponent.prototype,"handleDragOver",1);v([z("dragenter")],exports.SpsFileUploadComponent.prototype,"handleDragEnter",1);v([z("dragleave")],exports.SpsFileUploadComponent.prototype,"handleDragLeave",1);v([z("drop")],exports.SpsFileUploadComponent.prototype,"handleDrop",1);exports.SpsFileUploadComponent=v([E({tag:g})],exports.SpsFileUploadComponent);const nn={basic:{label:"Basic File Upload",description:c.code`
|
|
184
184
|
<p>Simply allow the user to drag-and-drop or select either a single file or multiple files at once.</p>
|
|
185
185
|
`,examples:{single:{description:"<p>Single file upload</p>",react:c.code`
|
|
186
186
|
function Component() {
|
package/lib/index.es.js
CHANGED
|
@@ -319,7 +319,7 @@ function ve(e, t, s, n) {
|
|
|
319
319
|
return e.__incrementalDOMData = i, i;
|
|
320
320
|
}
|
|
321
321
|
function $(e, t) {
|
|
322
|
-
return
|
|
322
|
+
return je(e, t);
|
|
323
323
|
}
|
|
324
324
|
function It(e) {
|
|
325
325
|
return Boolean(e.__incrementalDOMData);
|
|
@@ -327,16 +327,16 @@ function It(e) {
|
|
|
327
327
|
function kt(e) {
|
|
328
328
|
return se(e.__incrementalDOMData), $(e).key;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function je(e, t) {
|
|
331
331
|
if (e.__incrementalDOMData)
|
|
332
332
|
return e.__incrementalDOMData;
|
|
333
333
|
var s = ae(e) ? e.localName : e.nodeName, n = ae(e) ? e.getAttribute("key") || t : null, i = yt(e) ? e.data : void 0, r = ve(e, s, n, i);
|
|
334
334
|
return ae(e) && Lt(e, r), r;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
|
|
336
|
+
function Te(e) {
|
|
337
|
+
je(e);
|
|
338
338
|
for (var t = e.firstChild; t; t = t.nextSibling)
|
|
339
|
-
|
|
339
|
+
Te(t);
|
|
340
340
|
}
|
|
341
341
|
function Ue(e) {
|
|
342
342
|
e.__incrementalDOMData = null;
|
|
@@ -427,7 +427,7 @@ function Oe(e, t, s) {
|
|
|
427
427
|
var n = $(e, s);
|
|
428
428
|
return t == n.nameOrCtor && s == n.key;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function jt(e, t, s) {
|
|
431
431
|
if (!e)
|
|
432
432
|
return null;
|
|
433
433
|
if (Oe(e, t, s))
|
|
@@ -439,12 +439,12 @@ function Tt(e, t, s) {
|
|
|
439
439
|
}
|
|
440
440
|
return null;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function Tt(e, t) {
|
|
443
443
|
var s;
|
|
444
444
|
return e === "#text" ? s = Bt(k) : s = Rt(k, C, e, t), R.markCreated(s), s;
|
|
445
445
|
}
|
|
446
446
|
function He(e, t) {
|
|
447
|
-
var s =
|
|
447
|
+
var s = jt(u, e, t), n = s || Tt(e, t);
|
|
448
448
|
n !== u && (J.indexOf(n) >= 0 ? Pt(C, n, u) : C.insertBefore(n, u), u = n);
|
|
449
449
|
}
|
|
450
450
|
function Ve(e, t, s) {
|
|
@@ -619,7 +619,7 @@ h.skip = Ht;
|
|
|
619
619
|
var ce = h.skipNode = be;
|
|
620
620
|
h.getKey = kt;
|
|
621
621
|
h.clearCache = Ue;
|
|
622
|
-
h.importNode =
|
|
622
|
+
h.importNode = Te;
|
|
623
623
|
h.isDataInitialized = It;
|
|
624
624
|
h.notifications = U;
|
|
625
625
|
h.symbols = fe;
|
|
@@ -710,7 +710,7 @@ function ys(e) {
|
|
|
710
710
|
}
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
const Ie = Symbol("Component Attribute Bindings"),
|
|
713
|
+
const Ie = Symbol("Component Attribute Bindings"), j = Symbol("Component Class Bindings"), he = Symbol("Component Style Bindings"), ns = {
|
|
714
714
|
__initialized: !1,
|
|
715
715
|
__observer: null,
|
|
716
716
|
__queuedUpdate: null,
|
|
@@ -723,7 +723,7 @@ const Ie = Symbol("Component Attribute Bindings"), T = Symbol("Component Class B
|
|
|
723
723
|
e.style[t] = e[he][t];
|
|
724
724
|
for (const t of e.__managedClasses)
|
|
725
725
|
e.classList.remove(t);
|
|
726
|
-
for (const t of (e[
|
|
726
|
+
for (const t of (e[j] || []).filter(Boolean))
|
|
727
727
|
e.__managedClasses.add(t), e.classList.add(t);
|
|
728
728
|
for (const t of (e.getAttribute("classname") || "").split(/\w+/).filter(Boolean))
|
|
729
729
|
e.classList.add(t);
|
|
@@ -802,7 +802,7 @@ const Ie = Symbol("Component Attribute Bindings"), T = Symbol("Component Class B
|
|
|
802
802
|
e.__stopMutObs();
|
|
803
803
|
}
|
|
804
804
|
};
|
|
805
|
-
function
|
|
805
|
+
function T(e) {
|
|
806
806
|
return (t) => {
|
|
807
807
|
N.add(t, e), Object.assign(t.prototype, {
|
|
808
808
|
__cbAttributeChanged: t.prototype.attributeChangedCallback,
|
|
@@ -905,7 +905,7 @@ function et() {
|
|
|
905
905
|
});
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
|
-
var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, b = (e, t, s, n) => {
|
|
908
|
+
var tt = /* @__PURE__ */ ((e) => (e["7Z"] = "application/x-7z-compressed", e.AAC = "audio/aac", e.ABW = "application/x-abiword", e.ARC = "application/octet-stream", e.AVI = "video/x-msvideo", e.AZW = "application/vnd.amazon.ebook", e.BIN = "application/octet-stream", e.BMP = "image/bmp", e.BZ = "application/x-bzip", e.BZ2 = "application/x-bzip2", e.CER = "application/pkix-cert", e.CSH = "application/x-csh", e.CSS = "text/css", e.CSV = "text/csv,application/vnd.ms-excel", e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.EOT = "application/vnd.ms-fontobject", e.EPUB = "application/epub+zip", e.ES = "application/ecmascript", e.FLV = "video/x-flv", e.GIF = "image/gif", e.GZ = "application/x-gzip", e.HTM = "text/html", e.HTML = "text/html", e.ICO = "image/x-icon", e.ICS = "text/calendar", e.JAR = "application/java-archive", e.JPEG = "image/jpeg", e.JPG = "image/jpeg", e.JS = "application/javascript", e.JSON = "application/json", e.M3U = "audio/x-mpequrl", e.MID = "audio/midi", e.MIDI = "audio/midi", e.MOV = "video/quicktime", e.MP3 = "audio/mpeg3", e.MP4 = "video/mp4", e.MPEG = "video/mpeg", e.MPKG = "application/vnd.apple.installer+xml", e.ODP = "application/vnd.oasis.opendocument.presentation", e.ODS = "application/vnd.oasis.opendocument.spreadsheet", e.ODT = "application/vnd.oasis.opendocument.text", e.OGA = "audio/ogg", e.OGV = "video/ogg", e.OGX = "application/ogg", e.OTF = "font/otf", e.PNG = "image/png", e.PDF = "application/pdf", e.PPT = "application/vnd.ms-powerpoint", e.PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation", e.RAR = "application/x-rar-compressed", e.RTF = "application/rtf", e.SH = "application/x-sh", e.SVG = "image/svg+xml", e.SWF = "application/x-shockwave-flash", e.TAR = "application/x-tar", e.TIF = "image/tiff", e.TIFF = "image/tiff", e.TS = "application/typescript", e.TTF = "font/ttf", e.TXT = "text/plain", e.VSD = "application/vnd.visio", e.WAV = "audio/wav", e.WEBA = "audio/webm", e.WEBM = "video/webm", e.WEBP = "image/webp", e.WOFF = "font/woff", e.WOFF2 = "font/woff2", e.XHTML = "application/xhtml+xml", e.XLS = "application/vnd.ms-excel", e.XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", e.XML = "application/xml", e.XUL = "application/vnd.mozilla.xul+xml", e.ZIP = "application/zip", e))(tt || {}), rs = Object.defineProperty, as = Object.getOwnPropertyDescriptor, b = (e, t, s, n) => {
|
|
909
909
|
for (var i = n > 1 ? void 0 : n ? as(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
910
910
|
(l = e[r]) && (i = (n ? l(t, s, i) : l(i)) || i);
|
|
911
911
|
return n && i && rs(t, s, i), i;
|
|
@@ -940,7 +940,7 @@ let f = (q = class extends HTMLElement {
|
|
|
940
940
|
a(this, "namesOfUnsupportedFiles", []);
|
|
941
941
|
this.handleBrowseLinkClick = this.handleBrowseLinkClick.bind(this), this.handleDownloadButtonClick = this.handleDownloadButtonClick.bind(this), this.handleFileInputChange = this.handleFileInputChange.bind(this), this.dismiss = this.dismiss.bind(this);
|
|
942
942
|
}
|
|
943
|
-
get [
|
|
943
|
+
get [j]() {
|
|
944
944
|
return [
|
|
945
945
|
v,
|
|
946
946
|
this.active && `${v}--active`,
|
|
@@ -1150,7 +1150,7 @@ b([
|
|
|
1150
1150
|
re("drop")
|
|
1151
1151
|
], f.prototype, "handleDrop", 1);
|
|
1152
1152
|
f = b([
|
|
1153
|
-
|
|
1153
|
+
T({ tag: v })
|
|
1154
1154
|
], f);
|
|
1155
1155
|
const Ss = {
|
|
1156
1156
|
basic: {
|
|
@@ -1492,7 +1492,7 @@ let y = (G = class extends HTMLElement {
|
|
|
1492
1492
|
a(this, "content");
|
|
1493
1493
|
a(this, "detail");
|
|
1494
1494
|
}
|
|
1495
|
-
get [
|
|
1495
|
+
get [j]() {
|
|
1496
1496
|
return [
|
|
1497
1497
|
_,
|
|
1498
1498
|
`${_}--${this.kind}`,
|
|
@@ -1567,7 +1567,7 @@ O([
|
|
|
1567
1567
|
xe(`.${_}__detail`)
|
|
1568
1568
|
], y.prototype, "detail", 2);
|
|
1569
1569
|
y = O([
|
|
1570
|
-
|
|
1570
|
+
T({ tag: _ })
|
|
1571
1571
|
], y);
|
|
1572
1572
|
var cs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, ye = (e, t, s, n) => {
|
|
1573
1573
|
for (var i = n > 1 ? void 0 : n ? ps(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
@@ -1584,7 +1584,7 @@ let te = (X = class extends HTMLElement {
|
|
|
1584
1584
|
a(this, "showAdditionalInsights", !1);
|
|
1585
1585
|
this.toggleAdditionalInsights = this.toggleAdditionalInsights.bind(this);
|
|
1586
1586
|
}
|
|
1587
|
-
get [
|
|
1587
|
+
get [j]() {
|
|
1588
1588
|
return [
|
|
1589
1589
|
D,
|
|
1590
1590
|
this.showAdditionalInsights && `${D}--show-additional`,
|
|
@@ -1615,7 +1615,7 @@ ye([
|
|
|
1615
1615
|
is(".sps-insight-card__detail")
|
|
1616
1616
|
], te.prototype, "details", 2);
|
|
1617
1617
|
te = ye([
|
|
1618
|
-
|
|
1618
|
+
T({ tag: D })
|
|
1619
1619
|
], te);
|
|
1620
1620
|
const Os = {
|
|
1621
1621
|
basic: {
|
|
@@ -1965,7 +1965,7 @@ let P = (K = class extends HTMLElement {
|
|
|
1965
1965
|
a(this, "href");
|
|
1966
1966
|
a(this, "target");
|
|
1967
1967
|
}
|
|
1968
|
-
get [
|
|
1968
|
+
get [j]() {
|
|
1969
1969
|
return [
|
|
1970
1970
|
"sps-tabbed-nav__nav-item",
|
|
1971
1971
|
this.active && "sps-tabbed-nav__nav-item--active"
|
|
@@ -2010,7 +2010,7 @@ L([
|
|
|
2010
2010
|
p()
|
|
2011
2011
|
], P.prototype, "target", 2);
|
|
2012
2012
|
P = L([
|
|
2013
|
-
|
|
2013
|
+
T({ tag: "sps-nav-tab" })
|
|
2014
2014
|
], P);
|
|
2015
2015
|
var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, st = (e, t, s, n) => {
|
|
2016
2016
|
for (var i = n > 1 ? void 0 : n ? fs(t, s) : t, r = e.length - 1, l; r >= 0; r--)
|
|
@@ -2032,7 +2032,7 @@ st([
|
|
|
2032
2032
|
_e()
|
|
2033
2033
|
], ue.prototype, "content", 2);
|
|
2034
2034
|
ue = st([
|
|
2035
|
-
|
|
2035
|
+
T({ tag: "sps-nav-tab-set" })
|
|
2036
2036
|
], ue);
|
|
2037
2037
|
const As = {
|
|
2038
2038
|
basic: {
|
|
@@ -2105,7 +2105,7 @@ let A = (Z = class extends HTMLElement {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
}, 1e3 / 60));
|
|
2107
2107
|
}
|
|
2108
|
-
get [
|
|
2108
|
+
get [j]() {
|
|
2109
2109
|
return [
|
|
2110
2110
|
F,
|
|
2111
2111
|
this.fitWidth ? `${F}--fit-width` : `${F}--fit-height`,
|
|
@@ -2170,7 +2170,7 @@ E([
|
|
|
2170
2170
|
xe("img", { refresh: !0 })
|
|
2171
2171
|
], A.prototype, "image", 1);
|
|
2172
2172
|
A = E([
|
|
2173
|
-
|
|
2173
|
+
T({ tag: F })
|
|
2174
2174
|
], A);
|
|
2175
2175
|
const Ds = {
|
|
2176
2176
|
sizing: {
|
|
@@ -2314,8 +2314,8 @@ const Ds = {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
export {
|
|
2316
2316
|
Ie as AttrBindings,
|
|
2317
|
-
|
|
2318
|
-
|
|
2317
|
+
j as ClassBindings,
|
|
2318
|
+
T as Component,
|
|
2319
2319
|
_e as Content,
|
|
2320
2320
|
Ne as EventDispatcher,
|
|
2321
2321
|
re as EventListener,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-web-components",
|
|
3
3
|
"description": "SPS Design System Native Web Components",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.14.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-web-components",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"incremental-dom": "^0.6.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@spscommerce/ds-shared": "7.
|
|
27
|
+
"@spscommerce/ds-shared": "7.14.0",
|
|
28
28
|
"@spscommerce/utils": "^6.11.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@spscommerce/ds-shared": "7.
|
|
31
|
+
"@spscommerce/ds-shared": "7.14.0",
|
|
32
32
|
"@spscommerce/utils": "^6.12.1",
|
|
33
33
|
"@testing-library/react": "^10.0.0",
|
|
34
34
|
"react": "^16.9.0",
|
|
35
35
|
"react-dom": "^16.9.0",
|
|
36
|
-
"test": "7.
|
|
36
|
+
"test": "7.14.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "pnpm run build:js && pnpm run build:types && pnpm run build:create-dist && pnpm run build:copy-dist",
|