@rcarls/rc-splitter 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/CHANGELOG.md +116 -0
- package/README.md +22 -14
- package/dist/custom-elements.json +89 -8
- package/dist/rc-splitter-_P5HsZI9.js +437 -0
- package/dist/rc-splitter-_P5HsZI9.js.map +1 -0
- package/dist/rc-splitter-define.js +3 -1
- package/dist/rc-splitter-define.js.map +1 -1
- package/dist/rc-splitter.js +3 -2
- package/dist/types/packages/rc-splitter/src/rc-splitter.d.ts +45 -8
- package/package.json +2 -2
- package/dist/rc-splitter-CJTLxYi3.js +0 -608
- package/dist/rc-splitter-CJTLxYi3.js.map +0 -1
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { css as k, LitElement as M, html as m, nothing as $ } from "lit";
|
|
2
|
+
import { property as l, state as _, query as V, queryAssignedElements as S } from "lit/decorators.js";
|
|
3
|
+
import { MessagesController as w, DragGestureController as C, FlowController as A, renderedOrientation as y, resolveFlow as p, numberFormat as b, physicalAxis as d, isReversed as z, logicalDelta as g, findNextSnapIndex as B, findNearestSnapIndex as E, cssZoom as u, parseCssTime as P, keyNavigation as R, keyInteraction as T, bidiIsolate as x } from "@rcarls/rc-common";
|
|
4
|
+
const N = k`*,:before,:after{box-sizing:border-box}:host{--rc-splitter-separator-size:6px;flex-direction:row;align-items:stretch;display:flex;position:relative}:host([orientation=vertical]){flex-direction:column}:host([hidden]){display:none}:host([data-interaction-mode=keyboard]):focus-within{outline:auto}::slotted(*){width:100%;height:100%}#separator{flex:0 0 var(--rc-splitter-separator-size,6px);background-color:var(--rc-splitter-separator-color,color-mix(in srgb, ButtonBorder 35%, Canvas 65%));border-inline-start:var(--rc-splitter-separator-border-inline-start,var(--rc-splitter-keyline,1px solid ButtonBorder));border-inline-end:var(--rc-splitter-separator-border-inline-end,var(--rc-splitter-keyline,1px solid ButtonBorder));z-index:1;flex-direction:column;grid-column:separator;justify-content:center;display:flex;position:relative;:host([orientation=vertical]) &{border-inline-start:unset;border-inline-end:unset;border-block-start:var(--rc-splitter-separator-border-block-start,var(--rc-splitter-keyline,1px solid ButtonBorder));border-block-end:var(--rc-splitter-separator-border-block-end,var(--rc-splitter-keyline,1px solid ButtonBorder));flex-direction:row}}#collapse-button{inline-size:var(--rc-splitter-collapse-button-size,20px);block-size:var(--rc-splitter-collapse-button-size,20px);border:1px solid var(--rc-splitter-collapse-button-border,ButtonBorder);background:var(--rc-splitter-collapse-button-bg,Canvas);color:var(--rc-splitter-collapse-button-color,ButtonText);cursor:pointer;border-radius:50%;justify-content:center;align-items:center;margin-inline:auto;padding:0;line-height:1;display:flex;position:absolute;inset-block-start:var(--rc-splitter-collapse-button-offset,8px);inset-inline:0;&:hover{background:var(--rc-splitter-collapse-button-hover-bg,ButtonFace)}&:focus-visible{outline-offset:2px;outline:2px solid highlight}:host([orientation=vertical]) &{inset-block:0;inset-inline:var(--rc-splitter-collapse-button-offset,8px) auto;margin-block:auto;margin-inline:0}}#separator-handle{touch-action:none;inline-size:100%;block-size:var(--rc-splitter-separator-handle-size,100%);justify-content:center;align-items:center;display:flex;position:relative;&:before{content:"";inline-size:var(--rc-splitter-handle-thickness,4px);background-color:var(--rc-splitter-handle-fill,transparent);background-image:var(--rc-splitter-handle-pattern,radial-gradient(circle 1px at 50% calc(50% - 5px), var(--rc-splitter-handle-color,ButtonBorder) 100%, transparent 100%), radial-gradient(circle 1px at 50% 50%, var(--rc-splitter-handle-color,ButtonBorder) 100%, transparent 100%), radial-gradient(circle 1px at 50% calc(50% + 5px), var(--rc-splitter-handle-color,ButtonBorder) 100%, transparent 100%));border-radius:var(--rc-splitter-handle-border-radius,0);pointer-events:none;block-size:100%;transition:background-color var(--rc-splitter-handle-transition,0s);display:block}&:hover:before{background-color:var(--rc-splitter-handle-hover-fill,transparent)}&:after{content:"";pointer-events:none;border-radius:50%;block-size:24px;inline-size:24px;margin:auto;position:absolute;inset:0}:host([orientation=vertical]) &{inline-size:var(--rc-splitter-separator-handle-size,100%);block-size:100%;&:before{inline-size:100%;block-size:var(--rc-splitter-handle-thickness,4px)}}&[data-bar=vertical]{cursor:col-resize}&[data-bar=horizontal]{cursor:row-resize;&:before{background-image:var(--rc-splitter-handle-pattern,radial-gradient(circle 1px at calc(50% - 5px) 50%, var(--rc-splitter-handle-color,ButtonBorder) 100%, transparent 100%), radial-gradient(circle 1px at 50% 50%, var(--rc-splitter-handle-color,ButtonBorder) 100%, transparent 100%), radial-gradient(circle 1px at calc(50% + 5px) 50%, var(--rc-splitter-handle-color,ButtonBorder) 100%, transparent 100%))}}:host([fixed]) &{pointer-events:none}}@media (any-pointer:coarse){#separator-handle:after{pointer-events:auto}}#primary,#secondary{overflow:hidden}#primary{flex:none;grid-column:primary}#secondary{flex:1;grid-column:secondary}`;
|
|
5
|
+
var I = Object.defineProperty, U = Object.getOwnPropertyDescriptor, r = (h, e, t, i) => {
|
|
6
|
+
for (var s = i > 1 ? void 0 : i ? U(e, t) : e, n = h.length - 1, o; n >= 0; n--)
|
|
7
|
+
(o = h[n]) && (s = (i ? o(e, t, s) : o(s)) || s);
|
|
8
|
+
return i && s && I(e, t, s), s;
|
|
9
|
+
};
|
|
10
|
+
const D = {
|
|
11
|
+
left: "M 7 1 L 3 5 L 7 9",
|
|
12
|
+
right: "M 3 1 L 7 5 L 3 9",
|
|
13
|
+
up: "M 1 7 L 5 3 L 9 7",
|
|
14
|
+
down: "M 1 3 L 5 7 L 9 3"
|
|
15
|
+
}, O = {
|
|
16
|
+
left: "right",
|
|
17
|
+
right: "left",
|
|
18
|
+
up: "down",
|
|
19
|
+
down: "up"
|
|
20
|
+
};
|
|
21
|
+
function F(h, e) {
|
|
22
|
+
const t = z(h, e);
|
|
23
|
+
return d(h, e) === "x" ? t ? "right" : "left" : t ? "down" : "up";
|
|
24
|
+
}
|
|
25
|
+
const L = 24, G = 200, H = "cubic-bezier(0.4, 0, 0.2, 1)", K = Object.freeze({
|
|
26
|
+
label: "Splitter",
|
|
27
|
+
expand: (h) => `Expand ${x(h)}`,
|
|
28
|
+
collapse: (h) => `Collapse ${x(h)}`
|
|
29
|
+
}), f = class f extends M {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments), this._messages = new w(
|
|
32
|
+
this,
|
|
33
|
+
"rc-splitter",
|
|
34
|
+
K,
|
|
35
|
+
{
|
|
36
|
+
overrides: () => this.messages
|
|
37
|
+
}
|
|
38
|
+
), this.orientation = "horizontal", this.mode = "length", this.step = 1, this.min = 0, this.max = void 0, this._valueInitialized = !1, this._value = 0, this.fixed = !1, this.collapsible = !1, this.snapPoints = "", this.swipeVelocity = 500, this._minValue = 0, this._maxValue = 0, this._lastValue = 0, this._initialMax = 0, this._gestureStartValue = 0, this._gestureRestoreValue = 0, this._activeSnapAnimation = null, this._reducedMotion = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null, this._gesture = new C(this, {
|
|
39
|
+
target: () => this._$separatorHandle,
|
|
40
|
+
axis: this.orientation === "horizontal" ? "x" : "y",
|
|
41
|
+
focusOnStart: !0,
|
|
42
|
+
onStart: (e) => this._onGestureStart(e),
|
|
43
|
+
onMove: (e) => this._onGestureMove(e),
|
|
44
|
+
onEnd: (e) => this._onGestureEnd(e),
|
|
45
|
+
onCancel: () => this._onGestureCancel()
|
|
46
|
+
}), this._resizeObserver = new ResizeObserver(() => this._onResize()), this._flow = new A(this);
|
|
47
|
+
}
|
|
48
|
+
set value(e) {
|
|
49
|
+
const t = this._hostValue;
|
|
50
|
+
this._hostValue = e, this._initialMax && this._setValue(e, !1), this.requestUpdate("value", t);
|
|
51
|
+
}
|
|
52
|
+
/** The current splitter value, corresponding to the separator position, in either pixels or percentage points depending on `mode`. */
|
|
53
|
+
get value() {
|
|
54
|
+
return this._value;
|
|
55
|
+
}
|
|
56
|
+
set defaultValue(e) {
|
|
57
|
+
const t = this._defaultValue;
|
|
58
|
+
this._defaultValue = e, !this._initialMax && this._hostValue === void 0 && e !== void 0 && this._setValue(e, !1), this.requestUpdate("defaultValue", t);
|
|
59
|
+
}
|
|
60
|
+
/** Initial uncontrolled splitter value. */
|
|
61
|
+
get defaultValue() {
|
|
62
|
+
return this._defaultValue;
|
|
63
|
+
}
|
|
64
|
+
get _effectiveMin() {
|
|
65
|
+
return Math.max(this._minValue, this.min);
|
|
66
|
+
}
|
|
67
|
+
get _effectiveMax() {
|
|
68
|
+
return Math.min(this._maxValue, this.max ?? this._maxValue);
|
|
69
|
+
}
|
|
70
|
+
/** True once initialized and the primary pane is at its effective minimum. */
|
|
71
|
+
get _isCollapsed() {
|
|
72
|
+
return this._initialMax > 0 && this.value <= this._effectiveMin;
|
|
73
|
+
}
|
|
74
|
+
_toggleCollapse() {
|
|
75
|
+
this._setUserValue(this._isCollapsed ? this._lastValue : this._effectiveMin);
|
|
76
|
+
}
|
|
77
|
+
_onCollapseButtonClick() {
|
|
78
|
+
this._toggleCollapse();
|
|
79
|
+
}
|
|
80
|
+
_onCollapseKeydown(e) {
|
|
81
|
+
if (!this.collapsible || this.fixed || !e.ctrlKey && !e.metaKey)
|
|
82
|
+
return;
|
|
83
|
+
(y(this.orientation, p(this)) === "horizontal" ? e.key === "ArrowLeft" || e.key === "ArrowRight" : e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), e.stopImmediatePropagation(), this._toggleCollapse());
|
|
84
|
+
}
|
|
85
|
+
get _collapseButtonIcon() {
|
|
86
|
+
const e = F(this._paneAxis, this._flow.flow), t = this._isCollapsed ? O[e] : e, i = D[t];
|
|
87
|
+
return m`<svg
|
|
88
|
+
data-points=${t}
|
|
89
|
+
aria-hidden="true"
|
|
90
|
+
viewBox="0 0 10 10"
|
|
91
|
+
width="10"
|
|
92
|
+
height="10"
|
|
93
|
+
fill="none"
|
|
94
|
+
stroke="currentColor"
|
|
95
|
+
stroke-width="1.5"
|
|
96
|
+
stroke-linecap="round"
|
|
97
|
+
stroke-linejoin="round"
|
|
98
|
+
>
|
|
99
|
+
<path d=${i} />
|
|
100
|
+
</svg>`;
|
|
101
|
+
}
|
|
102
|
+
_setValue(e, t) {
|
|
103
|
+
const i = this._value;
|
|
104
|
+
this._value = Math.min(
|
|
105
|
+
Math.max(Math.round(e / this.step) * this.step, this._effectiveMin),
|
|
106
|
+
this._effectiveMax
|
|
107
|
+
), t && this._value !== i && this.dispatchEvent(
|
|
108
|
+
new CustomEvent("rc-splitter-change", {
|
|
109
|
+
bubbles: !0,
|
|
110
|
+
composed: !0,
|
|
111
|
+
detail: { value: this._value, valueText: this.valueText }
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
_setUserValue(e) {
|
|
116
|
+
this._valueInitialized = !0, this._hostValue = void 0, this._value > this._effectiveMin && (this._lastValue = this._value), this._setValue(e, !0);
|
|
117
|
+
}
|
|
118
|
+
/** The value as a CSS length, such as `40%` or `240px`. */
|
|
119
|
+
get valueText() {
|
|
120
|
+
return `${this.value}${this.mode === "percent" ? "%" : "px"}`;
|
|
121
|
+
}
|
|
122
|
+
/** The value for `aria-valuetext`, with digits in the splitter's locale. */
|
|
123
|
+
get _accessibleValueText() {
|
|
124
|
+
const e = this._messages.locale;
|
|
125
|
+
return this.mode === "percent" ? b(e, { style: "percent", maximumFractionDigits: 2 }).format(
|
|
126
|
+
this.value / 100
|
|
127
|
+
) : `${b(e, { maximumFractionDigits: 2 }).format(this.value)}px`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The logical axis the panes sit along: `horizontal` places them side by
|
|
131
|
+
* side along the inline axis, `vertical` stacks them along the block axis.
|
|
132
|
+
*/
|
|
133
|
+
get _paneAxis() {
|
|
134
|
+
return this.orientation === "horizontal" ? "inline" : "block";
|
|
135
|
+
}
|
|
136
|
+
_onKeyboardResize(e) {
|
|
137
|
+
if (!this.fixed)
|
|
138
|
+
switch (e) {
|
|
139
|
+
case "next":
|
|
140
|
+
this._setUserValue(this.value + this.step);
|
|
141
|
+
break;
|
|
142
|
+
case "prev":
|
|
143
|
+
this._setUserValue(this.value - this.step);
|
|
144
|
+
break;
|
|
145
|
+
case "next-large":
|
|
146
|
+
this._setUserValue(this.value + this.step * 10);
|
|
147
|
+
break;
|
|
148
|
+
case "prev-large":
|
|
149
|
+
this._setUserValue(this.value - this.step * 10);
|
|
150
|
+
break;
|
|
151
|
+
case "start":
|
|
152
|
+
this._setUserValue(this._effectiveMin);
|
|
153
|
+
break;
|
|
154
|
+
case "end":
|
|
155
|
+
this._setUserValue(this._effectiveMax);
|
|
156
|
+
break;
|
|
157
|
+
case "toggle":
|
|
158
|
+
this._setUserValue(
|
|
159
|
+
this.value === this._effectiveMin ? this._lastValue : this._effectiveMin
|
|
160
|
+
);
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
_onPointerResize(e) {
|
|
165
|
+
if (this.fixed)
|
|
166
|
+
return;
|
|
167
|
+
const t = p(this), i = this._paneAxis, s = this.getBoundingClientRect(), n = d(i, t) === "x", o = n ? s.width : s.height, c = n ? e.clientX - s.left : e.clientY - s.top, v = z(i, t) ? o - c : c;
|
|
168
|
+
this._setUserValue(v / o * this._maxValue);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Settles at a declared snap point by zero-based index.
|
|
172
|
+
*
|
|
173
|
+
* Finite fractional indices are truncated and clamped. Calls without valid
|
|
174
|
+
* snap points or with a non-finite index have no effect.
|
|
175
|
+
*
|
|
176
|
+
* @param index - zero-based index into `snapPoints`
|
|
177
|
+
* @param behavior - whether to animate the movement
|
|
178
|
+
*/
|
|
179
|
+
snapTo(e, t = "animated") {
|
|
180
|
+
const i = this._resolvedSnapPoints();
|
|
181
|
+
if (!Number.isFinite(e) || i.length === 0)
|
|
182
|
+
return;
|
|
183
|
+
const s = Math.max(0, Math.min(Math.trunc(e), i.length - 1));
|
|
184
|
+
this._settleToValue(i[s], t);
|
|
185
|
+
}
|
|
186
|
+
_onGestureStart(e) {
|
|
187
|
+
this._activeSnapAnimation?.cancel(), this._activeSnapAnimation = null, this._gestureStartValue = this.value, this._gestureRestoreValue = this._lastValue;
|
|
188
|
+
}
|
|
189
|
+
_onGestureMove(e) {
|
|
190
|
+
this._onPointerResize({ clientX: e.x, clientY: e.y });
|
|
191
|
+
}
|
|
192
|
+
_onGestureEnd(e) {
|
|
193
|
+
const t = p(this), i = g({ dx: e.deltaX, dy: e.deltaY }, this._paneAxis, t), s = g(
|
|
194
|
+
{ dx: e.velocityX, dy: e.velocityY },
|
|
195
|
+
this._paneAxis,
|
|
196
|
+
t
|
|
197
|
+
), n = Math.abs(i) >= L && Math.abs(s) >= this.swipeVelocity;
|
|
198
|
+
if (n && this.collapsible) {
|
|
199
|
+
if (s < 0) {
|
|
200
|
+
const v = this._gestureRestoreValue > this._effectiveMin ? this._gestureRestoreValue : this._gestureStartValue;
|
|
201
|
+
this._settleToValue(this._effectiveMin, "animated"), this._lastValue = v;
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (this._gestureStartValue <= this._effectiveMin) {
|
|
205
|
+
this._settleToValue(
|
|
206
|
+
Math.max(this._gestureRestoreValue, this._effectiveMin),
|
|
207
|
+
"animated"
|
|
208
|
+
);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const o = this._resolvedSnapPoints();
|
|
213
|
+
if (o.length === 0)
|
|
214
|
+
return;
|
|
215
|
+
const c = n ? B(o, this._gestureStartValue, s > 0 ? 1 : -1) : E(o, this.value);
|
|
216
|
+
c >= 0 && this._settleToValue(o[c], "animated");
|
|
217
|
+
}
|
|
218
|
+
_onGestureCancel() {
|
|
219
|
+
this._activeSnapAnimation?.cancel(), this._activeSnapAnimation = null;
|
|
220
|
+
}
|
|
221
|
+
_resolvedSnapPoints() {
|
|
222
|
+
return this.snapPoints.trim() ? this.snapPoints.trim().split(/\s+/).map(Number).filter(Number.isFinite).map((e) => Math.min(Math.max(e, this._effectiveMin), this._effectiveMax)).filter((e, t, i) => t === 0 || e !== i[t - 1]) : [];
|
|
223
|
+
}
|
|
224
|
+
async _settleToValue(e, t) {
|
|
225
|
+
const i = this._$primary, s = this._sizeAlong(i.getBoundingClientRect(), this._paneAxis) / u(i);
|
|
226
|
+
if (this._activeSnapAnimation?.cancel(), this._activeSnapAnimation = null, this._setUserValue(e), await this.updateComplete, t === "instant" || this._reducedMotion?.matches)
|
|
227
|
+
return;
|
|
228
|
+
const n = this._sizeAlong(i.getBoundingClientRect(), this._paneAxis) / u(i);
|
|
229
|
+
if (s === n)
|
|
230
|
+
return;
|
|
231
|
+
const o = this._paneAxis === "inline" ? "inlineSize" : "blockSize", c = i.animate(
|
|
232
|
+
[{ [o]: `${s}px` }, { [o]: `${n}px` }],
|
|
233
|
+
{
|
|
234
|
+
duration: this._snapDuration(),
|
|
235
|
+
easing: H
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
this._activeSnapAnimation = c;
|
|
239
|
+
try {
|
|
240
|
+
await c.finished;
|
|
241
|
+
} catch {
|
|
242
|
+
} finally {
|
|
243
|
+
this._activeSnapAnimation === c && (this._activeSnapAnimation = null);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
_snapDuration() {
|
|
247
|
+
const e = getComputedStyle(this).getPropertyValue("--rc-splitter-snap-duration");
|
|
248
|
+
return P(e) ?? G;
|
|
249
|
+
}
|
|
250
|
+
_onPrimaryChange(e) {
|
|
251
|
+
queueMicrotask(() => {
|
|
252
|
+
this._$primaryElements.length < 2 || this._$primaryElements.slice(1).forEach((t) => t.setAttribute("slot", "secondary"));
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
_onSecondaryChange(e) {
|
|
256
|
+
queueMicrotask(() => {
|
|
257
|
+
!this._$secondaryElements.length || this._$primaryElements.length || this._$secondaryElements.at(0)?.removeAttribute("slot");
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The extent of `rect` along a logical axis. The pane axis is vertical on
|
|
262
|
+
* screen in vertical text, so a physical width would measure the wrong one.
|
|
263
|
+
*/
|
|
264
|
+
_sizeAlong(e, t) {
|
|
265
|
+
return d(t, p(this)) === "x" ? e.width : e.height;
|
|
266
|
+
}
|
|
267
|
+
_measureHostSize(e) {
|
|
268
|
+
const t = this._sizeAlong(this.getBoundingClientRect(), e) / u(this);
|
|
269
|
+
if (t > 0)
|
|
270
|
+
return Math.ceil(t);
|
|
271
|
+
const i = getComputedStyle(this), s = e === "inline" ? i.inlineSize : i.blockSize, n = Number.parseFloat(s);
|
|
272
|
+
return Number.isFinite(n) ? Math.ceil(n) : 0;
|
|
273
|
+
}
|
|
274
|
+
_onResize() {
|
|
275
|
+
const e = this._$primaryElements.at(0), t = this._$primary.style.getPropertyValue("display");
|
|
276
|
+
globalThis.requestAnimationFrame(() => {
|
|
277
|
+
this._$primary.style.setProperty("display", "contents");
|
|
278
|
+
const i = e?.getBoundingClientRect() ?? this.getBoundingClientRect();
|
|
279
|
+
if (this.mode !== "percent") {
|
|
280
|
+
const s = this.orientation === "horizontal" ? (
|
|
281
|
+
// For horizontal splitters, just take the host width...
|
|
282
|
+
this._measureHostSize("inline")
|
|
283
|
+
) : (
|
|
284
|
+
// ...otherwise try to use the first lightDOM element's auto height, and cache it
|
|
285
|
+
this._initialMax || Math.ceil(this._sizeAlong(i, "block") / u(this)) || this._measureHostSize("block")
|
|
286
|
+
);
|
|
287
|
+
(s > 0 || !this._initialMax) && (this._maxValue = s);
|
|
288
|
+
} else
|
|
289
|
+
this._maxValue = 100;
|
|
290
|
+
this._initialMax ? this._hostValue !== void 0 ? this._setValue(this._hostValue, !1) : this._setValue(this.value, !1) : (this._initialMax = this._maxValue, this._setValue(
|
|
291
|
+
this._valueInitialized ? this._value : this._hostValue ?? this.defaultValue ?? this._maxValue / 2,
|
|
292
|
+
!1
|
|
293
|
+
)), t ? this._$primary.style.setProperty("display", t) : this._$primary.style.removeProperty("display");
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
connectedCallback() {
|
|
297
|
+
super.connectedCallback(), this._resizeObserver.observe(this);
|
|
298
|
+
}
|
|
299
|
+
disconnectedCallback() {
|
|
300
|
+
this._resizeObserver.disconnect(), this._activeSnapAnimation?.cancel(), this._activeSnapAnimation = null, super.disconnectedCallback();
|
|
301
|
+
}
|
|
302
|
+
firstUpdated() {
|
|
303
|
+
this._onResize();
|
|
304
|
+
}
|
|
305
|
+
updated() {
|
|
306
|
+
this._gesture.setOptions({
|
|
307
|
+
axis: d(this._paneAxis, this._flow.flow),
|
|
308
|
+
target: () => this._$separatorHandle
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
render() {
|
|
312
|
+
const e = y(
|
|
313
|
+
this.orientation === "horizontal" ? "vertical" : "horizontal",
|
|
314
|
+
this._flow.flow
|
|
315
|
+
), t = this._messages.value, i = this.label ?? t.label;
|
|
316
|
+
return m`
|
|
317
|
+
<div
|
|
318
|
+
id="primary"
|
|
319
|
+
part="primary"
|
|
320
|
+
aria-label=${i}
|
|
321
|
+
style=${`${this._paneAxis === "inline" ? "inline" : "block"}-size: ${this.valueText}`}
|
|
322
|
+
?hidden=${this.value === this._minValue}
|
|
323
|
+
>
|
|
324
|
+
<slot @slotchange=${this._onPrimaryChange}></slot>
|
|
325
|
+
</div>
|
|
326
|
+
|
|
327
|
+
<div id="separator" part="separator">
|
|
328
|
+
${this.collapsible && this._$secondaryElements.length && !this.fixed ? m`<button
|
|
329
|
+
id="collapse-button"
|
|
330
|
+
part="collapse-button"
|
|
331
|
+
aria-label=${this._isCollapsed ? t.expand(i) : t.collapse(i)}
|
|
332
|
+
aria-expanded=${String(!this._isCollapsed)}
|
|
333
|
+
aria-controls="primary"
|
|
334
|
+
@click=${this._onCollapseButtonClick}
|
|
335
|
+
>
|
|
336
|
+
${this._collapseButtonIcon}
|
|
337
|
+
</button>` : $}
|
|
338
|
+
<div
|
|
339
|
+
id="separator-handle"
|
|
340
|
+
role="separator"
|
|
341
|
+
tabindex="0"
|
|
342
|
+
part="separator-handle"
|
|
343
|
+
aria-labelledby="primary"
|
|
344
|
+
aria-controls="primary"
|
|
345
|
+
aria-orientation=${e}
|
|
346
|
+
data-bar=${e}
|
|
347
|
+
aria-valuenow=${this.value}
|
|
348
|
+
aria-valuetext=${this._accessibleValueText}
|
|
349
|
+
aria-valuemin=${this._effectiveMin}
|
|
350
|
+
aria-valuemax=${this._effectiveMax}
|
|
351
|
+
@keydown=${this._onCollapseKeydown}
|
|
352
|
+
${R(this._onKeyboardResize)}
|
|
353
|
+
${T()}
|
|
354
|
+
?hidden=${!this._$secondaryElements.length}
|
|
355
|
+
></div>
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<aside
|
|
359
|
+
id="secondary"
|
|
360
|
+
part="secondary"
|
|
361
|
+
?hidden=${!this._$secondaryElements.length || this.value === this._maxValue}
|
|
362
|
+
>
|
|
363
|
+
<slot name="secondary" @slotchange=${this._onSecondaryChange}></slot>
|
|
364
|
+
</aside>
|
|
365
|
+
`;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
f.styles = [N];
|
|
369
|
+
let a = f;
|
|
370
|
+
r([
|
|
371
|
+
l({ attribute: !1 })
|
|
372
|
+
], a.prototype, "messages", 2);
|
|
373
|
+
r([
|
|
374
|
+
l({ type: String })
|
|
375
|
+
], a.prototype, "label", 2);
|
|
376
|
+
r([
|
|
377
|
+
l({ type: String, reflect: !0 })
|
|
378
|
+
], a.prototype, "orientation", 2);
|
|
379
|
+
r([
|
|
380
|
+
l({ type: String, reflect: !0 })
|
|
381
|
+
], a.prototype, "mode", 2);
|
|
382
|
+
r([
|
|
383
|
+
l({ type: Number })
|
|
384
|
+
], a.prototype, "step", 2);
|
|
385
|
+
r([
|
|
386
|
+
l({ type: Number })
|
|
387
|
+
], a.prototype, "min", 2);
|
|
388
|
+
r([
|
|
389
|
+
l({ type: Number })
|
|
390
|
+
], a.prototype, "max", 2);
|
|
391
|
+
r([
|
|
392
|
+
l({ type: Number })
|
|
393
|
+
], a.prototype, "value", 1);
|
|
394
|
+
r([
|
|
395
|
+
l({ type: Number, attribute: "default-value" })
|
|
396
|
+
], a.prototype, "defaultValue", 1);
|
|
397
|
+
r([
|
|
398
|
+
_()
|
|
399
|
+
], a.prototype, "_value", 2);
|
|
400
|
+
r([
|
|
401
|
+
l({ type: Boolean })
|
|
402
|
+
], a.prototype, "fixed", 2);
|
|
403
|
+
r([
|
|
404
|
+
l({ type: Boolean })
|
|
405
|
+
], a.prototype, "collapsible", 2);
|
|
406
|
+
r([
|
|
407
|
+
l({ type: String, attribute: "snap-points" })
|
|
408
|
+
], a.prototype, "snapPoints", 2);
|
|
409
|
+
r([
|
|
410
|
+
l({ type: Number, attribute: "swipe-velocity" })
|
|
411
|
+
], a.prototype, "swipeVelocity", 2);
|
|
412
|
+
r([
|
|
413
|
+
_()
|
|
414
|
+
], a.prototype, "_minValue", 2);
|
|
415
|
+
r([
|
|
416
|
+
_()
|
|
417
|
+
], a.prototype, "_maxValue", 2);
|
|
418
|
+
r([
|
|
419
|
+
_()
|
|
420
|
+
], a.prototype, "_lastValue", 2);
|
|
421
|
+
r([
|
|
422
|
+
V("#primary", !0)
|
|
423
|
+
], a.prototype, "_$primary", 2);
|
|
424
|
+
r([
|
|
425
|
+
V("#separator-handle")
|
|
426
|
+
], a.prototype, "_$separatorHandle", 2);
|
|
427
|
+
r([
|
|
428
|
+
S()
|
|
429
|
+
], a.prototype, "_$primaryElements", 2);
|
|
430
|
+
r([
|
|
431
|
+
S({ slot: "secondary" })
|
|
432
|
+
], a.prototype, "_$secondaryElements", 2);
|
|
433
|
+
export {
|
|
434
|
+
K as D,
|
|
435
|
+
a as R
|
|
436
|
+
};
|
|
437
|
+
//# sourceMappingURL=rc-splitter-_P5HsZI9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rc-splitter-_P5HsZI9.js","sources":["../src/rc-splitter.styles.ts","../src/rc-splitter.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const splitterStyles = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host {\n --rc-splitter-separator-size: 6px;\n\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: stretch;\n }\n\n :host([orientation='vertical']) {\n flex-direction: column;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n /* because :has(:focus-visible) doesn't work across slot boundary */\n :host([data-interaction-mode='keyboard']):focus-within {\n outline: auto;\n }\n\n ::slotted(*) {\n width: 100%;\n height: 100%;\n }\n\n #separator {\n grid-column: separator;\n flex: 0 0 var(--rc-splitter-separator-size, 6px);\n display: flex;\n flex-direction: column;\n justify-content: center;\n background-color: var(\n --rc-splitter-separator-color,\n color-mix(in srgb, ButtonBorder 35%, Canvas 65%)\n );\n border-inline-start: var(\n --rc-splitter-separator-border-inline-start,\n var(--rc-splitter-keyline, 1px solid ButtonBorder)\n );\n border-inline-end: var(\n --rc-splitter-separator-border-inline-end,\n var(--rc-splitter-keyline, 1px solid ButtonBorder)\n );\n /* z-index: 1 as a flex item stacks separator above pane siblings so the\n ::after touch-target circle (which extends past the strip) is hittable */\n z-index: 1;\n /* Required for collapse-button absolute positioning */\n position: relative;\n\n :host([orientation='vertical']) & {\n flex-direction: row;\n border-inline-start: unset;\n border-inline-end: unset;\n border-block-start: var(\n --rc-splitter-separator-border-block-start,\n var(--rc-splitter-keyline, 1px solid ButtonBorder)\n );\n border-block-end: var(\n --rc-splitter-separator-border-block-end,\n var(--rc-splitter-keyline, 1px solid ButtonBorder)\n );\n }\n }\n\n #collapse-button {\n /* Positioned at the start of the separator strip, centered on the cross\n axis. The button intentionally protrudes into the primary pane so it\n is visible and hittable at a reasonable size even on narrow strips. */\n position: absolute;\n /* Centered on the cross axis with auto margins, which hold in RTL and in\n vertical text where a physical 50% offset plus translate would not. */\n inset-block-start: var(--rc-splitter-collapse-button-offset, 8px);\n inset-inline: 0;\n margin-inline: auto;\n inline-size: var(--rc-splitter-collapse-button-size, 20px);\n block-size: var(--rc-splitter-collapse-button-size, 20px);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: 1px solid var(--rc-splitter-collapse-button-border, ButtonBorder);\n border-radius: 50%;\n background: var(--rc-splitter-collapse-button-bg, Canvas);\n color: var(--rc-splitter-collapse-button-color, ButtonText);\n cursor: pointer;\n line-height: 1;\n\n &:hover {\n background: var(--rc-splitter-collapse-button-hover-bg, ButtonFace);\n }\n\n &:focus-visible {\n outline: 2px solid Highlight;\n outline-offset: 2px;\n }\n\n :host([orientation='vertical']) & {\n inset-block: 0;\n margin-block: auto;\n inset-inline: var(--rc-splitter-collapse-button-offset, 8px) auto;\n margin-inline: 0;\n }\n }\n\n #separator-handle {\n touch-action: none;\n inline-size: 100%;\n block-size: var(--rc-splitter-separator-handle-size, 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n /* Required so ::after is positioned relative to this element */\n position: relative;\n\n /* ── Visual drag indicator ─────────────────────────────────────────────\n The box follows the orientation attribute in logical terms; the dots\n and cursor are physical and follow data-bar, the bar's rendered\n direction, so they stay right in vertical text.\n Default: 3-dot grip along a vertical bar.\n Themes override via --rc-splitter-handle-pattern (background-image) and\n --rc-splitter-handle-fill (background-color). */\n &::before {\n content: '';\n display: block;\n inline-size: var(--rc-splitter-handle-thickness, 4px);\n block-size: 100%;\n background-color: var(--rc-splitter-handle-fill, transparent);\n background-image: var(\n --rc-splitter-handle-pattern,\n radial-gradient(\n circle 1px at 50% calc(50% - 5px),\n var(--rc-splitter-handle-color, ButtonBorder) 100%,\n transparent 100%\n ),\n radial-gradient(\n circle 1px at 50% 50%,\n var(--rc-splitter-handle-color, ButtonBorder) 100%,\n transparent 100%\n ),\n radial-gradient(\n circle 1px at 50% calc(50% + 5px),\n var(--rc-splitter-handle-color, ButtonBorder) 100%,\n transparent 100%\n )\n );\n border-radius: var(--rc-splitter-handle-border-radius, 0);\n pointer-events: none;\n transition: background-color var(--rc-splitter-handle-transition, 0ms);\n }\n\n /* Hover highlight stays on the visual indicator only, never the full strip */\n &:hover::before {\n background-color: var(--rc-splitter-handle-hover-fill, transparent);\n }\n\n /* ── Touch target circle ───────────────────────────────────────────────\n 24 px diameter transparent circle, centered on the handle. Invisible\n and non-interactive for mouse/keyboard. On coarse-pointer (touch)\n devices the circle becomes hittable, giving a WCAG-compliant touch\n target without widening the visual separator. */\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n margin: auto;\n inline-size: 24px;\n block-size: 24px;\n border-radius: 50%;\n pointer-events: none;\n }\n\n :host([orientation='vertical']) & {\n inline-size: var(--rc-splitter-separator-handle-size, 100%);\n block-size: 100%;\n\n &::before {\n inline-size: 100%;\n block-size: var(--rc-splitter-handle-thickness, 4px);\n }\n }\n\n &[data-bar='vertical'] {\n cursor: col-resize;\n }\n\n &[data-bar='horizontal'] {\n cursor: row-resize;\n\n /* 3-dot grip along a horizontal bar */\n &::before {\n background-image: var(\n --rc-splitter-handle-pattern,\n radial-gradient(\n circle 1px at calc(50% - 5px) 50%,\n var(--rc-splitter-handle-color, ButtonBorder) 100%,\n transparent 100%\n ),\n radial-gradient(\n circle 1px at 50% 50%,\n var(--rc-splitter-handle-color, ButtonBorder) 100%,\n transparent 100%\n ),\n radial-gradient(\n circle 1px at calc(50% + 5px) 50%,\n var(--rc-splitter-handle-color, ButtonBorder) 100%,\n transparent 100%\n )\n );\n }\n }\n\n :host([fixed]) & {\n pointer-events: none;\n }\n }\n\n /* Activate the touch target circle only on coarse-pointer (touch) devices */\n @media (any-pointer: coarse) {\n #separator-handle::after {\n pointer-events: auto;\n }\n }\n\n #primary,\n #secondary {\n overflow: hidden;\n }\n\n #primary {\n grid-column: primary;\n flex: 0 0 auto;\n }\n\n #secondary {\n grid-column: secondary;\n flex: 1;\n }\n`;\n\nexport default splitterStyles;\n","import { LitElement, html, nothing } from 'lit';\nimport { property, state, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport {\n cssZoom,\n bidiIsolate,\n MessagesController,\n numberFormat,\n DragGestureController,\n FlowController,\n findNearestSnapIndex,\n findNextSnapIndex,\n isReversed,\n keyInteraction,\n keyNavigation,\n logicalDelta,\n parseCssTime,\n physicalAxis,\n renderedOrientation,\n resolveFlow,\n type DragGestureDetail,\n type Flow,\n type KeyboardNavigationAction,\n type LogicalAxis,\n} from '@rcarls/rc-common';\n\nimport splitterStyles from './rc-splitter.styles.js';\n\ntype SplitterOrientation = 'horizontal' | 'vertical';\n\ntype ChevronSide = 'left' | 'right' | 'up' | 'down';\n\nconst CHEVRON_PATHS: Record<ChevronSide, string> = {\n left: 'M 7 1 L 3 5 L 7 9',\n right: 'M 3 1 L 7 5 L 3 9',\n up: 'M 1 7 L 5 3 L 9 7',\n down: 'M 1 3 L 5 7 L 9 3',\n};\n\nconst OPPOSITE_SIDE: Record<ChevronSide, ChevronSide> = {\n left: 'right',\n right: 'left',\n up: 'down',\n down: 'up',\n};\n\n/** The physical side the start of `axis` sits on. */\nfunction paneStartSide(axis: LogicalAxis, flow: Flow): ChevronSide {\n const reversed = isReversed(axis, flow);\n\n if (physicalAxis(axis, flow) === 'x') {\n return reversed ? 'right' : 'left';\n }\n\n return reversed ? 'down' : 'up';\n}\n\ntype SplitterMode = 'length' | 'percent' | 'fixed';\n\nconst MIN_SWIPE_DISTANCE = 24;\nconst DEFAULT_SNAP_DURATION_MS = 200;\nconst SNAP_EASING = 'cubic-bezier(0.4, 0, 0.2, 1)';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'rc-splitter': RCSplitter;\n }\n}\n\n/** Built-in text of `rc-splitter`. */\nexport interface RCSplitterMessages {\n /** Default name of the primary pane, when `label` is unset. */\n label: string;\n expand: (label: string) => string;\n collapse: (label: string) => string;\n}\n\nexport const DEFAULT_SPLITTER_MESSAGES: Readonly<RCSplitterMessages> = Object.freeze({\n label: 'Splitter',\n expand: (label: string) => `Expand ${bidiIsolate(label)}`,\n collapse: (label: string) => `Collapse ${bidiIsolate(label)}`,\n});\n\ndeclare module '@rcarls/rc-common' {\n interface RcMessageCatalog {\n 'rc-splitter': RCSplitterMessages;\n }\n}\n\n/**\n * Resizable pane splitter with pointer, keyboard, anchored settling, and\n * collapse/restore controls, following the WAI-ARIA Window Splitter pattern.\n *\n * Set `orientation=\"vertical\"` for a vertical splitter\n *\n * Built-in text (the collapse button name and default pane name; the separator value text is formatted for the same locale) follows the element's own `lang`, else\n * `<html lang>`: per element through `messages`, or for every instance\n * through `registerMessages()` from `@rcarls/rc-common` under `rc-splitter`.\n *\n * @see {@link https://richardcarls.github.io/rc-webcomponents/components/rc-splitter rc-splitter docs}\n * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/ WAI-ARIA Window Splitter pattern}\n *\n * @slot - Primary pane contents\n * @slot secondary - Secondary pane contents (optional)\n *\n * @fires rc-splitter-change - Fired when the separator position changes; `detail: { value, valueText }`\n *\n * @attr label - Accessible label applied to the primary pane and referenced by the separator\n * handle's `aria-labelledby`. Defaults to the `label` message.\n * @attr orientation - Layout: `horizontal` places the panes side by side along the inline axis\n * (left/right in LTR, right/left in RTL), `vertical` stacks them along the block axis. Both turn\n * over in vertical writing modes; the separator's `aria-orientation`, arrow keys, and dragging\n * follow the layout actually rendered.\n * @attr mode - Value units and pane sizing behavior: `length`, `percent`, or `fixed`.\n * @attr step - Keyboard resize step size, in the current mode's units.\n * @attr min - Minimum primary pane size, in the current mode's units.\n * @attr max - Maximum primary pane size, in the current mode's units. Defaults to the full\n * container size.\n * @attr value - Current primary pane size. Host writes update silently.\n * @attr default-value - Initial uncontrolled primary pane size.\n * @attr fixed - Disables pointer and keyboard resizing without changing pane size.\n * @attr collapsible - Renders a collapse/expand toggle button on the separator.\n * @attr snap-points - Ascending whitespace-separated anchors, in the current mode's units.\n * @attr swipe-velocity - Minimum release velocity, in px/s, that qualifies as a swipe.\n *\n * @cssprop [--rc-splitter-separator-size=6px] - Thickness of the separator bar\n * @cssprop [--rc-splitter-separator-handle-size=100%] - Length of the drag handle area within the separator (also the length of the visible indicator)\n * @cssprop [--rc-splitter-separator-color=color-mix(in srgb, ButtonBorder 35%, Canvas 65%)] - Separator background color\n * @cssprop [--rc-splitter-keyline=1px solid ButtonBorder] - Shared separator keyline border\n * @cssprop [--rc-splitter-handle-color=ButtonBorder] - Color of the dot grip indicators (default visual)\n * @cssprop [--rc-splitter-handle-thickness=4px] - Cross-axis size of the visual indicator (dot column width or pill/line thickness)\n * @cssprop [--rc-splitter-handle-border-radius=0] - Border-radius of the visual indicator; set to a large value (e.g. 999px) for a pill shape\n * @cssprop [--rc-splitter-handle-pattern=<3-dot radial-gradient>] - background-image for the visual indicator; set to `none` to use a solid fill via --rc-splitter-handle-fill instead\n * @cssprop [--rc-splitter-handle-fill=transparent] - background-color of the visual indicator; effective when --rc-splitter-handle-pattern is none (e.g. for a solid pill)\n * @cssprop [--rc-splitter-handle-hover-fill=transparent] - background-color of the visual indicator on hover; scoped to the indicator element only, not the full separator strip\n * @cssprop [--rc-splitter-handle-transition=0ms] - CSS transition duration/easing for the visual indicator's background-color changes\n * @cssprop [--rc-splitter-snap-duration=200ms] - Duration of anchored settling after pointer release or `snapTo()`\n * @cssprop [--rc-splitter-collapse-button-size=20px] - Diameter of the collapse/expand toggle button\n * @cssprop [--rc-splitter-collapse-button-offset=8px] - Distance from the start edge of the separator to the collapse button center\n * @cssprop [--rc-splitter-collapse-button-bg=Canvas] - Collapse button background color\n * @cssprop [--rc-splitter-collapse-button-hover-bg=ButtonFace] - Collapse button background color on hover\n * @cssprop [--rc-splitter-collapse-button-border=ButtonBorder] - Collapse button border color\n * @cssprop [--rc-splitter-collapse-button-color=ButtonText] - Collapse button icon color\n * @cssprop [--rc-splitter-separator-border-inline-start=1px solid ButtonBorder] - Inline-start border\n * @cssprop [--rc-splitter-separator-border-inline-end=1px solid ButtonBorder] - Inline-end border\n * @cssprop [--rc-splitter-separator-border-block-start=1px solid ButtonBorder] - Block-start border (vertical orientation)\n * @cssprop [--rc-splitter-separator-border-block-end=1px solid ButtonBorder] - Block-end border (vertical orientation)\n * @csspart primary - Primary pane container\n * @csspart secondary - Secondary pane container\n * @csspart separator - The separator bar\n * @csspart separator-handle - The focusable drag handle\n * @csspart collapse-button - The collapse/expand toggle button (only rendered when `collapsible` is set)\n */\nexport class RCSplitter extends LitElement {\n static styles = [splitterStyles];\n\n /** Built-in text overrides; unset keys fall back to registered text, then English. */\n @property({ attribute: false })\n messages: Partial<RCSplitterMessages> | undefined;\n\n private readonly _messages = new MessagesController(\n this,\n 'rc-splitter',\n DEFAULT_SPLITTER_MESSAGES,\n {\n overrides: () => this.messages,\n },\n );\n\n /** Accessible label for this splitter. Defaults to the `label` message. */\n @property({ type: String })\n label: string | undefined;\n\n /** Splitter orientation, for keyboard navigation and initial sizing. */\n @property({ type: String, reflect: true })\n orientation: SplitterOrientation = 'horizontal';\n\n /**\n * Determines value units and pane sizing behavior.\n *\n * - `length` uses px for the primary pane size.\n * - `percent` uses percentage points.\n * - `fixed` uses px for a clampable fixed primary pane while the secondary pane flexes.\n */\n @property({ type: String, reflect: true })\n mode: SplitterMode = 'length';\n\n /** The step size for resizing, in either pixels or percentage points depending on `mode`. */\n @property({ type: Number })\n step: number = 1;\n\n /** Minimum size of the primary pane in current mode units. Defaults to 0. */\n @property({ type: Number })\n min: number = 0;\n\n /** Maximum size of the primary pane in current mode units. Defaults to the full container size. */\n @property({ type: Number })\n max: number | undefined = undefined;\n\n private _defaultValue: number | undefined;\n private _hostValue: number | undefined;\n private _valueInitialized = false;\n\n /** The current splitter value. Host writes update silently. */\n @property({ type: Number })\n set value(val: number) {\n const oldValue = this._hostValue;\n\n this._hostValue = val;\n\n if (this._initialMax) {\n this._setValue(val, false);\n }\n\n this.requestUpdate('value', oldValue);\n }\n\n /** The current splitter value, corresponding to the separator position, in either pixels or percentage points depending on `mode`. */\n get value() {\n return this._value;\n }\n\n /** Initial uncontrolled splitter value. */\n @property({ type: Number, attribute: 'default-value' })\n set defaultValue(val: number | undefined) {\n const oldValue = this._defaultValue;\n\n this._defaultValue = val;\n\n if (!this._initialMax && this._hostValue === undefined && val !== undefined) {\n this._setValue(val, false);\n }\n\n this.requestUpdate('defaultValue', oldValue);\n }\n\n /** Initial uncontrolled splitter value. */\n get defaultValue() {\n return this._defaultValue;\n }\n\n protected get _effectiveMin(): number {\n return Math.max(this._minValue, this.min);\n }\n\n protected get _effectiveMax(): number {\n return Math.min(this._maxValue, this.max ?? this._maxValue);\n }\n\n /** True once initialized and the primary pane is at its effective minimum. */\n protected get _isCollapsed(): boolean {\n return this._initialMax > 0 && this.value <= this._effectiveMin;\n }\n\n protected _toggleCollapse(): void {\n this._setUserValue(this._isCollapsed ? this._lastValue : this._effectiveMin);\n }\n\n protected _onCollapseButtonClick(): void {\n this._toggleCollapse();\n }\n\n protected _onCollapseKeydown(e: KeyboardEvent): void {\n if (!this.collapsible || this.fixed) {\n return;\n }\n\n if (!e.ctrlKey && !e.metaKey) {\n return;\n }\n\n const isRelevantKey =\n renderedOrientation(this.orientation, resolveFlow(this)) === 'horizontal'\n ? e.key === 'ArrowLeft' || e.key === 'ArrowRight'\n : e.key === 'ArrowUp' || e.key === 'ArrowDown';\n\n if (isRelevantKey) {\n e.preventDefault();\n e.stopImmediatePropagation();\n this._toggleCollapse();\n }\n }\n\n protected get _collapseButtonIcon() {\n // The chevron points toward the primary pane to collapse (the separator\n // moves toward it) and away from it to expand. The primary pane sits at\n // the start of the pane axis, which the flow places on a physical side.\n const startSide = paneStartSide(this._paneAxis, this._flow.flow);\n const points = this._isCollapsed ? OPPOSITE_SIDE[startSide] : startSide;\n const d = CHEVRON_PATHS[points];\n\n return html`<svg\n data-points=${points}\n aria-hidden=\"true\"\n viewBox=\"0 0 10 10\"\n width=\"10\"\n height=\"10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=${d} />\n </svg>`;\n }\n\n protected _setValue(val: number, dispatch: boolean): void {\n const oldValue = this._value;\n\n this._value = Math.min(\n Math.max(Math.round(val / this.step) * this.step, this._effectiveMin),\n this._effectiveMax,\n );\n\n if (dispatch && this._value !== oldValue) {\n this.dispatchEvent(\n new CustomEvent('rc-splitter-change', {\n bubbles: true,\n composed: true,\n detail: { value: this._value, valueText: this.valueText },\n }),\n );\n }\n }\n\n protected _setUserValue(val: number): void {\n this._valueInitialized = true;\n this._hostValue = undefined;\n\n // Capture the last position above the effective minimum before a user-driven\n // change so toggle-collapse can restore it. Internal resize callbacks use\n // _setValue directly and must not overwrite this.\n if (this._value > this._effectiveMin) {\n this._lastValue = this._value;\n }\n\n this._setValue(val, true);\n }\n\n @state()\n private _value: number = 0;\n\n /** Disables pointer and keyboard resizing without changing pane size. */\n @property({ type: Boolean })\n fixed: boolean = false;\n\n /** Renders a collapse/expand toggle button on the separator. */\n @property({ type: Boolean })\n collapsible: boolean = false;\n\n /**\n * Ascending whitespace-separated snap points in the current mode's units.\n * An empty value keeps pointer resizing continuous.\n */\n @property({ type: String, attribute: 'snap-points' })\n snapPoints = '';\n\n /** Minimum release velocity, in px/s, that qualifies as a swipe. */\n @property({ type: Number, attribute: 'swipe-velocity' })\n swipeVelocity = 500;\n\n /** The value as a CSS length, such as `40%` or `240px`. */\n get valueText() {\n return `${this.value}${this.mode === 'percent' ? '%' : 'px'}`;\n }\n\n /** The value for `aria-valuetext`, with digits in the splitter's locale. */\n protected get _accessibleValueText(): string {\n const locale = this._messages.locale;\n\n return this.mode === 'percent'\n ? numberFormat(locale, { style: 'percent', maximumFractionDigits: 2 }).format(\n this.value / 100,\n )\n : `${numberFormat(locale, { maximumFractionDigits: 2 }).format(this.value)}px`;\n }\n\n @state()\n protected _minValue: number = 0;\n\n @state()\n protected _maxValue: number = 0;\n\n /** Last valid value, for collapse functionality. */\n @state()\n protected _lastValue: number = 0;\n\n @query('#primary', true)\n protected _$primary!: HTMLDivElement;\n\n @query('#separator-handle')\n protected _$separatorHandle!: HTMLDivElement;\n\n @queryAssignedElements()\n protected _$primaryElements!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'secondary' })\n protected _$secondaryElements!: Array<HTMLElement>;\n\n protected _initialMax: number = 0;\n\n protected _gestureStartValue = 0;\n protected _gestureRestoreValue = 0;\n protected _activeSnapAnimation: Animation | null = null;\n protected readonly _reducedMotion =\n typeof window !== 'undefined' ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;\n\n protected readonly _gesture = new DragGestureController(this, {\n target: () => this._$separatorHandle,\n axis: this.orientation === 'horizontal' ? 'x' : 'y',\n focusOnStart: true,\n onStart: (detail) => this._onGestureStart(detail),\n onMove: (detail) => this._onGestureMove(detail),\n onEnd: (detail) => this._onGestureEnd(detail),\n onCancel: () => this._onGestureCancel(),\n });\n\n protected _resizeObserver = new ResizeObserver(() => this._onResize());\n\n /** Keeps the separator's aria-orientation and drag axis on the rendered layout. */\n protected readonly _flow = new FlowController(this);\n\n /**\n * The logical axis the panes sit along: `horizontal` places them side by\n * side along the inline axis, `vertical` stacks them along the block axis.\n */\n protected get _paneAxis(): LogicalAxis {\n return this.orientation === 'horizontal' ? 'inline' : 'block';\n }\n\n protected _onKeyboardResize(action: KeyboardNavigationAction) {\n if (this.fixed) {\n return;\n }\n\n switch (action) {\n case 'next':\n this._setUserValue(this.value + this.step);\n break;\n case 'prev':\n this._setUserValue(this.value - this.step);\n break;\n case 'next-large':\n this._setUserValue(this.value + this.step * 10);\n break;\n case 'prev-large':\n this._setUserValue(this.value - this.step * 10);\n break;\n case 'start':\n this._setUserValue(this._effectiveMin);\n break;\n case 'end':\n this._setUserValue(this._effectiveMax);\n break;\n case 'toggle':\n this._setUserValue(\n this.value === this._effectiveMin ? this._lastValue : this._effectiveMin,\n );\n break;\n }\n }\n\n protected _onPointerResize(e: Pick<PointerEvent, 'clientX' | 'clientY'>) {\n if (this.fixed) {\n return;\n }\n\n // Measured from the primary pane's logical start edge, which is the\n // right edge in RTL and the top or right edge in vertical text.\n const flow = resolveFlow(this);\n const axis = this._paneAxis;\n const clientRect = this.getBoundingClientRect();\n const alongX = physicalAxis(axis, flow) === 'x';\n const size = alongX ? clientRect.width : clientRect.height;\n const fromPhysicalStart = alongX ? e.clientX - clientRect.left : e.clientY - clientRect.top;\n const offset = isReversed(axis, flow) ? size - fromPhysicalStart : fromPhysicalStart;\n\n this._setUserValue((offset / size) * this._maxValue);\n }\n\n /**\n * Settles at a declared snap point by zero-based index.\n *\n * Finite fractional indices are truncated and clamped. Calls without valid\n * snap points or with a non-finite index have no effect.\n *\n * @param index - zero-based index into `snapPoints`\n * @param behavior - whether to animate the movement\n */\n snapTo(index: number, behavior: 'animated' | 'instant' = 'animated'): void {\n const points = this._resolvedSnapPoints();\n\n if (!Number.isFinite(index) || points.length === 0) {\n return;\n }\n\n const clampedIndex = Math.max(0, Math.min(Math.trunc(index), points.length - 1));\n\n void this._settleToValue(points[clampedIndex], behavior);\n }\n\n protected _onGestureStart(_detail: DragGestureDetail): void {\n this._activeSnapAnimation?.cancel();\n this._activeSnapAnimation = null;\n this._gestureStartValue = this.value;\n this._gestureRestoreValue = this._lastValue;\n }\n\n protected _onGestureMove(detail: DragGestureDetail): void {\n this._onPointerResize({ clientX: detail.x, clientY: detail.y });\n }\n\n protected _onGestureEnd(detail: DragGestureDetail): void {\n // Positive toward the pane axis's logical end, i.e. away from the primary pane.\n const flow = resolveFlow(this);\n const delta = logicalDelta({ dx: detail.deltaX, dy: detail.deltaY }, this._paneAxis, flow);\n const velocity = logicalDelta(\n { dx: detail.velocityX, dy: detail.velocityY },\n this._paneAxis,\n flow,\n );\n const decisive =\n Math.abs(delta) >= MIN_SWIPE_DISTANCE && Math.abs(velocity) >= this.swipeVelocity;\n\n if (decisive && this.collapsible) {\n if (velocity < 0) {\n const restoreValue =\n this._gestureRestoreValue > this._effectiveMin\n ? this._gestureRestoreValue\n : this._gestureStartValue;\n\n void this._settleToValue(this._effectiveMin, 'animated');\n this._lastValue = restoreValue;\n\n return;\n }\n\n if (this._gestureStartValue <= this._effectiveMin) {\n void this._settleToValue(\n Math.max(this._gestureRestoreValue, this._effectiveMin),\n 'animated',\n );\n\n return;\n }\n }\n\n const points = this._resolvedSnapPoints();\n\n if (points.length === 0) {\n return;\n }\n\n const index = decisive\n ? findNextSnapIndex(points, this._gestureStartValue, velocity > 0 ? 1 : -1)\n : findNearestSnapIndex(points, this.value);\n\n if (index >= 0) {\n void this._settleToValue(points[index], 'animated');\n }\n }\n\n protected _onGestureCancel(): void {\n this._activeSnapAnimation?.cancel();\n this._activeSnapAnimation = null;\n }\n\n protected _resolvedSnapPoints(): number[] {\n if (!this.snapPoints.trim()) {\n return [];\n }\n\n return this.snapPoints\n .trim()\n .split(/\\s+/)\n .map(Number)\n .filter(Number.isFinite)\n .map((point) => Math.min(Math.max(point, this._effectiveMin), this._effectiveMax))\n .filter((point, index, points) => index === 0 || point !== points[index - 1]);\n }\n\n protected async _settleToValue(value: number, behavior: 'animated' | 'instant'): Promise<void> {\n const $primary = this._$primary;\n const fromSizeCssPx =\n this._sizeAlong($primary.getBoundingClientRect(), this._paneAxis) / cssZoom($primary);\n\n this._activeSnapAnimation?.cancel();\n this._activeSnapAnimation = null;\n this._setUserValue(value);\n await this.updateComplete;\n\n if (behavior === 'instant' || this._reducedMotion?.matches) {\n return;\n }\n\n const toSizeCssPx =\n this._sizeAlong($primary.getBoundingClientRect(), this._paneAxis) / cssZoom($primary);\n\n if (fromSizeCssPx === toSizeCssPx) {\n return;\n }\n\n const property = this._paneAxis === 'inline' ? 'inlineSize' : 'blockSize';\n const animation = $primary.animate(\n [{ [property]: `${fromSizeCssPx}px` }, { [property]: `${toSizeCssPx}px` }],\n {\n duration: this._snapDuration(),\n easing: SNAP_EASING,\n },\n );\n\n this._activeSnapAnimation = animation;\n\n try {\n await animation.finished;\n } catch {\n // A newer gesture or snap call owns the final visual state.\n } finally {\n if (this._activeSnapAnimation === animation) {\n this._activeSnapAnimation = null;\n }\n }\n }\n\n protected _snapDuration(): number {\n const raw = getComputedStyle(this).getPropertyValue('--rc-splitter-snap-duration');\n\n // Themes may resolve motion tokens in seconds (`.3s`); Web Animations\n // durations are milliseconds.\n return parseCssTime(raw) ?? DEFAULT_SNAP_DURATION_MS;\n }\n\n protected _onPrimaryChange(_e: Event) {\n queueMicrotask(() => {\n if (this._$primaryElements.length < 2) {\n return;\n }\n\n this._$primaryElements.slice(1).forEach(($el) => $el.setAttribute('slot', 'secondary'));\n });\n }\n\n protected _onSecondaryChange(_e: Event) {\n queueMicrotask(() => {\n if (!this._$secondaryElements.length || this._$primaryElements.length) {\n return;\n }\n\n this._$secondaryElements.at(0)?.removeAttribute('slot');\n });\n }\n\n /**\n * The extent of `rect` along a logical axis. The pane axis is vertical on\n * screen in vertical text, so a physical width would measure the wrong one.\n */\n protected _sizeAlong(rect: DOMRect, axis: LogicalAxis): number {\n return physicalAxis(axis, resolveFlow(this)) === 'x' ? rect.width : rect.height;\n }\n\n protected _measureHostSize(axis: 'inline' | 'block'): number {\n const measuredSize = this._sizeAlong(this.getBoundingClientRect(), axis) / cssZoom(this);\n\n if (measuredSize > 0) {\n return Math.ceil(measuredSize);\n }\n\n const computedStyle = getComputedStyle(this);\n const fallbackSize = axis === 'inline' ? computedStyle.inlineSize : computedStyle.blockSize;\n const parsedFallbackSize = Number.parseFloat(fallbackSize);\n\n return Number.isFinite(parsedFallbackSize) ? Math.ceil(parsedFallbackSize) : 0;\n }\n\n protected _onResize() {\n const $el = this._$primaryElements.at(0);\n const prevStyle = this._$primary.style.getPropertyValue('display');\n\n // Request animation frame to prevent layout paint jank.\n globalThis.requestAnimationFrame(() => {\n // Temporarily display the first light DOM element as a direct child for measurement.\n this._$primary.style.setProperty('display', 'contents');\n\n const clientRect = $el?.getBoundingClientRect() ?? this.getBoundingClientRect();\n\n if (this.mode !== 'percent') {\n const measured =\n this.orientation === 'horizontal'\n ? // For horizontal splitters, just take the host width...\n this._measureHostSize('inline')\n : // ...otherwise try to use the first lightDOM element's auto height, and cache it\n this._initialMax ||\n Math.ceil(this._sizeAlong(clientRect, 'block') / cssZoom(this)) ||\n this._measureHostSize('block');\n\n // After initialization, ignore spurious zero measurements (e.g. during\n // Chromium's layout recalculation triggered by a secondary ResizeObserver\n // callback). A temporarily-zero result would clamp _value to 0 incorrectly.\n if (measured > 0 || !this._initialMax) {\n this._maxValue = measured;\n }\n } else {\n // Percentage max is always just 100%\n this._maxValue = 100.0;\n }\n\n if (!this._initialMax) {\n this._initialMax = this._maxValue;\n\n this._setValue(\n this._valueInitialized\n ? this._value\n : (this._hostValue ?? this.defaultValue ?? this._maxValue / 2),\n false,\n );\n } else if (this._hostValue !== undefined) {\n this._setValue(this._hostValue, false);\n } else {\n this._setValue(this.value, false);\n }\n\n // Restore previous display mode\n prevStyle\n ? this._$primary.style.setProperty('display', prevStyle)\n : this._$primary.style.removeProperty('display');\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._resizeObserver.observe(this);\n }\n\n disconnectedCallback(): void {\n this._resizeObserver.disconnect();\n this._activeSnapAnimation?.cancel();\n this._activeSnapAnimation = null;\n super.disconnectedCallback();\n }\n\n firstUpdated() {\n this._onResize();\n }\n\n protected updated(): void {\n this._gesture.setOptions({\n axis: physicalAxis(this._paneAxis, this._flow.flow),\n target: () => this._$separatorHandle,\n });\n }\n\n render() {\n // The separator bar's rendered direction, which turns with the text. The\n // grip dots and resize cursor are physical, so they key off this rather\n // than the orientation attribute, which names a layout.\n const bar = renderedOrientation(\n this.orientation === 'horizontal' ? 'vertical' : 'horizontal',\n this._flow.flow,\n );\n\n const m = this._messages.value;\n const label = this.label ?? m.label;\n\n return html`\n <div\n id=\"primary\"\n part=\"primary\"\n aria-label=${label}\n style=${`${this._paneAxis === 'inline' ? 'inline' : 'block'}-size: ${this.valueText}`}\n ?hidden=${this.value === this._minValue}\n >\n <slot @slotchange=${this._onPrimaryChange}></slot>\n </div>\n\n <div id=\"separator\" part=\"separator\">\n ${this.collapsible && this._$secondaryElements.length && !this.fixed\n ? html`<button\n id=\"collapse-button\"\n part=\"collapse-button\"\n aria-label=${this._isCollapsed ? m.expand(label) : m.collapse(label)}\n aria-expanded=${String(!this._isCollapsed)}\n aria-controls=\"primary\"\n @click=${this._onCollapseButtonClick}\n >\n ${this._collapseButtonIcon}\n </button>`\n : nothing}\n <div\n id=\"separator-handle\"\n role=\"separator\"\n tabindex=\"0\"\n part=\"separator-handle\"\n aria-labelledby=\"primary\"\n aria-controls=\"primary\"\n aria-orientation=${bar}\n data-bar=${bar}\n aria-valuenow=${this.value}\n aria-valuetext=${this._accessibleValueText}\n aria-valuemin=${this._effectiveMin}\n aria-valuemax=${this._effectiveMax}\n @keydown=${this._onCollapseKeydown}\n ${keyNavigation(this._onKeyboardResize)}\n ${keyInteraction()}\n ?hidden=${!this._$secondaryElements.length}\n ></div>\n </div>\n\n <aside\n id=\"secondary\"\n part=\"secondary\"\n ?hidden=${!this._$secondaryElements.length || this.value === this._maxValue}\n >\n <slot name=\"secondary\" @slotchange=${this._onSecondaryChange}></slot>\n </aside>\n `;\n }\n}\n\nexport default RCSplitter;\n"],"names":["splitterStyles","css","CHEVRON_PATHS","OPPOSITE_SIDE","paneStartSide","axis","flow","reversed","isReversed","physicalAxis","MIN_SWIPE_DISTANCE","DEFAULT_SNAP_DURATION_MS","SNAP_EASING","DEFAULT_SPLITTER_MESSAGES","label","bidiIsolate","_RCSplitter","LitElement","MessagesController","DragGestureController","detail","FlowController","val","oldValue","renderedOrientation","resolveFlow","startSide","points","d","html","dispatch","locale","numberFormat","action","clientRect","alongX","size","fromPhysicalStart","offset","index","behavior","clampedIndex","_detail","delta","logicalDelta","velocity","decisive","restoreValue","findNextSnapIndex","findNearestSnapIndex","point","value","$primary","fromSizeCssPx","cssZoom","toSizeCssPx","property","animation","raw","parseCssTime","_e","$el","rect","measuredSize","computedStyle","fallbackSize","parsedFallbackSize","prevStyle","measured","bar","m","nothing","keyNavigation","keyInteraction","RCSplitter","__decorateClass","state","query","queryAssignedElements"],"mappings":";;;AAEO,MAAMA,IAAiBC;;;;;;AC8B9B,MAAMC,IAA6C;AAAA,EACjD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,IAAI;AA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|
1
|
+
import { R as t } from "./rc-splitter-_P5HsZI9.js";
|
|
2
|
+
import { D as m } from "./rc-splitter-_P5HsZI9.js";
|
|
2
3
|
customElements.get("rc-splitter") || customElements.define("rc-splitter", t);
|
|
3
4
|
export {
|
|
5
|
+
m as DEFAULT_SPLITTER_MESSAGES,
|
|
4
6
|
t as RCSplitter
|
|
5
7
|
};
|
|
6
8
|
//# sourceMappingURL=rc-splitter-define.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rc-splitter-define.js","sources":["../src/define.ts"],"sourcesContent":["import { RCSplitter } from './index.js';\n\ncustomElements.get('rc-splitter') || customElements.define('rc-splitter', RCSplitter);\n\nexport * from './index.js';\n"],"names":["RCSplitter"],"mappings":"
|
|
1
|
+
{"version":3,"file":"rc-splitter-define.js","sources":["../src/define.ts"],"sourcesContent":["import { RCSplitter } from './index.js';\n\ncustomElements.get('rc-splitter') || customElements.define('rc-splitter', RCSplitter);\n\nexport * from './index.js';\n"],"names":["RCSplitter"],"mappings":";;AAEA,eAAe,IAAI,aAAa,KAAK,eAAe,OAAO,eAAeA,CAAU;"}
|
package/dist/rc-splitter.js
CHANGED