@primer/react 38.6.0 → 38.6.1
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 +6 -0
- package/dist/PageLayout/PageLayout-c092f3db.css +2 -0
- package/dist/PageLayout/PageLayout-c092f3db.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +1 -12
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +502 -490
- package/dist/PageLayout/PageLayout.module.css.js +2 -2
- package/dist/PageLayout/usePaneWidth.d.ts +71 -0
- package/dist/PageLayout/usePaneWidth.d.ts.map +1 -0
- package/dist/PageLayout/usePaneWidth.js +283 -0
- package/dist/PageLayout/usePaneWidth.test.d.ts +2 -0
- package/dist/PageLayout/usePaneWidth.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/PageLayout/PageLayout-28a244f7.css +0 -2
- package/dist/PageLayout/PageLayout-28a244f7.css.map +0 -1
|
@@ -5,11 +5,11 @@ import { useId } from '../hooks/useId.js';
|
|
|
5
5
|
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
6
6
|
import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
7
7
|
import { useSlots } from '../hooks/useSlots.js';
|
|
8
|
-
import { canUseDOM } from '../utils/environment.js';
|
|
9
8
|
import { useOverflow } from '../hooks/useOverflow.js';
|
|
10
9
|
import { warning } from '../utils/warning.js';
|
|
11
10
|
import { getResponsiveAttributes } from '../internal/utils/getResponsiveAttributes.js';
|
|
12
11
|
import classes from './PageLayout.module.css.js';
|
|
12
|
+
import { usePaneWidth, isCustomWidthOptions, isPaneWidth, updateAriaValues, ARROW_KEY_STEP } from './usePaneWidth.js';
|
|
13
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
const PageLayoutContext = /*#__PURE__*/React.createContext({
|
|
@@ -18,6 +18,9 @@ const PageLayoutContext = /*#__PURE__*/React.createContext({
|
|
|
18
18
|
columnGap: 'normal',
|
|
19
19
|
paneRef: {
|
|
20
20
|
current: null
|
|
21
|
+
},
|
|
22
|
+
contentRef: {
|
|
23
|
+
current: null
|
|
21
24
|
}
|
|
22
25
|
});
|
|
23
26
|
|
|
@@ -39,6 +42,7 @@ const Root = t0 => {
|
|
|
39
42
|
const rowGap = t3 === undefined ? "normal" : t3;
|
|
40
43
|
const columnGap = t4 === undefined ? "normal" : t4;
|
|
41
44
|
const paneRef = useRef(null);
|
|
45
|
+
const contentRef = useRef(null);
|
|
42
46
|
let t5;
|
|
43
47
|
if ($[0] !== slotsConfig) {
|
|
44
48
|
t5 = slotsConfig !== null && slotsConfig !== void 0 ? slotsConfig : {
|
|
@@ -57,7 +61,8 @@ const Root = t0 => {
|
|
|
57
61
|
padding,
|
|
58
62
|
rowGap,
|
|
59
63
|
columnGap,
|
|
60
|
-
paneRef
|
|
64
|
+
paneRef,
|
|
65
|
+
contentRef
|
|
61
66
|
};
|
|
62
67
|
$[2] = columnGap;
|
|
63
68
|
$[3] = padding;
|
|
@@ -100,6 +105,7 @@ const Root = t0 => {
|
|
|
100
105
|
let t13;
|
|
101
106
|
if ($[12] !== rest) {
|
|
102
107
|
t13 = /*#__PURE__*/jsx("div", {
|
|
108
|
+
ref: contentRef,
|
|
103
109
|
className: t12,
|
|
104
110
|
children: rest
|
|
105
111
|
});
|
|
@@ -225,248 +231,259 @@ const HorizontalDivider = t0 => {
|
|
|
225
231
|
return t8;
|
|
226
232
|
};
|
|
227
233
|
const VerticalDivider = t0 => {
|
|
228
|
-
const $ = c(
|
|
234
|
+
const $ = c(12);
|
|
229
235
|
const {
|
|
230
236
|
variant: t1,
|
|
231
|
-
|
|
237
|
+
position,
|
|
238
|
+
className,
|
|
239
|
+
style,
|
|
240
|
+
children
|
|
241
|
+
} = t0;
|
|
242
|
+
const variant = t1 === undefined ? "none" : t1;
|
|
243
|
+
let t2;
|
|
244
|
+
if ($[0] !== className) {
|
|
245
|
+
t2 = clsx(classes.VerticalDivider, className);
|
|
246
|
+
$[0] = className;
|
|
247
|
+
$[1] = t2;
|
|
248
|
+
} else {
|
|
249
|
+
t2 = $[1];
|
|
250
|
+
}
|
|
251
|
+
let t3;
|
|
252
|
+
if ($[2] !== variant) {
|
|
253
|
+
t3 = getResponsiveAttributes("variant", variant);
|
|
254
|
+
$[2] = variant;
|
|
255
|
+
$[3] = t3;
|
|
256
|
+
} else {
|
|
257
|
+
t3 = $[3];
|
|
258
|
+
}
|
|
259
|
+
let t4;
|
|
260
|
+
if ($[4] !== position) {
|
|
261
|
+
t4 = getResponsiveAttributes("position", position);
|
|
262
|
+
$[4] = position;
|
|
263
|
+
$[5] = t4;
|
|
264
|
+
} else {
|
|
265
|
+
t4 = $[5];
|
|
266
|
+
}
|
|
267
|
+
let t5;
|
|
268
|
+
if ($[6] !== children || $[7] !== style || $[8] !== t2 || $[9] !== t3 || $[10] !== t4) {
|
|
269
|
+
t5 = /*#__PURE__*/jsx("div", {
|
|
270
|
+
className: t2,
|
|
271
|
+
...t3,
|
|
272
|
+
...t4,
|
|
273
|
+
style: style,
|
|
274
|
+
children: children
|
|
275
|
+
});
|
|
276
|
+
$[6] = children;
|
|
277
|
+
$[7] = style;
|
|
278
|
+
$[8] = t2;
|
|
279
|
+
$[9] = t3;
|
|
280
|
+
$[10] = t4;
|
|
281
|
+
$[11] = t5;
|
|
282
|
+
} else {
|
|
283
|
+
t5 = $[11];
|
|
284
|
+
}
|
|
285
|
+
return t5;
|
|
286
|
+
};
|
|
287
|
+
const DATA_DRAGGING_ATTR = 'data-dragging';
|
|
288
|
+
const isDragging = handle => {
|
|
289
|
+
return (handle === null || handle === void 0 ? void 0 : handle.getAttribute(DATA_DRAGGING_ATTR)) === 'true';
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* DragHandle - handles all pointer and keyboard interactions for resizing
|
|
294
|
+
* ARIA values are set in JSX for SSR accessibility,
|
|
295
|
+
* then updated via DOM manipulation during drag for performance
|
|
296
|
+
*/
|
|
297
|
+
const DragHandle = t0 => {
|
|
298
|
+
const $ = c(34);
|
|
299
|
+
const {
|
|
300
|
+
handleRef,
|
|
232
301
|
onDragStart,
|
|
233
302
|
onDrag,
|
|
234
303
|
onDragEnd,
|
|
235
304
|
onDoubleClick,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
305
|
+
"aria-valuemin": ariaValueMin,
|
|
306
|
+
"aria-valuemax": ariaValueMax,
|
|
307
|
+
"aria-valuenow": ariaValueNow
|
|
239
308
|
} = t0;
|
|
240
|
-
const
|
|
241
|
-
const draggable = t2 === undefined ? false : t2;
|
|
242
|
-
const [isDragging, setIsDragging] = React.useState(false);
|
|
243
|
-
const [isKeyboardDrag, setIsKeyboardDrag] = React.useState(false);
|
|
309
|
+
const stableOnDragStart = React.useRef(onDragStart);
|
|
244
310
|
const stableOnDrag = React.useRef(onDrag);
|
|
245
311
|
const stableOnDragEnd = React.useRef(onDragEnd);
|
|
312
|
+
let t1;
|
|
313
|
+
if ($[0] !== onDrag || $[1] !== onDragEnd || $[2] !== onDragStart) {
|
|
314
|
+
t1 = () => {
|
|
315
|
+
stableOnDragStart.current = onDragStart;
|
|
316
|
+
stableOnDrag.current = onDrag;
|
|
317
|
+
stableOnDragEnd.current = onDragEnd;
|
|
318
|
+
};
|
|
319
|
+
$[0] = onDrag;
|
|
320
|
+
$[1] = onDragEnd;
|
|
321
|
+
$[2] = onDragStart;
|
|
322
|
+
$[3] = t1;
|
|
323
|
+
} else {
|
|
324
|
+
t1 = $[3];
|
|
325
|
+
}
|
|
326
|
+
React.useEffect(t1);
|
|
246
327
|
const {
|
|
247
|
-
paneRef
|
|
328
|
+
paneRef,
|
|
329
|
+
contentRef
|
|
248
330
|
} = React.useContext(PageLayoutContext);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
331
|
+
let t2;
|
|
332
|
+
if ($[4] !== contentRef || $[5] !== handleRef) {
|
|
333
|
+
t2 = dragging => {
|
|
334
|
+
if (dragging) {
|
|
335
|
+
var _handleRef$current, _contentRef$current;
|
|
336
|
+
(_handleRef$current = handleRef.current) === null || _handleRef$current === void 0 ? void 0 : _handleRef$current.setAttribute(DATA_DRAGGING_ATTR, "true");
|
|
337
|
+
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.setAttribute(DATA_DRAGGING_ATTR, "true");
|
|
338
|
+
} else {
|
|
339
|
+
var _handleRef$current2, _contentRef$current2;
|
|
340
|
+
(_handleRef$current2 = handleRef.current) === null || _handleRef$current2 === void 0 ? void 0 : _handleRef$current2.removeAttribute(DATA_DRAGGING_ATTR);
|
|
341
|
+
(_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 ? void 0 : _contentRef$current2.removeAttribute(DATA_DRAGGING_ATTR);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
$[4] = contentRef;
|
|
345
|
+
$[5] = handleRef;
|
|
346
|
+
$[6] = t2;
|
|
347
|
+
} else {
|
|
348
|
+
t2 = $[6];
|
|
349
|
+
}
|
|
350
|
+
const setDragging = t2;
|
|
252
351
|
let t3;
|
|
253
|
-
if ($[
|
|
254
|
-
t3 =
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
const maxPaneWidthDiffPixels = paneStyles.getPropertyValue("--pane-max-width-diff");
|
|
258
|
-
const minWidthPixels = paneStyles.getPropertyValue("--pane-min-width");
|
|
259
|
-
const paneWidth = paneRef.current.getBoundingClientRect().width;
|
|
260
|
-
const maxPaneWidthDiff = Number(maxPaneWidthDiffPixels.split("px")[0]);
|
|
261
|
-
const minPaneWidth = Number(minWidthPixels.split("px")[0]);
|
|
262
|
-
const viewportWidth = window.innerWidth;
|
|
263
|
-
const maxPaneWidth = viewportWidth > maxPaneWidthDiff ? viewportWidth - maxPaneWidthDiff : viewportWidth;
|
|
264
|
-
setMinWidth(minPaneWidth);
|
|
265
|
-
setMaxWidth(maxPaneWidth);
|
|
266
|
-
setCurrentWidth(paneWidth || 0);
|
|
352
|
+
if ($[7] !== setDragging) {
|
|
353
|
+
t3 = event => {
|
|
354
|
+
if (event.button !== 0) {
|
|
355
|
+
return;
|
|
267
356
|
}
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
const target = event.currentTarget;
|
|
359
|
+
target.setPointerCapture(event.pointerId);
|
|
360
|
+
stableOnDragStart.current(event.clientX);
|
|
361
|
+
setDragging(true);
|
|
268
362
|
};
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
363
|
+
$[7] = setDragging;
|
|
364
|
+
$[8] = t3;
|
|
271
365
|
} else {
|
|
272
|
-
t3 = $[
|
|
366
|
+
t3 = $[8];
|
|
273
367
|
}
|
|
368
|
+
const handlePointerDown = t3;
|
|
274
369
|
let t4;
|
|
275
|
-
if ($[
|
|
276
|
-
t4 =
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
370
|
+
if ($[9] !== handleRef) {
|
|
371
|
+
t4 = event_0 => {
|
|
372
|
+
if (!isDragging(handleRef.current)) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
event_0.preventDefault();
|
|
376
|
+
stableOnDrag.current(event_0.clientX, false);
|
|
377
|
+
};
|
|
378
|
+
$[9] = handleRef;
|
|
379
|
+
$[10] = t4;
|
|
281
380
|
} else {
|
|
282
|
-
t4 = $[
|
|
381
|
+
t4 = $[10];
|
|
283
382
|
}
|
|
284
|
-
|
|
383
|
+
const handlePointerMove = t4;
|
|
285
384
|
let t5;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
385
|
+
if ($[11] !== handleRef) {
|
|
386
|
+
t5 = event_1 => {
|
|
387
|
+
if (!isDragging(handleRef.current)) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
event_1.preventDefault();
|
|
290
391
|
};
|
|
291
|
-
|
|
292
|
-
$[
|
|
293
|
-
$[7] = t5;
|
|
294
|
-
$[8] = t6;
|
|
392
|
+
$[11] = handleRef;
|
|
393
|
+
$[12] = t5;
|
|
295
394
|
} else {
|
|
296
|
-
t5 = $[
|
|
297
|
-
t6 = $[8];
|
|
395
|
+
t5 = $[12];
|
|
298
396
|
}
|
|
299
|
-
|
|
300
|
-
let
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
397
|
+
const handlePointerUp = t5;
|
|
398
|
+
let t6;
|
|
399
|
+
if ($[13] !== handleRef || $[14] !== setDragging) {
|
|
400
|
+
t6 = () => {
|
|
401
|
+
if (!isDragging(handleRef.current)) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
setDragging(false);
|
|
405
|
+
stableOnDragEnd.current();
|
|
305
406
|
};
|
|
306
|
-
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[11] = t8;
|
|
407
|
+
$[13] = handleRef;
|
|
408
|
+
$[14] = setDragging;
|
|
409
|
+
$[15] = t6;
|
|
310
410
|
} else {
|
|
311
|
-
|
|
312
|
-
t8 = $[11];
|
|
411
|
+
t6 = $[15];
|
|
313
412
|
}
|
|
314
|
-
|
|
315
|
-
let
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
const handleDrag = function handleDrag(event) {
|
|
320
|
-
var _stableOnDrag$current;
|
|
321
|
-
(_stableOnDrag$current = stableOnDrag.current) === null || _stableOnDrag$current === void 0 ? void 0 : _stableOnDrag$current.call(stableOnDrag, event.movementX, false);
|
|
322
|
-
event.preventDefault();
|
|
323
|
-
};
|
|
324
|
-
const handleDragEnd = function handleDragEnd(event_0) {
|
|
325
|
-
var _stableOnDragEnd$curr;
|
|
326
|
-
setIsDragging(false);
|
|
327
|
-
(_stableOnDragEnd$curr = stableOnDragEnd.current) === null || _stableOnDragEnd$curr === void 0 ? void 0 : _stableOnDragEnd$curr.call(stableOnDragEnd);
|
|
328
|
-
event_0.preventDefault();
|
|
329
|
-
};
|
|
330
|
-
const handleKeyDrag = function handleKeyDrag(event_1) {
|
|
331
|
-
var _stableOnDrag$current2;
|
|
332
|
-
let delta;
|
|
333
|
-
if ((event_1.key === "ArrowLeft" || event_1.key === "ArrowDown") && currentWidth > minWidth) {
|
|
334
|
-
delta = -3;
|
|
335
|
-
} else {
|
|
336
|
-
if ((event_1.key === "ArrowRight" || event_1.key === "ArrowUp") && currentWidth < maxWidth) {
|
|
337
|
-
delta = 3;
|
|
338
|
-
} else {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
setCurrentWidth(currentWidth + delta);
|
|
343
|
-
(_stableOnDrag$current2 = stableOnDrag.current) === null || _stableOnDrag$current2 === void 0 ? void 0 : _stableOnDrag$current2.call(stableOnDrag, delta, true);
|
|
344
|
-
event_1.preventDefault();
|
|
345
|
-
};
|
|
346
|
-
const handleKeyDragEnd = function handleKeyDragEnd(event_2) {
|
|
347
|
-
var _stableOnDragEnd$curr2;
|
|
348
|
-
setIsKeyboardDrag(false);
|
|
349
|
-
(_stableOnDragEnd$curr2 = stableOnDragEnd.current) === null || _stableOnDragEnd$curr2 === void 0 ? void 0 : _stableOnDragEnd$curr2.call(stableOnDragEnd);
|
|
413
|
+
const handleLostPointerCapture = t6;
|
|
414
|
+
let t7;
|
|
415
|
+
if ($[16] !== paneRef || $[17] !== setDragging) {
|
|
416
|
+
t7 = event_2 => {
|
|
417
|
+
if (event_2.key === "ArrowLeft" || event_2.key === "ArrowRight" || event_2.key === "ArrowUp" || event_2.key === "ArrowDown") {
|
|
350
418
|
event_2.preventDefault();
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const body = document.body;
|
|
358
|
-
body === null || body === void 0 ? void 0 : body.setAttribute("data-page-layout-dragging", "true");
|
|
359
|
-
} else {
|
|
360
|
-
window.removeEventListener("mousemove", handleDrag);
|
|
361
|
-
window.removeEventListener("mouseup", handleDragEnd);
|
|
362
|
-
window.removeEventListener("keydown", handleKeyDrag);
|
|
363
|
-
window.removeEventListener("keyup", handleKeyDragEnd);
|
|
364
|
-
const body_0 = document.body;
|
|
365
|
-
body_0 === null || body_0 === void 0 ? void 0 : body_0.removeAttribute("data-page-layout-dragging");
|
|
419
|
+
if (!paneRef.current) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const delta = event_2.key === "ArrowLeft" || event_2.key === "ArrowDown" ? -ARROW_KEY_STEP : ARROW_KEY_STEP;
|
|
423
|
+
setDragging(true);
|
|
424
|
+
stableOnDrag.current(delta, true);
|
|
366
425
|
}
|
|
367
|
-
return () => {
|
|
368
|
-
window.removeEventListener("mousemove", handleDrag);
|
|
369
|
-
window.removeEventListener("mouseup", handleDragEnd);
|
|
370
|
-
window.removeEventListener("keydown", handleKeyDrag);
|
|
371
|
-
window.removeEventListener("keyup", handleKeyDragEnd);
|
|
372
|
-
const body_1 = document.body;
|
|
373
|
-
body_1 === null || body_1 === void 0 ? void 0 : body_1.removeAttribute("data-page-layout-dragging");
|
|
374
|
-
};
|
|
375
426
|
};
|
|
376
|
-
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[14] = isKeyboardDrag;
|
|
380
|
-
$[15] = maxWidth;
|
|
381
|
-
$[16] = minWidth;
|
|
382
|
-
$[17] = t10;
|
|
383
|
-
$[18] = t9;
|
|
384
|
-
} else {
|
|
385
|
-
t10 = $[17];
|
|
386
|
-
t9 = $[18];
|
|
387
|
-
}
|
|
388
|
-
React.useEffect(t9, t10);
|
|
389
|
-
let t11;
|
|
390
|
-
if ($[19] !== className) {
|
|
391
|
-
t11 = clsx(classes.VerticalDivider, className);
|
|
392
|
-
$[19] = className;
|
|
393
|
-
$[20] = t11;
|
|
394
|
-
} else {
|
|
395
|
-
t11 = $[20];
|
|
396
|
-
}
|
|
397
|
-
let t12;
|
|
398
|
-
if ($[21] !== variant) {
|
|
399
|
-
t12 = getResponsiveAttributes("variant", variant);
|
|
400
|
-
$[21] = variant;
|
|
401
|
-
$[22] = t12;
|
|
427
|
+
$[16] = paneRef;
|
|
428
|
+
$[17] = setDragging;
|
|
429
|
+
$[18] = t7;
|
|
402
430
|
} else {
|
|
403
|
-
|
|
431
|
+
t7 = $[18];
|
|
404
432
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
433
|
+
const handleKeyDown = t7;
|
|
434
|
+
let t8;
|
|
435
|
+
if ($[19] !== setDragging) {
|
|
436
|
+
t8 = event_3 => {
|
|
437
|
+
if (event_3.key === "ArrowLeft" || event_3.key === "ArrowRight" || event_3.key === "ArrowUp" || event_3.key === "ArrowDown") {
|
|
438
|
+
event_3.preventDefault();
|
|
439
|
+
setDragging(false);
|
|
440
|
+
stableOnDragEnd.current();
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
$[19] = setDragging;
|
|
444
|
+
$[20] = t8;
|
|
410
445
|
} else {
|
|
411
|
-
|
|
446
|
+
t8 = $[20];
|
|
412
447
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
448
|
+
const handleKeyUp = t8;
|
|
449
|
+
const t9 = ariaValueNow !== undefined ? `Pane width ${ariaValueNow} pixels` : undefined;
|
|
450
|
+
let t10;
|
|
451
|
+
if ($[21] !== ariaValueMax || $[22] !== ariaValueMin || $[23] !== ariaValueNow || $[24] !== handleKeyDown || $[25] !== handleKeyUp || $[26] !== handleLostPointerCapture || $[27] !== handlePointerDown || $[28] !== handlePointerMove || $[29] !== handlePointerUp || $[30] !== handleRef || $[31] !== onDoubleClick || $[32] !== t9) {
|
|
452
|
+
t10 = /*#__PURE__*/jsx("div", {
|
|
453
|
+
ref: handleRef,
|
|
416
454
|
className: classes.DraggableHandle,
|
|
417
|
-
"data-dragging": isDragging || isKeyboardDrag,
|
|
418
455
|
role: "slider",
|
|
419
456
|
"aria-label": "Draggable pane splitter",
|
|
420
|
-
"aria-valuemin":
|
|
421
|
-
"aria-valuemax":
|
|
422
|
-
"aria-valuenow":
|
|
423
|
-
"aria-valuetext":
|
|
457
|
+
"aria-valuemin": ariaValueMin,
|
|
458
|
+
"aria-valuemax": ariaValueMax,
|
|
459
|
+
"aria-valuenow": ariaValueNow,
|
|
460
|
+
"aria-valuetext": t9,
|
|
424
461
|
tabIndex: 0,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
onKeyDown: event_4 => {
|
|
432
|
-
if (event_4.key === "ArrowLeft" || event_4.key === "ArrowRight" || event_4.key === "ArrowUp" || event_4.key === "ArrowDown") {
|
|
433
|
-
setIsKeyboardDrag(true);
|
|
434
|
-
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart();
|
|
435
|
-
}
|
|
436
|
-
},
|
|
462
|
+
onPointerDown: handlePointerDown,
|
|
463
|
+
onPointerMove: handlePointerMove,
|
|
464
|
+
onPointerUp: handlePointerUp,
|
|
465
|
+
onLostPointerCapture: handleLostPointerCapture,
|
|
466
|
+
onKeyDown: handleKeyDown,
|
|
467
|
+
onKeyUp: handleKeyUp,
|
|
437
468
|
onDoubleClick: onDoubleClick
|
|
438
|
-
}) : null;
|
|
439
|
-
$[25] = currentWidth;
|
|
440
|
-
$[26] = draggable;
|
|
441
|
-
$[27] = isDragging;
|
|
442
|
-
$[28] = isKeyboardDrag;
|
|
443
|
-
$[29] = maxWidth;
|
|
444
|
-
$[30] = minWidth;
|
|
445
|
-
$[31] = onDoubleClick;
|
|
446
|
-
$[32] = onDragStart;
|
|
447
|
-
$[33] = t14;
|
|
448
|
-
} else {
|
|
449
|
-
t14 = $[33];
|
|
450
|
-
}
|
|
451
|
-
let t15;
|
|
452
|
-
if ($[34] !== style || $[35] !== t11 || $[36] !== t12 || $[37] !== t13 || $[38] !== t14) {
|
|
453
|
-
t15 = /*#__PURE__*/jsx("div", {
|
|
454
|
-
className: t11,
|
|
455
|
-
...t12,
|
|
456
|
-
...t13,
|
|
457
|
-
style: style,
|
|
458
|
-
children: t14
|
|
459
469
|
});
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
470
|
+
$[21] = ariaValueMax;
|
|
471
|
+
$[22] = ariaValueMin;
|
|
472
|
+
$[23] = ariaValueNow;
|
|
473
|
+
$[24] = handleKeyDown;
|
|
474
|
+
$[25] = handleKeyUp;
|
|
475
|
+
$[26] = handleLostPointerCapture;
|
|
476
|
+
$[27] = handlePointerDown;
|
|
477
|
+
$[28] = handlePointerMove;
|
|
478
|
+
$[29] = handlePointerUp;
|
|
479
|
+
$[30] = handleRef;
|
|
480
|
+
$[31] = onDoubleClick;
|
|
481
|
+
$[32] = t9;
|
|
482
|
+
$[33] = t10;
|
|
466
483
|
} else {
|
|
467
|
-
|
|
484
|
+
t10 = $[33];
|
|
468
485
|
}
|
|
469
|
-
return
|
|
486
|
+
return t10;
|
|
470
487
|
};
|
|
471
488
|
|
|
472
489
|
// ----------------------------------------------------------------------------
|
|
@@ -694,22 +711,6 @@ const Content = t0 => {
|
|
|
694
711
|
return t11;
|
|
695
712
|
};
|
|
696
713
|
Content.displayName = 'PageLayout.Content';
|
|
697
|
-
|
|
698
|
-
// ----------------------------------------------------------------------------
|
|
699
|
-
// PageLayout.Pane
|
|
700
|
-
|
|
701
|
-
const isCustomWidthOptions = width => {
|
|
702
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
703
|
-
return width.default !== undefined;
|
|
704
|
-
};
|
|
705
|
-
const isPaneWidth = width => {
|
|
706
|
-
return ['small', 'medium', 'large'].includes(width);
|
|
707
|
-
};
|
|
708
|
-
const defaultPaneWidth = {
|
|
709
|
-
small: 256,
|
|
710
|
-
medium: 296,
|
|
711
|
-
large: 320
|
|
712
|
-
};
|
|
713
714
|
const overflowProps = {
|
|
714
715
|
tabIndex: 0,
|
|
715
716
|
role: 'region'
|
|
@@ -797,48 +798,43 @@ const Pane = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
797
798
|
columnGap,
|
|
798
799
|
paneRef
|
|
799
800
|
} = React.useContext(PageLayoutContext);
|
|
800
|
-
const
|
|
801
|
+
const handleRef = React.useRef(null);
|
|
802
|
+
const dragStartClientXRef = React.useRef(0);
|
|
803
|
+
const dragStartWidthRef = React.useRef(0);
|
|
804
|
+
const dragMaxWidthRef = React.useRef(0);
|
|
801
805
|
let t17;
|
|
802
|
-
if ($[10] !==
|
|
803
|
-
t17 =
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
} catch (t18) {
|
|
811
|
-
storedWidth = null;
|
|
812
|
-
}
|
|
813
|
-
return storedWidth && !isNaN(Number(storedWidth)) ? Number(storedWidth) : getDefaultPaneWidth(width);
|
|
814
|
-
};
|
|
815
|
-
$[10] = width;
|
|
816
|
-
$[11] = widthStorageKey;
|
|
817
|
-
$[12] = t17;
|
|
818
|
-
} else {
|
|
819
|
-
t17 = $[12];
|
|
820
|
-
}
|
|
821
|
-
const [paneWidth, setPaneWidth] = React.useState(t17);
|
|
822
|
-
let t18;
|
|
823
|
-
if ($[13] !== widthStorageKey) {
|
|
824
|
-
t18 = width_1 => {
|
|
825
|
-
setPaneWidth(width_1);
|
|
826
|
-
try {
|
|
827
|
-
localStorage.setItem(widthStorageKey, width_1.toString());
|
|
828
|
-
} catch (t19) {
|
|
829
|
-
}
|
|
806
|
+
if ($[10] !== minWidth || $[11] !== paneRef || $[12] !== resizable || $[13] !== width || $[14] !== widthStorageKey) {
|
|
807
|
+
t17 = {
|
|
808
|
+
width,
|
|
809
|
+
minWidth,
|
|
810
|
+
resizable,
|
|
811
|
+
widthStorageKey,
|
|
812
|
+
paneRef,
|
|
813
|
+
handleRef
|
|
830
814
|
};
|
|
831
|
-
$[
|
|
832
|
-
$[
|
|
815
|
+
$[10] = minWidth;
|
|
816
|
+
$[11] = paneRef;
|
|
817
|
+
$[12] = resizable;
|
|
818
|
+
$[13] = width;
|
|
819
|
+
$[14] = widthStorageKey;
|
|
820
|
+
$[15] = t17;
|
|
833
821
|
} else {
|
|
834
|
-
|
|
822
|
+
t17 = $[15];
|
|
835
823
|
}
|
|
836
|
-
const
|
|
824
|
+
const {
|
|
825
|
+
currentWidth,
|
|
826
|
+
currentWidthRef,
|
|
827
|
+
minPaneWidth,
|
|
828
|
+
maxPaneWidth,
|
|
829
|
+
getMaxPaneWidth,
|
|
830
|
+
saveWidth,
|
|
831
|
+
getDefaultWidth
|
|
832
|
+
} = usePaneWidth(t17);
|
|
837
833
|
useRefObjectAsForwardedRef(forwardRef, paneRef);
|
|
838
834
|
const hasOverflow = useOverflow(paneRef);
|
|
839
835
|
const paneId = useId(id);
|
|
840
836
|
let labelProp;
|
|
841
|
-
if ($[
|
|
837
|
+
if ($[16] !== hasOverflow || $[17] !== label || $[18] !== labelledBy) {
|
|
842
838
|
labelProp = {};
|
|
843
839
|
if (hasOverflow) {
|
|
844
840
|
process.env.NODE_ENV !== "production" ? warning(label === undefined && labelledBy === undefined, "The <PageLayout.Pane> has overflow and `aria-label` or `aria-labelledby` has not been set. Please provide `aria-label` or `aria-labelledby` to <PageLayout.Pane> in order to label this region.") : void 0;
|
|
@@ -850,170 +846,171 @@ const Pane = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
850
846
|
}
|
|
851
847
|
}
|
|
852
848
|
}
|
|
853
|
-
$[
|
|
854
|
-
$[
|
|
855
|
-
$[
|
|
856
|
-
$[
|
|
849
|
+
$[16] = hasOverflow;
|
|
850
|
+
$[17] = label;
|
|
851
|
+
$[18] = labelledBy;
|
|
852
|
+
$[19] = labelProp;
|
|
857
853
|
} else {
|
|
858
|
-
labelProp = $[
|
|
854
|
+
labelProp = $[19];
|
|
859
855
|
}
|
|
860
|
-
let
|
|
861
|
-
if ($[
|
|
862
|
-
|
|
863
|
-
$[
|
|
864
|
-
$[
|
|
865
|
-
} else {
|
|
866
|
-
|
|
867
|
-
}
|
|
868
|
-
const
|
|
869
|
-
const
|
|
870
|
-
const
|
|
871
|
-
let
|
|
872
|
-
if ($[
|
|
873
|
-
|
|
874
|
-
"--offset-header":
|
|
875
|
-
"--spacing-row":
|
|
876
|
-
"--spacing-column":
|
|
856
|
+
let t18;
|
|
857
|
+
if ($[20] !== className) {
|
|
858
|
+
t18 = clsx(classes.PaneWrapper, className);
|
|
859
|
+
$[20] = className;
|
|
860
|
+
$[21] = t18;
|
|
861
|
+
} else {
|
|
862
|
+
t18 = $[21];
|
|
863
|
+
}
|
|
864
|
+
const t19 = typeof offsetHeader === "number" ? `${offsetHeader}px` : offsetHeader;
|
|
865
|
+
const t20 = `var(--spacing-${rowGap})`;
|
|
866
|
+
const t21 = `var(--spacing-${columnGap})`;
|
|
867
|
+
let t22;
|
|
868
|
+
if ($[22] !== style || $[23] !== t19 || $[24] !== t20 || $[25] !== t21) {
|
|
869
|
+
t22 = {
|
|
870
|
+
"--offset-header": t19,
|
|
871
|
+
"--spacing-row": t20,
|
|
872
|
+
"--spacing-column": t21,
|
|
877
873
|
...style
|
|
878
874
|
};
|
|
879
|
-
$[
|
|
880
|
-
$[
|
|
881
|
-
$[
|
|
882
|
-
$[
|
|
883
|
-
$[
|
|
875
|
+
$[22] = style;
|
|
876
|
+
$[23] = t19;
|
|
877
|
+
$[24] = t20;
|
|
878
|
+
$[25] = t21;
|
|
879
|
+
$[26] = t22;
|
|
884
880
|
} else {
|
|
885
|
-
|
|
881
|
+
t22 = $[26];
|
|
886
882
|
}
|
|
887
|
-
const
|
|
888
|
-
let
|
|
889
|
-
if ($[
|
|
890
|
-
|
|
891
|
-
$[
|
|
892
|
-
$[
|
|
883
|
+
const t23 = t22;
|
|
884
|
+
let t24;
|
|
885
|
+
if ($[27] !== responsiveHidden) {
|
|
886
|
+
t24 = getResponsiveAttributes("is-hidden", responsiveHidden);
|
|
887
|
+
$[27] = responsiveHidden;
|
|
888
|
+
$[28] = t24;
|
|
893
889
|
} else {
|
|
894
|
-
|
|
890
|
+
t24 = $[28];
|
|
895
891
|
}
|
|
896
|
-
let
|
|
897
|
-
if ($[
|
|
898
|
-
|
|
899
|
-
$[
|
|
900
|
-
$[
|
|
892
|
+
let t25;
|
|
893
|
+
if ($[29] !== positionProp) {
|
|
894
|
+
t25 = getResponsiveAttributes("position", positionProp);
|
|
895
|
+
$[29] = positionProp;
|
|
896
|
+
$[30] = t25;
|
|
901
897
|
} else {
|
|
902
|
-
|
|
898
|
+
t25 = $[30];
|
|
903
899
|
}
|
|
904
|
-
const
|
|
905
|
-
let
|
|
906
|
-
if ($[
|
|
907
|
-
|
|
900
|
+
const t26 = sticky || undefined;
|
|
901
|
+
let t27;
|
|
902
|
+
if ($[31] !== dividerProp || $[32] !== dividerVariant) {
|
|
903
|
+
t27 = isResponsiveValue(dividerProp) ? dividerProp : {
|
|
908
904
|
narrow: dividerVariant,
|
|
909
905
|
regular: "none"
|
|
910
906
|
};
|
|
911
|
-
$[
|
|
912
|
-
$[
|
|
913
|
-
$[
|
|
907
|
+
$[31] = dividerProp;
|
|
908
|
+
$[32] = dividerVariant;
|
|
909
|
+
$[33] = t27;
|
|
914
910
|
} else {
|
|
915
|
-
|
|
911
|
+
t27 = $[33];
|
|
916
912
|
}
|
|
917
|
-
const
|
|
918
|
-
let
|
|
919
|
-
if ($[
|
|
920
|
-
|
|
921
|
-
"--spacing":
|
|
913
|
+
const t28 = `var(--spacing-${rowGap})`;
|
|
914
|
+
let t29;
|
|
915
|
+
if ($[34] !== t28) {
|
|
916
|
+
t29 = {
|
|
917
|
+
"--spacing": t28
|
|
922
918
|
};
|
|
923
|
-
$[
|
|
924
|
-
$[
|
|
919
|
+
$[34] = t28;
|
|
920
|
+
$[35] = t29;
|
|
925
921
|
} else {
|
|
926
|
-
|
|
922
|
+
t29 = $[35];
|
|
927
923
|
}
|
|
928
|
-
const
|
|
929
|
-
let
|
|
930
|
-
if ($[
|
|
931
|
-
|
|
932
|
-
variant:
|
|
924
|
+
const t30 = t29;
|
|
925
|
+
let t31;
|
|
926
|
+
if ($[36] !== positionProp || $[37] !== t27 || $[38] !== t30) {
|
|
927
|
+
t31 = /*#__PURE__*/jsx(HorizontalDivider, {
|
|
928
|
+
variant: t27,
|
|
933
929
|
className: classes.PaneHorizontalDivider,
|
|
934
|
-
style:
|
|
930
|
+
style: t30,
|
|
935
931
|
position: positionProp
|
|
936
932
|
});
|
|
937
|
-
$[
|
|
938
|
-
$[
|
|
939
|
-
$[
|
|
940
|
-
$[
|
|
933
|
+
$[36] = positionProp;
|
|
934
|
+
$[37] = t27;
|
|
935
|
+
$[38] = t30;
|
|
936
|
+
$[39] = t31;
|
|
941
937
|
} else {
|
|
942
|
-
|
|
938
|
+
t31 = $[39];
|
|
943
939
|
}
|
|
944
|
-
let
|
|
945
|
-
if ($[
|
|
946
|
-
|
|
947
|
-
$[
|
|
948
|
-
$[
|
|
940
|
+
let t32;
|
|
941
|
+
if ($[40] !== hasOverflow) {
|
|
942
|
+
t32 = hasOverflow ? overflowProps : {};
|
|
943
|
+
$[40] = hasOverflow;
|
|
944
|
+
$[41] = t32;
|
|
949
945
|
} else {
|
|
950
|
-
|
|
946
|
+
t32 = $[41];
|
|
951
947
|
}
|
|
952
|
-
let
|
|
953
|
-
if ($[
|
|
954
|
-
|
|
948
|
+
let t33;
|
|
949
|
+
if ($[42] !== id || $[43] !== paneId) {
|
|
950
|
+
t33 = id && {
|
|
955
951
|
id: paneId
|
|
956
952
|
};
|
|
957
|
-
$[
|
|
958
|
-
$[
|
|
959
|
-
$[
|
|
960
|
-
} else {
|
|
961
|
-
|
|
962
|
-
}
|
|
963
|
-
const
|
|
964
|
-
const
|
|
965
|
-
const
|
|
966
|
-
const
|
|
967
|
-
const
|
|
968
|
-
const
|
|
969
|
-
const
|
|
970
|
-
let
|
|
971
|
-
if ($[
|
|
972
|
-
|
|
973
|
-
"--spacing":
|
|
974
|
-
"--pane-min-width":
|
|
975
|
-
"--pane-max-width":
|
|
976
|
-
"--pane-width-custom":
|
|
977
|
-
"--pane-width-size":
|
|
978
|
-
"--pane-width":
|
|
953
|
+
$[42] = id;
|
|
954
|
+
$[43] = paneId;
|
|
955
|
+
$[44] = t33;
|
|
956
|
+
} else {
|
|
957
|
+
t33 = $[44];
|
|
958
|
+
}
|
|
959
|
+
const t34 = resizable || undefined;
|
|
960
|
+
const t35 = `var(--spacing-${padding})`;
|
|
961
|
+
const t36 = isCustomWidthOptions(width) ? width.min : `${minWidth}px`;
|
|
962
|
+
const t37 = isCustomWidthOptions(width) ? width.max : "calc(100vw - var(--pane-max-width-diff))";
|
|
963
|
+
const t38 = isCustomWidthOptions(width) ? width.default : undefined;
|
|
964
|
+
const t39 = `var(--pane-width-${isPaneWidth(width) ? width : "custom"})`;
|
|
965
|
+
const t40 = `${currentWidth}px`;
|
|
966
|
+
let t41;
|
|
967
|
+
if ($[45] !== t35 || $[46] !== t36 || $[47] !== t37 || $[48] !== t38 || $[49] !== t39 || $[50] !== t40) {
|
|
968
|
+
t41 = {
|
|
969
|
+
"--spacing": t35,
|
|
970
|
+
"--pane-min-width": t36,
|
|
971
|
+
"--pane-max-width": t37,
|
|
972
|
+
"--pane-width-custom": t38,
|
|
973
|
+
"--pane-width-size": t39,
|
|
974
|
+
"--pane-width": t40
|
|
979
975
|
};
|
|
980
|
-
$[
|
|
981
|
-
$[
|
|
982
|
-
$[
|
|
983
|
-
$[
|
|
984
|
-
$[
|
|
985
|
-
$[
|
|
986
|
-
$[
|
|
987
|
-
} else {
|
|
988
|
-
|
|
989
|
-
}
|
|
990
|
-
const
|
|
991
|
-
let
|
|
992
|
-
if ($[
|
|
993
|
-
|
|
976
|
+
$[45] = t35;
|
|
977
|
+
$[46] = t36;
|
|
978
|
+
$[47] = t37;
|
|
979
|
+
$[48] = t38;
|
|
980
|
+
$[49] = t39;
|
|
981
|
+
$[50] = t40;
|
|
982
|
+
$[51] = t41;
|
|
983
|
+
} else {
|
|
984
|
+
t41 = $[51];
|
|
985
|
+
}
|
|
986
|
+
const t42 = t41;
|
|
987
|
+
let t43;
|
|
988
|
+
if ($[52] !== children || $[53] !== labelProp || $[54] !== paneRef || $[55] !== t32 || $[56] !== t33 || $[57] !== t34 || $[58] !== t42) {
|
|
989
|
+
t43 = /*#__PURE__*/jsx("div", {
|
|
994
990
|
ref: paneRef,
|
|
995
|
-
|
|
991
|
+
suppressHydrationWarning: true,
|
|
992
|
+
...t32,
|
|
996
993
|
...labelProp,
|
|
997
|
-
...
|
|
994
|
+
...t33,
|
|
998
995
|
className: classes.Pane,
|
|
999
|
-
"data-resizable":
|
|
1000
|
-
style:
|
|
996
|
+
"data-resizable": t34,
|
|
997
|
+
style: t42,
|
|
1001
998
|
children: children
|
|
1002
999
|
});
|
|
1003
|
-
$[
|
|
1004
|
-
$[
|
|
1005
|
-
$[
|
|
1006
|
-
$[
|
|
1007
|
-
$[
|
|
1008
|
-
$[
|
|
1009
|
-
$[
|
|
1010
|
-
$[
|
|
1011
|
-
} else {
|
|
1012
|
-
|
|
1013
|
-
}
|
|
1014
|
-
let
|
|
1015
|
-
if ($[
|
|
1016
|
-
|
|
1000
|
+
$[52] = children;
|
|
1001
|
+
$[53] = labelProp;
|
|
1002
|
+
$[54] = paneRef;
|
|
1003
|
+
$[55] = t32;
|
|
1004
|
+
$[56] = t33;
|
|
1005
|
+
$[57] = t34;
|
|
1006
|
+
$[58] = t42;
|
|
1007
|
+
$[59] = t43;
|
|
1008
|
+
} else {
|
|
1009
|
+
t43 = $[59];
|
|
1010
|
+
}
|
|
1011
|
+
let t44;
|
|
1012
|
+
if ($[60] !== dividerProp || $[61] !== dividerVariant || $[62] !== resizable) {
|
|
1013
|
+
t44 = isResponsiveValue(dividerProp) ? {
|
|
1017
1014
|
narrow: "none",
|
|
1018
1015
|
regular: resizable ? "line" : dividerProp.regular || "none",
|
|
1019
1016
|
wide: resizable ? "line" : dividerProp.wide || dividerProp.regular || "none"
|
|
@@ -1021,115 +1018,140 @@ const Pane = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
|
1021
1018
|
narrow: "none",
|
|
1022
1019
|
regular: resizable ? "line" : dividerVariant
|
|
1023
1020
|
};
|
|
1024
|
-
$[
|
|
1025
|
-
$[
|
|
1026
|
-
$[
|
|
1027
|
-
$[
|
|
1021
|
+
$[60] = dividerProp;
|
|
1022
|
+
$[61] = dividerVariant;
|
|
1023
|
+
$[62] = resizable;
|
|
1024
|
+
$[63] = t44;
|
|
1028
1025
|
} else {
|
|
1029
|
-
|
|
1026
|
+
t44 = $[63];
|
|
1030
1027
|
}
|
|
1028
|
+
const t45 = `var(--spacing-${columnGap})`;
|
|
1031
1029
|
let t46;
|
|
1032
|
-
if ($[
|
|
1033
|
-
t46 =
|
|
1034
|
-
|
|
1035
|
-
let deltaWithDirection;
|
|
1036
|
-
if (isKeyboard) {
|
|
1037
|
-
deltaWithDirection = delta;
|
|
1038
|
-
} else {
|
|
1039
|
-
deltaWithDirection = position === "end" ? -delta : delta;
|
|
1040
|
-
}
|
|
1041
|
-
updatePaneWidth(paneWidth + deltaWithDirection);
|
|
1030
|
+
if ($[64] !== t45) {
|
|
1031
|
+
t46 = {
|
|
1032
|
+
"--spacing": t45
|
|
1042
1033
|
};
|
|
1043
|
-
$[
|
|
1044
|
-
$[
|
|
1045
|
-
$[65] = updatePaneWidth;
|
|
1046
|
-
$[66] = t46;
|
|
1047
|
-
} else {
|
|
1048
|
-
t46 = $[66];
|
|
1049
|
-
}
|
|
1050
|
-
let t47;
|
|
1051
|
-
if ($[67] !== paneRef || $[68] !== updatePaneWidth) {
|
|
1052
|
-
t47 = () => {
|
|
1053
|
-
var _paneRef$current;
|
|
1054
|
-
const paneRect = (_paneRef$current = paneRef.current) === null || _paneRef$current === void 0 ? void 0 : _paneRef$current.getBoundingClientRect();
|
|
1055
|
-
if (!paneRect) {
|
|
1056
|
-
return;
|
|
1057
|
-
}
|
|
1058
|
-
updatePaneWidth(paneRect.width);
|
|
1059
|
-
};
|
|
1060
|
-
$[67] = paneRef;
|
|
1061
|
-
$[68] = updatePaneWidth;
|
|
1062
|
-
$[69] = t47;
|
|
1034
|
+
$[64] = t45;
|
|
1035
|
+
$[65] = t46;
|
|
1063
1036
|
} else {
|
|
1064
|
-
|
|
1037
|
+
t46 = $[65];
|
|
1065
1038
|
}
|
|
1039
|
+
const t47 = t46;
|
|
1066
1040
|
let t48;
|
|
1067
|
-
if ($[70] !==
|
|
1068
|
-
t48 =
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1041
|
+
if ($[66] !== currentWidth || $[67] !== currentWidthRef || $[68] !== getDefaultWidth || $[69] !== getMaxPaneWidth || $[70] !== maxPaneWidth || $[71] !== minPaneWidth || $[72] !== paneRef || $[73] !== position || $[74] !== resizable || $[75] !== saveWidth) {
|
|
1042
|
+
t48 = resizable ? /*#__PURE__*/jsx(DragHandle, {
|
|
1043
|
+
handleRef: handleRef,
|
|
1044
|
+
"aria-valuemin": minPaneWidth,
|
|
1045
|
+
"aria-valuemax": maxPaneWidth,
|
|
1046
|
+
"aria-valuenow": currentWidth,
|
|
1047
|
+
onDragStart: clientX => {
|
|
1048
|
+
var _paneRef$current$getB, _paneRef$current;
|
|
1049
|
+
dragStartClientXRef.current = clientX;
|
|
1050
|
+
dragStartWidthRef.current = (_paneRef$current$getB = (_paneRef$current = paneRef.current) === null || _paneRef$current === void 0 ? void 0 : _paneRef$current.getBoundingClientRect().width) !== null && _paneRef$current$getB !== void 0 ? _paneRef$current$getB : currentWidthRef.current;
|
|
1051
|
+
dragMaxWidthRef.current = getMaxPaneWidth();
|
|
1052
|
+
},
|
|
1053
|
+
onDrag: (value, isKeyboard) => {
|
|
1054
|
+
const maxWidth = isKeyboard ? getMaxPaneWidth() : dragMaxWidthRef.current;
|
|
1055
|
+
if (isKeyboard) {
|
|
1056
|
+
const delta = value;
|
|
1057
|
+
const newWidth = Math.max(minPaneWidth, Math.min(maxWidth, currentWidthRef.current + delta));
|
|
1058
|
+
if (newWidth !== currentWidthRef.current) {
|
|
1059
|
+
var _paneRef$current2;
|
|
1060
|
+
currentWidthRef.current = newWidth;
|
|
1061
|
+
(_paneRef$current2 = paneRef.current) === null || _paneRef$current2 === void 0 ? void 0 : _paneRef$current2.style.setProperty("--pane-width", `${newWidth}px`);
|
|
1062
|
+
updateAriaValues(handleRef.current, {
|
|
1063
|
+
current: newWidth,
|
|
1064
|
+
max: maxWidth
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
} else {
|
|
1068
|
+
if (paneRef.current) {
|
|
1069
|
+
const deltaX = value - dragStartClientXRef.current;
|
|
1070
|
+
const directedDelta = position === "end" ? -deltaX : deltaX;
|
|
1071
|
+
const newWidth_0 = dragStartWidthRef.current + directedDelta;
|
|
1072
|
+
const clampedWidth = Math.max(minPaneWidth, Math.min(maxWidth, newWidth_0));
|
|
1073
|
+
if (Math.round(clampedWidth) !== Math.round(currentWidthRef.current)) {
|
|
1074
|
+
paneRef.current.style.setProperty("--pane-width", `${clampedWidth}px`);
|
|
1075
|
+
currentWidthRef.current = clampedWidth;
|
|
1076
|
+
updateAriaValues(handleRef.current, {
|
|
1077
|
+
current: Math.round(clampedWidth),
|
|
1078
|
+
max: maxWidth
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
onDragEnd: () => {
|
|
1085
|
+
saveWidth(currentWidthRef.current);
|
|
1086
|
+
},
|
|
1087
|
+
onDoubleClick: () => {
|
|
1088
|
+
const resetWidth = getDefaultWidth();
|
|
1089
|
+
if (paneRef.current) {
|
|
1090
|
+
paneRef.current.style.setProperty("--pane-width", `${resetWidth}px`);
|
|
1091
|
+
currentWidthRef.current = resetWidth;
|
|
1092
|
+
updateAriaValues(handleRef.current, {
|
|
1093
|
+
current: resetWidth
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
saveWidth(resetWidth);
|
|
1097
|
+
}
|
|
1098
|
+
}) : null;
|
|
1099
|
+
$[66] = currentWidth;
|
|
1100
|
+
$[67] = currentWidthRef;
|
|
1101
|
+
$[68] = getDefaultWidth;
|
|
1102
|
+
$[69] = getMaxPaneWidth;
|
|
1103
|
+
$[70] = maxPaneWidth;
|
|
1104
|
+
$[71] = minPaneWidth;
|
|
1105
|
+
$[72] = paneRef;
|
|
1106
|
+
$[73] = position;
|
|
1107
|
+
$[74] = resizable;
|
|
1108
|
+
$[75] = saveWidth;
|
|
1109
|
+
$[76] = t48;
|
|
1110
|
+
} else {
|
|
1111
|
+
t48 = $[76];
|
|
1112
|
+
}
|
|
1113
|
+
let t49;
|
|
1114
|
+
if ($[77] !== positionProp || $[78] !== resizable || $[79] !== t44 || $[80] !== t47 || $[81] !== t48) {
|
|
1115
|
+
t49 = /*#__PURE__*/jsx(VerticalDivider, {
|
|
1116
|
+
variant: t44,
|
|
1091
1117
|
draggable: resizable,
|
|
1092
|
-
onDrag: t46,
|
|
1093
|
-
onDragEnd: t47,
|
|
1094
1118
|
position: positionProp,
|
|
1095
|
-
onDoubleClick: t48,
|
|
1096
1119
|
className: classes.PaneVerticalDivider,
|
|
1097
|
-
style:
|
|
1120
|
+
style: t47,
|
|
1121
|
+
children: t48
|
|
1098
1122
|
});
|
|
1099
|
-
$[
|
|
1100
|
-
$[
|
|
1101
|
-
$[
|
|
1102
|
-
$[
|
|
1103
|
-
$[
|
|
1104
|
-
$[
|
|
1105
|
-
|
|
1106
|
-
$[82]
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
style: t24,
|
|
1123
|
+
$[77] = positionProp;
|
|
1124
|
+
$[78] = resizable;
|
|
1125
|
+
$[79] = t44;
|
|
1126
|
+
$[80] = t47;
|
|
1127
|
+
$[81] = t48;
|
|
1128
|
+
$[82] = t49;
|
|
1129
|
+
} else {
|
|
1130
|
+
t49 = $[82];
|
|
1131
|
+
}
|
|
1132
|
+
let t50;
|
|
1133
|
+
if ($[83] !== t18 || $[84] !== t23 || $[85] !== t24 || $[86] !== t25 || $[87] !== t26 || $[88] !== t31 || $[89] !== t43 || $[90] !== t49) {
|
|
1134
|
+
t50 = /*#__PURE__*/jsxs("div", {
|
|
1135
|
+
className: t18,
|
|
1136
|
+
style: t23,
|
|
1137
|
+
...t24,
|
|
1115
1138
|
...t25,
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
children: [t32, t44, t52]
|
|
1139
|
+
"data-sticky": t26,
|
|
1140
|
+
children: [t31, t43, t49]
|
|
1119
1141
|
});
|
|
1120
|
-
$[83] =
|
|
1121
|
-
$[84] =
|
|
1122
|
-
$[85] =
|
|
1123
|
-
$[86] =
|
|
1124
|
-
$[87] =
|
|
1125
|
-
$[88] =
|
|
1126
|
-
$[89] =
|
|
1127
|
-
$[90] =
|
|
1128
|
-
$[91] =
|
|
1129
|
-
} else {
|
|
1130
|
-
|
|
1131
|
-
}
|
|
1132
|
-
return
|
|
1142
|
+
$[83] = t18;
|
|
1143
|
+
$[84] = t23;
|
|
1144
|
+
$[85] = t24;
|
|
1145
|
+
$[86] = t25;
|
|
1146
|
+
$[87] = t26;
|
|
1147
|
+
$[88] = t31;
|
|
1148
|
+
$[89] = t43;
|
|
1149
|
+
$[90] = t49;
|
|
1150
|
+
$[91] = t50;
|
|
1151
|
+
} else {
|
|
1152
|
+
t50 = $[91];
|
|
1153
|
+
}
|
|
1154
|
+
return t50;
|
|
1133
1155
|
});
|
|
1134
1156
|
Pane.displayName = 'PageLayout.Pane';
|
|
1135
1157
|
|
|
@@ -1288,15 +1310,5 @@ Header.__SLOT__ = Symbol('PageLayout.Header');
|
|
|
1288
1310
|
Content.__SLOT__ = Symbol('PageLayout.Content');
|
|
1289
1311
|
Pane.__SLOT__ = Symbol('PageLayout.Pane');
|
|
1290
1312
|
Footer.__SLOT__ = Symbol('PageLayout.Footer');
|
|
1291
|
-
function _temp(width_0) {
|
|
1292
|
-
if (isPaneWidth(width_0)) {
|
|
1293
|
-
return defaultPaneWidth[width_0];
|
|
1294
|
-
} else {
|
|
1295
|
-
if (isCustomWidthOptions(width_0)) {
|
|
1296
|
-
return Number(width_0.default.split("px")[0]);
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
return 0;
|
|
1300
|
-
}
|
|
1301
1313
|
|
|
1302
1314
|
export { PageLayout };
|