monobill-mintui 0.6.685 → 0.6.687
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/chunks/{date-picker-Drb3TIOp.js → date-picker-B0CA1_Lp.js} +1 -1
- package/dist/components/chunks/{date-picker-Ip1NrxP9.js → date-picker-BHVWueiN.js} +1 -1
- package/dist/components/chunks/{popover-Bek5fgHz.js → popover-6cborap6.js} +1 -1
- package/dist/components/chunks/{popover-co0gSvD-.js → popover-C1qiTAvR.js} +41 -14
- package/dist/components/chunks/{time-picker-uJ2DcTIE.js → time-picker-CFKksmmW.js} +1 -1
- package/dist/components/chunks/{time-picker-C9TxayLS.js → time-picker-CRWdt9DU.js} +1 -1
- package/dist/components/date-picker/browser.js +1 -1
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/datetime-picker/browser.js +2 -2
- package/dist/components/datetime-picker/index.cjs +1 -1
- package/dist/components/datetime-picker/index.js +2 -2
- package/dist/components/navigation/browser.js +1 -1
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/page/Page.d.ts +2 -0
- package/dist/components/page/Page.d.ts.map +1 -1
- package/dist/components/page/browser.js +28 -20
- package/dist/components/page/index.cjs +2 -2
- package/dist/components/page/index.js +28 -20
- package/dist/components/popover/browser.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/resource-table/browser.js +1 -1
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +1 -1
- package/dist/components/select/browser.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/side-navigation/browser.js +1 -1
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +1 -1
- package/dist/components/tags/browser.js +1 -1
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +1 -1
- package/dist/components/time-picker/browser.js +1 -1
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/tree/browser.js +1 -1
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +69 -34
- package/dist/popover.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/button-kbb_mcUl.js`),require(`../chunks/popover-
|
|
1
|
+
require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/button-kbb_mcUl.js`),require(`../chunks/popover-6cborap6.js`),require(`../chunks/link-DVKhDl3O.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;
|
|
@@ -9,7 +9,7 @@ import '../../navigation.css'
|
|
|
9
9
|
import "../chunks/icon-Basse9AD.js";
|
|
10
10
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
11
11
|
import "../chunks/button-B3VB87bu.js";
|
|
12
|
-
import "../chunks/popover-
|
|
12
|
+
import "../chunks/popover-C1qiTAvR.js";
|
|
13
13
|
import "../chunks/link-ACOyvLkd.js";
|
|
14
14
|
//#region src/components/navigation/Navigation.js
|
|
15
15
|
var t = 0, n = class extends HTMLElement {
|
|
@@ -17,6 +17,8 @@ declare class MintPage extends HTMLElement {
|
|
|
17
17
|
private _actionsFrame;
|
|
18
18
|
private _groupingActions;
|
|
19
19
|
private _actionFullWidthOriginal;
|
|
20
|
+
private _autoGroupedActions;
|
|
21
|
+
private _explicitOverflowActions;
|
|
20
22
|
constructor();
|
|
21
23
|
connectedCallback(): void;
|
|
22
24
|
disconnectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/page/Page.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAA;AACxB,OAAO,eAAe,CAAA;AACtB,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AAEzB,cAAM,QAAS,SAAQ,WAAW;IAChC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,oBAAoB,CAAiB;IAC7C,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,sBAAsB,CAA8B;IAC5D,OAAO,CAAC,wBAAwB,CAAgC;IAChE,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,wBAAwB,CAA4C;;
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/page/Page.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAA;AACxB,OAAO,eAAe,CAAA;AACtB,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AAEzB,cAAM,QAAS,SAAQ,WAAW;IAChC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,oBAAoB,CAAiB;IAC7C,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,sBAAsB,CAA8B;IAC5D,OAAO,CAAC,wBAAwB,CAAgC;IAChE,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,wBAAwB,CAA4C;IAC5E,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,wBAAwB,CAA6B;;IAmI7D,iBAAiB,IAAI,IAAI;IAczB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI/F,UAAU,IAAI,MAAM;IAIpB,eAAe,IAAI,MAAM;IAIzB,oBAAoB,IAAI,OAAO;IAI/B,aAAa,IAAI,OAAO;IAIxB,MAAM,IAAI,IAAI;IAMd,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,aAAa;IAmFrB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,yBAAyB;IAoBjC,OAAO,CAAC,WAAW;CAyBpB;AAMD,eAAe,QAAQ,CAAA"}
|
|
@@ -22,7 +22,7 @@ import "../chunks/icon-Basse9AD.js";
|
|
|
22
22
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
23
23
|
import "../chunks/back-button-cGUnOwR0.js";
|
|
24
24
|
import "../chunks/button-B3VB87bu.js";
|
|
25
|
-
import "../chunks/popover-
|
|
25
|
+
import "../chunks/popover-C1qiTAvR.js";
|
|
26
26
|
//#region src/components/page/Page.js
|
|
27
27
|
var t = class extends HTMLElement {
|
|
28
28
|
static get observedAttributes() {
|
|
@@ -34,15 +34,19 @@ var t = class extends HTMLElement {
|
|
|
34
34
|
];
|
|
35
35
|
}
|
|
36
36
|
constructor() {
|
|
37
|
-
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
37
|
+
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
38
38
|
}
|
|
39
39
|
connectedCallback() {
|
|
40
40
|
this.render(), this._actionsResizeObserver = new ResizeObserver(() => this._scheduleActionGrouping()), this._actionsResizeObserver.observe(this._root.querySelector(".mint-page-header")), this._actionsMutationObserver = new MutationObserver((e) => {
|
|
41
|
-
e.some((e) => e.type === "childList" || e.attributeName === "importance" || e.attributeName === "slot" && !["actions", "overflow-actions"].includes(e.target.getAttribute("slot") || "")) && this._scheduleActionGrouping();
|
|
41
|
+
e.some((e) => e.type === "childList" || e.attributeName === "importance" || e.attributeName === "always-grouped" || e.attributeName === "slot" && !["actions", "overflow-actions"].includes(e.target.getAttribute("slot") || "")) && this._scheduleActionGrouping();
|
|
42
42
|
}), this._actionsMutationObserver.observe(this, {
|
|
43
43
|
childList: !0,
|
|
44
44
|
attributes: !0,
|
|
45
|
-
attributeFilter: [
|
|
45
|
+
attributeFilter: [
|
|
46
|
+
"slot",
|
|
47
|
+
"importance",
|
|
48
|
+
"always-grouped"
|
|
49
|
+
]
|
|
46
50
|
}), this._scheduleActionGrouping();
|
|
47
51
|
}
|
|
48
52
|
disconnectedCallback() {
|
|
@@ -79,31 +83,35 @@ var t = class extends HTMLElement {
|
|
|
79
83
|
this._actionsTrigger.hidden = !0, this._actionsPopover.style.display = "none", this._actionsWrapper.hidden = !0, this._groupingActions = !1;
|
|
80
84
|
return;
|
|
81
85
|
}
|
|
82
|
-
|
|
86
|
+
e.forEach((e) => {
|
|
87
|
+
e.getAttribute("slot") === "overflow-actions" && !this._autoGroupedActions.has(e) && this._explicitOverflowActions.add(e);
|
|
88
|
+
});
|
|
89
|
+
let t = e.filter((e) => e.hasAttribute("always-grouped") || this._explicitOverflowActions.has(e)), n = e.filter((e) => !t.includes(e));
|
|
90
|
+
if (e.length === 1 && t.length === 0) {
|
|
83
91
|
this._setActionSlot(e[0], "actions"), this._syncOverflowButtonWidths([]), this._actionsTrigger.hidden = !0, this._actionsPopover.style.display = "none", this._groupingActions = !1;
|
|
84
92
|
return;
|
|
85
93
|
}
|
|
86
|
-
e.forEach((e) => this._setActionSlot(e, "actions")), this._syncOverflowButtonWidths([]), this._actionsPopover.style.display = "", this._actionsTrigger.hidden = !0;
|
|
87
|
-
let
|
|
88
|
-
this._actionsResizeObserver?.observe(
|
|
89
|
-
let
|
|
94
|
+
n.forEach((e) => this._setActionSlot(e, "actions")), t.forEach((e) => this._setActionSlot(e, "overflow-actions")), this._syncOverflowButtonWidths([]), this._actionsPopover.style.display = "", this._actionsTrigger.hidden = !0;
|
|
95
|
+
let r = this._root.querySelector(".mint-page-actions-primary"), i = this._root.querySelector(".mint-page-header"), a = this._root.querySelector(".mint-page-heading");
|
|
96
|
+
this._actionsResizeObserver?.observe(r), e.forEach((e) => this._actionsResizeObserver?.observe(e));
|
|
97
|
+
let o = i.clientWidth <= 767, s = n.reduce((e, t, n) => e + t.getBoundingClientRect().width + (n ? 8 : 0), 0), c = this._backButton.hidden ? 0 : this._backButton.getBoundingClientRect().width + 16, l = Math.min(i.clientWidth, a.scrollWidth + c), u = Math.max(0, i.clientWidth - l - 16), d = [...t], f = (e) => {
|
|
90
98
|
let t = e.getAttribute("importance"), n = e.querySelector("[importance]")?.getAttribute("importance"), r = Number(t ?? n ?? 1);
|
|
91
99
|
return Number.isFinite(r) && r > 0 ? r : 1;
|
|
92
100
|
};
|
|
93
|
-
!
|
|
94
|
-
let
|
|
95
|
-
for (;
|
|
96
|
-
let t =
|
|
97
|
-
t.sort((t, n) =>
|
|
98
|
-
let
|
|
99
|
-
if (!
|
|
100
|
-
|
|
101
|
+
!o && s > u && (u = Math.max(0, u - 48));
|
|
102
|
+
let p = s;
|
|
103
|
+
for (; o ? n.length > d.length - t.length : p > u && d.length < e.length;) {
|
|
104
|
+
let t = n.filter((e) => !d.includes(e));
|
|
105
|
+
t.sort((t, n) => f(n) - f(t) || e.indexOf(n) - e.indexOf(t));
|
|
106
|
+
let r = t[0];
|
|
107
|
+
if (!r) break;
|
|
108
|
+
d.push(r), p -= r.getBoundingClientRect().width + (d.length < e.length ? 8 : 0);
|
|
101
109
|
}
|
|
102
|
-
let
|
|
103
|
-
e.forEach((e) => this._setActionSlot(e,
|
|
110
|
+
let m = new Set(d);
|
|
111
|
+
e.forEach((e) => this._setActionSlot(e, m.has(e) ? "overflow-actions" : "actions")), this._actionsTrigger.hidden = d.length === 0, this._actionsPopover.style.display = d.length === 0 ? "none" : "", this._syncOverflowButtonWidths(d), this._actionsResizeObserver?.observe(this._actionsTrigger), this._groupingActions = !1;
|
|
104
112
|
}
|
|
105
113
|
_setActionSlot(e, t) {
|
|
106
|
-
e.getAttribute("slot") !== t && e.setAttribute("slot", t);
|
|
114
|
+
t === "overflow-actions" ? this._autoGroupedActions.add(e) : this._autoGroupedActions.delete(e), e.getAttribute("slot") !== t && e.setAttribute("slot", t);
|
|
107
115
|
}
|
|
108
116
|
_syncOverflowButtonWidths(e) {
|
|
109
117
|
let t = /* @__PURE__ */ new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/back-button-olXJu_Sg.js`),require(`../chunks/button-kbb_mcUl.js`),require(`../chunks/popover-
|
|
1
|
+
require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/back-button-olXJu_Sg.js`),require(`../chunks/button-kbb_mcUl.js`),require(`../chunks/popover-6cborap6.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`heading`,`fallback-href`,`show-back-button`,`containered`]}constructor(){super(),this._actionsResizeObserver=null,this._actionsMutationObserver=null,this._actionsFrame=null,this._groupingActions=!1,this._actionFullWidthOriginal=new WeakMap,this._autoGroupedActions=new WeakSet,this._explicitOverflowActions=new WeakSet,this._root=this.attachShadow({mode:`open`}),this._root.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
/* The built-in back button lives inside this component's shadow root,
|
|
4
4
|
so document-level button.css cannot reach its light-DOM button. */
|
|
@@ -107,4 +107,4 @@ require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-elemen
|
|
|
107
107
|
</header>
|
|
108
108
|
<main part="body" class="mint-page-body"><slot></slot></main>
|
|
109
109
|
</div>
|
|
110
|
-
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._backButton=this._root.querySelector(`.mint-page-back`),this._actionsSlot=this._root.querySelector(`slot[name="actions"]`),this._overflowActionsSlot=this._root.querySelector(`slot[name="overflow-actions"]`),this._actionsWrapper=this._root.querySelector(`.mint-page-actions`),this._actionsTrigger=this._root.querySelector(`#mint-page-actions-trigger`),this._actionsPopover=this._root.querySelector(`#mint-page-actions-popover`),this._actionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._overflowActionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._backButton.addEventListener(`click`,e=>this._handleBack(e),!0)}connectedCallback(){this.render(),this._actionsResizeObserver=new ResizeObserver(()=>this._scheduleActionGrouping()),this._actionsResizeObserver.observe(this._root.querySelector(`.mint-page-header`)),this._actionsMutationObserver=new MutationObserver(e=>{e.some(e=>e.type===`childList`||e.attributeName===`importance`||e.attributeName===`slot`&&![`actions`,`overflow-actions`].includes(e.target.getAttribute(`slot`)||``))&&this._scheduleActionGrouping()}),this._actionsMutationObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`,`importance`]}),this._scheduleActionGrouping()}disconnectedCallback(){this._actionsResizeObserver?.disconnect(),this._actionsMutationObserver?.disconnect(),this._actionsFrame!==null&&cancelAnimationFrame(this._actionsFrame),this._actionsFrame=null}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getFallbackHref(){return this.getAttribute(`fallback-href`)||`/`}shouldShowBackButton(){return this.getAttribute(`show-back-button`)===`true`}isContainered(){return this.hasAttribute(`containered`)&&this.getAttribute(`containered`)!==`false`}render(){this._headingElement.textContent=this.getHeading(),this._backButton.setAttribute(`fallback-href`,this.getFallbackHref()),this._backButton.hidden=!this.shouldShowBackButton()}_scheduleActionGrouping(){this._actionsFrame!==null||!this.isConnected||(this._actionsFrame=requestAnimationFrame(()=>{this._actionsFrame=null,this._groupActions()}))}_groupActions(){if(this._groupingActions)return;this._groupingActions=!0;let e=Array.from(this.children).filter(e=>e instanceof HTMLElement&&(e.getAttribute(`slot`)===`actions`||e.getAttribute(`slot`)===`overflow-actions`));if(this._actionsWrapper.hidden=e.length===0,!e.length){this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._actionsWrapper.hidden=!0,this._groupingActions=!1;return}if(e.length===1){this._setActionSlot(e[0],`actions`),this._syncOverflowButtonWidths([]),this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._groupingActions=!1;return}e.forEach(e=>this._setActionSlot(e,`actions`)),this._syncOverflowButtonWidths([]),this._actionsPopover.style.display=``,this._actionsTrigger.hidden=!0;let
|
|
110
|
+
`,this._headingElement=this._root.querySelector(`.mint-page-heading`),this._backButton=this._root.querySelector(`.mint-page-back`),this._actionsSlot=this._root.querySelector(`slot[name="actions"]`),this._overflowActionsSlot=this._root.querySelector(`slot[name="overflow-actions"]`),this._actionsWrapper=this._root.querySelector(`.mint-page-actions`),this._actionsTrigger=this._root.querySelector(`#mint-page-actions-trigger`),this._actionsPopover=this._root.querySelector(`#mint-page-actions-popover`),this._actionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._overflowActionsSlot.addEventListener(`slotchange`,()=>this._scheduleActionGrouping()),this._backButton.addEventListener(`click`,e=>this._handleBack(e),!0)}connectedCallback(){this.render(),this._actionsResizeObserver=new ResizeObserver(()=>this._scheduleActionGrouping()),this._actionsResizeObserver.observe(this._root.querySelector(`.mint-page-header`)),this._actionsMutationObserver=new MutationObserver(e=>{e.some(e=>e.type===`childList`||e.attributeName===`importance`||e.attributeName===`always-grouped`||e.attributeName===`slot`&&![`actions`,`overflow-actions`].includes(e.target.getAttribute(`slot`)||``))&&this._scheduleActionGrouping()}),this._actionsMutationObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`,`importance`,`always-grouped`]}),this._scheduleActionGrouping()}disconnectedCallback(){this._actionsResizeObserver?.disconnect(),this._actionsMutationObserver?.disconnect(),this._actionsFrame!==null&&cancelAnimationFrame(this._actionsFrame),this._actionsFrame=null}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getFallbackHref(){return this.getAttribute(`fallback-href`)||`/`}shouldShowBackButton(){return this.getAttribute(`show-back-button`)===`true`}isContainered(){return this.hasAttribute(`containered`)&&this.getAttribute(`containered`)!==`false`}render(){this._headingElement.textContent=this.getHeading(),this._backButton.setAttribute(`fallback-href`,this.getFallbackHref()),this._backButton.hidden=!this.shouldShowBackButton()}_scheduleActionGrouping(){this._actionsFrame!==null||!this.isConnected||(this._actionsFrame=requestAnimationFrame(()=>{this._actionsFrame=null,this._groupActions()}))}_groupActions(){if(this._groupingActions)return;this._groupingActions=!0;let e=Array.from(this.children).filter(e=>e instanceof HTMLElement&&(e.getAttribute(`slot`)===`actions`||e.getAttribute(`slot`)===`overflow-actions`));if(this._actionsWrapper.hidden=e.length===0,!e.length){this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._actionsWrapper.hidden=!0,this._groupingActions=!1;return}e.forEach(e=>{e.getAttribute(`slot`)===`overflow-actions`&&!this._autoGroupedActions.has(e)&&this._explicitOverflowActions.add(e)});let t=e.filter(e=>e.hasAttribute(`always-grouped`)||this._explicitOverflowActions.has(e)),n=e.filter(e=>!t.includes(e));if(e.length===1&&t.length===0){this._setActionSlot(e[0],`actions`),this._syncOverflowButtonWidths([]),this._actionsTrigger.hidden=!0,this._actionsPopover.style.display=`none`,this._groupingActions=!1;return}n.forEach(e=>this._setActionSlot(e,`actions`)),t.forEach(e=>this._setActionSlot(e,`overflow-actions`)),this._syncOverflowButtonWidths([]),this._actionsPopover.style.display=``,this._actionsTrigger.hidden=!0;let r=this._root.querySelector(`.mint-page-actions-primary`),i=this._root.querySelector(`.mint-page-header`),a=this._root.querySelector(`.mint-page-heading`);this._actionsResizeObserver?.observe(r),e.forEach(e=>this._actionsResizeObserver?.observe(e));let o=i.clientWidth<=767,s=n.reduce((e,t,n)=>e+t.getBoundingClientRect().width+(n?8:0),0),c=this._backButton.hidden?0:this._backButton.getBoundingClientRect().width+16,l=Math.min(i.clientWidth,a.scrollWidth+c),u=Math.max(0,i.clientWidth-l-16),d=[...t],f=e=>{let t=e.getAttribute(`importance`),n=e.querySelector(`[importance]`)?.getAttribute(`importance`),r=Number(t??n??1);return Number.isFinite(r)&&r>0?r:1};!o&&s>u&&(u=Math.max(0,u-48));let p=s;for(;o?n.length>d.length-t.length:p>u&&d.length<e.length;){let t=n.filter(e=>!d.includes(e));t.sort((t,n)=>f(n)-f(t)||e.indexOf(n)-e.indexOf(t));let r=t[0];if(!r)break;d.push(r),p-=r.getBoundingClientRect().width+(d.length<e.length?8:0)}let m=new Set(d);e.forEach(e=>this._setActionSlot(e,m.has(e)?`overflow-actions`:`actions`)),this._actionsTrigger.hidden=d.length===0,this._actionsPopover.style.display=d.length===0?`none`:``,this._syncOverflowButtonWidths(d),this._actionsResizeObserver?.observe(this._actionsTrigger),this._groupingActions=!1}_setActionSlot(e,t){t===`overflow-actions`?this._autoGroupedActions.add(e):this._autoGroupedActions.delete(e),e.getAttribute(`slot`)!==t&&e.setAttribute(`slot`,t)}_syncOverflowButtonWidths(e){let t=new Set;e.forEach(e=>{e.matches(`mint-button`)&&t.add(e),e.querySelectorAll(`mint-button`).forEach(e=>t.add(e))}),Array.from(this.querySelectorAll(`mint-button[slot="actions"], mint-button[slot="overflow-actions"], [slot="actions"] mint-button, [slot="overflow-actions"] mint-button`)).forEach(e=>{if(t.has(e))this._actionFullWidthOriginal.has(e)||this._actionFullWidthOriginal.set(e,e.getAttribute(`full-width`)),e.setAttribute(`full-width`,`true`);else if(this._actionFullWidthOriginal.has(e)){let t=this._actionFullWidthOriginal.get(e);t===null?e.removeAttribute(`full-width`):t!==void 0&&e.setAttribute(`full-width`,t),this._actionFullWidthOriginal.delete(e)}})}_handleBack(e){e.preventDefault(),e.stopPropagation();let t=document.referrer,n=!!(t&&(()=>{try{return new URL(t).origin===window.location.origin}catch{return!1}})()),r={url:n?t:this.getFallbackHref(),isFromReferrer:n,referrer:t||null,fallbackHref:this.getFallbackHref()},i=new CustomEvent(`back`,{detail:r,bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(i)&&(n&&window.history.length>1?window.history.back():window.location.href=this.getFallbackHref())}};typeof customElements<`u`&&!customElements.get(`mint-page`)&&e.t(`mint-page`,t),module.exports=t;
|
|
@@ -10,7 +10,7 @@ import "../chunks/icon-Basse9AD.js";
|
|
|
10
10
|
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
11
11
|
import "../chunks/back-button-cGUnOwR0.js";
|
|
12
12
|
import "../chunks/button-B3VB87bu.js";
|
|
13
|
-
import "../chunks/popover-
|
|
13
|
+
import "../chunks/popover-C1qiTAvR.js";
|
|
14
14
|
//#region src/components/page/Page.js
|
|
15
15
|
var t = class extends HTMLElement {
|
|
16
16
|
static get observedAttributes() {
|
|
@@ -22,15 +22,19 @@ var t = class extends HTMLElement {
|
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
24
|
constructor() {
|
|
25
|
-
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
25
|
+
super(), this._actionsResizeObserver = null, this._actionsMutationObserver = null, this._actionsFrame = null, this._groupingActions = !1, this._actionFullWidthOriginal = /* @__PURE__ */ new WeakMap(), this._autoGroupedActions = /* @__PURE__ */ new WeakSet(), this._explicitOverflowActions = /* @__PURE__ */ new WeakSet(), this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = "\n <style>\n /* The built-in back button lives inside this component's shadow root,\n so document-level button.css cannot reach its light-DOM button. */\n /* Avoid an inline baseline line box below the native button core. */\n .mint-page-back mint-button {\n box-sizing: border-box;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n line-height: 0;\n vertical-align: middle;\n }\n .mint-page-back mint-button .mint-button-core {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-width: 2.25rem;\n min-height: 2.25rem;\n padding: .375rem;\n border: 2px solid var(--mint-color-border, #dfe6e0);\n border-top-color: #e5e7eb;\n border-left-color: #e5e7eb;\n border-right-color: #d1d5db;\n border-bottom-color: #d1d5db;\n border-radius: .5rem;\n background: var(--mint-color-surface, #fff);\n color: var(--mint-color-text, #28372d);\n font: inherit;\n box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n cursor: pointer;\n transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;\n }\n .mint-page-back mint-button .mint-button-core:hover:not(:disabled) { filter: brightness(.98); }\n .mint-page-back mint-button .mint-button-core:active:not(:disabled) {\n border-top-color: #9ca3af;\n border-left-color: #9ca3af;\n border-right-color: #e5e7eb;\n border-bottom-color: #e5e7eb;\n background: #f3f4f6;\n box-shadow: inset 0 2px 4px rgb(16 32 21 / 26%), inset 0 1px 2px rgb(6 25 15 / 14%);\n filter: brightness(.97);\n }\n .mint-page-back mint-button .mint-button-core:focus-visible {\n outline: 3px solid var(--mint-color-focus, #6eaa86);\n outline-offset: 2px;\n }\n .mint-page-actions-menu { box-sizing: border-box; display: flex; min-width: 14rem; flex-direction: column; gap: .25rem; padding: .375rem; }\n .mint-page-actions-primary { display: flex; align-items: center; gap: .5rem; min-width: 0; }\n .mint-page-actions-menu ::slotted(*) { box-sizing: border-box; display: block; width: 100%; }\n .mint-page-actions-menu ::slotted(div) { display: flex; flex-direction: column !important; align-items: stretch !important; gap: .25rem !important; }\n .mint-page-actions-trigger { display: inline-flex; vertical-align: middle; }\n .mint-page-actions-trigger[hidden] { display: none !important; }\n .mint-page-actions-trigger .mint-button-core {\n box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;\n width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: .5rem;\n border: 2px solid var(--mint-color-border, #dfe6e0); border-radius: .625rem;\n background: var(--mint-color-surface, #fff); color: var(--mint-color-text, #28372d);\n font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgb(21 36 26 / 8%);\n }\n .mint-page-actions-trigger .mint-button-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; }\n .mint-page-actions-trigger .mint-button-icon mint-icon { width: 100% !important; height: 100% !important; }\n .mint-page-actions-popover { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; }\n .mint-page-actions-popover:not([data-open]):not([data-state=\"closing\"]),\n .mint-page-actions-popover.hidden { display: none !important; }\n .mint-page-actions-popover[data-open],\n .mint-page-actions-popover[data-state=\"closing\"] {\n display: block; box-sizing: border-box; width: max-content; height: max-content;\n min-height: 0; max-width: calc(100vw - 24px); max-height: min(500px, calc(100vh - 24px));\n max-height: min(500px, calc(100svh - 24px)); overflow: auto; padding: 0;\n border: 1px solid var(--mint-color-border, #dfe6e0); border-radius: .75rem;\n background: var(--mint-color-surface-raised, #fff); color: var(--mint-color-text, #28372d);\n box-shadow: 0 12px 36px rgb(16 32 21 / 13%); pointer-events: auto;\n transform-origin: var(--mint-popover-origin-x, 50%) var(--mint-popover-origin-y, 0%);\n }\n .mint-page-actions-popover[data-state=\"closing\"] { pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-none { position: fixed; inset: 0; z-index: 55; pointer-events: none; }\n .mint-page-actions-popover > .pointer-events-auto {\n position: fixed; z-index: 60; min-width: 14rem; border-radius: .75rem;\n background: var(--mint-color-surface, #fff); pointer-events: auto;\n }\n .mint-page-actions-popover .popover-content {\n min-height: 0; overflow: visible; border: 1px solid var(--mint-color-border, #dfe6e0);\n border-radius: .75rem; background: var(--mint-color-surface, #fff);\n box-shadow: 0 12px 30px rgb(15 23 42 / 16%); padding: 0;\n }\n .mint-page-actions[hidden] { display: none !important; }\n </style>\n <div part=\"container\" class=\"mint-page-container\">\n <header part=\"header\" class=\"mint-page-header\">\n <div part=\"title\" class=\"mint-page-title\">\n <mint-back-button part=\"back-button\" class=\"mint-page-back\" aria-label=\"Go back\" hidden></mint-back-button>\n <h1 part=\"heading\" class=\"mint-page-heading\"></h1>\n </div>\n <div part=\"actions\" class=\"mint-page-actions\" hidden>\n <div class=\"mint-page-actions-primary\"><slot name=\"actions\"></slot></div>\n <mint-button id=\"mint-page-actions-trigger\" class=\"mint-page-actions-trigger\" variant=\"outline\" icon=\"ellipsis\" aria-label=\"Page actions\"></mint-button>\n <mint-popover id=\"mint-page-actions-popover\" class=\"mint-page-actions-popover\" trigger-id=\"mint-page-actions-trigger\" direction=\"down\" trigger-align=\"end\" padding=\"0\">\n <div class=\"mint-page-actions-menu\"><slot name=\"overflow-actions\"></slot></div>\n </mint-popover>\n </div>\n </header>\n <main part=\"body\" class=\"mint-page-body\"><slot></slot></main>\n </div>\n ", this._headingElement = this._root.querySelector(".mint-page-heading"), this._backButton = this._root.querySelector(".mint-page-back"), this._actionsSlot = this._root.querySelector("slot[name=\"actions\"]"), this._overflowActionsSlot = this._root.querySelector("slot[name=\"overflow-actions\"]"), this._actionsWrapper = this._root.querySelector(".mint-page-actions"), this._actionsTrigger = this._root.querySelector("#mint-page-actions-trigger"), this._actionsPopover = this._root.querySelector("#mint-page-actions-popover"), this._actionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._overflowActionsSlot.addEventListener("slotchange", () => this._scheduleActionGrouping()), this._backButton.addEventListener("click", (e) => this._handleBack(e), !0);
|
|
26
26
|
}
|
|
27
27
|
connectedCallback() {
|
|
28
28
|
this.render(), this._actionsResizeObserver = new ResizeObserver(() => this._scheduleActionGrouping()), this._actionsResizeObserver.observe(this._root.querySelector(".mint-page-header")), this._actionsMutationObserver = new MutationObserver((e) => {
|
|
29
|
-
e.some((e) => e.type === "childList" || e.attributeName === "importance" || e.attributeName === "slot" && !["actions", "overflow-actions"].includes(e.target.getAttribute("slot") || "")) && this._scheduleActionGrouping();
|
|
29
|
+
e.some((e) => e.type === "childList" || e.attributeName === "importance" || e.attributeName === "always-grouped" || e.attributeName === "slot" && !["actions", "overflow-actions"].includes(e.target.getAttribute("slot") || "")) && this._scheduleActionGrouping();
|
|
30
30
|
}), this._actionsMutationObserver.observe(this, {
|
|
31
31
|
childList: !0,
|
|
32
32
|
attributes: !0,
|
|
33
|
-
attributeFilter: [
|
|
33
|
+
attributeFilter: [
|
|
34
|
+
"slot",
|
|
35
|
+
"importance",
|
|
36
|
+
"always-grouped"
|
|
37
|
+
]
|
|
34
38
|
}), this._scheduleActionGrouping();
|
|
35
39
|
}
|
|
36
40
|
disconnectedCallback() {
|
|
@@ -67,31 +71,35 @@ var t = class extends HTMLElement {
|
|
|
67
71
|
this._actionsTrigger.hidden = !0, this._actionsPopover.style.display = "none", this._actionsWrapper.hidden = !0, this._groupingActions = !1;
|
|
68
72
|
return;
|
|
69
73
|
}
|
|
70
|
-
|
|
74
|
+
e.forEach((e) => {
|
|
75
|
+
e.getAttribute("slot") === "overflow-actions" && !this._autoGroupedActions.has(e) && this._explicitOverflowActions.add(e);
|
|
76
|
+
});
|
|
77
|
+
let t = e.filter((e) => e.hasAttribute("always-grouped") || this._explicitOverflowActions.has(e)), n = e.filter((e) => !t.includes(e));
|
|
78
|
+
if (e.length === 1 && t.length === 0) {
|
|
71
79
|
this._setActionSlot(e[0], "actions"), this._syncOverflowButtonWidths([]), this._actionsTrigger.hidden = !0, this._actionsPopover.style.display = "none", this._groupingActions = !1;
|
|
72
80
|
return;
|
|
73
81
|
}
|
|
74
|
-
e.forEach((e) => this._setActionSlot(e, "actions")), this._syncOverflowButtonWidths([]), this._actionsPopover.style.display = "", this._actionsTrigger.hidden = !0;
|
|
75
|
-
let
|
|
76
|
-
this._actionsResizeObserver?.observe(
|
|
77
|
-
let
|
|
82
|
+
n.forEach((e) => this._setActionSlot(e, "actions")), t.forEach((e) => this._setActionSlot(e, "overflow-actions")), this._syncOverflowButtonWidths([]), this._actionsPopover.style.display = "", this._actionsTrigger.hidden = !0;
|
|
83
|
+
let r = this._root.querySelector(".mint-page-actions-primary"), i = this._root.querySelector(".mint-page-header"), a = this._root.querySelector(".mint-page-heading");
|
|
84
|
+
this._actionsResizeObserver?.observe(r), e.forEach((e) => this._actionsResizeObserver?.observe(e));
|
|
85
|
+
let o = i.clientWidth <= 767, s = n.reduce((e, t, n) => e + t.getBoundingClientRect().width + (n ? 8 : 0), 0), c = this._backButton.hidden ? 0 : this._backButton.getBoundingClientRect().width + 16, l = Math.min(i.clientWidth, a.scrollWidth + c), u = Math.max(0, i.clientWidth - l - 16), d = [...t], f = (e) => {
|
|
78
86
|
let t = e.getAttribute("importance"), n = e.querySelector("[importance]")?.getAttribute("importance"), r = Number(t ?? n ?? 1);
|
|
79
87
|
return Number.isFinite(r) && r > 0 ? r : 1;
|
|
80
88
|
};
|
|
81
|
-
!
|
|
82
|
-
let
|
|
83
|
-
for (;
|
|
84
|
-
let t =
|
|
85
|
-
t.sort((t, n) =>
|
|
86
|
-
let
|
|
87
|
-
if (!
|
|
88
|
-
|
|
89
|
+
!o && s > u && (u = Math.max(0, u - 48));
|
|
90
|
+
let p = s;
|
|
91
|
+
for (; o ? n.length > d.length - t.length : p > u && d.length < e.length;) {
|
|
92
|
+
let t = n.filter((e) => !d.includes(e));
|
|
93
|
+
t.sort((t, n) => f(n) - f(t) || e.indexOf(n) - e.indexOf(t));
|
|
94
|
+
let r = t[0];
|
|
95
|
+
if (!r) break;
|
|
96
|
+
d.push(r), p -= r.getBoundingClientRect().width + (d.length < e.length ? 8 : 0);
|
|
89
97
|
}
|
|
90
|
-
let
|
|
91
|
-
e.forEach((e) => this._setActionSlot(e,
|
|
98
|
+
let m = new Set(d);
|
|
99
|
+
e.forEach((e) => this._setActionSlot(e, m.has(e) ? "overflow-actions" : "actions")), this._actionsTrigger.hidden = d.length === 0, this._actionsPopover.style.display = d.length === 0 ? "none" : "", this._syncOverflowButtonWidths(d), this._actionsResizeObserver?.observe(this._actionsTrigger), this._groupingActions = !1;
|
|
92
100
|
}
|
|
93
101
|
_setActionSlot(e, t) {
|
|
94
|
-
e.getAttribute("slot") !== t && e.setAttribute("slot", t);
|
|
102
|
+
t === "overflow-actions" ? this._autoGroupedActions.add(e) : this._autoGroupedActions.delete(e), e.getAttribute("slot") !== t && e.setAttribute("slot", t);
|
|
95
103
|
}
|
|
96
104
|
_syncOverflowButtonWidths(e) {
|
|
97
105
|
let t = /* @__PURE__ */ new Set();
|
|
@@ -13,5 +13,5 @@ const __mintLoadStyle = (key, url) => {
|
|
|
13
13
|
__mintLoadStyle('theme', '../../theme.css')
|
|
14
14
|
__mintLoadStyle('stack', '../../stack.css')
|
|
15
15
|
__mintLoadStyle('popover', '../../popover.css')
|
|
16
|
-
import { t as e } from "../chunks/popover-
|
|
16
|
+
import { t as e } from "../chunks/popover-C1qiTAvR.js";
|
|
17
17
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunks/popover-
|
|
1
|
+
const e=require(`../chunks/popover-6cborap6.js`);module.exports=e.t;
|
|
@@ -26,7 +26,7 @@ import "../chunks/spinner-B2sml0AG.js";
|
|
|
26
26
|
import "../chunks/button-B3VB87bu.js";
|
|
27
27
|
import "../chunks/input-Dqa8FmcB.js";
|
|
28
28
|
import "../chunks/caret-down-DpWztgFw.js";
|
|
29
|
-
import "../chunks/popover-
|
|
29
|
+
import "../chunks/popover-C1qiTAvR.js";
|
|
30
30
|
import { n as t } from "../chunks/ScrollFade-DvzPIk2A.js";
|
|
31
31
|
import "../chunks/search-oEuzdZDO.js";
|
|
32
32
|
import "../chunks/table-B_g7lNzN.js";
|