@esri/calcite-components 5.2.0-next.31 → 5.2.0-next.32
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/cdn/{SZHLLS6U.js → 2ALI4ENC.js} +1 -1
- package/dist/cdn/{VLZTSSQW.js → 34LN2LJS.js} +1 -1
- package/dist/cdn/{2PB3PUJA.js → 34S4GEZH.js} +1 -1
- package/dist/cdn/{YM7MW4ZE.js → 3DWN3FBO.js} +1 -1
- package/dist/cdn/{2H7GADY6.js → 3I2SZUSI.js} +1 -1
- package/dist/cdn/{7ZO4IPZP.js → 3KPB5ZG3.js} +1 -1
- package/dist/cdn/{FRJN2MYE.js → 3NZLINPY.js} +1 -1
- package/dist/cdn/{6TS5ZWQ7.js → 3UEVPCND.js} +1 -1
- package/dist/cdn/{4XIM5ILC.js → 4CJPVAV6.js} +1 -1
- package/dist/cdn/{GL2M4Y47.js → 4OTPD46Y.js} +1 -1
- package/dist/cdn/{B5SOOORA.js → 4PRZO5FL.js} +1 -1
- package/dist/cdn/{OSBBG6HI.js → 4XKPZDWA.js} +1 -1
- package/dist/cdn/{B32RTCOC.js → 5D5KWSRU.js} +1 -1
- package/dist/cdn/{W64C3RNL.js → 5PO5KWY4.js} +1 -1
- package/dist/cdn/{275HTM6C.js → 5T7XXZVM.js} +1 -1
- package/dist/cdn/{XHEIS6D3.js → 5TAEPFKA.js} +1 -1
- package/dist/cdn/{GTTVUYZE.js → 6BBTSWZJ.js} +1 -1
- package/dist/cdn/{K4PSZCHX.js → 6MJGHCHL.js} +1 -1
- package/dist/cdn/{5IPGJCLD.js → 6QTMT3BR.js} +1 -1
- package/dist/cdn/{KCNYR66O.js → 6UAE7TVW.js} +1 -1
- package/dist/cdn/{DSZP76JS.js → 6ZJIHGRE.js} +1 -1
- package/dist/cdn/{H6J4OSM7.js → 7CJ5CM4O.js} +1 -1
- package/dist/cdn/{UYUBR74C.js → 7H6JEAAY.js} +1 -1
- package/dist/cdn/{GSG6GHLN.js → 7HUQTHRG.js} +1 -1
- package/dist/cdn/{EBF72GF4.js → 7NGKKXBY.js} +1 -1
- package/dist/cdn/{HIHNZASH.js → 7NMYOO4C.js} +1 -1
- package/dist/cdn/{G6JEYMUX.js → 7VJQDFM5.js} +1 -1
- package/dist/cdn/{DX4UNEXL.js → 7XLKMGMO.js} +1 -1
- package/dist/cdn/{ILFOOTH6.js → 7YKEDO2W.js} +1 -1
- package/dist/cdn/{B2S475VC.js → A4JYA56A.js} +1 -1
- package/dist/cdn/{IA4HJQWG.js → A5XRC6GV.js} +1 -1
- package/dist/cdn/{EJ4Q77N6.js → AD6N6O57.js} +1 -1
- package/dist/cdn/{TBX6B7NS.js → AGS5VTQ7.js} +1 -1
- package/dist/cdn/{GXI7Q6QU.js → AVIL7OG7.js} +1 -1
- package/dist/cdn/{N3NMWUPR.js → BRLCJYRS.js} +1 -1
- package/dist/cdn/{LPRA3T32.js → BRQQDHKC.js} +1 -1
- package/dist/cdn/{BXZHLQWU.js → BTQF7UHA.js} +1 -1
- package/dist/cdn/{5JJPS3HK.js → BY7EPIAJ.js} +1 -1
- package/dist/cdn/{AGIZ5KII.js → C23B3A4Z.js} +1 -1
- package/dist/cdn/{DGQGNFWC.js → C6GZFOWX.js} +1 -1
- package/dist/cdn/{WQBBH5FE.js → CE6DVH5U.js} +1 -1
- package/dist/cdn/{MIXAK4SX.js → CJ2SUM7M.js} +1 -1
- package/dist/cdn/{CIZGCFP6.js → CLDDWBPJ.js} +1 -1
- package/dist/cdn/{RT3EYWNV.js → COEPTSMJ.js} +1 -1
- package/dist/cdn/{QN35D4ON.js → CWZ74ACK.js} +1 -1
- package/dist/cdn/{CN7PTHEB.js → CZ6EC5N6.js} +1 -1
- package/dist/cdn/{KDQXAYDJ.js → DGP7CLGV.js} +1 -1
- package/dist/cdn/{OMBL5LNO.js → DQ3PCOCG.js} +1 -1
- package/dist/cdn/{IXX32AEN.js → DYNPRZCV.js} +1 -1
- package/dist/cdn/{4DQGC5JY.js → E4NELUHA.js} +1 -1
- package/dist/cdn/{BN3I74NC.js → EEHJN6D5.js} +1 -1
- package/dist/cdn/{B64U7QND.js → EI4TFI4G.js} +1 -1
- package/dist/cdn/{P2S6K7H4.js → EL3MWVTU.js} +1 -1
- package/dist/cdn/{XZZQRQ65.js → EL4KJ476.js} +1 -1
- package/dist/cdn/{JSGT6DCJ.js → EMK36YXI.js} +1 -1
- package/dist/cdn/{ZJHYIAS5.js → F3KQEYE7.js} +1 -1
- package/dist/cdn/{B35DWLY3.js → F6RUE2M2.js} +1 -1
- package/dist/cdn/{6ICS6SMF.js → FIMDUKAT.js} +1 -1
- package/dist/cdn/{XOGICJGV.js → FJGZSA3T.js} +1 -1
- package/dist/cdn/{KMRQDEB2.js → FNFMG4OS.js} +1 -1
- package/dist/cdn/{IRVIPQ7D.js → FRPHXRCY.js} +1 -1
- package/dist/cdn/G7GMQSWX.js +2 -0
- package/dist/cdn/{FAYBZ4NA.js → GBA56KXZ.js} +1 -1
- package/dist/cdn/{YUYGZXBT.js → GINPHCKX.js} +1 -1
- package/dist/cdn/{GVXEBJEW.js → GMGUT6R2.js} +1 -1
- package/dist/cdn/{S6KZLK5M.js → GQZX6FJD.js} +1 -1
- package/dist/cdn/{JFKJED36.js → GSZ5XODZ.js} +1 -1
- package/dist/cdn/{D5VAYHIC.js → H5F5TKSQ.js} +1 -1
- package/dist/cdn/{YLAZZLRL.js → H5JD4SSM.js} +1 -1
- package/dist/cdn/{SKFU336B.js → HBFKOP4O.js} +1 -1
- package/dist/cdn/{XKRS7NPC.js → HKLXMKWW.js} +1 -1
- package/dist/cdn/{2DNDO7OS.js → HLXJR3SQ.js} +1 -1
- package/dist/cdn/{34LKI7AN.js → I2GT4O6W.js} +1 -1
- package/dist/cdn/{DM6ECIF2.js → IELIVXOH.js} +1 -1
- package/dist/cdn/{SIGHPEZ7.js → INB4ESKN.js} +1 -1
- package/dist/cdn/{CU7CJFBQ.js → INPOEQLV.js} +1 -1
- package/dist/cdn/{34T5T2XB.js → INZFPRLC.js} +1 -1
- package/dist/cdn/{O7NYKDOG.js → IOHWA5AF.js} +1 -1
- package/dist/cdn/IZS3M5HV.js +2 -0
- package/dist/cdn/{5XTVVQ6D.js → J5RTSFH2.js} +1 -1
- package/dist/cdn/{Y42AXULS.js → J7GLTPOG.js} +1 -1
- package/dist/cdn/{NEUPWH65.js → JDS4Q3DQ.js} +1 -1
- package/dist/cdn/{XPIK2PAN.js → JPP57EQ2.js} +1 -1
- package/dist/cdn/{5WA7VCUZ.js → JTPCZIUB.js} +1 -1
- package/dist/cdn/{WBRB2MAG.js → JZDX222C.js} +1 -1
- package/dist/cdn/{BAG3AJA4.js → K4BDB233.js} +1 -1
- package/dist/cdn/{LG7NMJYN.js → KDYHO3DX.js} +1 -1
- package/dist/cdn/{3GDCEW2O.js → KHVPREQL.js} +1 -1
- package/dist/cdn/{BXPFZXKS.js → KKFKA36R.js} +1 -1
- package/dist/cdn/{ASAPFCDE.js → KPLMTG7M.js} +1 -1
- package/dist/cdn/{ETODEMQI.js → KTMPQFXM.js} +1 -1
- package/dist/cdn/{2KBNA5VV.js → KYNFC67E.js} +1 -1
- package/dist/cdn/{SRJHFMFP.js → KYYFCGSM.js} +1 -1
- package/dist/cdn/{NQY3QGUP.js → LKHNWV7H.js} +1 -1
- package/dist/cdn/{ZYUHSMKB.js → LM5344X3.js} +1 -1
- package/dist/cdn/{JGCDFFLC.js → LMVGXCUB.js} +1 -1
- package/dist/cdn/{MQDJHBBP.js → M5CAMUJA.js} +1 -1
- package/dist/cdn/{62XMTWRN.js → M7ZWJ3WS.js} +1 -1
- package/dist/cdn/{F3AVUHA6.js → MEVB3IC5.js} +1 -1
- package/dist/cdn/{PUPGDIZ5.js → MO5B4VX7.js} +1 -1
- package/dist/cdn/{DDD32FUC.js → MQZF7GBV.js} +1 -1
- package/dist/cdn/{XNTVXLSV.js → MUQLRK7U.js} +1 -1
- package/dist/cdn/{SAW4B7WT.js → MYV5GGZF.js} +1 -1
- package/dist/cdn/{ZVDNCEBK.js → OSK3U7WF.js} +1 -1
- package/dist/cdn/{H34AXDQR.js → OSV7CFKC.js} +1 -1
- package/dist/cdn/{I7VLBVVR.js → OV4L7Y2U.js} +1 -1
- package/dist/cdn/{5PHIIVOU.js → PCDEZQ5O.js} +1 -1
- package/dist/cdn/{C7ODFPXC.js → PMMNGLYO.js} +1 -1
- package/dist/cdn/{5RP24S6I.js → POIX33V2.js} +1 -1
- package/dist/cdn/{7UDX2IW2.js → PUAN7SC7.js} +1 -1
- package/dist/cdn/{554NDE73.js → QS7YJ7ID.js} +1 -1
- package/dist/cdn/{JGO735CO.js → QYPBF7SX.js} +1 -1
- package/dist/cdn/{RA3ZTRG2.js → RCGGD4VD.js} +1 -1
- package/dist/cdn/{GJYVDQON.js → RIWCMIVC.js} +1 -1
- package/dist/cdn/{GVQVBOVP.js → RQNCEP7V.js} +1 -1
- package/dist/cdn/{2YFHVR5X.js → RX7LNL6H.js} +1 -1
- package/dist/cdn/{ESLOUCHV.js → SBCMJF3D.js} +1 -1
- package/dist/cdn/{SRNYDEOY.js → SIQA2PBC.js} +1 -1
- package/dist/cdn/{HX5G6PEU.js → SP5D6SJ2.js} +1 -1
- package/dist/cdn/{OHEH32P2.js → STG4CABT.js} +1 -1
- package/dist/cdn/{TSZKDMVH.js → SWO5BPAD.js} +1 -1
- package/dist/cdn/{IKBEV42F.js → T6HVZ47J.js} +1 -1
- package/dist/cdn/{OIYAOKXL.js → TBYUWYMH.js} +1 -1
- package/dist/cdn/{QPZWBDRN.js → TCSXUTNB.js} +1 -1
- package/dist/cdn/{SIYPKMOX.js → TE36HTKY.js} +1 -1
- package/dist/cdn/{O3ZI5ANT.js → TFCDXEXM.js} +1 -1
- package/dist/cdn/{5HDPDQLH.js → TNAV4Y7T.js} +1 -1
- package/dist/cdn/{73LRUXQN.js → UIRLGHFP.js} +1 -1
- package/dist/cdn/{HFKP45FH.js → UPBB5BK5.js} +1 -1
- package/dist/cdn/{ZXZ7BCV3.js → US7R2KAH.js} +1 -1
- package/dist/cdn/{JZA7C6P3.js → W7WKPRBR.js} +1 -1
- package/dist/cdn/{U5K5WQQL.js → WJ725XFM.js} +1 -1
- package/dist/cdn/{5WH4GGFT.js → WMKL773C.js} +1 -1
- package/dist/cdn/{6YTP7R4Z.js → X4X4FZMJ.js} +1 -1
- package/dist/cdn/{O6SPXDVK.js → X6FZGCQO.js} +1 -1
- package/dist/cdn/{YA7ARNQJ.js → XCC7RZKY.js} +1 -1
- package/dist/cdn/{WKGZT2PG.js → XF7AZMTR.js} +1 -1
- package/dist/cdn/{P6CXN7P4.js → YFNGK3IC.js} +1 -1
- package/dist/cdn/{IJ5EZCER.js → YJDVSJI7.js} +1 -1
- package/dist/cdn/{S5W6RC6X.js → YQLZIZEE.js} +1 -1
- package/dist/cdn/{ST5SCEF4.js → YRRWAHXD.js} +1 -1
- package/dist/cdn/{URIFYT4D.js → YX2464BY.js} +1 -1
- package/dist/cdn/{GOBF5ORA.js → Z5RHXMLK.js} +1 -1
- package/dist/cdn/{YWGZAN5R.js → ZTWTNJJ6.js} +1 -1
- package/dist/cdn/{OAT4WOFR.js → ZVP3ZHJW.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/components/calcite-shell/customElement.js +75 -5
- package/dist/components/calcite-shell-panel/customElement.d.ts +10 -1
- package/dist/components/calcite-shell-panel/customElement.js +75 -12
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cdn/CXNZFM4C.js +0 -2
- package/dist/cdn/PCWHJTFI.js +0 -2
|
@@ -3,7 +3,8 @@ import { c as customElement } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { keyed } from "lit/directives/keyed.js";
|
|
4
4
|
import { css, html } from "lit";
|
|
5
5
|
import { LitElement, safeClassMap } from "@arcgis/lumina";
|
|
6
|
-
import {
|
|
6
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
|
+
import { s as slotChangeHasAssignedElement, a as slotChangeGetAssignedElements, g as getStylePixelValue } from "../../chunks/dom.js";
|
|
7
8
|
const styles = css`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:absolute;inset:0;display:flex;block-size:100%;inline-size:100%;flex-direction:column;overflow:hidden;border-radius:var(--calcite-shell-corner-radius);box-shadow:var(--calcite-shell-shadow)}.main{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;flex-direction:row;justify-content:space-between;overflow:hidden}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;overflow:auto;justify-content:space-between}.content ::slotted(calcite-panel),.content ::slotted(calcite-flow){flex:1 1 auto;align-self:stretch;max-block-size:unset}.content--behind{position:absolute;inset:0;border-width:0px;z-index:calc(var(--calcite-z-index) - 1);display:initial}.content--non-interactive{pointer-events:none;display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap}::slotted(calcite-shell-panel){inline-size:unset}::slotted(.header .heading){font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-relative-snug);font-weight:var(--calcite-font-weight-normal)}slot[name=panel-start]::slotted(calcite-shell-panel),slot[name=panel-end]::slotted(calcite-shell-panel){position:relative;z-index:calc(var(--calcite-z-index) + 1)}slot[name=panel-end]::slotted(calcite-shell-panel){margin-inline-start:auto}::slotted(calcite-panel),::slotted(calcite-flow){border-width:var(--calcite-border-width-sm);border-color:var(--calcite-shell-border-color, var(--calcite-color-border-3));border-inline-start-width:var(--calcite-border-width-none);border-inline-end-width:var(--calcite-border-width-none);border-style:solid}slot[name=panel-top]::slotted(calcite-shell-panel:not([display-mode^=float])),slot[name=panel-bottom]::slotted(calcite-shell-panel:not([display-mode^=float])){border-color:var(--calcite-shell-border-color, var(--calcite-color-border-3));border-inline-start-width:var(--calcite-border-width-sm);border-inline-end-width:var(--calcite-border-width-sm)}.center-content{display:flex;flex-direction:column;justify-content:space-between;block-size:100%;inline-size:100%;min-inline-size:0}.content-bottom{justify-content:flex-end}::slotted(calcite-shell-panel){flex:none;align-self:stretch}::slotted(calcite-tip-manager){position:absolute;z-index:var(--calcite-z-index-toast);box-sizing:border-box}@keyframes in-up{0%{opacity:0;transform:translate3D(0,5px,0)}to{opacity:1;transform:translateZ(0)}}::slotted(calcite-tip-manager){animation:in-up var(--calcite-internal-animation-timing-slow) ease-in-out;border-radius:.25rem;--tw-shadow: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);inset-block-end:.5rem;inset-inline:var(--calcite-shell-tip-spacing, 26vw)}slot[name=panel-bottom]::slotted(calcite-shell-panel){margin-block-start:auto}slot[name=panel-top]::slotted(calcite-shell-panel){margin-block-end:auto}.position-wrapper{position:absolute;pointer-events:none;inset:0}.main.has-resizable-panel-top ::slotted(calcite-panel){border-block-start:none}.main.has-resizable-panel-bottom ::slotted(calcite-panel){border-block-end:none}.main.has-action-bar-position-panel ::slotted(calcite-panel){border:0}:host([hidden]){display:none}[hidden]{display:none}`;
|
|
8
9
|
const CSS = {
|
|
9
10
|
main: "main",
|
|
@@ -33,6 +34,11 @@ const panelSlots = ["panel-start", "panel-end", "panel-top", "panel-bottom"];
|
|
|
33
34
|
class Shell extends LitElement {
|
|
34
35
|
constructor() {
|
|
35
36
|
super();
|
|
37
|
+
this.defaultSlotRef = createRef();
|
|
38
|
+
this.panelBottomSlotRef = createRef();
|
|
39
|
+
this.panelEndSlotRef = createRef();
|
|
40
|
+
this.panelStartSlotRef = createRef();
|
|
41
|
+
this.panelTopSlotRef = createRef();
|
|
36
42
|
this.panelSlotState = {
|
|
37
43
|
"panel-start": { elements: [], resizable: false },
|
|
38
44
|
"panel-end": { elements: [], resizable: false },
|
|
@@ -108,9 +114,70 @@ class Shell extends LitElement {
|
|
|
108
114
|
el.embedded = true;
|
|
109
115
|
});
|
|
110
116
|
}
|
|
117
|
+
configurePanels(panels, layout, position) {
|
|
118
|
+
panels.forEach((panel) => {
|
|
119
|
+
const sizingPanel = panel;
|
|
120
|
+
panel.layout = layout;
|
|
121
|
+
panel.position = position;
|
|
122
|
+
sizingPanel.shellSizingDataProvider = (axis) => this.getShellPanelSizingData(panel, axis);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
getDefaultSlotMinSize(axis) {
|
|
126
|
+
return this.defaultSlotRef.value?.assignedElements({ flatten: true }).reduce((total, element) => {
|
|
127
|
+
const computedStyle = window.getComputedStyle(element);
|
|
128
|
+
return axis === "inline" ? total + getStylePixelValue(computedStyle.borderInlineStartWidth) + getStylePixelValue(computedStyle.borderInlineEndWidth) : total + getStylePixelValue(computedStyle.borderBlockStartWidth) + getStylePixelValue(computedStyle.borderBlockEndWidth);
|
|
129
|
+
}, 0) ?? 0;
|
|
130
|
+
}
|
|
131
|
+
getDefaultSlotBounds() {
|
|
132
|
+
const defaultSlotElements = this.defaultSlotRef.value?.assignedElements({ flatten: true }) ?? [];
|
|
133
|
+
if (!defaultSlotElements.length) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return defaultSlotElements.reduce((bounds, element) => {
|
|
137
|
+
const rect = element.getBoundingClientRect();
|
|
138
|
+
return bounds ? {
|
|
139
|
+
bottom: Math.max(bounds.bottom, rect.bottom),
|
|
140
|
+
left: Math.min(bounds.left, rect.left),
|
|
141
|
+
right: Math.max(bounds.right, rect.right),
|
|
142
|
+
top: Math.min(bounds.top, rect.top)
|
|
143
|
+
} : {
|
|
144
|
+
bottom: rect.bottom,
|
|
145
|
+
left: rect.left,
|
|
146
|
+
right: rect.right,
|
|
147
|
+
top: rect.top
|
|
148
|
+
};
|
|
149
|
+
}, null);
|
|
150
|
+
}
|
|
151
|
+
getShellPanelSizingData(panel, axis) {
|
|
152
|
+
const panelLayoutContainer = panel.assignedSlot?.parentElement;
|
|
153
|
+
if (!panelLayoutContainer) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
const containerRect = panelLayoutContainer.getBoundingClientRect();
|
|
157
|
+
const defaultSlotRect = this.getDefaultSlotBounds();
|
|
158
|
+
if (!defaultSlotRect) {
|
|
159
|
+
return {
|
|
160
|
+
availableSize: axis === "inline" ? containerRect.width : containerRect.height
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const defaultSlotMinSize = this.getDefaultSlotMinSize(axis);
|
|
164
|
+
const isRTL = window.getComputedStyle(this).direction === "rtl";
|
|
165
|
+
let availableOccupiedSize;
|
|
166
|
+
if (axis === "inline") {
|
|
167
|
+
const isStart = panel.position === "start";
|
|
168
|
+
availableOccupiedSize = isRTL ? isStart ? containerRect.right - defaultSlotRect.left : defaultSlotRect.right - containerRect.left : isStart ? defaultSlotRect.right - containerRect.left : containerRect.right - defaultSlotRect.left;
|
|
169
|
+
} else {
|
|
170
|
+
availableOccupiedSize = panel.position === "start" ? defaultSlotRect.bottom - containerRect.top : containerRect.bottom - defaultSlotRect.top;
|
|
171
|
+
}
|
|
172
|
+
const availableSize = Math.max(Math.floor(availableOccupiedSize) - Math.ceil(defaultSlotMinSize), 0);
|
|
173
|
+
return {
|
|
174
|
+
availableSize
|
|
175
|
+
};
|
|
176
|
+
}
|
|
111
177
|
handlePanelTopChange(event) {
|
|
112
178
|
const panelElements = slotChangeGetAssignedElements(event).filter((el) => el?.matches("calcite-shell-panel"));
|
|
113
179
|
this.hasPanelTop = slotChangeHasAssignedElement(event);
|
|
180
|
+
this.configurePanels(panelElements, "horizontal", "start");
|
|
114
181
|
panelElements.forEach((el) => {
|
|
115
182
|
el.layout = "horizontal";
|
|
116
183
|
el.position = "start";
|
|
@@ -120,6 +187,7 @@ class Shell extends LitElement {
|
|
|
120
187
|
handlePanelBottomChange(event) {
|
|
121
188
|
const panelElements = slotChangeGetAssignedElements(event).filter((el) => el?.matches("calcite-shell-panel"));
|
|
122
189
|
this.hasPanelBottom = slotChangeHasAssignedElement(event);
|
|
190
|
+
this.configurePanels(panelElements, "horizontal", "end");
|
|
123
191
|
panelElements.forEach((el) => {
|
|
124
192
|
el.layout = "horizontal";
|
|
125
193
|
el.position = "end";
|
|
@@ -128,6 +196,7 @@ class Shell extends LitElement {
|
|
|
128
196
|
}
|
|
129
197
|
handlePanelStartChange(event) {
|
|
130
198
|
const panelElements = slotChangeGetAssignedElements(event).filter((el) => el?.matches("calcite-shell-panel"));
|
|
199
|
+
this.configurePanels(panelElements, "vertical", "start");
|
|
131
200
|
panelElements.forEach((el) => {
|
|
132
201
|
el.layout = "vertical";
|
|
133
202
|
el.position = "start";
|
|
@@ -136,6 +205,7 @@ class Shell extends LitElement {
|
|
|
136
205
|
}
|
|
137
206
|
handlePanelEndChange(event) {
|
|
138
207
|
const panelElements = slotChangeGetAssignedElements(event).filter((el) => el?.matches("calcite-shell-panel"));
|
|
208
|
+
this.configurePanels(panelElements, "vertical", "end");
|
|
139
209
|
panelElements.forEach((el) => {
|
|
140
210
|
el.layout = "vertical";
|
|
141
211
|
el.position = "end";
|
|
@@ -180,10 +250,10 @@ class Shell extends LitElement {
|
|
|
180
250
|
}
|
|
181
251
|
renderContent() {
|
|
182
252
|
const { panelIsResizing } = this;
|
|
183
|
-
const defaultSlotNode = keyed("default-slot", html`<slot></slot>`);
|
|
253
|
+
const defaultSlotNode = keyed("default-slot", html`<slot ${ref(this.defaultSlotRef)}></slot>`);
|
|
184
254
|
const defaultSlotContainerNode = panelIsResizing ? html`<div class=${safeClassMap(CSS.contentNonInteractive)}>${defaultSlotNode}</div>` : defaultSlotNode;
|
|
185
|
-
const panelBottomSlotNode = keyed("panel-bottom-slot", html`<slot name=${SLOTS.panelBottom} @slotchange=${this.handlePanelBottomChange}></slot>`);
|
|
186
|
-
const panelTopSlotNode = keyed("panel-top-slot", html`<slot name=${SLOTS.panelTop} @slotchange=${this.handlePanelTopChange}></slot>`);
|
|
255
|
+
const panelBottomSlotNode = keyed("panel-bottom-slot", html`<slot name=${SLOTS.panelBottom} @slotchange=${this.handlePanelBottomChange} ${ref(this.panelBottomSlotRef)}></slot>`);
|
|
256
|
+
const panelTopSlotNode = keyed("panel-top-slot", html`<slot name=${SLOTS.panelTop} @slotchange=${this.handlePanelTopChange} ${ref(this.panelTopSlotRef)}></slot>`);
|
|
187
257
|
const contentContainerKey = "content-container";
|
|
188
258
|
const content = this.contentBehind ? [
|
|
189
259
|
keyed(contentContainerKey, html`<div class=${safeClassMap({
|
|
@@ -205,7 +275,7 @@ class Shell extends LitElement {
|
|
|
205
275
|
[CSS.hasActionBarPositionPanel]: this.hasActionBarPositionPanel,
|
|
206
276
|
[CSS.hasResizablePanelBottom]: this.hasResizablePanelBottom,
|
|
207
277
|
[CSS.hasResizablePanelTop]: this.hasResizablePanelTop
|
|
208
|
-
})}><slot name=${SLOTS.panelStart} @slotchange=${this.handlePanelStartChange}></slot>${this.renderContent()}<slot name=${SLOTS.panelEnd} @slotchange=${this.handlePanelEndChange}></slot></div>`;
|
|
278
|
+
})}><slot name=${SLOTS.panelStart} @slotchange=${this.handlePanelStartChange} ${ref(this.panelStartSlotRef)}></slot>${this.renderContent()}<slot name=${SLOTS.panelEnd} @slotchange=${this.handlePanelEndChange} ${ref(this.panelEndSlotRef)}></slot></div>`;
|
|
209
279
|
}
|
|
210
280
|
renderPositionedSlots() {
|
|
211
281
|
return html`<div class=${safeClassMap(CSS.positionedSlotWrapper)}>${this.renderAlerts()}${this.renderDialogs()}${this.renderSheets()}</div>`;
|
|
@@ -78,6 +78,8 @@ export abstract class ShellPanel extends LitElement {
|
|
|
78
78
|
* @default false
|
|
79
79
|
*/
|
|
80
80
|
accessor resizable: boolean;
|
|
81
|
+
/** @internal */
|
|
82
|
+
accessor shellSizingDataProvider: ShellSizingDataProvider | undefined;
|
|
81
83
|
/** Specifies the component's width. */
|
|
82
84
|
accessor width: Extract<Width, Scale> | undefined;
|
|
83
85
|
/**
|
|
@@ -107,4 +109,11 @@ export abstract class ShellPanel extends LitElement {
|
|
|
107
109
|
calciteShellPanelCollapse: ShellPanel["calciteShellPanelCollapse"]["detail"];
|
|
108
110
|
calciteShellPanelExpand: ShellPanel["calciteShellPanelExpand"]["detail"];
|
|
109
111
|
};
|
|
110
|
-
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @param axis */
|
|
115
|
+
export type ShellSizingDataProvider = (axis: "inline" | "block") => ShellPanelSizingData | null;
|
|
116
|
+
|
|
117
|
+
export type ShellPanelSizingData = {
|
|
118
|
+
availableSize: number;
|
|
119
|
+
};
|
|
@@ -40,6 +40,7 @@ class ShellPanel extends LitElement {
|
|
|
40
40
|
super();
|
|
41
41
|
this.direction = useDirection();
|
|
42
42
|
this.resizeHandleRef = createRef();
|
|
43
|
+
this.actionBars = [];
|
|
43
44
|
this.actionBarContainerResizeObserver = createObserver("resize", () => this.updateActionBarSize());
|
|
44
45
|
this.handleActionBarExpand = () => {
|
|
45
46
|
this.isActionBarExpanded = true;
|
|
@@ -48,12 +49,13 @@ class ShellPanel extends LitElement {
|
|
|
48
49
|
this.isActionBarExpanded = false;
|
|
49
50
|
};
|
|
50
51
|
this.contentRef = createRef();
|
|
52
|
+
this.containerRef = createRef();
|
|
51
53
|
this.messages = useT9n();
|
|
52
54
|
this.sizeOverride = useSizeOverride({
|
|
53
55
|
targetElement: this.contentRef,
|
|
54
56
|
getBounds: () => ({
|
|
55
|
-
inline: { min: this.resizeValues.minInlineSize, max: this.
|
|
56
|
-
block: { min: this.resizeValues.minBlockSize, max: this.
|
|
57
|
+
inline: { min: this.resizeValues.minInlineSize, max: this.getMaxInlineSize() },
|
|
58
|
+
block: { min: this.resizeValues.minBlockSize, max: this.getMaxBlockSize() }
|
|
57
59
|
}),
|
|
58
60
|
onResize: (resizeValues) => {
|
|
59
61
|
this.resizeValues = resizeValues;
|
|
@@ -85,7 +87,7 @@ class ShellPanel extends LitElement {
|
|
|
85
87
|
this.listen("calciteActionBarCollapse", this.handleActionBarCollapseEvent);
|
|
86
88
|
}
|
|
87
89
|
static {
|
|
88
|
-
this.properties = { resizeValues: [16, {}, { state: true }], isActionBarExpanded: [16, {}, { state: true }], hasHeader: [16, {}, { state: true }], actionBarPosition: [3, {}, { reflect: true }], collapsed: [7, {}, { reflect: true, type: Boolean }], displayMode: [3, {}, { reflect: true }], heightScale: [3, {}, { reflect: true }], layout: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], position: [3, {}, { reflect: true }], resizable: [7, {}, { reflect: true, type: Boolean }], height: [3, {}, { reflect: true }], widthScale: [3, {}, { reflect: true }], width: [3, {}, { reflect: true }] };
|
|
90
|
+
this.properties = { resizeValues: [16, {}, { state: true }], isActionBarExpanded: [16, {}, { state: true }], hasHeader: [16, {}, { state: true }], actionBarPosition: [3, {}, { reflect: true }], collapsed: [7, {}, { reflect: true, type: Boolean }], displayMode: [3, {}, { reflect: true }], heightScale: [3, {}, { reflect: true }], layout: [3, {}, { reflect: true }], messageOverrides: [0, {}, { attribute: false }], position: [3, {}, { reflect: true }], resizable: [7, {}, { reflect: true, type: Boolean }], shellSizingDataProvider: [0, {}, { attribute: false }], height: [3, {}, { reflect: true }], widthScale: [3, {}, { reflect: true }], width: [3, {}, { reflect: true }] };
|
|
89
91
|
}
|
|
90
92
|
static {
|
|
91
93
|
this.styles = [styles, styles$1];
|
|
@@ -201,20 +203,85 @@ class ShellPanel extends LitElement {
|
|
|
201
203
|
this.interaction?.unset();
|
|
202
204
|
}
|
|
203
205
|
updateResizeValues() {
|
|
204
|
-
const { contentRef } = this;
|
|
206
|
+
const { contentRef, layout } = this;
|
|
205
207
|
if (!contentRef.value) {
|
|
206
208
|
return;
|
|
207
209
|
}
|
|
208
210
|
const computedStyle = window.getComputedStyle(contentRef.value);
|
|
211
|
+
const computedMaxInlineSize = getStylePixelValue(computedStyle.maxInlineSize) || window.innerWidth;
|
|
212
|
+
const computedMaxBlockSize = getStylePixelValue(computedStyle.maxBlockSize) || window.innerHeight;
|
|
213
|
+
const availableInlineSize = layout === "vertical" ? this.getAvailableInlineSize() : null;
|
|
214
|
+
const availableBlockSize = layout === "horizontal" ? this.getAvailableBlockSize() : null;
|
|
209
215
|
this.resizeValues = {
|
|
210
216
|
inlineSize: getStylePixelValue(computedStyle.inlineSize),
|
|
211
217
|
blockSize: getStylePixelValue(computedStyle.blockSize),
|
|
212
218
|
minInlineSize: getStylePixelValue(computedStyle.minInlineSize),
|
|
213
219
|
minBlockSize: getStylePixelValue(computedStyle.minBlockSize),
|
|
214
|
-
maxInlineSize:
|
|
215
|
-
maxBlockSize:
|
|
220
|
+
maxInlineSize: availableInlineSize === null ? computedMaxInlineSize : Math.min(computedMaxInlineSize, availableInlineSize),
|
|
221
|
+
maxBlockSize: availableBlockSize === null ? computedMaxBlockSize : Math.min(computedMaxBlockSize, availableBlockSize)
|
|
216
222
|
};
|
|
217
223
|
}
|
|
224
|
+
getAvailableBlockSize() {
|
|
225
|
+
return this.getAvailableSize("block");
|
|
226
|
+
}
|
|
227
|
+
getAvailableInlineSize() {
|
|
228
|
+
return this.getAvailableSize("inline");
|
|
229
|
+
}
|
|
230
|
+
getAvailableSize(axis) {
|
|
231
|
+
const dimension = axis === "inline" ? "width" : "height";
|
|
232
|
+
const shellSizingData = this.shellSizingDataProvider?.(axis);
|
|
233
|
+
const actionBarContainerSize = this.actionBarContainerEl?.getBoundingClientRect()[dimension] ?? 0;
|
|
234
|
+
const actionBarSize = Math.max(actionBarContainerSize, this.actionBars.reduce((total, actionBar) => total + actionBar.getBoundingClientRect()[dimension], 0));
|
|
235
|
+
if (!shellSizingData) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
const { availableSize } = shellSizingData;
|
|
239
|
+
const containerSpacingSize = this.getContainerSpacingSize(axis);
|
|
240
|
+
const contentSpacingSize = this.getContentSpacingSize(axis);
|
|
241
|
+
return Math.max(Math.floor(availableSize) - Math.ceil(actionBarSize) - Math.ceil(containerSpacingSize) - Math.ceil(contentSpacingSize), 0);
|
|
242
|
+
}
|
|
243
|
+
getContentSpacingSize(axis) {
|
|
244
|
+
const content = this.contentRef.value;
|
|
245
|
+
if (!content) {
|
|
246
|
+
return 0;
|
|
247
|
+
}
|
|
248
|
+
const computedStyle = window.getComputedStyle(content);
|
|
249
|
+
return axis === "inline" ? getStylePixelValue(computedStyle.marginInlineStart) + getStylePixelValue(computedStyle.marginInlineEnd) + getStylePixelValue(computedStyle.borderInlineStartWidth) + getStylePixelValue(computedStyle.borderInlineEndWidth) : getStylePixelValue(computedStyle.marginBlockStart) + getStylePixelValue(computedStyle.marginBlockEnd) + getStylePixelValue(computedStyle.borderBlockStartWidth) + getStylePixelValue(computedStyle.borderBlockEndWidth);
|
|
250
|
+
}
|
|
251
|
+
getContainerSpacingSize(axis) {
|
|
252
|
+
const container = this.containerRef.value;
|
|
253
|
+
if (!container) {
|
|
254
|
+
return 0;
|
|
255
|
+
}
|
|
256
|
+
const computedStyle = window.getComputedStyle(container);
|
|
257
|
+
return axis === "inline" ? getStylePixelValue(computedStyle.marginInlineStart) + getStylePixelValue(computedStyle.marginInlineEnd) + getStylePixelValue(computedStyle.borderInlineStartWidth) + getStylePixelValue(computedStyle.borderInlineEndWidth) : getStylePixelValue(computedStyle.marginBlockStart) + getStylePixelValue(computedStyle.marginBlockEnd) + getStylePixelValue(computedStyle.borderBlockStartWidth) + getStylePixelValue(computedStyle.borderBlockEndWidth);
|
|
258
|
+
}
|
|
259
|
+
getMaxBlockSize() {
|
|
260
|
+
const { layout, contentRef } = this;
|
|
261
|
+
if (layout !== "horizontal") {
|
|
262
|
+
return this.resizeValues.maxBlockSize;
|
|
263
|
+
}
|
|
264
|
+
if (!contentRef.value) {
|
|
265
|
+
return this.resizeValues.maxBlockSize;
|
|
266
|
+
}
|
|
267
|
+
const computedStyle = window.getComputedStyle(contentRef.value);
|
|
268
|
+
const cssMax = getStylePixelValue(computedStyle.maxBlockSize) || window.innerHeight;
|
|
269
|
+
const availableBlockSize = this.getAvailableBlockSize();
|
|
270
|
+
return availableBlockSize === null ? cssMax : Math.min(cssMax, availableBlockSize);
|
|
271
|
+
}
|
|
272
|
+
getMaxInlineSize() {
|
|
273
|
+
const { layout, contentRef } = this;
|
|
274
|
+
if (layout !== "vertical") {
|
|
275
|
+
return this.resizeValues.maxInlineSize;
|
|
276
|
+
}
|
|
277
|
+
if (!contentRef.value) {
|
|
278
|
+
return this.resizeValues.maxInlineSize;
|
|
279
|
+
}
|
|
280
|
+
const computedStyle = window.getComputedStyle(contentRef.value);
|
|
281
|
+
const cssMax = getStylePixelValue(computedStyle.maxInlineSize) || window.innerWidth;
|
|
282
|
+
const availableInlineSize = this.getAvailableInlineSize();
|
|
283
|
+
return availableInlineSize === null ? cssMax : Math.min(cssMax, availableInlineSize);
|
|
284
|
+
}
|
|
218
285
|
async refreshResize() {
|
|
219
286
|
await this.componentOnReady();
|
|
220
287
|
await this.updateComplete;
|
|
@@ -230,7 +297,6 @@ class ShellPanel extends LitElement {
|
|
|
230
297
|
}
|
|
231
298
|
const rtl = this.direction === "rtl";
|
|
232
299
|
const restrictSizeMin = this.resizeValues.minInlineSize === null || this.resizeValues.minBlockSize === null ? void 0 : { width: this.resizeValues.minInlineSize, height: this.resizeValues.minBlockSize };
|
|
233
|
-
const restrictSizeMax = this.resizeValues.maxInlineSize === null || this.resizeValues.maxBlockSize === null ? void 0 : { width: this.resizeValues.maxInlineSize, height: this.resizeValues.maxBlockSize };
|
|
234
300
|
this.interaction = interact(contentRef.value, { context: el.ownerDocument }).resizable({
|
|
235
301
|
edges: {
|
|
236
302
|
top: position === "end" && layout === "horizontal" ? resizeHandle : false,
|
|
@@ -238,7 +304,7 @@ class ShellPanel extends LitElement {
|
|
|
238
304
|
bottom: position === "start" && layout === "horizontal" ? resizeHandle : false,
|
|
239
305
|
left: position === (rtl ? "start" : "end") && layout === "vertical" ? resizeHandle : false
|
|
240
306
|
},
|
|
241
|
-
modifiers: [interact.modifiers.restrictSize({ min: restrictSizeMin
|
|
307
|
+
modifiers: [interact.modifiers.restrictSize({ min: restrictSizeMin })],
|
|
242
308
|
listeners: {
|
|
243
309
|
resizestart: () => {
|
|
244
310
|
this.calciteInternalShellPanelResizeStart.emit();
|
|
@@ -344,10 +410,7 @@ class ShellPanel extends LitElement {
|
|
|
344
410
|
if (effectivePosition === "end" || effectivePosition === "bottom") {
|
|
345
411
|
mainNodes.reverse();
|
|
346
412
|
}
|
|
347
|
-
return html`<div class=${safeClassMap({
|
|
348
|
-
[CSS.container]: true,
|
|
349
|
-
[CSS.floatAll]: displayMode === "float-all"
|
|
350
|
-
})}>${mainNodes}</div>`;
|
|
413
|
+
return html`<div class=${safeClassMap({ [CSS.container]: true, [CSS.floatAll]: displayMode === "float-all" })} ${ref(this.containerRef)}>${mainNodes}</div>`;
|
|
351
414
|
}
|
|
352
415
|
}
|
|
353
416
|
customElement("calcite-shell-panel", ShellPanel);
|