@jimka/typescript-ui 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{AbstractInput-sRNPzWel.js → AbstractInput-W2PLJV5_.js} +2 -2
- package/dist/lib/{AbstractInput-sRNPzWel.js.map → AbstractInput-W2PLJV5_.js.map} +1 -1
- package/dist/lib/{Anchor-CwRhdP2J.js → Anchor-iZhsvMlT.js} +2 -2
- package/dist/lib/{Anchor-CwRhdP2J.js.map → Anchor-iZhsvMlT.js.map} +1 -1
- package/dist/lib/AnimatedDropdown-D0RhVgv3.js +2 -0
- package/dist/lib/AnimatedDropdown-D0RhVgv3.js.map +1 -0
- package/dist/lib/Border-6GsTNV-2.js +2 -0
- package/dist/lib/Border-6GsTNV-2.js.map +1 -0
- package/dist/lib/Button-CnFAiQuV.js +2 -0
- package/dist/lib/Button-CnFAiQuV.js.map +1 -0
- package/dist/lib/{Card-QYo27r5b.js → Card-C20k2YHU.js} +2 -2
- package/dist/lib/{Card-QYo27r5b.js.map → Card-C20k2YHU.js.map} +1 -1
- package/dist/lib/Checkbox-CM1z8keM.js +2 -0
- package/dist/lib/Checkbox-CM1z8keM.js.map +1 -0
- package/dist/lib/{CheckboxMenuRow-CesLhSnp.js → CheckboxMenuRow-C1h4LPHR.js} +2 -2
- package/dist/lib/{CheckboxMenuRow-CesLhSnp.js.map → CheckboxMenuRow-C1h4LPHR.js.map} +1 -1
- package/dist/lib/{CodeEditor-N1FQodcF.js → CodeEditor-CTL2WjF8.js} +2 -2
- package/dist/lib/{CodeEditor-N1FQodcF.js.map → CodeEditor-CTL2WjF8.js.map} +1 -1
- package/dist/lib/ComboBox-PZ5YPL0X.js +2 -0
- package/dist/lib/ComboBox-PZ5YPL0X.js.map +1 -0
- package/dist/lib/Component-D99-15Zt.js +2 -0
- package/dist/lib/Component-D99-15Zt.js.map +1 -0
- package/dist/lib/Container-FWRjgF6T.js +2 -0
- package/dist/lib/{Container-abY5Ww3W.js.map → Container-FWRjgF6T.js.map} +1 -1
- package/dist/lib/DOM-Cjh7_7TF.js +2 -0
- package/dist/lib/DOM-Cjh7_7TF.js.map +1 -0
- package/dist/lib/Dialog-DN78RaVH.js +2 -0
- package/dist/lib/Dialog-DN78RaVH.js.map +1 -0
- package/dist/lib/{FieldDecorator-BlYMfZ9L.js → FieldDecorator-DyPX8CFh.js} +2 -2
- package/dist/lib/{FieldDecorator-BlYMfZ9L.js.map → FieldDecorator-DyPX8CFh.js.map} +1 -1
- package/dist/lib/{Fit-BhlB-HAo.js → Fit-CaPMj7Up.js} +2 -2
- package/dist/lib/{Fit-BhlB-HAo.js.map → Fit-CaPMj7Up.js.map} +1 -1
- package/dist/lib/{FloatingPanel-DkJXsZ2D.js → FloatingPanel-Dsy_vJxi.js} +2 -2
- package/dist/lib/{FloatingPanel-DkJXsZ2D.js.map → FloatingPanel-Dsy_vJxi.js.map} +1 -1
- package/dist/lib/Glyph-DiEpD3gy.js +2 -0
- package/dist/lib/Glyph-DiEpD3gy.js.map +1 -0
- package/dist/lib/{Grid-Daiz7F5d.js → Grid-ft_UUpj8.js} +2 -2
- package/dist/lib/{Grid-Daiz7F5d.js.map → Grid-ft_UUpj8.js.map} +1 -1
- package/dist/lib/{GridConstraints-C58LuTqM.js → GridConstraints-CvZ0Nzaw.js} +2 -2
- package/dist/lib/{GridConstraints-C58LuTqM.js.map → GridConstraints-CvZ0Nzaw.js.map} +1 -1
- package/dist/lib/{Header-Dql3Zxc6.js → Header-Osm3IjDw.js} +2 -2
- package/dist/lib/{Header-Dql3Zxc6.js.map → Header-Osm3IjDw.js.map} +1 -1
- package/dist/lib/{IconText-PUjhTLlp.js → IconText-BBaYJ2Fx.js} +2 -2
- package/dist/lib/{IconText-PUjhTLlp.js.map → IconText-BBaYJ2Fx.js.map} +1 -1
- package/dist/lib/{LayoutSerialization-CMxunLfV.js → LayoutSerialization-BC64__O7.js} +2 -2
- package/dist/lib/{LayoutSerialization-CMxunLfV.js.map → LayoutSerialization-BC64__O7.js.map} +1 -1
- package/dist/lib/List-CQbZK_pT.js +2 -0
- package/dist/lib/List-CQbZK_pT.js.map +1 -0
- package/dist/lib/{Menu-Q0bpXXze.js → Menu-CwHluLGT.js} +2 -2
- package/dist/lib/{Menu-Q0bpXXze.js.map → Menu-CwHluLGT.js.map} +1 -1
- package/dist/lib/{MenuButton-DCXi0tsP.js → MenuButton-BqCT-1yv.js} +2 -2
- package/dist/lib/{MenuButton-DCXi0tsP.js.map → MenuButton-BqCT-1yv.js.map} +1 -1
- package/dist/lib/{OverlayFade-3pof2AJH.js → OverlayFade-CuEXgimf.js} +2 -2
- package/dist/lib/{OverlayFade-3pof2AJH.js.map → OverlayFade-CuEXgimf.js.map} +1 -1
- package/dist/lib/{Panel-Cy1pdlWO.js → Panel-CtViePqY.js} +2 -2
- package/dist/lib/{Panel-Cy1pdlWO.js.map → Panel-CtViePqY.js.map} +1 -1
- package/dist/lib/{Position-BwtxouxK.js → Position-BIEU1Eze.js} +2 -2
- package/dist/lib/Position-BIEU1Eze.js.map +1 -0
- package/dist/lib/{ProgressSpinner-DK8xEQ9y.js → ProgressSpinner-BuBvC1FY.js} +2 -2
- package/dist/lib/{ProgressSpinner-DK8xEQ9y.js.map → ProgressSpinner-BuBvC1FY.js.map} +1 -1
- package/dist/lib/RadioButton-Df5J-H6m.js +2 -0
- package/dist/lib/RadioButton-Df5J-H6m.js.map +1 -0
- package/dist/lib/RadioMenuRow-Cfv0x6Qj.js +2 -0
- package/dist/lib/RadioMenuRow-Cfv0x6Qj.js.map +1 -0
- package/dist/lib/{RovingTabIndex-pHEv5oLD.js → RovingTabIndex--w28AnXc.js} +2 -2
- package/dist/lib/{RovingTabIndex-pHEv5oLD.js.map → RovingTabIndex--w28AnXc.js.map} +1 -1
- package/dist/lib/Scrollbar-DcnueNJd.js +2 -0
- package/dist/lib/Scrollbar-DcnueNJd.js.map +1 -0
- package/dist/lib/SelectableText-DZNxjKXR.js +2 -0
- package/dist/lib/SelectableText-DZNxjKXR.js.map +1 -0
- package/dist/lib/{Slider-CTbwR6HR.js → Slider-DNfd8Lxz.js} +2 -2
- package/dist/lib/{Slider-CTbwR6HR.js.map → Slider-DNfd8Lxz.js.map} +1 -1
- package/dist/lib/{Spacer-srdN2d2b.js → Spacer-BznfGbwG.js} +2 -2
- package/dist/lib/{Spacer-srdN2d2b.js.map → Spacer-BznfGbwG.js.map} +1 -1
- package/dist/lib/TabButton-CAACsMov.js +2 -0
- package/dist/lib/TabButton-CAACsMov.js.map +1 -0
- package/dist/lib/{TabCloseButton-CY7BGitY.js → TabCloseButton-CCiqsX3y.js} +2 -2
- package/dist/lib/{TabCloseButton-CY7BGitY.js.map → TabCloseButton-CCiqsX3y.js.map} +1 -1
- package/dist/lib/Text-O-FWa5Cy.js +2 -0
- package/dist/lib/Text-O-FWa5Cy.js.map +1 -0
- package/dist/lib/{Tooltip-CUOJOqQi.js → Tooltip-CyICVu15.js} +2 -2
- package/dist/lib/Tooltip-CyICVu15.js.map +1 -0
- package/dist/lib/{Tree-C64JNPWJ.js → Tree-CSEguhlk.js} +2 -2
- package/dist/lib/{Tree-C64JNPWJ.js.map → Tree-CSEguhlk.js.map} +1 -1
- package/dist/lib/{VBox-DfJPWXqc.js → VBox-DVe4UXwX.js} +2 -2
- package/dist/lib/{VBox-DfJPWXqc.js.map → VBox-DVe4UXwX.js.map} +1 -1
- package/dist/lib/{VirtualScroller-DTIn19o1.js → VirtualScroller-ggPTCQb0.js} +2 -2
- package/dist/lib/{VirtualScroller-DTIn19o1.js.map → VirtualScroller-ggPTCQb0.js.map} +1 -1
- package/dist/lib/component/button.es.js +1 -1
- package/dist/lib/component/chart.es.js +1 -1
- package/dist/lib/component/chart.es.js.map +1 -1
- package/dist/lib/component/container.es.js +1 -1
- package/dist/lib/component/diagram.es.js +1 -1
- package/dist/lib/component/display.es.js +1 -1
- package/dist/lib/component/display.es.js.map +1 -1
- package/dist/lib/component/editor.es.js +2 -2
- package/dist/lib/component/editor.es.js.map +1 -1
- package/dist/lib/component/input.es.js +1 -1
- package/dist/lib/component/input.es.js.map +1 -1
- package/dist/lib/component/list.es.js +1 -1
- package/dist/lib/component/menubar.es.js +1 -1
- package/dist/lib/component/table.es.js +6 -6
- package/dist/lib/component/table.es.js.map +1 -1
- package/dist/lib/component/tree.es.js +1 -1
- package/dist/lib/core.es.js +1 -1
- package/dist/lib/core.es.js.map +1 -1
- package/dist/lib/glyphs/solid/index.es.js +1 -1
- package/dist/lib/layout.es.js +1 -1
- package/dist/lib/overlay.es.js +1 -1
- package/dist/lib/overlay.es.js.map +1 -1
- package/dist/lib/primitive.es.js +1 -1
- package/dist/lib/router.es.js +1 -1
- package/dist/lib/{selectionsEqual-gMG7gCVI.js → selectionsEqual-C7MrKMQr.js} +2 -2
- package/dist/lib/{selectionsEqual-gMG7gCVI.js.map → selectionsEqual-C7MrKMQr.js.map} +1 -1
- package/dist/lib/types/component/button/Button.d.ts +9 -0
- package/dist/lib/types/component/button/TabButton.d.ts +5 -0
- package/dist/lib/types/component/button/ToggleButton.d.ts +3 -0
- package/dist/lib/types/component/chart/AbstractChart.d.ts +2 -0
- package/dist/lib/types/component/display/Markdown.d.ts +2 -1
- package/dist/lib/types/component/input/AbstractCalendarDropdown.d.ts +2 -0
- package/dist/lib/types/component/input/AbstractPickerField.d.ts +2 -0
- package/dist/lib/types/component/input/AutoCompleteDropdown.d.ts +2 -0
- package/dist/lib/types/component/input/ComboBox.d.ts +3 -1
- package/dist/lib/types/component/input/Link.d.ts +2 -0
- package/dist/lib/types/component/input/PasswordField.d.ts +2 -0
- package/dist/lib/types/component/input/PickerInput.d.ts +2 -0
- package/dist/lib/types/component/input/SelectableText.d.ts +11 -0
- package/dist/lib/types/component/input/SpinButton.d.ts +2 -0
- package/dist/lib/types/component/input/Text.d.ts +16 -2
- package/dist/lib/types/component/input/TextArea.d.ts +2 -0
- package/dist/lib/types/component/input/TextField.d.ts +2 -0
- package/dist/lib/types/component/input/TextInput.d.ts +2 -0
- package/dist/lib/types/component/input/TimePickerDropdown.d.ts +3 -1
- package/dist/lib/types/component/input/UsernameField.d.ts +2 -0
- package/dist/lib/types/component/input/index.d.ts +2 -0
- package/dist/lib/types/component/list/AbstractSelectableList.d.ts +4 -2
- package/dist/lib/types/component/table/Body.d.ts +40 -14
- package/dist/lib/types/component/table/Header.d.ts +1 -1
- package/dist/lib/types/component/table/Row.d.ts +20 -2
- package/dist/lib/types/component/table/Table.d.ts +2 -0
- package/dist/lib/types/component/table/TableExporter.d.ts +3 -0
- package/dist/lib/types/component/table/TablePanel.d.ts +1 -0
- package/dist/lib/types/component/table/TreeTablePanel.d.ts +1 -0
- package/dist/lib/types/component/table/cell/Cell.d.ts +7 -2
- package/dist/lib/types/component/table/cell/Default.d.ts +1 -1
- package/dist/lib/types/component/table/cell/Header.d.ts +3 -0
- package/dist/lib/types/component/table/cell/ResizeHandle.d.ts +1 -1
- package/dist/lib/types/component/table/cell/renderer/CellRenderer.d.ts +2 -2
- package/dist/lib/types/component/table/cell/renderer/String.d.ts +3 -1
- package/dist/lib/types/component/table/index.d.ts +1 -1
- package/dist/lib/types/core/AnimatedDropdown.d.ts +2 -0
- package/dist/lib/types/core/ClassStyleRules.d.ts +46 -3
- package/dist/lib/types/core/Component.d.ts +30 -2
- package/dist/lib/types/core/DOM.d.ts +5 -1
- package/dist/lib/types/core/LayerManager.d.ts +1 -0
- package/dist/lib/types/core/StyleTarget.d.ts +2 -0
- package/dist/lib/types/core/Theme.d.ts +1 -0
- package/dist/lib/types/core/Util.d.ts +4 -0
- package/dist/lib/types/core/index.d.ts +1 -1
- package/dist/lib/types/layout/Table.d.ts +2 -0
- package/dist/lib/types/overlay/AbstractWindow.d.ts +3 -0
- package/dist/lib/types/overlay/PopupPanel.d.ts +2 -0
- package/dist/lib/validation.es.js +1 -1
- package/package.json +1 -1
- package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js +0 -2
- package/dist/lib/AnimatedDropdown-H3Rh-YMZ.js.map +0 -1
- package/dist/lib/Border-0DJFDiij.js +0 -2
- package/dist/lib/Border-0DJFDiij.js.map +0 -1
- package/dist/lib/Button-MpMIYBYJ.js +0 -2
- package/dist/lib/Button-MpMIYBYJ.js.map +0 -1
- package/dist/lib/Checkbox-D0JYK-wc.js +0 -2
- package/dist/lib/Checkbox-D0JYK-wc.js.map +0 -1
- package/dist/lib/ComboBox-Dx8Tk9yg.js +0 -2
- package/dist/lib/ComboBox-Dx8Tk9yg.js.map +0 -1
- package/dist/lib/Component-B0ShfPVi.js +0 -2
- package/dist/lib/Component-B0ShfPVi.js.map +0 -1
- package/dist/lib/Container-abY5Ww3W.js +0 -2
- package/dist/lib/DOM-C-Edb3tA.js +0 -2
- package/dist/lib/DOM-C-Edb3tA.js.map +0 -1
- package/dist/lib/Dialog-cbA9V17e.js +0 -2
- package/dist/lib/Dialog-cbA9V17e.js.map +0 -1
- package/dist/lib/Glyph-_VeBacS2.js +0 -2
- package/dist/lib/Glyph-_VeBacS2.js.map +0 -1
- package/dist/lib/List-nx8220Fi.js +0 -2
- package/dist/lib/List-nx8220Fi.js.map +0 -1
- package/dist/lib/Position-BwtxouxK.js.map +0 -1
- package/dist/lib/RadioButton-BEwpqg1k.js +0 -2
- package/dist/lib/RadioButton-BEwpqg1k.js.map +0 -1
- package/dist/lib/RadioMenuRow-DP5qPyFR.js +0 -2
- package/dist/lib/RadioMenuRow-DP5qPyFR.js.map +0 -1
- package/dist/lib/Scrollbar-t8fFrUVQ.js +0 -2
- package/dist/lib/Scrollbar-t8fFrUVQ.js.map +0 -1
- package/dist/lib/TabButton-DLoMQzky.js +0 -2
- package/dist/lib/TabButton-DLoMQzky.js.map +0 -1
- package/dist/lib/Text-CMKnK9uB.js +0 -2
- package/dist/lib/Text-CMKnK9uB.js.map +0 -1
- package/dist/lib/Tooltip-CUOJOqQi.js.map +0 -1
- package/dist/lib/types/component/table/CellGeometry.d.ts +0 -6
package/dist/lib/layout.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,o as t}from"./Position-
|
|
1
|
+
import{a as e,o as t}from"./Position-BIEU1Eze.js";import{d as n,f as r,h as i,m as a,p as o}from"./Component-D99-15Zt.js";import{t as s}from"./Fit-CaPMj7Up.js";import{i as c,n as l,r as u}from"./VBox-DVe4UXwX.js";import{s as d}from"./RadioMenuRow-Cfv0x6Qj.js";import{t as f}from"./LayoutConstraints-LIHYYd2F.js";import{t as p}from"./Border-6GsTNV-2.js";import{a as m,n as h,r as g,t as _}from"./LayoutSerialization-BC64__O7.js";import{t as v}from"./Anchor-iZhsvMlT.js";import{t as y}from"./AnchorConstraints-Bfkt8019.js";import{n as b,r as x,t as S}from"./GridConstraints-CvZ0Nzaw.js";import{t as C}from"./Grid-ft_UUpj8.js";import{t as w}from"./Card-C20k2YHU.js";var FlowLayout=class extends r{_spacing=5;_lineSpacing=5;_uniform=`none`;_align=`start`;_itemAlign=`start`;_justify=`start`;_wrappedLineExtent=null;constructor(e){super(),e&&this.applyOptions(e)}applyOptions(e){super.applyOptions(e),e.spacing!==void 0&&this.setComponentSpacing(e.spacing),e.lineSpacing!==void 0&&this.setLineSpacing(e.lineSpacing),e.uniform!==void 0&&this.setUniform(e.uniform),e.align!==void 0&&this.setAlign(e.align),e.itemAlign!==void 0&&this.setItemAlign(e.itemAlign),e.justify!==void 0&&this.setJustify(e.justify)}getComponentSpacing(){return this._spacing||0}setComponentSpacing(e){return this._spacing=e||0,this}getLineSpacing(){return this._lineSpacing||0}setLineSpacing(e){return this._lineSpacing=e||0,this}getWrappedLineExtent(){return this._wrappedLineExtent}publishWrappedLineExtent(e){!Number.isFinite(e)||this._wrappedLineExtent===e||(this._wrappedLineExtent=e,this.getContainer()?.notifyIntrinsicSizeChanged())}attach(e){return super.attach(e),this._wrappedLineExtent=null,this}getUniform(){return this._uniform}setUniform(e){return this._uniform=e,this}getAlign(){return this._align}setAlign(e){return this._align=e,this}getItemAlign(){return this._itemAlign}setItemAlign(e){return this._itemAlign=e,this}getJustify(){return this._justify}setJustify(e){return this._justify=e,this}isUniformWidth(){return this._uniform===`width`||this._uniform===`both`}isUniformHeight(){return this._uniform===`height`||this._uniform===`both`}computeUniformExtents(e){let t=0,n=0;for(let r of e){let e=this.clampedPreferredSize(r);t=Math.max(t,e.width),n=Math.max(n,e.height)}return{width:t,height:n}}clampedPreferredSize(e){let t=e.getPreferredSize(),n=e.getMinSize(),r=e.getMaxSize(),i=t?t.width:0,a=t?t.height:0;return r&&(i=Math.min(i,r.width),a=Math.min(a,r.height)),n&&(i=Math.max(i,n.width),a=Math.max(a,n.height)),{width:i,height:a}}alignLead(e,t){let n=Math.max(0,t-e);return this._align===`center`?n/2:this._align===`end`?n:0}crossOffset(e,t,n,r,i){switch(this._itemAlign){case`center`:return Math.max(0,(t-e)/2);case`end`:return Math.max(0,t-e);case`baseline`:return r===null?0:n===null?this.nullChildY(e,r,i):r-n;default:return 0}}justifyGaps(e,t,n,r){let i=t+r*Math.max(0,e-1);if(this._justify===`start`||e<2||i>=n)return{lead:0,gap:r};let a=n-t;if(this._justify===`between`)return{lead:0,gap:a/(e-1)};let o=a/e;return{lead:o/2,gap:o}}},HFlow=class extends FlowLayout{getPreferredSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=e.getLaidOutComponents(),r=this.isUniformWidth(),i=this.isUniformHeight(),a=r||i?this.computeUniformExtents(n):{width:0,height:0},o=this.getWrappedLineExtent(),s=o===null&&!i,c=t.left+t.right,l=[],u=[];for(let e of n){let t=e.getPreferredSize();t&&(r||(c+=t.width),s&&(l.push(t.height),u.push(e.getBaseline())))}r&&(c+=n.length*a.width),c+=this._spacing*Math.max(0,n.length-1);let d=o===null?i?a.height:this.lineExtent(l,u):o;return d+=t.top+t.bottom,{width:c,height:d}}getMinSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=e.getLaidOutComponents(),r=0,i=[],a=[];for(let e of n){let t=e.getMinSize();t&&(r=Math.max(r,t.width),i.push(t.height),a.push(e.getBaseline()))}let o=t.left+t.right+r,s=this.lineExtent(i,a);return s+=t.top+t.bottom,{width:o,height:s}}getMaxSize(){let n=this.getContainer();if(!n)return null;let r=n.getPerimeterSize(),i=n.getLaidOutComponents(),a=this.isUniformWidth(),o=a?this.computeUniformExtents(i):{width:0,height:0},s=r.left+r.right,c=0,l=!1,u=!1;for(let e of i){let n=e.getMaxSize();if(!n){a||(l=!0),u=!0;continue}a||(t(n.width)?l=!0:s+=n.width),t(n.height)?u=!0:c=Math.max(c,n.height)}a&&(s+=i.length*o.width),s+=this._spacing*Math.max(0,i.length-1);let d=this.getWrappedLineExtent();return d!==null&&!u&&(c=Math.max(c,d)),c+=r.top+r.bottom,{width:l?e:s,height:u?e:c}}doLayout(){let e=this.getContainer();if(!e)return;let t=e.getInnerSize();if(!t)return;let n=e.getLaidOutComponents(),r=e.getContentInsets(),i=this.getComponentSpacing(),a=this.getLineSpacing(),o=this.isUniformWidth(),s=this.isUniformHeight(),c=o||s?this.computeUniformExtents(n):{width:0,height:0},l=this.groupIntoRows(n,t.width,r.getTop(),i,a,o,s,c),u=this.resolveRows(l,r.getLeft(),t.width,i);this.commitPlacements(u),Number.isFinite(t.width)&&this.publishWrappedLineExtent(this.rowsCrossExtent(l,a)),this.reserveContentFrame()}groupIntoRows(e,t,n,r,i,a,o,s){let c=[],l=n,u=null;for(let n of e){let e=this.clampedPreferredSize(n),d=a?s.width:e.width,f=o?s.height:e.height;u&&u.contentWidth+r+d>t&&(l+=u.rowHeight+i,u=null),u||(u={cells:[],contentWidth:0,rowHeight:0,y:l},c.push(u));let p=u.cells.length===0?Math.min(d,t):d;u.contentWidth+=u.cells.length===0?p:r+p,u.cells.push({component:n,width:p,height:f,baseline:n.getBaseline()}),u.rowHeight=this.rowExtent(u,f)}return c}resolveRows(e,t,n,r){let i=[];for(let o of e){let e=o.cells.map(e=>e.height),s=o.cells.map(e=>e.baseline),{rowAscent:c,rowDescent:l}=this.computeRowMetrics(e,s),{lead:u,gap:d}=this.justifyGaps(o.cells.length,this.cellsMainExtent(o),n,r),f=t+(this._justify===`start`?this.alignLead(o.contentWidth,n):0)+u;for(let e of o.cells){let t=o.y+this.crossOffset(e.height,o.rowHeight,e.baseline,c,l);i.push({component:e.component,...this.resolveBounds(e.component,f,t,e.width,e.height,a.NONE)}),f+=e.width+d}}return i}cellsMainExtent(e){return e.cells.reduce((e,t)=>e+t.width,0)}rowsCrossExtent(e,t){if(e.length===0)return 0;let n=t*(e.length-1);for(let t of e)n+=t.rowHeight;return n}rowExtent(e,t){return this._itemAlign===`baseline`?this.lineExtent(e.cells.map(e=>e.height),e.cells.map(e=>e.baseline)):Math.max(e.rowHeight,t)}lineExtent(e,t){return this._itemAlign===`baseline`?this.computeRowHeight(e,t):e.reduce((e,t)=>Math.max(e,t),0)}},T=i(HFlow),VFlow=class extends FlowLayout{getPreferredSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=e.getLaidOutComponents(),r=this.isUniformWidth(),i=this.isUniformHeight(),a=r||i?this.computeUniformExtents(n):{width:0,height:0},o=t.top+t.bottom,s=0;for(let e of n){let t=e.getPreferredSize();t&&(i||(o+=t.height),s=Math.max(s,t.width))}i&&(o+=n.length*a.height),o+=this._spacing*Math.max(0,n.length-1);let c=this.getWrappedLineExtent(),l=c===null?r?a.width:s:c;return l+=t.left+t.right,{width:l,height:o}}getMinSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=e.getLaidOutComponents(),r=0,i=0;for(let e of n){let t=e.getMinSize();t&&(r=Math.max(r,t.height),i=Math.max(i,t.width))}return{width:t.left+t.right+i,height:t.top+t.bottom+r}}getMaxSize(){let n=this.getContainer();if(!n)return null;let r=n.getPerimeterSize(),i=n.getLaidOutComponents(),a=this.isUniformHeight(),o=a?this.computeUniformExtents(i):{width:0,height:0},s=r.top+r.bottom,c=0,l=!1,u=!1;for(let e of i){let n=e.getMaxSize();if(!n){a||(u=!0),l=!0;continue}a||(t(n.height)?u=!0:s+=n.height),t(n.width)?l=!0:c=Math.max(c,n.width)}a&&(s+=i.length*o.height),s+=this._spacing*Math.max(0,i.length-1);let d=this.getWrappedLineExtent();return d!==null&&!l&&(c=Math.max(c,d)),c+=r.left+r.right,{width:l?e:c,height:u?e:s}}doLayout(){let e=this.getContainer();if(!e)return;let t=e.getInnerSize();if(!t)return;let n=e.getLaidOutComponents(),r=e.getContentInsets(),i=this.getComponentSpacing(),a=this.getLineSpacing(),o=this.isUniformWidth(),s=this.isUniformHeight(),c=o||s?this.computeUniformExtents(n):{width:0,height:0},l=this.groupIntoColumns(n,t.height,r.getLeft(),i,a,o,s,c),u=this.resolveColumns(l,r.getTop(),t.height,i);this.commitPlacements(u),Number.isFinite(t.height)&&this.publishWrappedLineExtent(this.columnsCrossExtent(l,a)),this.reserveContentFrame()}groupIntoColumns(e,t,n,r,i,a,o,s){let c=[],l=n,u=null;for(let n of e){let e=this.clampedPreferredSize(n),d=a?s.width:e.width,f=o?s.height:e.height;u&&u.contentHeight+r+f>t&&(l+=u.columnWidth+i,u=null),u||(u={cells:[],contentHeight:0,columnWidth:0,x:l},c.push(u));let p=u.cells.length===0?Math.min(f,t):f;u.contentHeight+=u.cells.length===0?p:r+p,u.cells.push({component:n,width:d,height:p,baseline:null}),u.columnWidth=Math.max(u.columnWidth,d)}return c}resolveColumns(e,t,n,r){let i=[];for(let o of e){let{lead:e,gap:s}=this.justifyGaps(o.cells.length,this.cellsMainExtent(o),n,r),c=t+(this._justify===`start`?this.alignLead(o.contentHeight,n):0)+e;for(let e of o.cells){let t=o.x+this.crossOffset(e.width,o.columnWidth,null,null,0);i.push({component:e.component,...this.resolveBounds(e.component,t,c,e.width,e.height,a.NONE)}),c+=e.height+s}}return i}cellsMainExtent(e){return e.cells.reduce((e,t)=>e+t.height,0)}columnsCrossExtent(e,t){if(e.length===0)return 0;let n=t*(e.length-1);for(let t of e)n+=t.columnWidth;return n}},E=i(VFlow);export{n as Absolute,x as Accordion,b as AccordionConstraints,v as Anchor,y as AnchorConstraints,o as AnchorType,p as Border,c as BoxLayout,w as Card,g as DockRegion,a as FillType,s as Fit,FlowLayout,C as Grid,S as GridConstraints,u as HBox,T as HFlow,f as LayoutConstraints,r as LayoutManager,m as Split,d as Tab,l as VBox,E as VFlow,_ as restoreLayout,h as serializeLayout};
|
|
2
2
|
//# sourceMappingURL=layout.es.js.map
|
package/dist/lib/overlay.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./DOM-C-Edb3tA.js";import{n as t,o as n,t as r}from"./Position-BwtxouxK.js";import{S as i,b as a,h as o,t as s,v as c}from"./Component-B0ShfPVi.js";import{t as l}from"./ListenerBag-WPdKuuds.js";import{t as u}from"./Container-abY5Ww3W.js";import{t as d}from"./Glyph-_VeBacS2.js";import{a as f,r as ee,t as p}from"./Tooltip-CUOJOqQi.js";import{t as te}from"./AnimatedDropdown-H3Rh-YMZ.js";import{t as m}from"./Fit-BhlB-HAo.js";import{t as h}from"./Text-CMKnK9uB.js";import{i as ne,n as g,r as re}from"./VBox-DfJPWXqc.js";import{f as _,h as ie,o as v,s as y,u as ae}from"./RadioMenuRow-DP5qPyFR.js";import{a as b,c as oe,i as se,l as x,n as S,o as C,s as ce}from"./CheckboxMenuRow-CesLhSnp.js";import{t as w}from"./Placement-7kqdaK4Z.js";import{t as T}from"./LayoutConstraints-LIHYYd2F.js";import{r as le}from"./Border-0DJFDiij.js";import{t as E}from"./Button-MpMIYBYJ.js";import{xmark as ue}from"./glyphs/solid/xmark.es.js";import{t as de}from"./Menu-Q0bpXXze.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./Dialog-cbA9V17e.js";import{circle_check as N}from"./glyphs/solid/circle_check.es.js";import{circle_info as P}from"./glyphs/solid/circle_info.es.js";import{triangle_exclamation as F}from"./glyphs/solid/triangle_exclamation.es.js";import{circle_exclamation as I}from"./glyphs/solid/circle_exclamation.es.js";import{t as L}from"./MenuButton-DCXi0tsP.js";import{clock_rotate_left as R}from"./glyphs/solid/clock_rotate_left.es.js";import{a as z,i as B,n as V,r as H,t as fe}from"./LayoutSerialization-CMxunLfV.js";var pe=4,PopupPanel=class extends te{_currentOpener=null;constructor(e,n){super(e,{layoutManager:new g({stretching:!0}),insets:new t(4,4,4,4),backgroundColor:`var(--ts-ui-autocomplete-bg, rgb(255, 255, 255))`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`,shadow:`var(--ts-ui-autocomplete-shadow, 2px 4px 8px rgba(0,0,0,0.15))`,...n??{}}),this.getAria().setRole(`dialog`),this.setContain(`layout`),this.setOverflowX(`hidden`),this.setOverflowY(`auto`),this.getLayoutManager()?.setOverflowing(!1,!0)}showAt(t){this.getElement(!0),this.setMaxSize({width:Number.MAX_VALUE,height:Number.MAX_VALUE});let n=this.getPreferredSize(),r=n?.width??this.getWidth(),i=n?.height??this.getHeight(),a=e.source.getViewportSize(),o=this.resolvePlacement(t,{width:r,height:i},a);return this.setWidth(r),this.setMaxSize({width:Number.MAX_VALUE,height:Math.max(0,o.available)}),this.setHeight(i),this.setX(o.x),this.setY(o.y),this.showAnimated(),this.doLayout(),this}toggleFor(t,n){if(this.isOpen()&&this._currentOpener===t)return this.hideAnimated(),this;this._currentOpener=t,this.setAnchorElement(t);let r=e.source.getId(t);return r!==``&&this.getAria().setLabelledBy(r),this.showAt(n)}hideAnimated(){return this._currentOpener=null,super.hideAnimated()}resolvePlacement(e,t,n){return ee(e,t,n,pe)}},me=o(PopupPanel);d.register(P,N,F,I,ue);var U={info:`circle-info`,success:`circle-check`,warning:`triangle-exclamation`,error:`circle-exclamation`},he={info:`Information`,success:`Success`,warning:`Warning`,error:`Error`},ge=8e3,_e=200,ve=200,W=class Notification extends s{_showAnimation=null;_dismissAnimation=null;static WIDTH=320;static HEIGHT=64;static MARGIN=16;static H_PADDING=12;static V_PADDING=10;static CLOSE_SIZE=20;static BADGE_SIZE=20;static BADGE_TEXT_GAP=8;static Z_INDEX=10002;static activeNotifications=[];static HISTORY_CAP=50;static history=[];static hoverCount=0;static modalCount=0;_type;_fullMessage;_badge;_messageText;_closeButton;_dismissTimer=null;_remainingDuration=0;_timerStartedAt=0;_dismissing=!1;_boundOnCloseAction=()=>(this.dismiss(),!0);_boundOnDblClick=()=>this.openDetail();_boundOnMouseOver=e=>Notification.acquireHoverHold(e,this.getElement());_boundOnMouseOut=e=>Notification.releaseHoverHold(e,this.getElement());constructor(e,n){super(),this._type=n,this._fullMessage=e,this.setPosition(r.FIXED),this.setZIndex(Notification.Z_INDEX),this.setWidth(Notification.WIDTH),this.setHeight(Notification.HEIGHT),this.setOverflow(`hidden`),this.setContain(`strict`);let a=n===`error`||n===`warning`;this.getAria().setRole(a?`alert`:`status`),this.getAria().setLive(a?`assertive`:`polite`);let o=`var(--ts-ui-notification-${n}-bg)`,s=`var(--ts-ui-notification-${n}-border)`;this.setBackgroundColor(o),this.setBorder({border:`1px solid ${s}`}),this.setShadow(`var(--ts-ui-notification-shadow)`),this.setBorderRadius(`var(--ts-ui-border-radius, 4px)`),this._badge=new d(U[n]),this._badge.setForegroundColor(s),this._badge.setPreferredSize({width:Notification.BADGE_SIZE,height:Notification.BADGE_SIZE}),this._badge.setPointerEvents(`none`),this._badge.getAria().setHidden(!0),this.addComponent(this._badge),this._messageText=new h(e),this._messageText.setLineClamp(2),this._messageText.setWhiteSpace(`normal`),this._messageText.setWordBreak(`break-word`),this._messageText.setUserSelect(`text`),this._messageText.setCursor(`text`),this.addComponent(this._messageText),this._closeButton=new E({glyph:`xmark`}),this._closeButton.setInsets(new t(0,0,0,0)),this._closeButton.setBorder(`none`),this._closeButton.clearBackgroundImage(),this._closeButton.setBackgroundColor(`transparent`),this._closeButton.clearShadow(),this._closeButton.clearPressedShadow(),this._closeButton.setForegroundColor(`var(--ts-ui-text-color, rgb(0, 0, 0))`),this._closeButton.setPreferredSize({width:Notification.CLOSE_SIZE,height:Notification.CLOSE_SIZE}),this._closeButton.getAria().setLabel(`Dismiss notification`),this.addComponent(this._closeButton),this._closeButton.on(`action`,this._boundOnCloseAction),i.addSubtreeListener(this,`dblclick`,this._boundOnDblClick),i.addSubtreeListener(this,`mouseover`,this._boundOnMouseOver),i.addSubtreeListener(this,`mouseout`,this._boundOnMouseOut)}static show(e,t=`info`,n=3e3){Notification.record(e,t);let r=new Notification(e,t);Notification.activeNotifications.push(r);let i=r.getElement(!0);r.scheduleLayout(),f.mount(i),Notification.restack(),r.animateIn(),n>0&&(r.startTimer(n),Notification.isPaused()&&r.pauseTimer())}static record(e,t){Notification.history.push({message:e,type:t,timestamp:Date.now()}),Notification.history.length>Notification.HISTORY_CAP&&Notification.history.shift()}static getHistory(){return[...Notification.history]}animateIn(){let e=this.getElement();e&&(this._showAnimation?.cancel(),this._showAnimation=c.play(e,{from:{transform:`translateX(100%)`,opacity:`0`},to:{transform:`translateX(0)`,opacity:`1`},durationMs:ve,properties:[`transform`,`opacity`]}))}static pauseAll(){let e=Notification.isPaused();Notification.modalCount+=1,e||Notification.pauseAllTimers()}static resumeAll(){Notification.modalCount!==0&&(--Notification.modalCount,Notification.isPaused()||Notification.resumeAllTimers(!0))}static acquireHoverHold(t,n){if(n&&e.source.isNode(t.relatedTarget)&&e.source.contains(n,e.source.intern(t.relatedTarget)))return;let r=Notification.isPaused();Notification.hoverCount+=1,r||Notification.pauseAllTimers()}static releaseHoverHold(t,n){n&&e.source.isNode(t.relatedTarget)&&e.source.contains(n,e.source.intern(t.relatedTarget))||Notification.hoverCount!==0&&(--Notification.hoverCount,Notification.isPaused()||Notification.resumeAllTimers(!1))}static isPaused(){return Notification.hoverCount>0||Notification.modalCount>0}static pauseAllTimers(){for(let e of Notification.activeNotifications)e.pauseTimer()}static resumeAllTimers(e){for(let t of Notification.activeNotifications)t.restartTimer(e)}startTimer(e){this._remainingDuration=e,this._timerStartedAt=Date.now(),this._dismissTimer=setTimeout(()=>this.dismiss(),e)}pauseTimer(){this._dismissTimer!==null&&(clearTimeout(this._dismissTimer),this._dismissTimer=null,this._remainingDuration=Math.max(0,this._remainingDuration-(Date.now()-this._timerStartedAt)))}restartTimer(e){this._dismissing||this._remainingDuration<=0||this._dismissTimer!==null||(e&&(this._remainingDuration=Math.max(this._remainingDuration,ge)),this._timerStartedAt=Date.now(),this._dismissTimer=setTimeout(()=>this.dismiss(),this._remainingDuration))}openDetail(){Notification.showDetail(this._fullMessage,this._type)}static showDetail(e,n){Notification.pauseAll();let r=new h(e);r.setAutoMeasure(!1),r.setWhiteSpace(`pre-wrap`),r.setWordBreak(`break-word`),r.setPadding(new t(16,16,16,16)),r.setUserSelect(`text`),r.setCursor(`text`);let i=new M({title:he[n],contentComponent:r,buttons:[{...k.Close,primary:!0}],width:420,height:220}),a=i.getTitleBar();a.setBackgroundColor(`var(--ts-ui-notification-${n}-bg)`),a.getTitleText().setForegroundColor(`var(--ts-ui-notification-${n}-border)`),a.setGlyph(U[n]);let o=a.getGlyph();o!==null&&o.setForegroundColor(`var(--ts-ui-notification-${n}-border)`),i.show().then(()=>Notification.resumeAll())}dismiss(){if(this._dismissing)return;this._dismissing=!0,this._dismissTimer!==null&&(clearTimeout(this._dismissTimer),this._dismissTimer=null);let e=this.getElement();if(!e){this.finishDismiss();return}this._dismissAnimation?.cancel(),this._dismissAnimation=c.play(e,{to:{transform:`translateX(100%)`,opacity:`0`},durationMs:_e,properties:[`transform`,`opacity`],onComplete:()=>this.finishDismiss()})}finishDismiss(){Notification.activeNotifications=Notification.activeNotifications.filter(e=>e!==this),this.dispose(),Notification.restack()}static restack(){let t=e.source.getViewportSize(),n=t.width-Notification.WIDTH-Notification.MARGIN,r=t.height-Notification.MARGIN;for(let e=Notification.activeNotifications.length-1;e>=0;e--){let t=Notification.activeNotifications[e];r-=Notification.HEIGHT,t.setX(n),t.setY(r),r-=Notification.MARGIN}}doLayout(){super.doLayout();let e=Notification.WIDTH-Notification.CLOSE_SIZE-4,t=Notification.H_PADDING,n=Notification.V_PADDING+2,r=t+Notification.BADGE_SIZE+Notification.BADGE_TEXT_GAP,i=e-r-4,a=Notification.HEIGHT-Notification.V_PADDING*2;return this._badge.setX(t),this._badge.setY(n),this._badge.setWidth(Notification.BADGE_SIZE),this._badge.setHeight(Notification.BADGE_SIZE),this._messageText.setX(r),this._messageText.setY(Notification.V_PADDING),this._messageText.setWidth(i),this._messageText.setHeight(a),this._closeButton.setX(e),this._closeButton.setY(4),this._closeButton.setWidth(Notification.CLOSE_SIZE),this._closeButton.setHeight(Notification.CLOSE_SIZE),this._closeButton.doLayout(),this}destructor(){this._showAnimation?.cancel(),this._showAnimation=null,this._dismissAnimation?.cancel(),this._dismissAnimation=null,Notification.activeNotifications.includes(this)&&(Notification.activeNotifications=Notification.activeNotifications.filter(e=>e!==this),Notification.restack()),super.destructor()}};d.register(R);var G=6e4,K=36e5,q=864e5;function formatRelativeTime(e,t){let n=Math.max(0,t-e);return n<G?`just now`:n<K?`${Math.floor(n/G)}m ago`:n<q?`${Math.floor(n/K)}h ago`:`${Math.floor(n/q)}d ago`}function buildHistoryItems(){let e=W.getHistory();if(e.length===0)return[{text:`No notifications yet`,enabled:!1}];let t=Date.now();return e.map(e=>({glyph:U[e.type],glyphColor:`var(--ts-ui-notification-${e.type}-border)`,text:e.message,shortcut:formatRelativeTime(e.timestamp,t),action:()=>W.showDetail(e.message,e.type)}))}var NotificationHistoryButton=class extends L{constructor(e){super(void 0,e,{glyph:`clock-rotate-left`,menuItems:buildHistoryItems,scrollToBottomOnShow:!0}),this.getAria().setLabel(`Notification history`),this.applyListeners(e?.listeners)}},ye=o(NotificationHistoryButton),be={edge:w.WEST,modal:!1,size:320,durationMs:220,overflow:`auto`,backgroundColor:`var(--ts-ui-body-bg)`,shadow:`var(--ts-ui-drawer-shadow)`},Drawer=class extends s{_panelInAnimation=null;_panelOutAnimation=null;_backdropInAnimation=null;_backdropOutAnimation=null;_open=!1;_closing=!1;_backdrop=null;_listeners=new l;_boundResizeHandler=()=>this.onViewportResize();_boundBackdropClose=()=>{this.close()};constructor(e,t){super(e,{...be,...t??{}}),this.setPosition(r.FIXED),this.applyListeners(e?.listeners)}applyOptions(e){return super.applyOptions(e),this.setEdge(e.edge??this.getEdge()),this.setModal(e.modal??this.isModal()),this.setDrawerSize(e.size??this.getDrawerSize()),this.setDurationMs(e.durationMs??this.getDurationMs()),this}setEdge(e){return this._options.edge=e,this}getEdge(){return this._options.edge??this._defaultOptions.edge}setModal(e){return this._options.modal=e,this}isModal(){return this._options.modal??this._defaultOptions.modal}setDrawerSize(e){return this._options.size=e,this}getDrawerSize(){return this._options.size??this._defaultOptions.size}setDurationMs(e){return this._options.durationMs=e,this}getDurationMs(){return this._options.durationMs??this._defaultOptions.durationMs}open(){if(this._open)return this;f.register(this);let t=f.getZIndex(this);return this.setZIndex(t),this.isModal()&&this.openBackdrop(t-1),this.applyEdgeBorder(),this.applyRestingGeometry(),e.sink.appendChild(e.source.getDocumentElement(),this.getElement(!0)),oe(this),this.scheduleLayout(),this.animateIn(),i.addViewportListener(this,`resize`,this._boundResizeHandler),this._open=!0,this.emit(`open`),this}close(){if(!this._open||this._closing)return this;let e=!1;return this.emit(`beforeclose`,{preventDefault:()=>{e=!0}}),e?this:(this._closing=!0,i.removeViewportListener(this,`resize`,this._boundResizeHandler),this.animateOutAndFinalize(),this)}toggle(){return this._open?this.close():this.open()}isOpen(){return this._open}restingRect(){let t=e.source.getViewportSize(),n=this.getDrawerSize();switch(this.getEdge()){case w.EAST:return{x:t.width-n,y:0,width:n,height:t.height};case w.NORTH:return{x:0,y:0,width:t.width,height:n};case w.SOUTH:return{x:0,y:t.height-n,width:t.width,height:n};case w.WEST:default:return{x:0,y:0,width:n,height:t.height}}}applyRestingGeometry(){let e=this.restingRect();this.setX(e.x),this.setY(e.y),this.setWidth(e.width),this.setHeight(e.height)}offscreenTransform(){let e=this.getDrawerSize();switch(this.getEdge()){case w.EAST:return`translateX(${e}px)`;case w.NORTH:return`translateY(${-e}px)`;case w.SOUTH:return`translateY(${e}px)`;case w.WEST:default:return`translateX(${-e}px)`}}applyEdgeBorder(){let e=`1px solid var(--ts-ui-drawer-border)`;switch(this.getEdge()){case w.EAST:this.setBorder({border:`none`,borderLeft:e});break;case w.NORTH:this.setBorder({border:`none`,borderBottom:e});break;case w.SOUTH:this.setBorder({border:`none`,borderTop:e});break;case w.WEST:default:this.setBorder({border:`none`,borderRight:e})}}animateIn(){let e=this.getElement();e&&(this._panelInAnimation?.cancel(),this._panelInAnimation=c.play(e,{from:{transform:this.offscreenTransform()},to:{transform:`translate(0, 0)`},durationMs:this.getDurationMs(),properties:[`transform`]}))}animateOutAndFinalize(){let e=this.getElement(),finalize=()=>{this.removeElement(),this.teardownBackdrop(),f.unregister(this),x(this),this._open=!1,this._closing=!1,this.emit(`close`)};if(!e){finalize();return}this._panelOutAnimation?.cancel(),this._panelOutAnimation=c.play(e,{to:{transform:this.offscreenTransform()},durationMs:this.getDurationMs(),properties:[`transform`],onComplete:finalize}),this.fadeBackdropOut()}openBackdrop(t){this._backdrop=new D,this._backdrop.setZIndex(t),this._backdrop.addClickListener(this._boundBackdropClose);let n=this._backdrop.getElement(!0);e.sink.appendChild(e.source.getDocumentElement(),n),this._backdropInAnimation?.cancel(),this._backdropInAnimation=c.play(n,{from:{opacity:`0`},to:{opacity:`1`},durationMs:this.getDurationMs(),properties:[`opacity`]})}fadeBackdropOut(){let e=this._backdrop?.getElement();e&&(this._backdropOutAnimation?.cancel(),this._backdropOutAnimation=c.play(e,{to:{opacity:`0`},durationMs:this.getDurationMs(),properties:[`opacity`]}))}teardownBackdrop(){this._backdrop!==null&&(this._backdrop.destroy(),this._backdrop=null)}onViewportResize(){this._backdrop!==null&&this._backdrop.resize(),this.applyRestingGeometry()}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}getLayerElement(){return this.getElement()??null}getDismissMode(){return this.isModal()?`modal`:`manual`}requestClose(){this.close()}isLayerRoot(){return!0}onZIndexChanged(e){this.setZIndex(e),this._backdrop!==null&&this._backdrop.setZIndex(e-1)}destructor(){this._panelInAnimation?.cancel(),this._panelInAnimation=null,this._panelOutAnimation?.cancel(),this._panelOutAnimation=null,this._backdropInAnimation?.cancel(),this._backdropInAnimation=null,this._backdropOutAnimation?.cancel(),this._backdropOutAnimation=null,this.teardownBackdrop(),f.unregister(this),x(this),this._open=!1,this._closing=!1,super.destructor()}},xe=o(Drawer),RailHandle=class extends E{get selectedRule(){return this._selectedRule??=this.createStyleRule(`.selected`)}get railHoverRule(){return this._railHoverRule??=this.createStyleRule(`:hover:not(.selected)`)}constructor(e={}){super(e.text,e,{chromeless:!0}),this.railHoverRule.set(`backgroundColor`,`var(--ts-ui-rail-handle-hover-bg)`),this.selectedRule.set(`backgroundColor`,`var(--ts-ui-rail-handle-selected-bg)`)}applyOptions(e){return super.applyOptions(e),e.selected!==void 0&&this.setSelected(e.selected),this}isSelected(){return this._options.selected??!1}setSelected(t){this._options.selected=t,this.getAria().setPressed(t);let n=this.getElement();return n&&e.sink.apply(n,{toggleClass:{selected:t}}),this}render(){let t=super.render();return e.sink.apply(t,{toggleClass:{selected:this.isSelected()}}),t}},J=o(RailHandle),Y=48,Se=8900,X=200,Z=10,Q=5;function collapseHeadingFor(e){switch(e){case w.EAST:return`east`;case w.NORTH:return`north`;case w.SOUTH:return`south`;case w.WEST:default:return`west`}}var $={west:`east`,east:`west`,north:`south`,south:`north`},Ce={edge:w.WEST,orientation:`horizontal`,backgroundColor:`var(--ts-ui-body-bg)`,shadow:`var(--ts-ui-rail-shadow)`},Rail=class extends s{_collapseAnimation=null;_slideOutAnimation=null;_slideInAnimation=null;_listeners=new l;_drawers=new Map;_windows=new Map;_mounted=!1;_collapseButton;_expandedThickness=Y;_boundResizeHandler=()=>this.applyRestingGeometry();constructor(e,t){super(e,{...Ce,...t??{}}),this.setPosition(r.FIXED),this.setZIndex(Se),this._collapseButton=new le({direction:collapseHeadingFor(this.getEdge()),listeners:{collapse:()=>{this.toggleCollapsed()}}}),e?.listeners!==void 0&&this.applyListeners(e.listeners)}applyOptions(e){return super.applyOptions(e),this.setEdge(e.edge??this.getEdge()),this.setOrientation(e.orientation??this.getOrientation()),e.thickness!==void 0&&this.setThickness(e.thickness),e.collapsed!==void 0&&(this._options.collapsed=e.collapsed),this}setEdge(e){return this._options.edge=e,this}getEdge(){return this._options.edge??this._defaultOptions.edge}setThickness(e){return this._options.thickness=e,this.adaptThickness(),this}getThickness(){return this.isCollapsed()?Z:this._options.thickness===void 0?this.measureContentThickness():this._options.thickness}measureContentThickness(){let e=this.getPreferredSize();if(!e)return Y;let t=this.isVertical()?e.width:e.height;return t<=0||n(t)?Y:Math.ceil(t)}adaptThickness(){this._mounted&&this.applyRestingGeometry()}isCollapsed(){return this._options.collapsed??!1}setCollapsed(e){return e===this.isCollapsed()?this:(e&&(this._expandedThickness=this.getThickness()),this._options.collapsed=e,this._mounted&&this.animateCollapseTransition(e),this)}toggleCollapsed(){return this.setCollapsed(!this.isCollapsed())}applyCollapseAppearance(){let e=this.isCollapsed(),t=collapseHeadingFor(this.getEdge());this._collapseButton.setDirection(e?$[t]:t),this.applyCollapseStyling(e),this.positionChevron(e),this.setAllHandlesDisplayed(!e)}applyCollapseStyling(e){e?(this.setBackgroundColor(`var(--ts-ui-button-bg, #e8e8e8)`),this.setBackgroundImage(`var(--ts-ui-button-bg, linear-gradient(rgb(241, 241, 241), rgb(200, 200, 200)))`),this.setBorder(`1px solid var(--ts-ui-button-border, #c8c8c8)`)):(this.clearBackgroundImage(),this.setBackgroundColor(`var(--ts-ui-body-bg)`),this.applyEdgeBorder())}positionChevron(e){let t,n;if(e)t=`50%`,n=`50%`;else{let e=`calc(100% - ${Q}px)`,r=`${Q}px`;switch(this.getEdge()){case w.EAST:t=r,n=`50%`;break;case w.NORTH:t=`50%`,n=e;break;case w.SOUTH:t=`50%`,n=r;break;case w.WEST:default:t=e,n=`50%`}}let r=e?`10px`:null;new a({scope:`component`,name:this._collapseButton.getId(),styles:{left:t,top:n,width:r,zIndex:`1`}})}animateCollapseTransition(e){let t=collapseHeadingFor(this.getEdge());this._collapseButton.setDirection(e?$[t]:t),this.applyCollapseStyling(e),this.positionChevron(e);let n=this.getElement(),r=this.isVertical()?this.getWidth():this.getHeight(),i=e?Z:this._expandedThickness;e||(this.setAllHandlesDisplayed(!0),this.applyRestingGeometry(),this.scheduleLayout());let finalize=()=>{e&&this.setAllHandlesDisplayed(!1),this.applyRestingGeometry(),e||this.scheduleLayout()};if(!n){finalize();return}let a=this.collapseTween(r,i);this._collapseAnimation?.cancel(),this._collapseAnimation=c.play(n,{from:a.from,to:a.to,durationMs:X,properties:a.properties,onComplete:finalize})}collapseTween(t,n){let r=e.source.getViewportSize(),i={},a={};return this.isVertical()?(i.width=t+`px`,a.width=n+`px`,this.getEdge()===w.EAST&&(i.left=r.width-t+`px`,a.left=r.width-n+`px`)):(i.height=t+`px`,a.height=n+`px`,this.getEdge()===w.SOUTH&&(i.top=r.height-t+`px`,a.top=r.height-n+`px`)),{from:i,to:a,properties:Object.keys(a)}}setAllHandlesDisplayed(e){for(let t of this._drawers.values())t.handle.setDisplayed(e);for(let t of this._windows.values())t.handle?.setDisplayed(e)}setOrientation(e){return this._options.orientation=e,this._drawers!==void 0&&this.applyOrientation(),this}getOrientation(){return this._options.orientation??this._defaultOptions.orientation}mount(){if(this._mounted)return this;this.setLayoutManager(this.isVertical()?new g:new re),this.applyEdgeBorder(),this.applyRestingGeometry();let t=this.getElement(!0);e.sink.appendChild(e.source.getDocumentElement(),t);let n=this._collapseButton.getElement(!0);return n&&e.source.getParentElement(n)!==t&&e.sink.appendChild(t,n),this.applyCollapseAppearance(),this.scheduleLayout(),i.addViewportListener(this,`resize`,this._boundResizeHandler),this._mounted=!0,this.animateIn(),this}unmount(){if(!this._mounted)return this;i.removeViewportListener(this,`resize`,this._boundResizeHandler),this._mounted=!1;let e=this.getElement(),detach=()=>{this.removeElement()};return e?(this._slideOutAnimation?.cancel(),this._slideOutAnimation=c.play(e,{to:{transform:this.offscreenTransform()},durationMs:X,properties:[`transform`],onComplete:detach}),this):(detach(),this)}animateIn(){let e=this.getElement();e&&(this._slideInAnimation?.cancel(),this._slideInAnimation=c.play(e,{from:{transform:this.offscreenTransform()},to:{transform:`translate(0, 0)`},durationMs:X,properties:[`transform`]}))}offscreenTransform(){switch(this.getEdge()){case w.EAST:return`translateX(100%)`;case w.NORTH:return`translateY(-100%)`;case w.SOUTH:return`translateY(100%)`;case w.WEST:default:return`translateX(-100%)`}}registerDrawer(e,t={}){if(this._drawers.has(e))return this;let n=new J({text:t.text,glyph:t.glyph,selected:e.isOpen()}),onOpen=()=>{n.setSelected(!0)},onClose=()=>{n.setSelected(!1)},onAction=()=>{e.toggle()};return e.on(`open`,onOpen),e.on(`close`,onClose),n.on(`action`,onAction),t.alignEdge!==!1&&e.setEdge(this.getEdge()),this.applyHandleOrientation(n),n.setDisplayed(!this.isCollapsed()),this.addComponent(n),this._drawers.set(e,{handle:n,onOpen,onClose,onAction}),this.adaptThickness(),this.scheduleLayout(),this.emit(`register`,e),this}unregisterDrawer(e){let t=this._drawers.get(e);return t?(e.off(`open`,t.onOpen),e.off(`close`,t.onClose),t.handle.off(`action`,t.onAction),this.removeComponent(t.handle),this._drawers.delete(e),this.adaptThickness(),this.emit(`unregister`,e),this):this}registerWindow(e){if(this._windows.has(e))return this;let onMinimize=()=>{this.showWindowHandle(e)},onRestore=()=>{this.removeWindowHandle(e)},onClose=()=>{this.unregisterWindow(e)},onAction=()=>{e.restore()};return e.on(`minimize`,onMinimize),e.on(`restore`,onRestore),e.on(`close`,onClose),this._windows.set(e,{handle:null,onMinimize,onRestore,onClose,onAction}),e.isMinimized()&&this.showWindowHandle(e),this.emit(`register`,e),this}unregisterWindow(e){let t=this._windows.get(e);return t?(e.off(`minimize`,t.onMinimize),e.off(`restore`,t.onRestore),e.off(`close`,t.onClose),this.removeWindowHandle(e),this._windows.delete(e),this.emit(`unregister`,e),this):this}showWindowHandle(e){let t=this._windows.get(e);if(!t||t.handle!==null)return;let n=new J({text:e.getTitle(),glyph:e.getGlyph(),selected:!0});n.on(`action`,t.onAction),t.handle=n,this.applyHandleOrientation(n),n.setDisplayed(!this.isCollapsed()),this.addComponent(n),this.adaptThickness(),this.scheduleLayout()}removeWindowHandle(e){let t=this._windows.get(e);!t||t.handle===null||(t.handle.off(`action`,t.onAction),this.removeComponent(t.handle),t.handle=null,this.adaptThickness())}applyOrientation(){for(let e of this._drawers.values())this.applyHandleOrientation(e.handle);for(let e of this._windows.values())e.handle!==null&&this.applyHandleOrientation(e.handle);this.adaptThickness(),this.scheduleLayout()}applyHandleOrientation(e){let t=this.getOrientation(),n=t===`vertical-cw`?`sideways-rl`:t===`vertical-ccw`?`sideways-lr`:null;this.isVertical()&&n!==null?e.setWritingMode(n):e.clearWritingMode()}clampsToContentSize(){return!1}isVertical(){let e=this.getEdge();return e===w.WEST||e===w.EAST}handleMainAxisOffset(e){let t=this.isVertical(),mainPos=e=>t?e.getY():e.getX(),mainExtent=e=>t?e.getHeight():e.getWidth(),n=this._windows.get(e)?.handle??null;if(n!==null)return mainPos(n);let r=this.getComponents();if(r.length===0)return 0;let i=r[r.length-1];return mainPos(i)+mainExtent(i)+this.handleSpacing()}handleMainAxisExtent(e){let t=this.isVertical(),mainExtent=e=>t?e.getHeight():e.getWidth(),n=this._windows.get(e)?.handle??null;if(n!==null)return mainExtent(n);let r=this.getComponents();return r.length===0?0:mainExtent(r[r.length-1])}handleSpacing(){let e=this.getLayoutManager();return e instanceof ne?e.getComponentSpacing():0}restingRect(){let t=e.source.getViewportSize(),n=this.getThickness();switch(this.getEdge()){case w.EAST:return{x:t.width-n,y:0,width:n,height:t.height};case w.NORTH:return{x:0,y:0,width:t.width,height:n};case w.SOUTH:return{x:0,y:t.height-n,width:t.width,height:n};case w.WEST:default:return{x:0,y:0,width:n,height:t.height}}}applyRestingGeometry(){let e=this.restingRect();this.setX(e.x),this.setY(e.y),this.setWidth(e.width),this.setHeight(e.height)}applyEdgeBorder(){let e=`1px solid transparent`,t=`1px solid var(--ts-ui-rail-border)`;switch(this.getEdge()){case w.EAST:this.setBorder({border:e,borderLeft:t});break;case w.NORTH:this.setBorder({border:e,borderBottom:t});break;case w.SOUTH:this.setBorder({border:e,borderTop:t});break;case w.WEST:default:this.setBorder({border:e,borderRight:t})}}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,t){this._listeners.fire(e,t)}destructor(){this._collapseAnimation?.cancel(),this._collapseAnimation=null,this._slideOutAnimation?.cancel(),this._slideOutAnimation=null,this._slideInAnimation?.cancel(),this._slideInAnimation=null,this._collapseButton.dispose(),super.destructor()}},we=o(Rail),Dock=class extends u{_panels=new Map;_frames=new Map;_lazyFactories=new Map;_wiring=new Map;_sweepScheduled=!1;_listeners=new l;_focusedPanelId=null;_panelHost=new Map;_frameRegion=new Map;_lastActiveRegion=null;_floatSubscribed=new Set;_emptyDropOverlay=new B;_empty=!0;_emptyReconciled=!1;requestSweep=()=>{this.scheduleSweep()};onPanelDocked=e=>{this.requestSweep()};constructor(e,t){super(e,{layoutManager:new m,...t});let n=e?.layout?this.compileLayout(e.layout):this.newTabRegion();this.addComponent(n),this.scheduleSweep(),this.wireEmptyDropTarget(),this.applyListeners(e?.listeners)}applyOptions(e){return super.applyOptions(e),e.emptyContent!==void 0&&this.setEmptyContent(e.emptyContent),this}setEmptyContent(e){let t=this._emptyReconciled&&this.mainRegionEmpty();return t&&this.hideEmptyState(),this._options.emptyContent=e??void 0,t&&this.showEmptyState(),this}getEmptyContent(){return this._options.emptyContent??null}isEmpty(){return this._frames.size===0}wireEmptyDropTarget(){S.makeDropTarget(this,{accepts:e=>e.dragData.tabDrag===!0&&this.getComponents().length===0,suppressValidityTint:!0,onDragOver:()=>(this._emptyDropOverlay.attachTo(this),this._emptyDropOverlay.highlightFull(),null),onDragLeave:()=>{this._emptyDropOverlay.detach()},onDrop:e=>{this._emptyDropOverlay.detach();let t=se.get(e.dragData.componentId);if(!t)return;let n=this.newTabRegion();this.addComponent(n),n.moveComponent(t),this.scheduleSweep()}})}addPanel(e){this._panels.set(e.id,e);let t=this.resolvePanel(e.id);if(t){let n=this.activeTabRegion();this._lastActiveRegion=n,n.moveComponent(t,void 0,this.leafConstraints(e)),n.getLayoutManager().setActiveContent(t),this._frameRegion.set(e.id,n),this.scheduleSweep()}return this}addLazyPanel(e){this._panels.set(e.id,e),this._lazyFactories.set(e.id,typeof e.content==`function`?e.content:()=>e.content);let t=this.resolvePanel(e.id);if(t){let n=this.activeTabRegion();this._lastActiveRegion=n,n.moveComponent(t,void 0,this.leafConstraints(e)),n.getLayoutManager().setActiveContent(t),this._frameRegion.set(e.id,n),this.scheduleSweep()}return this}getRootRegion(){return this.getComponents()[0]}getLayoutState(){return V(this.getRootRegion())}setLayoutState(e){return this._frameRegion.clear(),fe(this.getRootRegion(),e,e=>this.resolvePanel(e)),this.scheduleSweep(),this}resolvePanel(e){let t=this._panels.get(e);if(!t)return null;let n=this._frames.get(e);if(!n){let r=this._lazyFactories.get(e);if(r){let e=new y;e.setBarVisible(!1),n=new u({id:t.id,name:t.title,layoutManager:e});let onFailed=e=>{this.failPanel(t.id,e)},onBusyChanged=e=>{this.setFrameBusy(t.id,e)};e.on(`exception`,onFailed),e.on(`busychange`,onBusyChanged),e.addLazyTab(r,t.title??t.id)}else n=new u({id:t.id,name:t.title,layoutManager:new m}),n.addComponent(t.content);this._frames.set(e,n)}return n}leafConstraints(e){let t=new T;return t.closeable=e.closeable??!0,t.disposeOnClose=e.disposeOnClose??!0,e.glyph&&(t.glyph=e.glyph),e.tooltip&&(t.tooltip=e.tooltip),t}activeTabRegion(){let e=this.getRootRegion(),t=this._lastActiveRegion;return t&&this.isTab(t)&&this.containsRegion(e,t)?t:this.isTab(e)?e:this.firstTabRegion(e)??this.wrapRootInTab()}containsRegion(e,t){if(e===t)return!0;for(let n of e.getComponents())if(this.isRegionContainer(n)&&this.containsRegion(n,t))return!0;return!1}firstTabRegion(e){if(this.isTab(e))return e;for(let t of e.getComponents())if(this.isRegionContainer(t)){let e=this.firstTabRegion(t);if(e)return e}return null}wrapRootInTab(){let e=this.newTabRegion(),t=this.getRootRegion();return this.addComponent(e),e.moveComponent(t),e}newTabRegion(){return new u({layoutManager:new y({reorderable:!0,compact:!0})})}compileLayout(e){if(`split`in e){let t=new u({layoutManager:new z({orientation:e.split})});for(let n of e.children)t.addComponent(this.compileRegion(n));return t}return`tabs`in e?this.compileTabs(e.tabs):this.compileTabs([e])}compileRegion(e){return`split`in e||`tabs`in e?this.compileLayout(e):this.compileTabs([e])}compileTabs(e){let t=this.newTabRegion();for(let n of e){this._panels.set(n.id,n);let e=this.resolvePanel(n.id);e&&(t.addComponent(e,this.leafConstraints(n)),this._panelHost.set(n.id,null),this._frameRegion.set(n.id,t))}return t}scheduleSweep(){this._sweepScheduled||(this._sweepScheduled=!0,e.sink.requestAnimationFrame(()=>{this._sweepScheduled=!1,this.runSweep()}))}runSweep(){let e=this.getRootRegion();if(!e)return;let t=this.ownedFloatWindows().map(e=>this.adoptFloat(e)).filter(e=>e!==null);this.wireRegion(e);for(let e of t)this.wireRegion(e);this.subscribeFloatWindows(),this.reconcileHosts(e),this.teardownVanished(e,t),this.reconcileEmptyState()}reconcileEmptyState(){this.mainRegionEmpty()?this.showEmptyState():this.hideEmptyState();let e=this.isEmpty();!this._emptyReconciled&&(this._emptyReconciled=!0,e===this._empty)||e!==this._empty&&(this._empty=e,this.emit(`emptychange`,{empty:e}))}mainRegionEmpty(){let e=this.getRootRegion();if(!e)return!1;let t=this.getEmptyContent();return e.getComponents().every(e=>e===t)}showEmptyState(){let e=this.getRootRegion(),t=this.getEmptyContent();e&&(t?(this.rootTab()?.setBarVisible(!0),t.getParentComponent()!==e&&e.moveComponent(t,void 0,this.placeholderConstraints())):this.rootTab()?.setBarVisible(!1))}hideEmptyState(){let e=this.getEmptyContent(),t=e?.getParentComponent(),n=t?.getLayoutManager();e&&(n instanceof y&&n.closeTab(e)||t?.removeComponent(e)),this.rootTab()?.setBarVisible(!0)}rootTab(){let e=this.getRootRegion()?.getLayoutManager();return e instanceof y?e:null}placeholderConstraints(){let e=new T;return e.closeable=!1,e.transient=!0,e.disposeOnClose=!1,e}subscribeFloatWindows(){for(let e of this.floatWindowsHoldingFrames()){if(this._floatSubscribed.has(e))continue;let onFloatActivate=()=>{this.onFloatActivated(e)},onFloatClose=()=>{this.onFloatClosed(e)};if(e.on(`activate`,onFloatActivate),e.on(`close`,onFloatClose),e instanceof v){let t=e.getLayoutManager();t.on(`activate`,this.onPanelFocused),t.on(`tabclose`,this.onPanelClosed),t.on(`detach`,this.onPanelDetached),t.on(`dock`,this.onPanelDocked)}this._floatSubscribed.add(e)}this.pruneClosedFloatSubscriptions()}pruneClosedFloatSubscriptions(){let e=new Set(_.getOpenWindows());for(let t of this._floatSubscribed)e.has(t)||this._floatSubscribed.delete(t)}floatWindowsHoldingFrames(){let e=[...this._frames.values()];return _.getOpenWindows().filter(t=>!this.windowContains(t,this)&&e.some(e=>this.windowContains(t,e)))}reconcileHosts(e){for(let[t,n]of this._frames){if(!this._panels.has(t))continue;let r=this.hostForFrame(n,e),i=this._panelHost.has(t),a=this._panelHost.get(t)??null,o=this.regionForFrame(n),s=this._frameRegion.get(t)??null;i?r===a?o&&s&&o!==s&&this.emit(`move`,{id:t,content:n,window:r}):(this.emit(`detach`,{id:t,content:n,window:a}),this.emit(`attach`,{id:t,content:n,window:r})):this.emit(`attach`,{id:t,content:n,window:r}),this._panelHost.set(t,r),o&&this._frameRegion.set(t,o)}}hostForFrame(e,t){return this.isUnder(t,e)?null:this.floatForFrame(e)}ownedFloatWindows(){let e=[...this._frames.values()];return _.getOpenWindows().filter(t=>!(t instanceof v)&&!this.windowContains(t,this)&&e.some(e=>this.windowContains(t,e)))}windowContains(e,t){for(let n=t;n;n=n.getParentComponent())if(n===e)return!0;return!1}windowContent(e){return e.getComponents().find(t=>!e.isChromeComponent(t))??null}adoptFloat(e){let t=this.windowContent(e);if(!t)return null;if(this.isRegionContainer(t))return t;let n=this.newTabRegion();return e.moveComponent(n),n.moveComponent(t),n}wireRegion(e){let t=this._wiring.get(e);t||(t={dockRegion:new H(e,this.requestSweep),tabWired:!1},this._wiring.set(e,t));let n=e.getLayoutManager();if(this.isTab(e)&&!t.tabWired){let r=n;r.setReorderable(!0);let onEmpty=()=>{this.pruneRegion(e)};r.on(`empty`,onEmpty),r.on(`tabclose`,this.onPanelClosed),r.on(`activate`,this.onPanelFocused),r.on(`detach`,this.onPanelDetached),r.on(`dock`,this.onPanelDocked),t.tabWired=!0}for(let t of e.getComponents())this.isRegionContainer(t)&&this._frames.get(t.getId())!==t&&this.wireRegion(t)}pruneRegion(e){let t=e.getParentComponent();!t||e.getComponents().length>0||t!==this&&(t.removeComponent(e),this.collapseSinglePaneSplit(t),this.closeFloatIfEmpty(t),this.scheduleSweep())}closeFloatIfEmpty(e){_.getOpenWindows().includes(e)&&(this.windowContent(e)||e.requestClose())}collapseSinglePaneSplit(e){if(this.regionKind(e)!==`Split`)return;let t=e.getComponents();if(t.length!==1)return;let n=e.getParentComponent();if(!n)return;let r=n.getComponents().indexOf(e);this.regionKind(n)===`Split`&&n.getLayoutManager().transferPaneSize(e,t[0]),n.moveComponent(t[0],r),n.removeComponent(e)}teardownVanished(e,t){let n=new Set;this.collectRegions(e,n);for(let e of t)this.collectRegions(e,n);for(let[e,t]of this._wiring)n.has(e)||(t.dockRegion.destroy(),this._wiring.delete(e))}collectRegions(e,t){t.add(e);for(let n of e.getComponents())this.isRegionContainer(n)&&this.collectRegions(n,t)}isRegionContainer(e){let t=this.regionKind(e);return t===`Split`||t===`Tab`}isTab(e){return this.regionKind(e)===`Tab`}regionKind(e){let t=e.getLayoutManager();return t?t.getClassName().replace(/^_/,``):``}onPanelClosed=e=>{let t=e.getId();if(this._frames.get(t)!==e)return;let n=this._frameRegion.get(t)??null;this._frames.delete(t),this._panelHost.delete(t),this._frameRegion.delete(t),this.emit(`close`,{id:t,content:e,window:null}),this.scheduleSweep(),this._focusedPanelId===t&&this.scheduleFocusRecompute(n)};failPanel(e,t){this._frames.has(e)&&(this.removePanel(e)||this._frames.delete(e),this.emit(`exception`,{id:e,error:t}))}setFrameBusy(e,t){let n=this._frames.get(e);if(!n)return;let r=this.regionForFrame(n);r&&r.getLayoutManager().setTabBusy(n,t)}onPanelFocused=e=>{let t=e.getId();if(this._frames.get(t)!==e)return;let n=this._frameRegion.get(t);n&&(this._lastActiveRegion=n),this.setFocus(t)};onPanelDetached=e=>{this.scheduleSweep()};onFloatActivated(e){let t=this.activeFrameInFloat(e);t&&this.setFocus(t.getId())}onFloatClosed(e){let t=!1;for(let n of this.framesInWindow(e)){let e=n.getId();this._frames.delete(e),this._panelHost.delete(e),this._frameRegion.delete(e),this.emit(`close`,{id:e,content:n,window:null}),this._focusedPanelId===e&&(t=!0)}this.scheduleSweep(),t&&this.scheduleFocusRecompute(null)}setFocus(e){if(e===this._focusedPanelId)return;if(this._focusedPanelId=e,e===null){this.emit(`focus`,null);return}let t=this._frames.get(e);if(t){let n=this.hostForFrame(t,this.getRootRegion());this.emit(`focus`,{id:e,content:t,window:n})}}scheduleFocusRecompute(t){e.sink.requestAnimationFrame(()=>this.recomputeFocusAfterClose(t))}recomputeFocusAfterClose(e){if(this._frames.size===0){this.setFocus(null);return}if(!e||!this.isTab(e)||e.getComponents().length===0){this.setFocus(null);return}let t=e.getLayoutManager().getActiveContent();this.setFocus(t?t.getId():null)}focusPanel(e){let t=this._frames.get(e);if(!t)return!1;let n=this.regionForFrame(t);if(!n)return!1;let r=n.getLayoutManager().indexOfContent(t);return r<0?!1:(this.floatForFrame(t)?.bringToFront(),n.getLayoutManager().setActiveTabIndex(r),!0)}removePanel(e){let t=this._frames.get(e);if(!t)return!1;let n=this.regionForFrame(t);return n?n.getLayoutManager().closeTab(t):!1}regionForFrame(e){for(let t of this.allTabRegions())if(t.getLayoutManager().indexOfContent(e)>=0)return t;return null}floatForFrame(e){return this.floatWindowsHoldingFrames().find(t=>this.windowContains(t,e))??null}allTabRegions(){let e=[],t=this.getRootRegion();t&&this.collectTabRegions(t,e);for(let t of this.floatWindowsHoldingFrames()){if(t instanceof v){e.push(t);continue}let n=this.windowContent(t);n&&this.collectTabRegions(n,e)}return e}collectTabRegions(e,t){this.isTab(e)&&t.push(e);for(let n of e.getComponents())this.isRegionContainer(n)&&this.collectTabRegions(n,t)}framesInWindow(e){return[...this._frames.values()].filter(t=>this.windowContains(e,t))}activeFrameInFloat(e){let t=null;if(e instanceof v)t=e.getLayoutManager();else{let n=this.windowContent(e),r=[];n&&this.collectTabRegions(n,r),t=r.length>0?r[0].getLayoutManager():null}let n=t?t.getActiveContent():null;return n&&this._frames.get(n.getId())===n?n:null}isUnder(e,t){for(let n=t;n;n=n.getParentComponent())if(n===e)return!0;return!1}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,t){this._listeners.fire(e,t)}destructor(){this._emptyDropOverlay.dispose();for(let e of this._wiring.values())e.dockRegion.destroy();this._wiring.clear(),super.destructor()}},Te=o(Dock);export{_ as AbstractWindow,ie as ButtonGroup,j as Dialog,k as DialogButtons,O as DialogTitleBar,Te as Dock,ce as DragFeedback,C as DragGhost,S as DragManager,xe as Drawer,B as DropZoneOverlay,de as Menu,W as Notification,ye as NotificationHistoryButton,A as Popover,me as PopupPanel,we as Rail,J as RailHandle,b as ReorderIndicator,v as TabWindow,p as Tooltip,ae as Window};
|
|
1
|
+
import{t as e}from"./DOM-Cjh7_7TF.js";import{n as t,o as n,t as r}from"./Position-BIEU1Eze.js";import{S as i,b as a,h as o,t as s,v as c}from"./Component-D99-15Zt.js";import{t as l}from"./ListenerBag-WPdKuuds.js";import{t as u}from"./Container-FWRjgF6T.js";import{t as d}from"./Glyph-DiEpD3gy.js";import{a as f,r as ee,t as te}from"./Tooltip-CyICVu15.js";import{t as p}from"./AnimatedDropdown-D0RhVgv3.js";import{t as m}from"./Fit-CaPMj7Up.js";import{i as ne,n as h,r as re}from"./VBox-DVe4UXwX.js";import{f as g,h as ie,o as _,s as v,u as ae}from"./RadioMenuRow-Cfv0x6Qj.js";import{a as oe,c as se,i as y,l as b,n as x,o as S,s as C}from"./CheckboxMenuRow-C1h4LPHR.js";import{t as w}from"./Placement-7kqdaK4Z.js";import{t as T}from"./LayoutConstraints-LIHYYd2F.js";import{r as ce}from"./Border-6GsTNV-2.js";import{t as E}from"./Button-CnFAiQuV.js";import{xmark as le}from"./glyphs/solid/xmark.es.js";import{t as ue}from"./Menu-CwHluLGT.js";import{a as de,i as fe,n as D,o as O,r as k,t as A}from"./Dialog-DN78RaVH.js";import{t as j}from"./SelectableText-DZNxjKXR.js";import{circle_check as M}from"./glyphs/solid/circle_check.es.js";import{circle_info as N}from"./glyphs/solid/circle_info.es.js";import{triangle_exclamation as P}from"./glyphs/solid/triangle_exclamation.es.js";import{circle_exclamation as F}from"./glyphs/solid/circle_exclamation.es.js";import{t as I}from"./MenuButton-BqCT-1yv.js";import{clock_rotate_left as L}from"./glyphs/solid/clock_rotate_left.es.js";import{a as R,i as z,n as B,r as V,t as pe}from"./LayoutSerialization-BC64__O7.js";var me=4,H={backgroundColor:`var(--ts-ui-autocomplete-bg, rgb(255, 255, 255))`,border:`var(--ts-ui-input-border)`,borderRadius:`var(--ts-ui-border-radius, 4px)`,shadow:`var(--ts-ui-autocomplete-shadow, 2px 4px 8px rgba(0,0,0,0.15))`},PopupPanel=class extends p{static ownClassStyleDefaults=H;_currentOpener=null;constructor(e,n){super(e,{layoutManager:new h({stretching:!0}),insets:new t(4,4,4,4),...H,...n??{}}),this.getAria().setRole(`dialog`),this.setContain(`layout`),this.setOverflowX(`hidden`),this.setOverflowY(`auto`),this.getLayoutManager()?.setOverflowing(!1,!0)}showAt(t){this.getElement(!0),this.setMaxSize({width:Number.MAX_VALUE,height:Number.MAX_VALUE});let n=this.getPreferredSize(),r=n?.width??this.getWidth(),i=n?.height??this.getHeight(),a=e.source.getViewportSize(),o=this.resolvePlacement(t,{width:r,height:i},a);return this.setWidth(r),this.setMaxSize({width:Number.MAX_VALUE,height:Math.max(0,o.available)}),this.setHeight(i),this.setX(o.x),this.setY(o.y),this.showAnimated(),this.doLayout(),this}toggleFor(t,n){if(this.isOpen()&&this._currentOpener===t)return this.hideAnimated(),this;this._currentOpener=t,this.setAnchorElement(t);let r=e.source.getId(t);return r!==``&&this.getAria().setLabelledBy(r),this.showAt(n)}hideAnimated(){return this._currentOpener=null,super.hideAnimated()}resolvePlacement(e,t,n){return ee(e,t,n,me)}},he=o(PopupPanel);d.register(N,M,P,F,le);var U={info:`circle-info`,success:`circle-check`,warning:`triangle-exclamation`,error:`circle-exclamation`},ge={info:`Information`,success:`Success`,warning:`Warning`,error:`Error`},_e=8e3,ve=200,ye=200,W=class Notification extends s{_showAnimation=null;_dismissAnimation=null;static WIDTH=320;static HEIGHT=64;static MARGIN=16;static H_PADDING=12;static V_PADDING=10;static CLOSE_SIZE=20;static BADGE_SIZE=20;static BADGE_TEXT_GAP=8;static Z_INDEX=10002;static activeNotifications=[];static HISTORY_CAP=50;static history=[];static hoverCount=0;static modalCount=0;_type;_fullMessage;_badge;_messageText;_closeButton;_dismissTimer=null;_remainingDuration=0;_timerStartedAt=0;_dismissing=!1;_boundOnCloseAction=()=>(this.dismiss(),!0);_boundOnDblClick=()=>this.openDetail();_boundOnMouseOver=e=>Notification.acquireHoverHold(e,this.getElement());_boundOnMouseOut=e=>Notification.releaseHoverHold(e,this.getElement());constructor(e,n){super(),this._type=n,this._fullMessage=e,this.setPosition(r.FIXED),this.setZIndex(Notification.Z_INDEX),this.setWidth(Notification.WIDTH),this.setHeight(Notification.HEIGHT),this.setOverflow(`hidden`),this.setContain(`strict`);let a=n===`error`||n===`warning`;this.getAria().setRole(a?`alert`:`status`),this.getAria().setLive(a?`assertive`:`polite`);let o=`var(--ts-ui-notification-${n}-bg)`,s=`var(--ts-ui-notification-${n}-border)`;this.setBackgroundColor(o),this.setBorder({border:`1px solid ${s}`}),this.setShadow(`var(--ts-ui-notification-shadow)`),this.setBorderRadius(`var(--ts-ui-border-radius, 4px)`),this._badge=new d(U[n]),this._badge.setForegroundColor(s),this._badge.setPreferredSize({width:Notification.BADGE_SIZE,height:Notification.BADGE_SIZE}),this._badge.setPointerEvents(`none`),this._badge.getAria().setHidden(!0),this.addComponent(this._badge),this._messageText=new j(e),this._messageText.setLineClamp(2),this._messageText.setWhiteSpace(`normal`),this._messageText.setWordBreak(`break-word`),this.addComponent(this._messageText),this._closeButton=new E({glyph:`xmark`}),this._closeButton.setInsets(new t(0,0,0,0)),this._closeButton.setBorder(`none`),this._closeButton.clearBackgroundImage(),this._closeButton.setBackgroundColor(`transparent`),this._closeButton.clearShadow(),this._closeButton.clearPressedShadow(),this._closeButton.setForegroundColor(`var(--ts-ui-text-color, rgb(0, 0, 0))`),this._closeButton.setPreferredSize({width:Notification.CLOSE_SIZE,height:Notification.CLOSE_SIZE}),this._closeButton.getAria().setLabel(`Dismiss notification`),this.addComponent(this._closeButton),this._closeButton.on(`action`,this._boundOnCloseAction),i.addSubtreeListener(this,`dblclick`,this._boundOnDblClick),i.addSubtreeListener(this,`mouseover`,this._boundOnMouseOver),i.addSubtreeListener(this,`mouseout`,this._boundOnMouseOut)}static show(e,t=`info`,n=3e3){Notification.record(e,t);let r=new Notification(e,t);Notification.activeNotifications.push(r);let i=r.getElement(!0);r.scheduleLayout(),f.mount(i),Notification.restack(),r.animateIn(),n>0&&(r.startTimer(n),Notification.isPaused()&&r.pauseTimer())}static record(e,t){Notification.history.push({message:e,type:t,timestamp:Date.now()}),Notification.history.length>Notification.HISTORY_CAP&&Notification.history.shift()}static getHistory(){return[...Notification.history]}animateIn(){let e=this.getElement();e&&(this._showAnimation?.cancel(),this._showAnimation=c.play(e,{from:{transform:`translateX(100%)`,opacity:`0`},to:{transform:`translateX(0)`,opacity:`1`},durationMs:ye,properties:[`transform`,`opacity`]}))}static pauseAll(){let e=Notification.isPaused();Notification.modalCount+=1,e||Notification.pauseAllTimers()}static resumeAll(){Notification.modalCount!==0&&(--Notification.modalCount,Notification.isPaused()||Notification.resumeAllTimers(!0))}static acquireHoverHold(t,n){if(n&&e.source.isNode(t.relatedTarget)&&e.source.contains(n,e.source.intern(t.relatedTarget)))return;let r=Notification.isPaused();Notification.hoverCount+=1,r||Notification.pauseAllTimers()}static releaseHoverHold(t,n){n&&e.source.isNode(t.relatedTarget)&&e.source.contains(n,e.source.intern(t.relatedTarget))||Notification.hoverCount!==0&&(--Notification.hoverCount,Notification.isPaused()||Notification.resumeAllTimers(!1))}static isPaused(){return Notification.hoverCount>0||Notification.modalCount>0}static pauseAllTimers(){for(let e of Notification.activeNotifications)e.pauseTimer()}static resumeAllTimers(e){for(let t of Notification.activeNotifications)t.restartTimer(e)}startTimer(e){this._remainingDuration=e,this._timerStartedAt=Date.now(),this._dismissTimer=setTimeout(()=>this.dismiss(),e)}pauseTimer(){this._dismissTimer!==null&&(clearTimeout(this._dismissTimer),this._dismissTimer=null,this._remainingDuration=Math.max(0,this._remainingDuration-(Date.now()-this._timerStartedAt)))}restartTimer(e){this._dismissing||this._remainingDuration<=0||this._dismissTimer!==null||(e&&(this._remainingDuration=Math.max(this._remainingDuration,_e)),this._timerStartedAt=Date.now(),this._dismissTimer=setTimeout(()=>this.dismiss(),this._remainingDuration))}openDetail(){Notification.showDetail(this._fullMessage,this._type)}static showDetail(e,n){Notification.pauseAll();let r=new j(e);r.setAutoMeasure(!1),r.setWhiteSpace(`pre-wrap`),r.setWordBreak(`break-word`),r.setPadding(new t(16,16,16,16));let i=new A({title:ge[n],contentComponent:r,buttons:[{...D.Close,primary:!0}],width:420,height:220}),a=i.getTitleBar();a.setBackgroundColor(`var(--ts-ui-notification-${n}-bg)`),a.getTitleText().setForegroundColor(`var(--ts-ui-notification-${n}-border)`),a.setGlyph(U[n]);let o=a.getGlyph();o!==null&&o.setForegroundColor(`var(--ts-ui-notification-${n}-border)`),i.show().then(()=>Notification.resumeAll())}dismiss(){if(this._dismissing)return;this._dismissing=!0,this._dismissTimer!==null&&(clearTimeout(this._dismissTimer),this._dismissTimer=null);let e=this.getElement();if(!e){this.finishDismiss();return}this._dismissAnimation?.cancel(),this._dismissAnimation=c.play(e,{to:{transform:`translateX(100%)`,opacity:`0`},durationMs:ve,properties:[`transform`,`opacity`],onComplete:()=>this.finishDismiss()})}finishDismiss(){Notification.activeNotifications=Notification.activeNotifications.filter(e=>e!==this),this.dispose(),Notification.restack()}static restack(){let t=e.source.getViewportSize(),n=t.width-Notification.WIDTH-Notification.MARGIN,r=t.height-Notification.MARGIN;for(let e=Notification.activeNotifications.length-1;e>=0;e--){let t=Notification.activeNotifications[e];r-=Notification.HEIGHT,t.setX(n),t.setY(r),r-=Notification.MARGIN}}doLayout(){super.doLayout();let e=Notification.WIDTH-Notification.CLOSE_SIZE-4,t=Notification.H_PADDING,n=Notification.V_PADDING+2,r=t+Notification.BADGE_SIZE+Notification.BADGE_TEXT_GAP,i=e-r-4,a=Notification.HEIGHT-Notification.V_PADDING*2;return this._badge.setX(t),this._badge.setY(n),this._badge.setWidth(Notification.BADGE_SIZE),this._badge.setHeight(Notification.BADGE_SIZE),this._messageText.setX(r),this._messageText.setY(Notification.V_PADDING),this._messageText.setWidth(i),this._messageText.setHeight(a),this._closeButton.setX(e),this._closeButton.setY(4),this._closeButton.setWidth(Notification.CLOSE_SIZE),this._closeButton.setHeight(Notification.CLOSE_SIZE),this._closeButton.doLayout(),this}destructor(){this._showAnimation?.cancel(),this._showAnimation=null,this._dismissAnimation?.cancel(),this._dismissAnimation=null,Notification.activeNotifications.includes(this)&&(Notification.activeNotifications=Notification.activeNotifications.filter(e=>e!==this),Notification.restack()),super.destructor()}};d.register(L);var G=6e4,K=36e5,q=864e5;function formatRelativeTime(e,t){let n=Math.max(0,t-e);return n<G?`just now`:n<K?`${Math.floor(n/G)}m ago`:n<q?`${Math.floor(n/K)}h ago`:`${Math.floor(n/q)}d ago`}function buildHistoryItems(){let e=W.getHistory();if(e.length===0)return[{text:`No notifications yet`,enabled:!1}];let t=Date.now();return e.map(e=>({glyph:U[e.type],glyphColor:`var(--ts-ui-notification-${e.type}-border)`,text:e.message,shortcut:formatRelativeTime(e.timestamp,t),action:()=>W.showDetail(e.message,e.type)}))}var NotificationHistoryButton=class extends I{constructor(e){super(void 0,e,{glyph:`clock-rotate-left`,menuItems:buildHistoryItems,scrollToBottomOnShow:!0}),this.getAria().setLabel(`Notification history`),this.applyListeners(e?.listeners)}},be=o(NotificationHistoryButton),xe={edge:w.WEST,modal:!1,size:320,durationMs:220,overflow:`auto`,backgroundColor:`var(--ts-ui-body-bg)`,shadow:`var(--ts-ui-drawer-shadow)`},Drawer=class extends s{_panelInAnimation=null;_panelOutAnimation=null;_backdropInAnimation=null;_backdropOutAnimation=null;_open=!1;_closing=!1;_backdrop=null;_listeners=new l;_boundResizeHandler=()=>this.onViewportResize();_boundBackdropClose=()=>{this.close()};constructor(e,t){super(e,{...xe,...t??{}}),this.setPosition(r.FIXED),this.applyListeners(e?.listeners)}applyOptions(e){return super.applyOptions(e),this.setEdge(e.edge??this.getEdge()),this.setModal(e.modal??this.isModal()),this.setDrawerSize(e.size??this.getDrawerSize()),this.setDurationMs(e.durationMs??this.getDurationMs()),this}setEdge(e){return this._options.edge=e,this}getEdge(){return this._options.edge??this._defaultOptions.edge}setModal(e){return this._options.modal=e,this}isModal(){return this._options.modal??this._defaultOptions.modal}setDrawerSize(e){return this._options.size=e,this}getDrawerSize(){return this._options.size??this._defaultOptions.size}setDurationMs(e){return this._options.durationMs=e,this}getDurationMs(){return this._options.durationMs??this._defaultOptions.durationMs}open(){if(this._open)return this;f.register(this);let t=f.getZIndex(this);return this.setZIndex(t),this.isModal()&&this.openBackdrop(t-1),this.applyEdgeBorder(),this.applyRestingGeometry(),e.sink.appendChild(e.source.getDocumentElement(),this.getElement(!0)),se(this),this.scheduleLayout(),this.animateIn(),i.addViewportListener(this,`resize`,this._boundResizeHandler),this._open=!0,this.emit(`open`),this}close(){if(!this._open||this._closing)return this;let e=!1;return this.emit(`beforeclose`,{preventDefault:()=>{e=!0}}),e?this:(this._closing=!0,i.removeViewportListener(this,`resize`,this._boundResizeHandler),this.animateOutAndFinalize(),this)}toggle(){return this._open?this.close():this.open()}isOpen(){return this._open}restingRect(){let t=e.source.getViewportSize(),n=this.getDrawerSize();switch(this.getEdge()){case w.EAST:return{x:t.width-n,y:0,width:n,height:t.height};case w.NORTH:return{x:0,y:0,width:t.width,height:n};case w.SOUTH:return{x:0,y:t.height-n,width:t.width,height:n};case w.WEST:default:return{x:0,y:0,width:n,height:t.height}}}applyRestingGeometry(){let e=this.restingRect();this.setX(e.x),this.setY(e.y),this.setWidth(e.width),this.setHeight(e.height)}offscreenTransform(){let e=this.getDrawerSize();switch(this.getEdge()){case w.EAST:return`translateX(${e}px)`;case w.NORTH:return`translateY(${-e}px)`;case w.SOUTH:return`translateY(${e}px)`;case w.WEST:default:return`translateX(${-e}px)`}}applyEdgeBorder(){let e=`1px solid var(--ts-ui-drawer-border)`;switch(this.getEdge()){case w.EAST:this.setBorder({border:`none`,borderLeft:e});break;case w.NORTH:this.setBorder({border:`none`,borderBottom:e});break;case w.SOUTH:this.setBorder({border:`none`,borderTop:e});break;case w.WEST:default:this.setBorder({border:`none`,borderRight:e})}}animateIn(){let e=this.getElement();e&&(this._panelInAnimation?.cancel(),this._panelInAnimation=c.play(e,{from:{transform:this.offscreenTransform()},to:{transform:`translate(0, 0)`},durationMs:this.getDurationMs(),properties:[`transform`]}))}animateOutAndFinalize(){let e=this.getElement(),finalize=()=>{this.removeElement(),this.teardownBackdrop(),f.unregister(this),b(this),this._open=!1,this._closing=!1,this.emit(`close`)};if(!e){finalize();return}this._panelOutAnimation?.cancel(),this._panelOutAnimation=c.play(e,{to:{transform:this.offscreenTransform()},durationMs:this.getDurationMs(),properties:[`transform`],onComplete:finalize}),this.fadeBackdropOut()}openBackdrop(t){this._backdrop=new de,this._backdrop.setZIndex(t),this._backdrop.addClickListener(this._boundBackdropClose);let n=this._backdrop.getElement(!0);e.sink.appendChild(e.source.getDocumentElement(),n),this._backdropInAnimation?.cancel(),this._backdropInAnimation=c.play(n,{from:{opacity:`0`},to:{opacity:`1`},durationMs:this.getDurationMs(),properties:[`opacity`]})}fadeBackdropOut(){let e=this._backdrop?.getElement();e&&(this._backdropOutAnimation?.cancel(),this._backdropOutAnimation=c.play(e,{to:{opacity:`0`},durationMs:this.getDurationMs(),properties:[`opacity`]}))}teardownBackdrop(){this._backdrop!==null&&(this._backdrop.destroy(),this._backdrop=null)}onViewportResize(){this._backdrop!==null&&this._backdrop.resize(),this.applyRestingGeometry()}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}getLayerElement(){return this.getElement()??null}getDismissMode(){return this.isModal()?`modal`:`manual`}requestClose(){this.close()}isLayerRoot(){return!0}onZIndexChanged(e){this.setZIndex(e),this._backdrop!==null&&this._backdrop.setZIndex(e-1)}destructor(){this._panelInAnimation?.cancel(),this._panelInAnimation=null,this._panelOutAnimation?.cancel(),this._panelOutAnimation=null,this._backdropInAnimation?.cancel(),this._backdropInAnimation=null,this._backdropOutAnimation?.cancel(),this._backdropOutAnimation=null,this.teardownBackdrop(),f.unregister(this),b(this),this._open=!1,this._closing=!1,super.destructor()}},Se=o(Drawer),RailHandle=class extends E{get selectedRule(){return this._selectedRule??=this.createStyleRule(`.selected`)}get railHoverRule(){return this._railHoverRule??=this.createStyleRule(`:hover:not(.selected)`)}constructor(e={}){super(e.text,e,{chromeless:!0}),this.railHoverRule.set(`backgroundColor`,`var(--ts-ui-rail-handle-hover-bg)`),this.selectedRule.set(`backgroundColor`,`var(--ts-ui-rail-handle-selected-bg)`)}applyOptions(e){return super.applyOptions(e),e.selected!==void 0&&this.setSelected(e.selected),this}isSelected(){return this._options.selected??!1}setSelected(t){this._options.selected=t,this.getAria().setPressed(t);let n=this.getElement();return n&&e.sink.apply(n,{toggleClass:{selected:t}}),this}render(){let t=super.render();return e.sink.apply(t,{toggleClass:{selected:this.isSelected()}}),t}},J=o(RailHandle),Y=48,Ce=8900,X=200,Z=10,Q=5;function collapseHeadingFor(e){switch(e){case w.EAST:return`east`;case w.NORTH:return`north`;case w.SOUTH:return`south`;case w.WEST:default:return`west`}}var $={west:`east`,east:`west`,north:`south`,south:`north`},we={edge:w.WEST,orientation:`horizontal`,backgroundColor:`var(--ts-ui-body-bg)`,shadow:`var(--ts-ui-rail-shadow)`},Rail=class extends s{_collapseAnimation=null;_slideOutAnimation=null;_slideInAnimation=null;_listeners=new l;_drawers=new Map;_windows=new Map;_mounted=!1;_collapseButton;_expandedThickness=Y;_boundResizeHandler=()=>this.applyRestingGeometry();constructor(e,t){super(e,{...we,...t??{}}),this.setPosition(r.FIXED),this.setZIndex(Ce),this._collapseButton=new ce({direction:collapseHeadingFor(this.getEdge()),listeners:{collapse:()=>{this.toggleCollapsed()}}}),e?.listeners!==void 0&&this.applyListeners(e.listeners)}applyOptions(e){return super.applyOptions(e),this.setEdge(e.edge??this.getEdge()),this.setOrientation(e.orientation??this.getOrientation()),e.thickness!==void 0&&this.setThickness(e.thickness),e.collapsed!==void 0&&(this._options.collapsed=e.collapsed),this}setEdge(e){return this._options.edge=e,this}getEdge(){return this._options.edge??this._defaultOptions.edge}setThickness(e){return this._options.thickness=e,this.adaptThickness(),this}getThickness(){return this.isCollapsed()?Z:this._options.thickness===void 0?this.measureContentThickness():this._options.thickness}measureContentThickness(){let e=this.getPreferredSize();if(!e)return Y;let t=this.isVertical()?e.width:e.height;return t<=0||n(t)?Y:Math.ceil(t)}adaptThickness(){this._mounted&&this.applyRestingGeometry()}isCollapsed(){return this._options.collapsed??!1}setCollapsed(e){return e===this.isCollapsed()?this:(e&&(this._expandedThickness=this.getThickness()),this._options.collapsed=e,this._mounted&&this.animateCollapseTransition(e),this)}toggleCollapsed(){return this.setCollapsed(!this.isCollapsed())}applyCollapseAppearance(){let e=this.isCollapsed(),t=collapseHeadingFor(this.getEdge());this._collapseButton.setDirection(e?$[t]:t),this.applyCollapseStyling(e),this.positionChevron(e),this.setAllHandlesDisplayed(!e)}applyCollapseStyling(e){e?(this.setBackgroundColor(`var(--ts-ui-button-bg, #e8e8e8)`),this.setBackgroundImage(`var(--ts-ui-button-bg, linear-gradient(rgb(241, 241, 241), rgb(200, 200, 200)))`),this.setBorder(`1px solid var(--ts-ui-button-border, #c8c8c8)`)):(this.clearBackgroundImage(),this.setBackgroundColor(`var(--ts-ui-body-bg)`),this.applyEdgeBorder())}positionChevron(e){let t,n;if(e)t=`50%`,n=`50%`;else{let e=`calc(100% - ${Q}px)`,r=`${Q}px`;switch(this.getEdge()){case w.EAST:t=r,n=`50%`;break;case w.NORTH:t=`50%`,n=e;break;case w.SOUTH:t=`50%`,n=r;break;case w.WEST:default:t=e,n=`50%`}}let r=e?`10px`:null;new a({scope:`component`,name:this._collapseButton.getId(),styles:{left:t,top:n,width:r,zIndex:`1`}})}animateCollapseTransition(e){let t=collapseHeadingFor(this.getEdge());this._collapseButton.setDirection(e?$[t]:t),this.applyCollapseStyling(e),this.positionChevron(e);let n=this.getElement(),r=this.isVertical()?this.getWidth():this.getHeight(),i=e?Z:this._expandedThickness;e||(this.setAllHandlesDisplayed(!0),this.applyRestingGeometry(),this.scheduleLayout());let finalize=()=>{e&&this.setAllHandlesDisplayed(!1),this.applyRestingGeometry(),e||this.scheduleLayout()};if(!n){finalize();return}let a=this.collapseTween(r,i);this._collapseAnimation?.cancel(),this._collapseAnimation=c.play(n,{from:a.from,to:a.to,durationMs:X,properties:a.properties,onComplete:finalize})}collapseTween(t,n){let r=e.source.getViewportSize(),i={},a={};return this.isVertical()?(i.width=t+`px`,a.width=n+`px`,this.getEdge()===w.EAST&&(i.left=r.width-t+`px`,a.left=r.width-n+`px`)):(i.height=t+`px`,a.height=n+`px`,this.getEdge()===w.SOUTH&&(i.top=r.height-t+`px`,a.top=r.height-n+`px`)),{from:i,to:a,properties:Object.keys(a)}}setAllHandlesDisplayed(e){for(let t of this._drawers.values())t.handle.setDisplayed(e);for(let t of this._windows.values())t.handle?.setDisplayed(e)}setOrientation(e){return this._options.orientation=e,this._drawers!==void 0&&this.applyOrientation(),this}getOrientation(){return this._options.orientation??this._defaultOptions.orientation}mount(){if(this._mounted)return this;this.setLayoutManager(this.isVertical()?new h:new re),this.applyEdgeBorder(),this.applyRestingGeometry();let t=this.getElement(!0);e.sink.appendChild(e.source.getDocumentElement(),t);let n=this._collapseButton.getElement(!0);return n&&e.source.getParentElement(n)!==t&&e.sink.appendChild(t,n),this.applyCollapseAppearance(),this.scheduleLayout(),i.addViewportListener(this,`resize`,this._boundResizeHandler),this._mounted=!0,this.animateIn(),this}unmount(){if(!this._mounted)return this;i.removeViewportListener(this,`resize`,this._boundResizeHandler),this._mounted=!1;let e=this.getElement(),detach=()=>{this.removeElement()};return e?(this._slideOutAnimation?.cancel(),this._slideOutAnimation=c.play(e,{to:{transform:this.offscreenTransform()},durationMs:X,properties:[`transform`],onComplete:detach}),this):(detach(),this)}animateIn(){let e=this.getElement();e&&(this._slideInAnimation?.cancel(),this._slideInAnimation=c.play(e,{from:{transform:this.offscreenTransform()},to:{transform:`translate(0, 0)`},durationMs:X,properties:[`transform`]}))}offscreenTransform(){switch(this.getEdge()){case w.EAST:return`translateX(100%)`;case w.NORTH:return`translateY(-100%)`;case w.SOUTH:return`translateY(100%)`;case w.WEST:default:return`translateX(-100%)`}}registerDrawer(e,t={}){if(this._drawers.has(e))return this;let n=new J({text:t.text,glyph:t.glyph,selected:e.isOpen()}),onOpen=()=>{n.setSelected(!0)},onClose=()=>{n.setSelected(!1)},onAction=()=>{e.toggle()};return e.on(`open`,onOpen),e.on(`close`,onClose),n.on(`action`,onAction),t.alignEdge!==!1&&e.setEdge(this.getEdge()),this.applyHandleOrientation(n),n.setDisplayed(!this.isCollapsed()),this.addComponent(n),this._drawers.set(e,{handle:n,onOpen,onClose,onAction}),this.adaptThickness(),this.scheduleLayout(),this.emit(`register`,e),this}unregisterDrawer(e){let t=this._drawers.get(e);return t?(e.off(`open`,t.onOpen),e.off(`close`,t.onClose),t.handle.off(`action`,t.onAction),this.removeComponent(t.handle),this._drawers.delete(e),this.adaptThickness(),this.emit(`unregister`,e),this):this}registerWindow(e){if(this._windows.has(e))return this;let onMinimize=()=>{this.showWindowHandle(e)},onRestore=()=>{this.removeWindowHandle(e)},onClose=()=>{this.unregisterWindow(e)},onAction=()=>{e.restore()};return e.on(`minimize`,onMinimize),e.on(`restore`,onRestore),e.on(`close`,onClose),this._windows.set(e,{handle:null,onMinimize,onRestore,onClose,onAction}),e.isMinimized()&&this.showWindowHandle(e),this.emit(`register`,e),this}unregisterWindow(e){let t=this._windows.get(e);return t?(e.off(`minimize`,t.onMinimize),e.off(`restore`,t.onRestore),e.off(`close`,t.onClose),this.removeWindowHandle(e),this._windows.delete(e),this.emit(`unregister`,e),this):this}showWindowHandle(e){let t=this._windows.get(e);if(!t||t.handle!==null)return;let n=new J({text:e.getTitle(),glyph:e.getGlyph(),selected:!0});n.on(`action`,t.onAction),t.handle=n,this.applyHandleOrientation(n),n.setDisplayed(!this.isCollapsed()),this.addComponent(n),this.adaptThickness(),this.scheduleLayout()}removeWindowHandle(e){let t=this._windows.get(e);!t||t.handle===null||(t.handle.off(`action`,t.onAction),this.removeComponent(t.handle),t.handle=null,this.adaptThickness())}applyOrientation(){for(let e of this._drawers.values())this.applyHandleOrientation(e.handle);for(let e of this._windows.values())e.handle!==null&&this.applyHandleOrientation(e.handle);this.adaptThickness(),this.scheduleLayout()}applyHandleOrientation(e){let t=this.getOrientation(),n=t===`vertical-cw`?`sideways-rl`:t===`vertical-ccw`?`sideways-lr`:null;this.isVertical()&&n!==null?e.setWritingMode(n):e.clearWritingMode()}clampsToContentSize(){return!1}isVertical(){let e=this.getEdge();return e===w.WEST||e===w.EAST}handleMainAxisOffset(e){let t=this.isVertical(),mainPos=e=>t?e.getY()+e.getTranslateY():e.getX()+e.getTranslateX(),mainExtent=e=>t?e.getHeight():e.getWidth(),n=this._windows.get(e)?.handle??null;if(n!==null)return mainPos(n);let r=this.getComponents();if(r.length===0)return 0;let i=r[r.length-1];return mainPos(i)+mainExtent(i)+this.handleSpacing()}handleMainAxisExtent(e){let t=this.isVertical(),mainExtent=e=>t?e.getHeight():e.getWidth(),n=this._windows.get(e)?.handle??null;if(n!==null)return mainExtent(n);let r=this.getComponents();return r.length===0?0:mainExtent(r[r.length-1])}handleSpacing(){let e=this.getLayoutManager();return e instanceof ne?e.getComponentSpacing():0}restingRect(){let t=e.source.getViewportSize(),n=this.getThickness();switch(this.getEdge()){case w.EAST:return{x:t.width-n,y:0,width:n,height:t.height};case w.NORTH:return{x:0,y:0,width:t.width,height:n};case w.SOUTH:return{x:0,y:t.height-n,width:t.width,height:n};case w.WEST:default:return{x:0,y:0,width:n,height:t.height}}}applyRestingGeometry(){let e=this.restingRect();this.setX(e.x),this.setY(e.y),this.setWidth(e.width),this.setHeight(e.height)}applyEdgeBorder(){let e=`1px solid transparent`,t=`1px solid var(--ts-ui-rail-border)`;switch(this.getEdge()){case w.EAST:this.setBorder({border:e,borderLeft:t});break;case w.NORTH:this.setBorder({border:e,borderBottom:t});break;case w.SOUTH:this.setBorder({border:e,borderTop:t});break;case w.WEST:default:this.setBorder({border:e,borderRight:t})}}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,t){this._listeners.fire(e,t)}destructor(){this._collapseAnimation?.cancel(),this._collapseAnimation=null,this._slideOutAnimation?.cancel(),this._slideOutAnimation=null,this._slideInAnimation?.cancel(),this._slideInAnimation=null,this._collapseButton.dispose(),super.destructor()}},Te=o(Rail),Dock=class extends u{_panels=new Map;_frames=new Map;_lazyFactories=new Map;_wiring=new Map;_sweepScheduled=!1;_listeners=new l;_focusedPanelId=null;_panelHost=new Map;_frameRegion=new Map;_lastActiveRegion=null;_floatSubscribed=new Set;_emptyDropOverlay=new z;_empty=!0;_emptyReconciled=!1;requestSweep=()=>{this.scheduleSweep()};onPanelDocked=e=>{this.requestSweep()};constructor(e,t){super(e,{layoutManager:new m,...t});let n=e?.layout?this.compileLayout(e.layout):this.newTabRegion();this.addComponent(n),this.scheduleSweep(),this.wireEmptyDropTarget(),this.applyListeners(e?.listeners)}applyOptions(e){return super.applyOptions(e),e.emptyContent!==void 0&&this.setEmptyContent(e.emptyContent),this}setEmptyContent(e){let t=this._emptyReconciled&&this.mainRegionEmpty();return t&&this.hideEmptyState(),this._options.emptyContent=e??void 0,t&&this.showEmptyState(),this}getEmptyContent(){return this._options.emptyContent??null}isEmpty(){return this._frames.size===0}wireEmptyDropTarget(){x.makeDropTarget(this,{accepts:e=>e.dragData.tabDrag===!0&&this.getComponents().length===0,suppressValidityTint:!0,onDragOver:()=>(this._emptyDropOverlay.attachTo(this),this._emptyDropOverlay.highlightFull(),null),onDragLeave:()=>{this._emptyDropOverlay.detach()},onDrop:e=>{this._emptyDropOverlay.detach();let t=y.get(e.dragData.componentId);if(!t)return;let n=this.newTabRegion();this.addComponent(n),n.moveComponent(t),this.scheduleSweep()}})}addPanel(e){this._panels.set(e.id,e);let t=this.resolvePanel(e.id);if(t){let n=this.activeTabRegion();this._lastActiveRegion=n,n.moveComponent(t,void 0,this.leafConstraints(e)),n.getLayoutManager().setActiveContent(t),this._frameRegion.set(e.id,n),this.scheduleSweep()}return this}addLazyPanel(e){this._panels.set(e.id,e),this._lazyFactories.set(e.id,typeof e.content==`function`?e.content:()=>e.content);let t=this.resolvePanel(e.id);if(t){let n=this.activeTabRegion();this._lastActiveRegion=n,n.moveComponent(t,void 0,this.leafConstraints(e)),n.getLayoutManager().setActiveContent(t),this._frameRegion.set(e.id,n),this.scheduleSweep()}return this}getRootRegion(){return this.getComponents()[0]}getLayoutState(){return B(this.getRootRegion())}setLayoutState(e){return this._frameRegion.clear(),pe(this.getRootRegion(),e,e=>this.resolvePanel(e)),this.scheduleSweep(),this}resolvePanel(e){let t=this._panels.get(e);if(!t)return null;let n=this._frames.get(e);if(!n){let r=this._lazyFactories.get(e);if(r){let e=new v;e.setBarVisible(!1),n=new u({id:t.id,name:t.title,layoutManager:e});let onFailed=e=>{this.failPanel(t.id,e)},onBusyChanged=e=>{this.setFrameBusy(t.id,e)};e.on(`exception`,onFailed),e.on(`busychange`,onBusyChanged),e.addLazyTab(r,t.title??t.id)}else n=new u({id:t.id,name:t.title,layoutManager:new m}),n.addComponent(t.content);this._frames.set(e,n)}return n}leafConstraints(e){let t=new T;return t.closeable=e.closeable??!0,t.disposeOnClose=e.disposeOnClose??!0,e.glyph&&(t.glyph=e.glyph),e.tooltip&&(t.tooltip=e.tooltip),t}activeTabRegion(){let e=this.getRootRegion(),t=this._lastActiveRegion;return t&&this.isTab(t)&&this.containsRegion(e,t)?t:this.isTab(e)?e:this.firstTabRegion(e)??this.wrapRootInTab()}containsRegion(e,t){if(e===t)return!0;for(let n of e.getComponents())if(this.isRegionContainer(n)&&this.containsRegion(n,t))return!0;return!1}firstTabRegion(e){if(this.isTab(e))return e;for(let t of e.getComponents())if(this.isRegionContainer(t)){let e=this.firstTabRegion(t);if(e)return e}return null}wrapRootInTab(){let e=this.newTabRegion(),t=this.getRootRegion();return this.addComponent(e),e.moveComponent(t),e}newTabRegion(){return new u({layoutManager:new v({reorderable:!0,compact:!0})})}compileLayout(e){if(`split`in e){let t=new u({layoutManager:new R({orientation:e.split})});for(let n of e.children)t.addComponent(this.compileRegion(n));return t}return`tabs`in e?this.compileTabs(e.tabs):this.compileTabs([e])}compileRegion(e){return`split`in e||`tabs`in e?this.compileLayout(e):this.compileTabs([e])}compileTabs(e){let t=this.newTabRegion();for(let n of e){this._panels.set(n.id,n);let e=this.resolvePanel(n.id);e&&(t.addComponent(e,this.leafConstraints(n)),this._panelHost.set(n.id,null),this._frameRegion.set(n.id,t))}return t}scheduleSweep(){this._sweepScheduled||(this._sweepScheduled=!0,e.sink.requestAnimationFrame(()=>{this._sweepScheduled=!1,this.runSweep()}))}runSweep(){let e=this.getRootRegion();if(!e)return;let t=this.ownedFloatWindows().map(e=>this.adoptFloat(e)).filter(e=>e!==null);this.wireRegion(e);for(let e of t)this.wireRegion(e);this.subscribeFloatWindows(),this.reconcileHosts(e),this.teardownVanished(e,t),this.reconcileEmptyState()}reconcileEmptyState(){this.mainRegionEmpty()?this.showEmptyState():this.hideEmptyState();let e=this.isEmpty();!this._emptyReconciled&&(this._emptyReconciled=!0,e===this._empty)||e!==this._empty&&(this._empty=e,this.emit(`emptychange`,{empty:e}))}mainRegionEmpty(){let e=this.getRootRegion();if(!e)return!1;let t=this.getEmptyContent();return e.getComponents().every(e=>e===t)}showEmptyState(){let e=this.getRootRegion(),t=this.getEmptyContent();e&&(t?(this.rootTab()?.setBarVisible(!0),t.getParentComponent()!==e&&e.moveComponent(t,void 0,this.placeholderConstraints())):this.rootTab()?.setBarVisible(!1))}hideEmptyState(){let e=this.getEmptyContent(),t=e?.getParentComponent(),n=t?.getLayoutManager();e&&(n instanceof v&&n.closeTab(e)||t?.removeComponent(e)),this.rootTab()?.setBarVisible(!0)}rootTab(){let e=this.getRootRegion()?.getLayoutManager();return e instanceof v?e:null}placeholderConstraints(){let e=new T;return e.closeable=!1,e.transient=!0,e.disposeOnClose=!1,e}subscribeFloatWindows(){for(let e of this.floatWindowsHoldingFrames()){if(this._floatSubscribed.has(e))continue;let onFloatActivate=()=>{this.onFloatActivated(e)},onFloatClose=()=>{this.onFloatClosed(e)};if(e.on(`activate`,onFloatActivate),e.on(`close`,onFloatClose),e instanceof _){let t=e.getLayoutManager();t.on(`activate`,this.onPanelFocused),t.on(`tabclose`,this.onPanelClosed),t.on(`detach`,this.onPanelDetached),t.on(`dock`,this.onPanelDocked)}this._floatSubscribed.add(e)}this.pruneClosedFloatSubscriptions()}pruneClosedFloatSubscriptions(){let e=new Set(g.getOpenWindows());for(let t of this._floatSubscribed)e.has(t)||this._floatSubscribed.delete(t)}floatWindowsHoldingFrames(){let e=[...this._frames.values()];return g.getOpenWindows().filter(t=>!this.windowContains(t,this)&&e.some(e=>this.windowContains(t,e)))}reconcileHosts(e){for(let[t,n]of this._frames){if(!this._panels.has(t))continue;let r=this.hostForFrame(n,e),i=this._panelHost.has(t),a=this._panelHost.get(t)??null,o=this.regionForFrame(n),s=this._frameRegion.get(t)??null;i?r===a?o&&s&&o!==s&&this.emit(`move`,{id:t,content:n,window:r}):(this.emit(`detach`,{id:t,content:n,window:a}),this.emit(`attach`,{id:t,content:n,window:r})):this.emit(`attach`,{id:t,content:n,window:r}),this._panelHost.set(t,r),o&&this._frameRegion.set(t,o)}}hostForFrame(e,t){return this.isUnder(t,e)?null:this.floatForFrame(e)}ownedFloatWindows(){let e=[...this._frames.values()];return g.getOpenWindows().filter(t=>!(t instanceof _)&&!this.windowContains(t,this)&&e.some(e=>this.windowContains(t,e)))}windowContains(e,t){for(let n=t;n;n=n.getParentComponent())if(n===e)return!0;return!1}windowContent(e){return e.getComponents().find(t=>!e.isChromeComponent(t))??null}adoptFloat(e){let t=this.windowContent(e);if(!t)return null;if(this.isRegionContainer(t))return t;let n=this.newTabRegion();return e.moveComponent(n),n.moveComponent(t),n}wireRegion(e){let t=this._wiring.get(e);t||(t={dockRegion:new V(e,this.requestSweep),tabWired:!1},this._wiring.set(e,t));let n=e.getLayoutManager();if(this.isTab(e)&&!t.tabWired){let r=n;r.setReorderable(!0);let onEmpty=()=>{this.pruneRegion(e)};r.on(`empty`,onEmpty),r.on(`tabclose`,this.onPanelClosed),r.on(`activate`,this.onPanelFocused),r.on(`detach`,this.onPanelDetached),r.on(`dock`,this.onPanelDocked),t.tabWired=!0}for(let t of e.getComponents())this.isRegionContainer(t)&&this._frames.get(t.getId())!==t&&this.wireRegion(t)}pruneRegion(e){let t=e.getParentComponent();!t||e.getComponents().length>0||t!==this&&(t.removeComponent(e),this.collapseSinglePaneSplit(t),this.closeFloatIfEmpty(t),this.scheduleSweep())}closeFloatIfEmpty(e){g.getOpenWindows().includes(e)&&(this.windowContent(e)||e.requestClose())}collapseSinglePaneSplit(e){if(this.regionKind(e)!==`Split`)return;let t=e.getComponents();if(t.length!==1)return;let n=e.getParentComponent();if(!n)return;let r=n.getComponents().indexOf(e);this.regionKind(n)===`Split`&&n.getLayoutManager().transferPaneSize(e,t[0]),n.moveComponent(t[0],r),n.removeComponent(e)}teardownVanished(e,t){let n=new Set;this.collectRegions(e,n);for(let e of t)this.collectRegions(e,n);for(let[e,t]of this._wiring)n.has(e)||(t.dockRegion.destroy(),this._wiring.delete(e))}collectRegions(e,t){t.add(e);for(let n of e.getComponents())this.isRegionContainer(n)&&this.collectRegions(n,t)}isRegionContainer(e){let t=this.regionKind(e);return t===`Split`||t===`Tab`}isTab(e){return this.regionKind(e)===`Tab`}regionKind(e){let t=e.getLayoutManager();return t?t.getClassName().replace(/^_/,``):``}onPanelClosed=e=>{let t=e.getId();if(this._frames.get(t)!==e)return;let n=this._frameRegion.get(t)??null;this._frames.delete(t),this._panelHost.delete(t),this._frameRegion.delete(t),this.emit(`close`,{id:t,content:e,window:null}),this.scheduleSweep(),this._focusedPanelId===t&&this.scheduleFocusRecompute(n)};failPanel(e,t){this._frames.has(e)&&(this.removePanel(e)||this._frames.delete(e),this.emit(`exception`,{id:e,error:t}))}setFrameBusy(e,t){let n=this._frames.get(e);if(!n)return;let r=this.regionForFrame(n);r&&r.getLayoutManager().setTabBusy(n,t)}onPanelFocused=e=>{let t=e.getId();if(this._frames.get(t)!==e)return;let n=this._frameRegion.get(t);n&&(this._lastActiveRegion=n),this.setFocus(t)};onPanelDetached=e=>{this.scheduleSweep()};onFloatActivated(e){let t=this.activeFrameInFloat(e);t&&this.setFocus(t.getId())}onFloatClosed(e){let t=!1;for(let n of this.framesInWindow(e)){let e=n.getId();this._frames.delete(e),this._panelHost.delete(e),this._frameRegion.delete(e),this.emit(`close`,{id:e,content:n,window:null}),this._focusedPanelId===e&&(t=!0)}this.scheduleSweep(),t&&this.scheduleFocusRecompute(null)}setFocus(e){if(e===this._focusedPanelId)return;if(this._focusedPanelId=e,e===null){this.emit(`focus`,null);return}let t=this._frames.get(e);if(t){let n=this.hostForFrame(t,this.getRootRegion());this.emit(`focus`,{id:e,content:t,window:n})}}scheduleFocusRecompute(t){e.sink.requestAnimationFrame(()=>this.recomputeFocusAfterClose(t))}recomputeFocusAfterClose(e){if(this._frames.size===0){this.setFocus(null);return}if(!e||!this.isTab(e)||e.getComponents().length===0){this.setFocus(null);return}let t=e.getLayoutManager().getActiveContent();this.setFocus(t?t.getId():null)}focusPanel(e){let t=this._frames.get(e);if(!t)return!1;let n=this.regionForFrame(t);if(!n)return!1;let r=n.getLayoutManager().indexOfContent(t);return r<0?!1:(this.floatForFrame(t)?.bringToFront(),n.getLayoutManager().setActiveTabIndex(r),!0)}removePanel(e){let t=this._frames.get(e);if(!t)return!1;let n=this.regionForFrame(t);return n?n.getLayoutManager().closeTab(t):!1}regionForFrame(e){for(let t of this.allTabRegions())if(t.getLayoutManager().indexOfContent(e)>=0)return t;return null}floatForFrame(e){return this.floatWindowsHoldingFrames().find(t=>this.windowContains(t,e))??null}allTabRegions(){let e=[],t=this.getRootRegion();t&&this.collectTabRegions(t,e);for(let t of this.floatWindowsHoldingFrames()){if(t instanceof _){e.push(t);continue}let n=this.windowContent(t);n&&this.collectTabRegions(n,e)}return e}collectTabRegions(e,t){this.isTab(e)&&t.push(e);for(let n of e.getComponents())this.isRegionContainer(n)&&this.collectTabRegions(n,t)}framesInWindow(e){return[...this._frames.values()].filter(t=>this.windowContains(e,t))}activeFrameInFloat(e){let t=null;if(e instanceof _)t=e.getLayoutManager();else{let n=this.windowContent(e),r=[];n&&this.collectTabRegions(n,r),t=r.length>0?r[0].getLayoutManager():null}let n=t?t.getActiveContent():null;return n&&this._frames.get(n.getId())===n?n:null}isUnder(e,t){for(let n=t;n;n=n.getParentComponent())if(n===e)return!0;return!1}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,t){this._listeners.fire(e,t)}destructor(){this._emptyDropOverlay.dispose();for(let e of this._wiring.values())e.dockRegion.destroy();this._wiring.clear(),super.destructor()}},Ee=o(Dock);export{g as AbstractWindow,ie as ButtonGroup,k as Dialog,D as DialogButtons,fe as DialogTitleBar,Ee as Dock,C as DragFeedback,S as DragGhost,x as DragManager,Se as Drawer,z as DropZoneOverlay,ue as Menu,W as Notification,be as NotificationHistoryButton,O as Popover,he as PopupPanel,Te as Rail,J as RailHandle,oe as ReorderIndicator,_ as TabWindow,te as Tooltip,ae as Window};
|
|
2
2
|
//# sourceMappingURL=overlay.es.js.map
|