monobill-mintui 0.6.619 → 0.6.621
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/components/alert/browser.js +3 -3
- package/dist/components/alert/index.cjs +1 -1
- package/dist/components/alert/index.js +3 -3
- package/dist/components/back-button/browser.js +2 -2
- package/dist/components/back-button/index.cjs +1 -1
- package/dist/components/back-button/index.js +2 -2
- package/dist/components/bottom-navigation/browser.js +2 -2
- package/dist/components/bottom-navigation/index.cjs +1 -1
- package/dist/components/bottom-navigation/index.js +2 -2
- package/dist/components/button/browser.js +1 -1
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/checkbox/browser.js +2 -2
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/chip/browser.js +1 -1
- package/dist/components/chip/index.cjs +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chunks/{button-BZ25puI2.js → button-BYQbRAwl.js} +2 -2
- package/dist/components/chunks/{button-CgYC1lB7.js → button-DbxqmBWQ.js} +1 -1
- package/dist/components/chunks/caret-down-CeADWana.js +1 -0
- package/dist/components/chunks/{caret-down-CDGP3GB2.js → caret-down-DD9Ie5js.js} +1 -1
- package/dist/components/chunks/caret-right-3V_JDnOP.js +1 -0
- package/dist/components/chunks/{caret-right-CQ5hBjsy.js → caret-right-fnCcTJKp.js} +1 -1
- package/dist/components/chunks/{caret-up-1paz-pnI.js → caret-up-CK7JOG6X.js} +1 -1
- package/dist/components/chunks/caret-up-hwsMK8n3.js +1 -0
- package/dist/components/chunks/{chip-p6RXdzHa.js → chip-08aR26vc.js} +3 -3
- package/dist/components/chunks/{chip-Bb1Epj5C.js → chip-8BYSJ7yI.js} +1 -1
- package/dist/components/chunks/close-BdZJfr6m.js +1 -0
- package/dist/components/chunks/{close-y8q0rMSE.js → close-CFxX3WCG.js} +1 -1
- package/dist/components/chunks/icon-B8p3Co0-.js +1 -0
- package/dist/components/chunks/{icon-B01tq_aJ.js → icon-BWUYe89V.js} +4 -3
- package/dist/components/chunks/{icon-BcsWL4kZ.js → icon-B_7c8b8e.js} +1 -1
- package/dist/components/chunks/icon-CSqBgTae.js +1 -0
- package/dist/components/chunks/{input-BzrCXBg4.js → input-Dwrs8tJH.js} +4 -4
- package/dist/components/chunks/{input-DnVgj6QV.js → input-lLl8cB6r.js} +1 -1
- package/dist/components/chunks/{modal-9S-FF3_o.js → modal-CNBmdA63.js} +1 -1
- package/dist/components/chunks/{modal-D7KKb4f9.js → modal-CPcIPIO7.js} +2 -2
- package/dist/components/chunks/search-Bsaoxa30.js +1 -0
- package/dist/components/chunks/{search-Dd28O4mG.js → search-xHKqAXph.js} +1 -1
- package/dist/components/confirm-action/browser.js +3 -3
- package/dist/components/confirm-action/index.cjs +1 -1
- package/dist/components/confirm-action/index.js +3 -3
- package/dist/components/date-picker/browser.js +4 -4
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +4 -4
- package/dist/components/dropzone/browser.js +3 -3
- package/dist/components/dropzone/index.cjs +1 -1
- package/dist/components/dropzone/index.js +3 -3
- package/dist/components/icon/browser.js +1 -1
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/input/browser.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/modal/browser.js +1 -1
- package/dist/components/modal/index.cjs +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/navigation/browser.js +2 -2
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/off-canvas/browser.js +2 -2
- package/dist/components/off-canvas/index.cjs +1 -1
- package/dist/components/off-canvas/index.js +2 -2
- package/dist/components/resource-table/browser.js +7 -7
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +7 -7
- package/dist/components/search/browser.js +7 -7
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +7 -7
- package/dist/components/select/browser.js +4 -4
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +4 -4
- package/dist/components/side-navigation/browser.js +5 -5
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +5 -5
- package/dist/components/switch/browser.js +2 -2
- package/dist/components/switch/index.cjs +1 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/tags/browser.js +3 -3
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +3 -3
- package/dist/components/time-picker/browser.js +2 -2
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -2
- package/dist/icons/pin.svg +1 -3
- package/dist/index.cjs +3 -3
- package/dist/index.js +6 -5
- package/package.json +1 -1
- package/dist/components/chunks/caret-down-C5a1fGvt.js +0 -1
- package/dist/components/chunks/caret-right-BMyWflHN.js +0 -1
- package/dist/components/chunks/caret-up-BJAyfrty.js +0 -1
- package/dist/components/chunks/close-Bg0kqvrY.js +0 -1
- package/dist/components/chunks/icon-DNWs0suS.js +0 -1
- package/dist/components/chunks/icon-uMo_iGkX.js +0 -1
- package/dist/components/chunks/search-C5jD2OC-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/icon-BcsWL4kZ.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-uMo_iGkX.js`),require(`../chunks/close-Bg0kqvrY.js`),e.a({name:`upload`,viewBox:`0 0 24 24`,path:`M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`attach`,viewBox:`0 0 24 24`,path:`M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`label`,`accept`,`multiple`,`width`,`height`,`disabled`,`name`,`error`,`error-message`,`loading`,`aria-label`,`aria-describedby`]}constructor(){super(),this._dropzone=null,this._fileInput=null,this._previewContainer=null,this._isDragging=!1,this._wasDragging=!1,this._isUpdatingFiles=!1,this._listenersInitialized=!1,this._selectedFiles=[],this._previewUrls=[],this._resetHandler=null,this._a11yId=`mint-dropzone-${Math.random().toString(36).slice(2,10)}`}connectedCallback(){this.classList.add(`mint-dropzone`),this.render(),this._attachFormResetListener()}disconnectedCallback(){if(this.removeEventListeners(),this._cleanupPreviewUrls(),this._resetHandler){let e=this.closest(`form`);e&&e.removeEventListener(`reset`,this._resetHandler),this._resetHandler=null}}attributeChangedCallback(e,t,n){if(t!==n){if(e===`error`||e===`error-message`){this._updateDragStateClass(),this._renderErrorState(this.hasError(),this.getErrorMessage());return}if(e===`loading`){this.render();return}this.render()}}getLabel(){return this.getAttribute(`label`)||``}getAccept(){return this.getAttribute(`accept`)||``}isMultiple(){return this.getAttribute(`multiple`)===`true`}getWidth(){return this.getAttribute(`width`)||`200px`}getHeight(){return this.getAttribute(`height`)||`200px`}_renderSkeleton(e){let t=this.querySelector(`.mint-dropzone-skeleton-container`),n=this._dropzone;if(e){this.classList.add(`is-loading`),t||(t=document.createElement(`div`),t.className=`mint-dropzone-skeleton-container`,n?(n.classList.add(`is-positioned`),n.appendChild(t)):this.appendChild(t));let e=t.querySelector(`.mint-dropzone-skeleton`);e||(e=document.createElement(`div`),e.className=`mint-dropzone-skeleton`,t.appendChild(e)),t.classList.add(`is-visible`),n?.classList.add(`is-loading`)}else this.classList.remove(`is-loading`),t&&t.classList.remove(`is-visible`),n?.classList.remove(`is-loading`)}getName(){return this.getAttribute(`name`)||``}hasError(){return this.getAttribute(`error`)===`true`}getErrorMessage(){return this.getAttribute(`error-message`)||``}isDisabled(){return this.getAttribute(`disabled`)===`true`}isLoading(){return this.getAttribute(`loading`)===`true`}render(){let e=this.isLoading(),t=this.getLabel(),n=this.getAccept(),r=this.isMultiple(),i=this.isDisabled(),a=this.getWidth(),o=this.getHeight(),s=this.getName(),c=this.hasError(),l=this.getErrorMessage();if(this._dropzone||(this._dropzone=document.createElement(`div`),this.appendChild(this._dropzone)),this._updateDragStateClass(),this._dropzone.setAttribute(`aria-invalid`,c?`true`:`false`),i)this._dropzone.setAttribute(`tabindex`,`-1`),this._dropzone.removeAttribute(`role`);else{this._dropzone.setAttribute(`tabindex`,`0`),this._dropzone.setAttribute(`role`,`button`),this._dropzone.setAttribute(`aria-label`,this.getAttribute(`aria-label`)||t||`File upload dropzone`);let e=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean),n=this.querySelector(`.mint-dropzone-error`);n&&(n.id=`${this.id||this._a11yId}-error`,e.push(n.id)),e.length?this._dropzone.setAttribute(`aria-describedby`,Array.from(new Set(e)).join(` `)):this._dropzone.removeAttribute(`aria-describedby`)}this._dropzone.style.width=a,this._dropzone.style.height=o,this._dropzone.style.minWidth=a,this._dropzone.style.minHeight=o,this._fileInput||(this._fileInput=document.createElement(`input`),this._fileInput.type=`file`,this._fileInput.className=`mint-dropzone-file-input`,this._fileInput.setAttribute(`tabindex`,`-1`),this._fileInput.setAttribute(`aria-hidden`,`true`),this._dropzone.appendChild(this._fileInput)),this._fileInput.accept=n,this._fileInput.multiple=r,this._fileInput.disabled=i,s?this._fileInput.name=s:this._fileInput.removeAttribute(`name`),this._fileInput.setAttribute(`aria-invalid`,c?`true`:`false`);let u=this._dropzone.querySelector(`.mint-dropzone-icon`),d=this._dropzone.querySelector(`.mint-dropzone-label`);u&&u.remove(),d&&d.remove();let f=document.createElement(`div`);f.className=`mint-dropzone-icon`;let p=document.createElement(`mint-icon`);if(p.setAttribute(`name`,`upload`),p.className=`mint-dropzone-upload-icon`,f.appendChild(p),this._dropzone.appendChild(f),t){let e=document.createElement(`div`);e.className=`mint-dropzone-label`,e.textContent=t,this._dropzone.appendChild(e)}this.setupEventListeners(),this._renderErrorState(c,l),this._renderPreviews(),this._renderSkeleton(e)}_updateDragState(){this._dropzone&&this._updateDragStateClass()}_renderErrorState(e,t){let n=this.querySelector(`.mint-dropzone-error`);if(e&&t?(n||(n=document.createElement(`div`),n.className=`mint-dropzone-error`,this.appendChild(n)),n.textContent=t):n&&n.remove(),this._dropzone){this._dropzone.setAttribute(`aria-invalid`,String(e)),n&&(n.id=`${this.id||this._a11yId}-error`);let t=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean);n&&t.push(n.id),t.length?this._dropzone.setAttribute(`aria-describedby`,Array.from(new Set(t)).join(` `)):this._dropzone.removeAttribute(`aria-describedby`)}}_updateDragStateClass(){if(!this._dropzone)return;let e=this.isDisabled(),t=this.hasError();this._dropzone.className=`mint-dropzone-target`,this._dropzone.classList.toggle(`has-files`,this._selectedFiles.length>0),this._dropzone.classList.toggle(`is-dragging`,this._isDragging),this._dropzone.classList.toggle(`has-error`,t),this._dropzone.classList.toggle(`is-disabled`,e)}setupEventListeners(){this._listenersInitialized||(this._listenersInitialized=!0,this.removeEventListeners(),!(!this._dropzone||!this._fileInput||this.isDisabled())&&(this._onDropzoneClick||=e=>{if(!(this.isDisabled()||!this._fileInput)&&e.target!==this._fileInput&&(e.stopPropagation(),e.preventDefault(),e.isTrusted))try{this._fileInput.click()}catch(e){console.debug(`File chooser blocked:`,e)}},this._onDragOver||=e=>{e.preventDefault(),e.stopPropagation(),this.isDisabled()||this._isDragging||(this._isDragging=!0,this._wasDragging=!0,this._updateDragState())},this._onDragLeave||=e=>{e.preventDefault(),e.stopPropagation();let t=this._dropzone?.getBoundingClientRect();t&&(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&this._isDragging&&(this._isDragging=!1,this._wasDragging=!1,this._updateDragState())},this._onDrop||=e=>{if(e.preventDefault(),e.stopPropagation(),this._isDragging&&(this._isDragging=!1,this._wasDragging=!1,this._updateDragState()),this.isDisabled())return;let t=e.dataTransfer?.files;t&&t.length>0&&this._handleFiles(t)},this._onFileInputInput||=e=>{e.stopImmediatePropagation(),e.stopPropagation()},this._onKeyDown||=e=>{if(!(this.isDisabled()||!this._fileInput)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),e.isTrusted))try{this._fileInput.click()}catch(e){console.debug(`File chooser blocked:`,e)}},this._onFocus||=e=>{this._dropzone&&!this.isDisabled()&&this._dropzone.classList.add(`is-focused`)},this._onBlur||=e=>{this._dropzone},this._onFileInputChange||=e=>{if(e.stopImmediatePropagation(),e.stopPropagation(),this._isUpdatingFiles)return;let t=e.target.files;if(t&&t.length>0){let e=this.getAccept(),n=this.isMultiple(),r=[],i=[];for(let n=0;n<t.length;n++){let a=t[n];this._isFileAccepted(a,e)?r.push(a):i.push(a)}if(!n&&r.length>1&&(i.push(...r.slice(1)),r.splice(1)),i.length>0){let e=new CustomEvent(`dropRejected`,{detail:{files:i,reason:`File type not accepted or multiple files not allowed`},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}r.length>0&&this._applyValidFiles(r)}},this._dropzone.addEventListener(`click`,this._onDropzoneClick),this._dropzone.addEventListener(`dragover`,this._onDragOver),this._dropzone.addEventListener(`dragleave`,this._onDragLeave),this._dropzone.addEventListener(`drop`,this._onDrop),this._dropzone.addEventListener(`keydown`,this._onKeyDown),this._dropzone.addEventListener(`focus`,this._onFocus),this._dropzone.addEventListener(`blur`,this._onBlur),this._fileInput.addEventListener(`change`,this._onFileInputChange),this._fileInput.addEventListener(`input`,this._onFileInputInput,!0)))}removeEventListeners(){this._dropzone&&(this._onDropzoneClick&&this._dropzone.removeEventListener(`click`,this._onDropzoneClick),this._onDragOver&&this._dropzone.removeEventListener(`dragover`,this._onDragOver),this._onDragLeave&&this._dropzone.removeEventListener(`dragleave`,this._onDragLeave),this._onDrop&&this._dropzone.removeEventListener(`drop`,this._onDrop),this._onKeyDown&&this._dropzone.removeEventListener(`keydown`,this._onKeyDown),this._onFocus&&this._dropzone.removeEventListener(`focus`,this._onFocus),this._onBlur&&this._dropzone.removeEventListener(`blur`,this._onBlur)),this._fileInput&&(this._onFileInputChange&&this._fileInput.removeEventListener(`change`,this._onFileInputChange),this._onFileInputInput&&this._fileInput.removeEventListener(`input`,this._onFileInputInput,!0)),this._isDragging=!1,this._listenersInitialized=!1}_handleFiles(e){let t=this.getAccept(),n=this.isMultiple(),r=[],i=[];for(let n=0;n<e.length;n++){let a=e[n];this._isFileAccepted(a,t)?r.push(a):i.push(a)}if(!n&&r.length>1&&(i.push(...r.slice(1)),r.splice(1)),i.length>0){let e=new CustomEvent(`dropRejected`,{detail:{files:i,reason:`File type not accepted or multiple files not allowed`},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}r.length>0&&this._applyValidFiles(r)}_isFileAccepted(e,t){if(!t)return!0;let n=t.split(`,`).map(e=>e.trim().toLowerCase());for(let t of n)if(t.startsWith(`.`)){if(`.`+e.name.split(`.`).pop()?.toLowerCase()===t)return!0}else if(t.includes(`/*`)){if(t.split(`/`)[0]===e.type.split(`/`)[0])return!0}else if(e.type===t)return!0;return!1}_dispatchEvent(e,t){let n=t.target,r=new CustomEvent(e,{detail:{files:n.files?Array.from(n.files):[],value:n.value||``},bubbles:!0,cancelable:!0});this.dispatchEvent(r)}_dispatchSelectionEvents(){let e={files:[...this._selectedFiles],value:``};this.dispatchEvent(new CustomEvent(`input`,{detail:e,bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`change`,{detail:e,bubbles:!0,cancelable:!0,composed:!0}))}_syncFileInputFromSelected(){if(!this._fileInput)return;let e=new DataTransfer;this._selectedFiles.forEach(t=>{try{e.items.add(t)}catch(e){console.warn(`Failed to add file to DataTransfer:`,e)}}),this._isUpdatingFiles=!0;try{this._fileInput.files=e.files}catch(e){console.warn(`Failed to set files on input:`,e)}setTimeout(()=>{this._isUpdatingFiles=!1},0)}get files(){return this._syncFileInputFromSelected(),this._fileInput?.files||null}syncFiles(){this._syncFileInputFromSelected()}_renderPreviews(){if(!this._dropzone)return;if(this._previewContainer&&(this._cleanupPreviewUrls(),this._previewContainer.remove()),this._selectedFiles.length===0){this._previewContainer=null,this._updateDragStateClass();return}let e=document.createElement(`div`);e.className=`mint-dropzone-previews-wrapper`,e.classList.toggle(`has-error`,this.hasError()),e.classList.toggle(`is-dragging`,this._isDragging);let t=document.createElement(`div`);t.className=`mint-dropzone-previews`,this._selectedFiles.forEach((e,n)=>{let r=document.createElement(`div`);if(r.className=`mint-dropzone-file`,e.type.startsWith(`image/`)){let t=document.createElement(`img`);t.className=`mint-dropzone-file-image`;let n=URL.createObjectURL(e);this._previewUrls.push(n),t.src=n,r.appendChild(t)}else{let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`attach`),e.className=`mint-dropzone-file-icon`,r.appendChild(e)}let i=document.createElement(`div`);i.className=`mint-dropzone-file-name`,i.textContent=e.name,r.appendChild(i);let a=document.createElement(`button`);a.type=`button`,a.className=`mint-dropzone-file-remove`;let o=document.createElement(`mint-icon`);o.setAttribute(`name`,`close`),o.className=`mint-dropzone-file-remove-icon`,a.appendChild(o),a.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),this._removeFileAt(n)}),r.appendChild(a),t.appendChild(r)});let n=document.createElement(`div`);n.className=`mint-dropzone-preview-fade is-top`,e.appendChild(n);let r=document.createElement(`div`);r.className=`mint-dropzone-preview-fade is-bottom is-visible`,e.appendChild(r);let i=()=>{let e=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;e>0?n.classList.add(`is-visible`):n.classList.remove(`is-visible`),e+a<i-1?r.classList.add(`is-visible`):r.classList.remove(`is-visible`)};i(),t.addEventListener(`scroll`,i),e.appendChild(t),this._previewContainer=e,this._dropzone.appendChild(e),this._updateDragStateClass()}_removeFileAt(e){if(e<0||e>=this._selectedFiles.length)return;let[t]=this._selectedFiles.splice(e,1);t&&this._cleanupPreviewUrls(),this._syncFileInputFromSelected(),this._renderPreviews(),this._dispatchSelectionEvents()}_cleanupPreviewUrls(){this._previewUrls.forEach(e=>URL.revokeObjectURL(e)),this._previewUrls=[]}_attachFormResetListener(){let e=this.closest(`form`);!e||this._resetHandler||(this._resetHandler=()=>{this._selectedFiles=[],this._syncFileInputFromSelected(),this._renderPreviews(),this._cleanupPreviewUrls()},e.addEventListener(`reset`,this._resetHandler))}_applyValidFiles(e){if(this.isMultiple()){let t=e.filter(e=>!this._isDuplicateFile(e));this._selectedFiles.push(...t)}else this._selectedFiles=[e[0]];this._syncFileInputFromSelected(),this._selectedFiles.length>0&&(this.removeAttribute(`error`),this.removeAttribute(`error-message`),this._fileInput&&this._fileInput.removeAttribute(`aria-invalid`)),this._renderPreviews(),this._dispatchSelectionEvents()}_isDuplicateFile(e){return this._selectedFiles.some(t=>t.name===e.name&&t.size===e.size&&t.lastModified===e.lastModified)}};customElements.get(`mint-dropzone`)||t.t(`mint-dropzone`,n),module.exports=n;
|
|
1
|
+
const e=require(`../chunks/icon-B_7c8b8e.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-CSqBgTae.js`),require(`../chunks/close-BdZJfr6m.js`),e.a({name:`upload`,viewBox:`0 0 24 24`,path:`M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`attach`,viewBox:`0 0 24 24`,path:`M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`label`,`accept`,`multiple`,`width`,`height`,`disabled`,`name`,`error`,`error-message`,`loading`,`aria-label`,`aria-describedby`]}constructor(){super(),this._dropzone=null,this._fileInput=null,this._previewContainer=null,this._isDragging=!1,this._wasDragging=!1,this._isUpdatingFiles=!1,this._listenersInitialized=!1,this._selectedFiles=[],this._previewUrls=[],this._resetHandler=null,this._a11yId=`mint-dropzone-${Math.random().toString(36).slice(2,10)}`}connectedCallback(){this.classList.add(`mint-dropzone`),this.render(),this._attachFormResetListener()}disconnectedCallback(){if(this.removeEventListeners(),this._cleanupPreviewUrls(),this._resetHandler){let e=this.closest(`form`);e&&e.removeEventListener(`reset`,this._resetHandler),this._resetHandler=null}}attributeChangedCallback(e,t,n){if(t!==n){if(e===`error`||e===`error-message`){this._updateDragStateClass(),this._renderErrorState(this.hasError(),this.getErrorMessage());return}if(e===`loading`){this.render();return}this.render()}}getLabel(){return this.getAttribute(`label`)||``}getAccept(){return this.getAttribute(`accept`)||``}isMultiple(){return this.getAttribute(`multiple`)===`true`}getWidth(){return this.getAttribute(`width`)||`200px`}getHeight(){return this.getAttribute(`height`)||`200px`}_renderSkeleton(e){let t=this.querySelector(`.mint-dropzone-skeleton-container`),n=this._dropzone;if(e){this.classList.add(`is-loading`),t||(t=document.createElement(`div`),t.className=`mint-dropzone-skeleton-container`,n?(n.classList.add(`is-positioned`),n.appendChild(t)):this.appendChild(t));let e=t.querySelector(`.mint-dropzone-skeleton`);e||(e=document.createElement(`div`),e.className=`mint-dropzone-skeleton`,t.appendChild(e)),t.classList.add(`is-visible`),n?.classList.add(`is-loading`)}else this.classList.remove(`is-loading`),t&&t.classList.remove(`is-visible`),n?.classList.remove(`is-loading`)}getName(){return this.getAttribute(`name`)||``}hasError(){return this.getAttribute(`error`)===`true`}getErrorMessage(){return this.getAttribute(`error-message`)||``}isDisabled(){return this.getAttribute(`disabled`)===`true`}isLoading(){return this.getAttribute(`loading`)===`true`}render(){let e=this.isLoading(),t=this.getLabel(),n=this.getAccept(),r=this.isMultiple(),i=this.isDisabled(),a=this.getWidth(),o=this.getHeight(),s=this.getName(),c=this.hasError(),l=this.getErrorMessage();if(this._dropzone||(this._dropzone=document.createElement(`div`),this.appendChild(this._dropzone)),this._updateDragStateClass(),this._dropzone.setAttribute(`aria-invalid`,c?`true`:`false`),i)this._dropzone.setAttribute(`tabindex`,`-1`),this._dropzone.removeAttribute(`role`);else{this._dropzone.setAttribute(`tabindex`,`0`),this._dropzone.setAttribute(`role`,`button`),this._dropzone.setAttribute(`aria-label`,this.getAttribute(`aria-label`)||t||`File upload dropzone`);let e=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean),n=this.querySelector(`.mint-dropzone-error`);n&&(n.id=`${this.id||this._a11yId}-error`,e.push(n.id)),e.length?this._dropzone.setAttribute(`aria-describedby`,Array.from(new Set(e)).join(` `)):this._dropzone.removeAttribute(`aria-describedby`)}this._dropzone.style.width=a,this._dropzone.style.height=o,this._dropzone.style.minWidth=a,this._dropzone.style.minHeight=o,this._fileInput||(this._fileInput=document.createElement(`input`),this._fileInput.type=`file`,this._fileInput.className=`mint-dropzone-file-input`,this._fileInput.setAttribute(`tabindex`,`-1`),this._fileInput.setAttribute(`aria-hidden`,`true`),this._dropzone.appendChild(this._fileInput)),this._fileInput.accept=n,this._fileInput.multiple=r,this._fileInput.disabled=i,s?this._fileInput.name=s:this._fileInput.removeAttribute(`name`),this._fileInput.setAttribute(`aria-invalid`,c?`true`:`false`);let u=this._dropzone.querySelector(`.mint-dropzone-icon`),d=this._dropzone.querySelector(`.mint-dropzone-label`);u&&u.remove(),d&&d.remove();let f=document.createElement(`div`);f.className=`mint-dropzone-icon`;let p=document.createElement(`mint-icon`);if(p.setAttribute(`name`,`upload`),p.className=`mint-dropzone-upload-icon`,f.appendChild(p),this._dropzone.appendChild(f),t){let e=document.createElement(`div`);e.className=`mint-dropzone-label`,e.textContent=t,this._dropzone.appendChild(e)}this.setupEventListeners(),this._renderErrorState(c,l),this._renderPreviews(),this._renderSkeleton(e)}_updateDragState(){this._dropzone&&this._updateDragStateClass()}_renderErrorState(e,t){let n=this.querySelector(`.mint-dropzone-error`);if(e&&t?(n||(n=document.createElement(`div`),n.className=`mint-dropzone-error`,this.appendChild(n)),n.textContent=t):n&&n.remove(),this._dropzone){this._dropzone.setAttribute(`aria-invalid`,String(e)),n&&(n.id=`${this.id||this._a11yId}-error`);let t=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean);n&&t.push(n.id),t.length?this._dropzone.setAttribute(`aria-describedby`,Array.from(new Set(t)).join(` `)):this._dropzone.removeAttribute(`aria-describedby`)}}_updateDragStateClass(){if(!this._dropzone)return;let e=this.isDisabled(),t=this.hasError();this._dropzone.className=`mint-dropzone-target`,this._dropzone.classList.toggle(`has-files`,this._selectedFiles.length>0),this._dropzone.classList.toggle(`is-dragging`,this._isDragging),this._dropzone.classList.toggle(`has-error`,t),this._dropzone.classList.toggle(`is-disabled`,e)}setupEventListeners(){this._listenersInitialized||(this._listenersInitialized=!0,this.removeEventListeners(),!(!this._dropzone||!this._fileInput||this.isDisabled())&&(this._onDropzoneClick||=e=>{if(!(this.isDisabled()||!this._fileInput)&&e.target!==this._fileInput&&(e.stopPropagation(),e.preventDefault(),e.isTrusted))try{this._fileInput.click()}catch(e){console.debug(`File chooser blocked:`,e)}},this._onDragOver||=e=>{e.preventDefault(),e.stopPropagation(),this.isDisabled()||this._isDragging||(this._isDragging=!0,this._wasDragging=!0,this._updateDragState())},this._onDragLeave||=e=>{e.preventDefault(),e.stopPropagation();let t=this._dropzone?.getBoundingClientRect();t&&(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&this._isDragging&&(this._isDragging=!1,this._wasDragging=!1,this._updateDragState())},this._onDrop||=e=>{if(e.preventDefault(),e.stopPropagation(),this._isDragging&&(this._isDragging=!1,this._wasDragging=!1,this._updateDragState()),this.isDisabled())return;let t=e.dataTransfer?.files;t&&t.length>0&&this._handleFiles(t)},this._onFileInputInput||=e=>{e.stopImmediatePropagation(),e.stopPropagation()},this._onKeyDown||=e=>{if(!(this.isDisabled()||!this._fileInput)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),e.isTrusted))try{this._fileInput.click()}catch(e){console.debug(`File chooser blocked:`,e)}},this._onFocus||=e=>{this._dropzone&&!this.isDisabled()&&this._dropzone.classList.add(`is-focused`)},this._onBlur||=e=>{this._dropzone},this._onFileInputChange||=e=>{if(e.stopImmediatePropagation(),e.stopPropagation(),this._isUpdatingFiles)return;let t=e.target.files;if(t&&t.length>0){let e=this.getAccept(),n=this.isMultiple(),r=[],i=[];for(let n=0;n<t.length;n++){let a=t[n];this._isFileAccepted(a,e)?r.push(a):i.push(a)}if(!n&&r.length>1&&(i.push(...r.slice(1)),r.splice(1)),i.length>0){let e=new CustomEvent(`dropRejected`,{detail:{files:i,reason:`File type not accepted or multiple files not allowed`},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}r.length>0&&this._applyValidFiles(r)}},this._dropzone.addEventListener(`click`,this._onDropzoneClick),this._dropzone.addEventListener(`dragover`,this._onDragOver),this._dropzone.addEventListener(`dragleave`,this._onDragLeave),this._dropzone.addEventListener(`drop`,this._onDrop),this._dropzone.addEventListener(`keydown`,this._onKeyDown),this._dropzone.addEventListener(`focus`,this._onFocus),this._dropzone.addEventListener(`blur`,this._onBlur),this._fileInput.addEventListener(`change`,this._onFileInputChange),this._fileInput.addEventListener(`input`,this._onFileInputInput,!0)))}removeEventListeners(){this._dropzone&&(this._onDropzoneClick&&this._dropzone.removeEventListener(`click`,this._onDropzoneClick),this._onDragOver&&this._dropzone.removeEventListener(`dragover`,this._onDragOver),this._onDragLeave&&this._dropzone.removeEventListener(`dragleave`,this._onDragLeave),this._onDrop&&this._dropzone.removeEventListener(`drop`,this._onDrop),this._onKeyDown&&this._dropzone.removeEventListener(`keydown`,this._onKeyDown),this._onFocus&&this._dropzone.removeEventListener(`focus`,this._onFocus),this._onBlur&&this._dropzone.removeEventListener(`blur`,this._onBlur)),this._fileInput&&(this._onFileInputChange&&this._fileInput.removeEventListener(`change`,this._onFileInputChange),this._onFileInputInput&&this._fileInput.removeEventListener(`input`,this._onFileInputInput,!0)),this._isDragging=!1,this._listenersInitialized=!1}_handleFiles(e){let t=this.getAccept(),n=this.isMultiple(),r=[],i=[];for(let n=0;n<e.length;n++){let a=e[n];this._isFileAccepted(a,t)?r.push(a):i.push(a)}if(!n&&r.length>1&&(i.push(...r.slice(1)),r.splice(1)),i.length>0){let e=new CustomEvent(`dropRejected`,{detail:{files:i,reason:`File type not accepted or multiple files not allowed`},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}r.length>0&&this._applyValidFiles(r)}_isFileAccepted(e,t){if(!t)return!0;let n=t.split(`,`).map(e=>e.trim().toLowerCase());for(let t of n)if(t.startsWith(`.`)){if(`.`+e.name.split(`.`).pop()?.toLowerCase()===t)return!0}else if(t.includes(`/*`)){if(t.split(`/`)[0]===e.type.split(`/`)[0])return!0}else if(e.type===t)return!0;return!1}_dispatchEvent(e,t){let n=t.target,r=new CustomEvent(e,{detail:{files:n.files?Array.from(n.files):[],value:n.value||``},bubbles:!0,cancelable:!0});this.dispatchEvent(r)}_dispatchSelectionEvents(){let e={files:[...this._selectedFiles],value:``};this.dispatchEvent(new CustomEvent(`input`,{detail:e,bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`change`,{detail:e,bubbles:!0,cancelable:!0,composed:!0}))}_syncFileInputFromSelected(){if(!this._fileInput)return;let e=new DataTransfer;this._selectedFiles.forEach(t=>{try{e.items.add(t)}catch(e){console.warn(`Failed to add file to DataTransfer:`,e)}}),this._isUpdatingFiles=!0;try{this._fileInput.files=e.files}catch(e){console.warn(`Failed to set files on input:`,e)}setTimeout(()=>{this._isUpdatingFiles=!1},0)}get files(){return this._syncFileInputFromSelected(),this._fileInput?.files||null}syncFiles(){this._syncFileInputFromSelected()}_renderPreviews(){if(!this._dropzone)return;if(this._previewContainer&&(this._cleanupPreviewUrls(),this._previewContainer.remove()),this._selectedFiles.length===0){this._previewContainer=null,this._updateDragStateClass();return}let e=document.createElement(`div`);e.className=`mint-dropzone-previews-wrapper`,e.classList.toggle(`has-error`,this.hasError()),e.classList.toggle(`is-dragging`,this._isDragging);let t=document.createElement(`div`);t.className=`mint-dropzone-previews`,this._selectedFiles.forEach((e,n)=>{let r=document.createElement(`div`);if(r.className=`mint-dropzone-file`,e.type.startsWith(`image/`)){let t=document.createElement(`img`);t.className=`mint-dropzone-file-image`;let n=URL.createObjectURL(e);this._previewUrls.push(n),t.src=n,r.appendChild(t)}else{let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`attach`),e.className=`mint-dropzone-file-icon`,r.appendChild(e)}let i=document.createElement(`div`);i.className=`mint-dropzone-file-name`,i.textContent=e.name,r.appendChild(i);let a=document.createElement(`button`);a.type=`button`,a.className=`mint-dropzone-file-remove`;let o=document.createElement(`mint-icon`);o.setAttribute(`name`,`close`),o.className=`mint-dropzone-file-remove-icon`,a.appendChild(o),a.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),this._removeFileAt(n)}),r.appendChild(a),t.appendChild(r)});let n=document.createElement(`div`);n.className=`mint-dropzone-preview-fade is-top`,e.appendChild(n);let r=document.createElement(`div`);r.className=`mint-dropzone-preview-fade is-bottom is-visible`,e.appendChild(r);let i=()=>{let e=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;e>0?n.classList.add(`is-visible`):n.classList.remove(`is-visible`),e+a<i-1?r.classList.add(`is-visible`):r.classList.remove(`is-visible`)};i(),t.addEventListener(`scroll`,i),e.appendChild(t),this._previewContainer=e,this._dropzone.appendChild(e),this._updateDragStateClass()}_removeFileAt(e){if(e<0||e>=this._selectedFiles.length)return;let[t]=this._selectedFiles.splice(e,1);t&&this._cleanupPreviewUrls(),this._syncFileInputFromSelected(),this._renderPreviews(),this._dispatchSelectionEvents()}_cleanupPreviewUrls(){this._previewUrls.forEach(e=>URL.revokeObjectURL(e)),this._previewUrls=[]}_attachFormResetListener(){let e=this.closest(`form`);!e||this._resetHandler||(this._resetHandler=()=>{this._selectedFiles=[],this._syncFileInputFromSelected(),this._renderPreviews(),this._cleanupPreviewUrls()},e.addEventListener(`reset`,this._resetHandler))}_applyValidFiles(e){if(this.isMultiple()){let t=e.filter(e=>!this._isDuplicateFile(e));this._selectedFiles.push(...t)}else this._selectedFiles=[e[0]];this._syncFileInputFromSelected(),this._selectedFiles.length>0&&(this.removeAttribute(`error`),this.removeAttribute(`error-message`),this._fileInput&&this._fileInput.removeAttribute(`aria-invalid`)),this._renderPreviews(),this._dispatchSelectionEvents()}_isDuplicateFile(e){return this._selectedFiles.some(t=>t.name===e.name&&t.size===e.size&&t.lastModified===e.lastModified)}};customElements.get(`mint-dropzone`)||t.t(`mint-dropzone`,n),module.exports=n;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../../theme.css'
|
|
2
2
|
import '../../icon.css'
|
|
3
3
|
import '../../dropzone.css'
|
|
4
|
-
import { a as e } from "../chunks/icon-
|
|
4
|
+
import { a as e } from "../chunks/icon-BWUYe89V.js";
|
|
5
5
|
import { t } from "../chunks/register-element-BFYmIynH.js";
|
|
6
|
-
import "../chunks/icon-
|
|
7
|
-
import "../chunks/close-
|
|
6
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
7
|
+
import "../chunks/close-CFxX3WCG.js";
|
|
8
8
|
e({
|
|
9
9
|
name: "upload",
|
|
10
10
|
viewBox: "0 0 24 24",
|
|
@@ -12,5 +12,5 @@ const __mintLoadStyle = (key, url) => {
|
|
|
12
12
|
}
|
|
13
13
|
__mintLoadStyle('theme', '../../theme.css')
|
|
14
14
|
__mintLoadStyle('icon', '../../icon.css')
|
|
15
|
-
import { a as e, i as t, n, r, t as i } from "../chunks/icon-
|
|
15
|
+
import { a as e, i as t, n, r, t as i } from "../chunks/icon-BWUYe89V.js";
|
|
16
16
|
export { i as default, n as getAllIcons, r as getIcon, t as hasIcon, e as registerIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../chunks/icon-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../chunks/icon-B_7c8b8e.js`);exports.default=e.t,exports.getAllIcons=e.n,exports.getIcon=e.r,exports.hasIcon=e.i,exports.registerIcon=e.a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../theme.css'
|
|
2
2
|
import '../../icon.css'
|
|
3
|
-
import { a as e, i as t, n, r, t as i } from "../chunks/icon-
|
|
3
|
+
import { a as e, i as t, n, r, t as i } from "../chunks/icon-BWUYe89V.js";
|
|
4
4
|
export { i as default, n as getAllIcons, r as getIcon, t as hasIcon, e as registerIcon };
|
|
@@ -13,5 +13,5 @@ const __mintLoadStyle = (key, url) => {
|
|
|
13
13
|
__mintLoadStyle('theme', '../../theme.css')
|
|
14
14
|
__mintLoadStyle('icon', '../../icon.css')
|
|
15
15
|
__mintLoadStyle('input', '../../input.css')
|
|
16
|
-
import { t as e } from "../chunks/input-
|
|
16
|
+
import { t as e } from "../chunks/input-Dwrs8tJH.js";
|
|
17
17
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/input-
|
|
1
|
+
const e=require(`../chunks/input-lLl8cB6r.js`);module.exports=e.t;
|
|
@@ -17,5 +17,5 @@ __mintLoadStyle('icon', '../../icon.css')
|
|
|
17
17
|
__mintLoadStyle('text', '../../text.css')
|
|
18
18
|
__mintLoadStyle('stack', '../../stack.css')
|
|
19
19
|
__mintLoadStyle('modal', '../../modal.css')
|
|
20
|
-
import { t as e } from "../chunks/modal-
|
|
20
|
+
import { t as e } from "../chunks/modal-CPcIPIO7.js";
|
|
21
21
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/modal-
|
|
1
|
+
const e=require(`../chunks/modal-CNBmdA63.js`);module.exports=e.t;
|
|
@@ -18,9 +18,9 @@ __mintLoadStyle('link', '../../link.css')
|
|
|
18
18
|
__mintLoadStyle('popover', '../../popover.css')
|
|
19
19
|
__mintLoadStyle('stack', '../../stack.css')
|
|
20
20
|
__mintLoadStyle('navigation', '../../navigation.css')
|
|
21
|
-
import "../chunks/icon-
|
|
21
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
22
22
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
23
|
-
import "../chunks/button-
|
|
23
|
+
import "../chunks/button-BYQbRAwl.js";
|
|
24
24
|
import "../chunks/popover-gviDCspV.js";
|
|
25
25
|
import "../chunks/link-DKgtBYK6.js";
|
|
26
26
|
//#region src/components/navigation/Navigation.js
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../chunks/icon-
|
|
1
|
+
require(`../chunks/icon-B_7c8b8e.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/button-DbxqmBWQ.js`),require(`../chunks/popover-BeaGf_JC.js`),require(`../chunks/link-BxhPnVaz.js`);var t=0,n=class extends HTMLElement{static get observedAttributes(){return[`brand`,`brand-href`,`direction`,`label`,`open`,`fixed`]}constructor(){super(),this._built=!1,this._brand=null,this._brandLink=null,this._leadingActions=null,this._items=null,this._toggle=null,this._toggleLabel=null,this._mobileActions=null,this._mobileActionNodes=[],this._instanceId=++t,this._dropdowns=[],this._content=null,this._actions=null,this._activeDropdown=null,this._layoutObserver=null}connectedCallback(){this._built||this._build(),this._observeDropdowns(),this._syncResponsiveDropdowns(),this._syncMobileActions(),typeof ResizeObserver<`u`&&(this._layoutObserver=new ResizeObserver(()=>{this._syncResponsiveDropdowns(),this._syncMobileActions()}),this._layoutObserver.observe(this)),this._syncAttributes()}disconnectedCallback(){for(let e of this._dropdowns)e.observer?.disconnect();this._layoutObserver?.disconnect(),this._layoutObserver=null}attributeChangedCallback(e,t,n){t===n||!this._built||(e===`open`?this._syncOpenState():this._syncAttributes())}getDirection(){return this.getAttribute(`direction`)===`vertical`?`vertical`:`horizontal`}getBrand(){return this.getAttribute(`brand`)||``}getBrandHref(){return this.getAttribute(`brand-href`)||`/`}getLabel(){return this.getAttribute(`label`)||`Primary navigation`}_build(){let e=Array.from(this.childNodes),t=e.find(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`brand`),n=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`leading-actions`),r=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&[`actions`,`mobile-actions`].includes(e.getAttribute(`slot`)));this._mobileActionNodes=r.filter(e=>e.getAttribute(`slot`)===`mobile-actions`);let i=e.filter(e=>e!==t&&!n.includes(e)&&!r.includes(e));this.replaceChildren();let a=document.createElement(`div`);a.className=`mint-navigation-shell`;let o=document.createElement(`div`);o.className=`mint-navigation-bar`,this._leadingActions=document.createElement(`div`),this._leadingActions.className=`mint-navigation-leading-actions`;for(let e of n)e.removeAttribute(`slot`),this._leadingActions.appendChild(e);this._brand=document.createElement(`div`),this._brand.className=`mint-navigation-brand`,t?(t.removeAttribute(`slot`),this._brand.appendChild(t)):this.getBrand()&&(this._brandLink=document.createElement(`mint-link`),this._brandLink.className=`mint-navigation-brand-link`,this._brandLink.textContent=this.getBrand(),this._brandLink.setAttribute(`href`,this.getBrandHref()),this._brand.appendChild(this._brandLink)),this._toggle=document.createElement(`mint-button`),this._toggle.className=`mint-navigation-toggle`,this._toggle.setAttribute(`aria-expanded`,`false`),this._toggle.addEventListener(`click`,()=>this.toggleMenu()),this._toggleLabel=document.createElement(`span`),this._toggleLabel.className=`mint-navigation-visually-hidden`,this._toggleLabel.textContent=`Open navigation menu`,this._toggle.append(this._toggleLabel),this._toggle.setAttribute(`variant`,`ghost`),this._toggle.setAttribute(`tone`,`action`),this._toggle.setAttribute(`button-type`,`button`),this._toggle.setAttribute(`icon`,`menu`),this._mobileActions=document.createElement(`div`),this._mobileActions.className=`mint-navigation-mobile-actions`,o.append(this._leadingActions,this._brand,this._mobileActions,this._toggle);let s=document.createElement(`div`);this._content=s,s.className=`mint-navigation-content`,this._items=document.createElement(`nav`),this._items.className=`mint-navigation-items`,this._items.setAttribute(`aria-label`,this.getLabel()),this._items.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()});let c=0;for(let e of i)if(e.nodeType!==Node.ELEMENT_NODE)this._items.appendChild(e);else if(e.tagName===`DETAILS`){let t=this._createDropdown(e,c++);this._items.append(t.trigger,t.popover),this._registerDropdown(t.trigger,t.popover)}else{let t=this._toMintLink(e);if(this._items.appendChild(t),t.nodeType===Node.ELEMENT_NODE&&t.tagName===`MINT-POPOVER`){let e=t.getAttribute(`trigger-id`),n=Array.from(this._items.querySelectorAll(`mint-button`)).find(t=>t.id===e);this._registerDropdown(n,t)}}let l=document.createElement(`div`);this._actions=l,l.className=`mint-navigation-actions`;for(let e of r)e.removeAttribute(`slot`),l.appendChild(e);let u=document.createElement(`section`);u.className=`mint-navigation-submenu`,u.setAttribute(`aria-label`,`Navigation submenu`);let d=document.createElement(`div`);d.className=`mint-navigation-submenu-header`;let f=document.createElement(`mint-button`);f.className=`mint-navigation-submenu-back`,f.setAttribute(`variant`,`ghost`),f.setAttribute(`tone`,`action`),f.setAttribute(`button-type`,`button`),f.setAttribute(`icon`,`arrow-left`),f.setAttribute(`aria-label`,`Back to main navigation`),f.addEventListener(`click`,()=>this._closeSubmenu());let p=document.createElement(`h3`);p.className=`mint-navigation-submenu-title`,d.append(f,p);let m=document.createElement(`nav`);m.className=`mint-navigation-submenu-items`,m.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()}),u.append(d,m),this._submenu=u,this._submenuTitle=p,this._submenuItems=m;for(let e of this._dropdowns)m.append(...e.submenuItems);s.append(this._items,l,u),a.append(o,s),this.appendChild(a),this._built=!0,this._syncMobileActions()}_syncMobileActions(){if(!this._mobileActions||!this._actions)return;let e=this._isMobileLayout()?this._mobileActions:this._actions;for(let t of this._mobileActionNodes)e.appendChild(t)}_toMintLink(e){if(e.nodeType!==Node.ELEMENT_NODE||e.tagName!==`A`)return e;let t=document.createElement(`mint-link`);for(;e.firstChild;)t.appendChild(e.firstChild);for(let n of Array.from(e.attributes))n.name!==`slot`&&t.setAttribute(n.name,n.value);return t}_createDropdown(e,t){let n=e.querySelector(`:scope > summary`),r=document.createElement(`mint-button`),i=`mint-navigation-${this._instanceId}-dropdown-${t}`,a=`${i}-popover`;if(r.id=i,r.className=`mint-navigation-dropdown-trigger`,r.setAttribute(`aria-haspopup`,`dialog`),r.setAttribute(`aria-expanded`,`false`),r.setAttribute(`aria-controls`,a),n){for(;n.firstChild;)r.appendChild(n.firstChild);n.remove()}else r.textContent=e.getAttribute(`label`)||`More`;r.setAttribute(`variant`,`ghost`),r.setAttribute(`tone`,`action`),r.setAttribute(`button-type`,`button`),r.setAttribute(`icon-position`,`right`);let o=document.createElement(`mint-popover`);o.id=a,o.className=`mint-navigation-dropdown`,o.setAttribute(`trigger-id`,i),o.setAttribute(`direction`,`down`),o.setAttribute(`aria-label`,`${r.textContent.trim()} links`);for(let t of Array.from(e.childNodes))o.appendChild(this._toMintLink(t));return{trigger:r,popover:o,observer:null}}_registerDropdown(e,t){if(!e||!t)return;t.id||=`mint-navigation-${this._instanceId}-popover-${this._dropdowns.length}`,e.classList.add(`mint-navigation-dropdown-trigger`),e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,String(t.hasAttribute(`open`))),e.setAttribute(`aria-controls`,t.id),t.classList.add(`mint-navigation-dropdown`),t.hasAttribute(`role`)||t.setAttribute(`role`,`group`),t.hasAttribute(`aria-label`)||t.setAttribute(`aria-label`,`${e.textContent.trim()} links`);let n=Array.from(t.querySelectorAll(`mint-link`)).map(e=>e.cloneNode(!0)),r={trigger:e,popover:t,observer:null,triggerId:t.getAttribute(`trigger-id`)||e.id,submenuItems:n};e.addEventListener(`click`,()=>{this._isMobileLayout()&&this._openSubmenu(r)}),this._dropdowns.push(r)}_observeDropdowns(){for(let e of this._dropdowns)e.observer||(e.observer=new MutationObserver(()=>{e.trigger.setAttribute(`aria-expanded`,String(e.popover.hasAttribute(`open`)))}),e.observer.observe(e.popover,{attributes:!0,attributeFilter:[`open`]}))}_isMobileLayout(){return this.getBoundingClientRect().width<=640}_syncResponsiveDropdowns(){let e=this._isMobileLayout();for(let t of this._dropdowns)e?(t.popover.hasAttribute(`open`)&&t.popover.close(),t.popover.getAttribute(`trigger-id`)&&t.popover.setAttribute(`trigger-id`,``)):t.triggerId&&t.popover.getAttribute(`trigger-id`)!==t.triggerId&&t.popover.setAttribute(`trigger-id`,t.triggerId);!e&&this._activeDropdown&&this._closeSubmenu()}_openSubmenu(e){this._isMobileLayout()&&(this._activeDropdown&&this._activeDropdown!==e&&this._activeDropdown.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=e,e.trigger.setAttribute(`aria-expanded`,`true`),this._submenuTitle.textContent=e.trigger.textContent.trim(),this._submenuItems.replaceChildren(...e.submenuItems),this._content.setAttribute(`data-submenu-open`,``))}_closeSubmenu(){this._activeDropdown?.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=null,this._content?.removeAttribute(`data-submenu-open`)}_syncAttributes(){if(this._brandLink){this._brandLink.setAttribute(`href`,this.getBrandHref());let e=this._brandLink.querySelector(`a`);e?e.textContent=this.getBrand():this._brandLink.textContent=this.getBrand()}this._items&&this._items.setAttribute(`aria-label`,this.getLabel()),this._syncOpenState()}_syncOpenState(){if(!this._toggle)return;let e=this.hasAttribute(`open`);this._toggle.setAttribute(`aria-expanded`,String(e));let t=e?`Close navigation menu`:`Open navigation menu`;this._toggle.setAttribute(`aria-label`,t),this._toggleLabel&&(this._toggleLabel.textContent=t),this._toggle.setAttribute(`icon`,e?`close`:`menu`)}openMenu(){this.setAttribute(`open`,``)}closeMenu(){this._closeSubmenu(),this.removeAttribute(`open`)}toggleMenu(){this.hasAttribute(`open`)?this.closeMenu():this.openMenu()}};typeof customElements<`u`&&!customElements.get(`mint-navigation`)&&e.t(`mint-navigation`,n),module.exports=n;
|
|
@@ -6,9 +6,9 @@ import '../../link.css'
|
|
|
6
6
|
import '../../popover.css'
|
|
7
7
|
import '../../stack.css'
|
|
8
8
|
import '../../navigation.css'
|
|
9
|
-
import "../chunks/icon-
|
|
9
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
10
10
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
11
|
-
import "../chunks/button-
|
|
11
|
+
import "../chunks/button-BYQbRAwl.js";
|
|
12
12
|
import "../chunks/popover-gviDCspV.js";
|
|
13
13
|
import "../chunks/link-DKgtBYK6.js";
|
|
14
14
|
//#region src/components/navigation/Navigation.js
|
|
@@ -17,10 +17,10 @@ __mintLoadStyle('icon', '../../icon.css')
|
|
|
17
17
|
__mintLoadStyle('text', '../../text.css')
|
|
18
18
|
__mintLoadStyle('stack', '../../stack.css')
|
|
19
19
|
__mintLoadStyle('off-canvas', '../../off-canvas.css')
|
|
20
|
-
import "../chunks/icon-
|
|
20
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
21
21
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
22
22
|
import "../chunks/text-Bmfl6CxJ.js";
|
|
23
|
-
import "../chunks/button-
|
|
23
|
+
import "../chunks/button-BYQbRAwl.js";
|
|
24
24
|
import "../chunks/stack-DyQfjPDh.js";
|
|
25
25
|
//#region src/components/off-canvas/OffCanvas.ts
|
|
26
26
|
var t = class extends HTMLElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../chunks/icon-
|
|
1
|
+
require(`../chunks/icon-B_7c8b8e.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/text-Cpl5ljSe.js`),require(`../chunks/button-DbxqmBWQ.js`),require(`../chunks/stack-D1uh4L79.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`id`,`heading`,`open`,`position`,`full-page`,`width`,`height`]}constructor(){super(),this._overlay=null,this._offCanvas=null,this._header=null,this._headingSlot=null,this._bodySlot=null,this._actionsSlot=null,this._closeButton=null,this._contentObserver=null,this._renderFrame=null,this._exitTimer=null,this._previousFocus=null,this._dialogWasOpen=!1,this._dialogKeydownHandler=null}connectedCallback(){this.classList.add(`mint-off-canvas-host`),this.isOpen()||this.classList.add(`mint-off-canvas-hidden`),this.render(),this._observeContentMutations(),this._dialogKeydownHandler=e=>{if(!this.isOpen())return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this.close();return}if(e.key!==`Tab`)return;let t=this._offCanvas?.querySelector(`.mint-off-canvas-panel`);if(!t)return;let n=this._getDialogFocusableElements(t);if(!n.length){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===r||!t.contains(a))?(e.preventDefault(),i.focus()):!e.shiftKey&&(a===i||!t.contains(a))&&(e.preventDefault(),r.focus())},document.addEventListener(`keydown`,this._dialogKeydownHandler,!0)}disconnectedCallback(){this._dialogKeydownHandler&&=(document.removeEventListener(`keydown`,this._dialogKeydownHandler,!0),null),this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null),this._exitTimer!==null&&(clearTimeout(this._exitTimer),this._exitTimer=null)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}getId(){return this.getAttribute(`id`)||``}getHeading(){return this.getAttribute(`heading`)||``}getPosition(){let e=this.getAttribute(`position`)?.toLowerCase();return e===`top`||e===`bottom`||e===`left`||e===`right`?e:`right`}isFullPage(){return this.getAttribute(`full-page`)===`true`}getWidth(){return this.getAttribute(`width`)||`320px`}getHeight(){return this.getAttribute(`height`)||``}_normalizeCssValue(e){return/^\d+(\.\d+)?$/.test(e.trim())?`${e.trim()}px`:e.trim()}isOpen(){return this.getAttribute(`open`)===`true`}open(){this.setAttribute(`open`,`true`)}close(){this.removeAttribute(`open`)}render(){let e=this.getId(),t=this.getHeading(),n=this.isOpen(),r=this.getPosition(),i=this.isFullPage(),a=this.getHeight();e&&(this.id=e),this._overlay||(this._overlay=document.createElement(`div`),this._overlay.className=`mint-off-canvas-overlay`,this._overlay.setAttribute(`aria-hidden`,`true`),this._overlay.addEventListener(`click`,()=>this.close()),this.appendChild(this._overlay)),this._offCanvas||(this._offCanvas=document.createElement(`div`),this.appendChild(this._offCanvas)),this._offCanvas.className=`mint-off-canvas-shell`,this._offCanvas.dataset.position=r,this._offCanvas.dataset.fullPage=String(i);let o=this._offCanvas.querySelector(`.mint-off-canvas-panel`);o||(o=document.createElement(`div`),o.className=`mint-off-canvas-panel`,o.style.transform=this._getTransformValue(r,!1),this._offCanvas.appendChild(o)),o.setAttribute(`role`,`dialog`),o.setAttribute(`aria-modal`,`true`),o.hasAttribute(`tabindex`)||(o.tabIndex=-1),n?this._animateEnter():this._animateExit(),o.style.removeProperty(`--off-canvas-width`),o.style.removeProperty(`--off-canvas-height`),r===`top`||r===`bottom`?a&&o.style.setProperty(`--off-canvas-height`,this._normalizeCssValue(a)):o.style.setProperty(`--off-canvas-width`,this._normalizeCssValue(this.getWidth())),this._header||(this._header=document.createElement(`div`),this._header.className=`mint-off-canvas-header`,o.appendChild(this._header)),this._headingSlot||(this._headingSlot=document.createElement(`div`),this._headingSlot.className=`mint-off-canvas-heading`,this._headingSlot.setAttribute(`slot`,`heading`),this._header.appendChild(this._headingSlot));let s=this._headingSlot.querySelector(`mint-text`);if(t?(s||(s=document.createElement(`mint-text`),s.setAttribute(`size`,`sub-heading`),s.setAttribute(`bold`,`true`),this._headingSlot.appendChild(s)),s.textContent=t,s.id=`${e||`mint-off-canvas`}-heading`,o.setAttribute(`aria-labelledby`,s.id),o.removeAttribute(`aria-label`)):s&&s.remove(),!t){let e=this.getAttribute(`aria-label`)?.trim();e?o.setAttribute(`aria-label`,e):o.hasAttribute(`aria-label`)||o.setAttribute(`aria-label`,`Dialog`)}Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._offCanvas&&e!==this._headingSlot&&e.getAttribute(`slot`)===`heading`).forEach(e=>{this._headingSlot&&e.parentElement!==this._headingSlot&&this._headingSlot.appendChild(e)}),this._closeButton||(this._closeButton=document.createElement(`mint-button`),this._closeButton.setAttribute(`variant`,`ghost`),this._closeButton.setAttribute(`icon`,`close`),this._closeButton.setAttribute(`aria-label`,`Close panel`),this._closeButton.addEventListener(`click`,()=>this.close()),this._header.appendChild(this._closeButton)),this._bodySlot||(this._bodySlot=document.createElement(`div`),this._bodySlot.className=`mint-off-canvas-body`,this._bodySlot.setAttribute(`slot`,`body`),o.appendChild(this._bodySlot)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._offCanvas&&e!==this._bodySlot&&e.getAttribute(`slot`)===`body`).forEach(e=>{this._bodySlot&&e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._actionsSlot||(this._actionsSlot=document.createElement(`div`),this._actionsSlot.className=`mint-off-canvas-actions`,this._actionsSlot.setAttribute(`slot`,`actions`),o.appendChild(this._actionsSlot));let c=this._actionsSlot.querySelector(`mint-stack`);c||(c=document.createElement(`mint-stack`),c.setAttribute(`direction`,`horizontal`),c.className=`mint-off-canvas-actions-stack`,this._actionsSlot.appendChild(c)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._offCanvas&&e!==this._actionsSlot&&e.getAttribute(`slot`)===`actions`).forEach(e=>{Array.from(e.children).forEach(e=>{e.parentElement!==c&&c.appendChild(e)}),e.parentElement&&e.remove()}),Array.from(this.children).forEach(e=>{e!==this._overlay&&e!==this._offCanvas&&e.getAttribute(`slot`)!==`heading`&&e.getAttribute(`slot`)!==`body`&&e.getAttribute(`slot`)!==`actions`&&e!==this._headingSlot&&e!==this._bodySlot&&e!==this._actionsSlot&&e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)})}_getTransformValue(e,t){if(t)switch(e){case`top`:return`translateY(0)`;case`bottom`:return`translateY(0)`;case`left`:return`translateX(0)`;case`right`:return`translateX(0)`;default:return`translateX(0)`}else switch(e){case`top`:return`translateY(-100%)`;case`bottom`:return`translateY(100%)`;case`left`:return`translateX(-100%)`;case`right`:return`translateX(100%)`;default:return`translateX(100%)`}}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}_getDialogFocusableElements(e){return Array.from(e.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>{if(e.closest(`[hidden], [aria-hidden="true"]`))return!1;let t=window.getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`})}_animateEnter(){let e=this._offCanvas?.querySelector(`.mint-off-canvas-panel`);if(!e)return;this._exitTimer!==null&&(clearTimeout(this._exitTimer),this._exitTimer=null);let t=this.getPosition(),n=!this._dialogWasOpen;if(n){this._dialogWasOpen=!0;let e=document.activeElement;this._previousFocus=e instanceof HTMLElement&&e!==document.body?e:null}e.style.transform=this._getTransformValue(t,!1),e.style.transition=`transform 300ms ease-out`,this.classList.remove(`mint-off-canvas-hidden`),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isOpen()&&(this.classList.add(`mint-off-canvas-open`),e.style.transform=this._getTransformValue(t,!0),n&&(this._getDialogFocusableElements(e)[0]??e).focus())})})}_animateExit(){this.classList.remove(`mint-off-canvas-open`);let e=this._offCanvas?.querySelector(`.mint-off-canvas-panel`);if(!e){this.classList.add(`mint-off-canvas-hidden`),this._dialogWasOpen=!1;return}let t=this.getPosition();e.style.transition=`transform 300ms ease-in`,e.style.transform=this._getTransformValue(t,!1),this._exitTimer!==null&&clearTimeout(this._exitTimer),this._exitTimer=window.setTimeout(()=>{if(this._exitTimer=null,this.isOpen())return;this.classList.add(`mint-off-canvas-hidden`),e.style.transform=``,e.style.transition=``;let t=this._previousFocus;this._previousFocus=null,t?.isConnected&&t.focus()},300)}};customElements.get(`mint-off-canvas`)||e.t(`mint-off-canvas`,t),module.exports=t;
|
|
@@ -5,10 +5,10 @@ import '../../icon.css'
|
|
|
5
5
|
import '../../text.css'
|
|
6
6
|
import '../../stack.css'
|
|
7
7
|
import '../../off-canvas.css'
|
|
8
|
-
import "../chunks/icon-
|
|
8
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
9
9
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
10
10
|
import "../chunks/text-Bmfl6CxJ.js";
|
|
11
|
-
import "../chunks/button-
|
|
11
|
+
import "../chunks/button-BYQbRAwl.js";
|
|
12
12
|
import "../chunks/stack-DyQfjPDh.js";
|
|
13
13
|
//#region src/components/off-canvas/OffCanvas.ts
|
|
14
14
|
var t = class extends HTMLElement {
|
|
@@ -19,16 +19,16 @@ __mintLoadStyle('spinner', '../../spinner.css')
|
|
|
19
19
|
__mintLoadStyle('popover', '../../popover.css')
|
|
20
20
|
__mintLoadStyle('stack', '../../stack.css')
|
|
21
21
|
__mintLoadStyle('resource-table', '../../resource-table.css')
|
|
22
|
-
import "../chunks/icon-
|
|
22
|
+
import "../chunks/icon-BWUYe89V.js";
|
|
23
23
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
24
|
-
import "../chunks/icon-
|
|
24
|
+
import "../chunks/icon-B8p3Co0-.js";
|
|
25
25
|
import "../chunks/spinner-BsaFHuS6.js";
|
|
26
|
-
import "../chunks/button-
|
|
27
|
-
import "../chunks/input-
|
|
28
|
-
import "../chunks/caret-up-
|
|
29
|
-
import "../chunks/caret-down-
|
|
26
|
+
import "../chunks/button-BYQbRAwl.js";
|
|
27
|
+
import "../chunks/input-Dwrs8tJH.js";
|
|
28
|
+
import "../chunks/caret-up-CK7JOG6X.js";
|
|
29
|
+
import "../chunks/caret-down-DD9Ie5js.js";
|
|
30
30
|
import "../chunks/popover-gviDCspV.js";
|
|
31
|
-
import "../chunks/search-
|
|
31
|
+
import "../chunks/search-xHKqAXph.js";
|
|
32
32
|
import "../chunks/table-BgboosRK.js";
|
|
33
33
|
//#region src/components/resource-table/utility-aliases.js
|
|
34
34
|
var t = {
|