react-resizable-panels 2.0.11 → 2.0.13
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/.parcel-cache/0e613961dce44a82 +0 -0
- package/.parcel-cache/13776de4870b0ae4.txt +2 -0
- package/.parcel-cache/35c20fb91e350b46 +0 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/dist/react-resizable-panels.browser.cjs.js +84 -47
- package/dist/react-resizable-panels.browser.development.cjs.js +84 -47
- package/dist/react-resizable-panels.browser.development.esm.js +84 -47
- package/dist/react-resizable-panels.browser.esm.js +84 -47
- package/dist/react-resizable-panels.cjs.js +84 -47
- package/dist/react-resizable-panels.development.cjs.js +84 -47
- package/dist/react-resizable-panels.development.esm.js +84 -47
- package/dist/react-resizable-panels.development.node.cjs.js +84 -47
- package/dist/react-resizable-panels.development.node.esm.js +84 -47
- package/dist/react-resizable-panels.esm.js +84 -47
- package/dist/react-resizable-panels.node.cjs.js +84 -47
- package/dist/react-resizable-panels.node.esm.js +84 -47
- package/package.json +9 -9
- package/src/PanelGroup.ts +8 -4
- package/src/hooks/useWindowSplitterPanelGroupBehavior.ts +2 -1
- package/src/utils/adjustLayoutByDelta.test.ts +268 -115
- package/src/utils/adjustLayoutByDelta.ts +51 -39
- package/src/utils/numbers/fuzzyLayoutsEqual.ts +22 -0
- package/src/vendor/stacking-order.ts +10 -4
|
@@ -5,9 +5,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
5
5
|
expect(
|
|
6
6
|
adjustLayoutByDelta({
|
|
7
7
|
delta: 1,
|
|
8
|
-
|
|
8
|
+
initialLayout: [50, 50],
|
|
9
9
|
panelConstraints: [{}, {}],
|
|
10
10
|
pivotIndices: [0, 1],
|
|
11
|
+
prevLayout: [50, 50],
|
|
11
12
|
trigger: "imperative-api",
|
|
12
13
|
})
|
|
13
14
|
).toEqual([51, 49]);
|
|
@@ -17,18 +18,20 @@ describe("adjustLayoutByDelta", () => {
|
|
|
17
18
|
expect(
|
|
18
19
|
adjustLayoutByDelta({
|
|
19
20
|
delta: 25,
|
|
20
|
-
|
|
21
|
+
initialLayout: [50, 50],
|
|
21
22
|
panelConstraints: [{}, {}],
|
|
22
23
|
pivotIndices: [0, 1],
|
|
24
|
+
prevLayout: [50, 50],
|
|
23
25
|
trigger: "imperative-api",
|
|
24
26
|
})
|
|
25
27
|
).toEqual([75, 25]);
|
|
26
28
|
expect(
|
|
27
29
|
adjustLayoutByDelta({
|
|
28
30
|
delta: 50,
|
|
29
|
-
|
|
31
|
+
initialLayout: [50, 50],
|
|
30
32
|
panelConstraints: [{}, {}],
|
|
31
33
|
pivotIndices: [0, 1],
|
|
34
|
+
prevLayout: [50, 50],
|
|
32
35
|
trigger: "imperative-api",
|
|
33
36
|
})
|
|
34
37
|
).toEqual([100, 0]);
|
|
@@ -38,7 +41,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
38
41
|
expect(
|
|
39
42
|
adjustLayoutByDelta({
|
|
40
43
|
delta: 50,
|
|
41
|
-
|
|
44
|
+
initialLayout: [50, 50],
|
|
42
45
|
panelConstraints: [
|
|
43
46
|
{
|
|
44
47
|
minSize: 20,
|
|
@@ -50,6 +53,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
50
53
|
},
|
|
51
54
|
],
|
|
52
55
|
pivotIndices: [0, 1],
|
|
56
|
+
prevLayout: [50, 50],
|
|
53
57
|
trigger: "imperative-api",
|
|
54
58
|
})
|
|
55
59
|
).toEqual([60, 40]);
|
|
@@ -59,7 +63,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
59
63
|
expect(
|
|
60
64
|
adjustLayoutByDelta({
|
|
61
65
|
delta: 25,
|
|
62
|
-
|
|
66
|
+
initialLayout: [50, 50],
|
|
63
67
|
panelConstraints: [
|
|
64
68
|
{},
|
|
65
69
|
{
|
|
@@ -69,6 +73,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
69
73
|
},
|
|
70
74
|
],
|
|
71
75
|
pivotIndices: [0, 1],
|
|
76
|
+
prevLayout: [50, 50],
|
|
72
77
|
trigger: "imperative-api",
|
|
73
78
|
})
|
|
74
79
|
).toEqual([75, 25]);
|
|
@@ -78,7 +83,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
78
83
|
expect(
|
|
79
84
|
adjustLayoutByDelta({
|
|
80
85
|
delta: 40,
|
|
81
|
-
|
|
86
|
+
initialLayout: [50, 50],
|
|
82
87
|
panelConstraints: [
|
|
83
88
|
{},
|
|
84
89
|
{
|
|
@@ -88,6 +93,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
88
93
|
},
|
|
89
94
|
],
|
|
90
95
|
pivotIndices: [0, 1],
|
|
96
|
+
prevLayout: [50, 50],
|
|
91
97
|
trigger: "imperative-api",
|
|
92
98
|
})
|
|
93
99
|
).toEqual([95, 5]);
|
|
@@ -99,7 +105,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
99
105
|
expect(
|
|
100
106
|
adjustLayoutByDelta({
|
|
101
107
|
delta: 5,
|
|
102
|
-
|
|
108
|
+
initialLayout: [10, 90],
|
|
103
109
|
panelConstraints: [
|
|
104
110
|
{
|
|
105
111
|
collapsedSize: 10,
|
|
@@ -109,6 +115,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
109
115
|
{},
|
|
110
116
|
],
|
|
111
117
|
pivotIndices: [0, 1],
|
|
118
|
+
prevLayout: [10, 90],
|
|
112
119
|
trigger: "imperative-api",
|
|
113
120
|
})
|
|
114
121
|
).toEqual([10, 90]);
|
|
@@ -120,7 +127,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
120
127
|
expect(
|
|
121
128
|
adjustLayoutByDelta({
|
|
122
129
|
delta: 5,
|
|
123
|
-
|
|
130
|
+
initialLayout: [10, 90],
|
|
124
131
|
panelConstraints: [
|
|
125
132
|
{
|
|
126
133
|
collapsedSize: 10,
|
|
@@ -130,6 +137,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
130
137
|
{},
|
|
131
138
|
],
|
|
132
139
|
pivotIndices: [0, 1],
|
|
140
|
+
prevLayout: [10, 90],
|
|
133
141
|
trigger: "keyboard",
|
|
134
142
|
})
|
|
135
143
|
).toEqual([25, 75]);
|
|
@@ -141,7 +149,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
141
149
|
expect(
|
|
142
150
|
adjustLayoutByDelta({
|
|
143
151
|
delta: 5,
|
|
144
|
-
|
|
152
|
+
initialLayout: [75, 25],
|
|
145
153
|
panelConstraints: [
|
|
146
154
|
{},
|
|
147
155
|
{
|
|
@@ -150,6 +158,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
150
158
|
},
|
|
151
159
|
],
|
|
152
160
|
pivotIndices: [0, 1],
|
|
161
|
+
prevLayout: [75, 25],
|
|
153
162
|
trigger: "keyboard",
|
|
154
163
|
})
|
|
155
164
|
).toEqual([100, 0]);
|
|
@@ -161,7 +170,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
161
170
|
expect(
|
|
162
171
|
adjustLayoutByDelta({
|
|
163
172
|
delta: 1,
|
|
164
|
-
|
|
173
|
+
initialLayout: [4, 96],
|
|
165
174
|
panelConstraints: [
|
|
166
175
|
{
|
|
167
176
|
collapsedSize: 4,
|
|
@@ -175,6 +184,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
175
184
|
},
|
|
176
185
|
],
|
|
177
186
|
pivotIndices: [0, 1],
|
|
187
|
+
prevLayout: [4, 96],
|
|
178
188
|
trigger: "imperative-api",
|
|
179
189
|
})
|
|
180
190
|
).toEqual([4, 96]);
|
|
@@ -186,7 +196,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
186
196
|
expect(
|
|
187
197
|
adjustLayoutByDelta({
|
|
188
198
|
delta: 1,
|
|
189
|
-
|
|
199
|
+
initialLayout: [4, 96],
|
|
190
200
|
panelConstraints: [
|
|
191
201
|
{
|
|
192
202
|
collapsedSize: 4,
|
|
@@ -200,6 +210,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
200
210
|
},
|
|
201
211
|
],
|
|
202
212
|
pivotIndices: [0, 1],
|
|
213
|
+
prevLayout: [4, 96],
|
|
203
214
|
trigger: "keyboard",
|
|
204
215
|
})
|
|
205
216
|
).toEqual([6, 94]);
|
|
@@ -211,7 +222,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
211
222
|
expect(
|
|
212
223
|
adjustLayoutByDelta({
|
|
213
224
|
delta: 25,
|
|
214
|
-
|
|
225
|
+
initialLayout: [4, 96],
|
|
215
226
|
panelConstraints: [
|
|
216
227
|
{
|
|
217
228
|
collapsedSize: 4,
|
|
@@ -225,6 +236,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
225
236
|
},
|
|
226
237
|
],
|
|
227
238
|
pivotIndices: [0, 1],
|
|
239
|
+
prevLayout: [4, 96],
|
|
228
240
|
trigger: "imperative-api",
|
|
229
241
|
})
|
|
230
242
|
).toEqual([15, 85]);
|
|
@@ -236,7 +248,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
236
248
|
expect(
|
|
237
249
|
adjustLayoutByDelta({
|
|
238
250
|
delta: 30,
|
|
239
|
-
|
|
251
|
+
initialLayout: [5, 95],
|
|
240
252
|
panelConstraints: [
|
|
241
253
|
{
|
|
242
254
|
collapsedSize: 5,
|
|
@@ -249,6 +261,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
249
261
|
},
|
|
250
262
|
],
|
|
251
263
|
pivotIndices: [0, 1],
|
|
264
|
+
prevLayout: [5, 95],
|
|
252
265
|
trigger: "imperative-api",
|
|
253
266
|
})
|
|
254
267
|
).toEqual([35, 65]);
|
|
@@ -260,7 +273,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
260
273
|
expect(
|
|
261
274
|
adjustLayoutByDelta({
|
|
262
275
|
delta: 30,
|
|
263
|
-
|
|
276
|
+
initialLayout: [5, 95],
|
|
264
277
|
panelConstraints: [
|
|
265
278
|
{
|
|
266
279
|
collapsedSize: 5,
|
|
@@ -273,6 +286,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
273
286
|
},
|
|
274
287
|
],
|
|
275
288
|
pivotIndices: [0, 1],
|
|
289
|
+
prevLayout: [5, 95],
|
|
276
290
|
trigger: "keyboard",
|
|
277
291
|
})
|
|
278
292
|
).toEqual([35, 65]);
|
|
@@ -284,7 +298,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
284
298
|
expect(
|
|
285
299
|
adjustLayoutByDelta({
|
|
286
300
|
delta: 30,
|
|
287
|
-
|
|
301
|
+
initialLayout: [0, 100],
|
|
288
302
|
panelConstraints: [
|
|
289
303
|
{
|
|
290
304
|
collapsedSize: 0,
|
|
@@ -295,6 +309,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
295
309
|
{},
|
|
296
310
|
],
|
|
297
311
|
pivotIndices: [0, 1],
|
|
312
|
+
prevLayout: [0, 100],
|
|
298
313
|
trigger: "keyboard",
|
|
299
314
|
})
|
|
300
315
|
).toEqual([30, 70]);
|
|
@@ -304,9 +319,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
304
319
|
expect(
|
|
305
320
|
adjustLayoutByDelta({
|
|
306
321
|
delta: -1,
|
|
307
|
-
|
|
322
|
+
initialLayout: [50, 50],
|
|
308
323
|
panelConstraints: [{}, {}],
|
|
309
324
|
pivotIndices: [0, 1],
|
|
325
|
+
prevLayout: [50, 50],
|
|
310
326
|
trigger: "imperative-api",
|
|
311
327
|
})
|
|
312
328
|
).toEqual([49, 51]);
|
|
@@ -316,9 +332,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
316
332
|
expect(
|
|
317
333
|
adjustLayoutByDelta({
|
|
318
334
|
delta: -25,
|
|
319
|
-
|
|
335
|
+
initialLayout: [50, 50],
|
|
320
336
|
panelConstraints: [{}, {}],
|
|
321
337
|
pivotIndices: [0, 1],
|
|
338
|
+
prevLayout: [50, 50],
|
|
322
339
|
trigger: "imperative-api",
|
|
323
340
|
})
|
|
324
341
|
).toEqual([25, 75]);
|
|
@@ -328,9 +345,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
328
345
|
expect(
|
|
329
346
|
adjustLayoutByDelta({
|
|
330
347
|
delta: -50,
|
|
331
|
-
|
|
348
|
+
initialLayout: [50, 50],
|
|
332
349
|
panelConstraints: [{}, {}],
|
|
333
350
|
pivotIndices: [0, 1],
|
|
351
|
+
prevLayout: [50, 50],
|
|
334
352
|
trigger: "imperative-api",
|
|
335
353
|
})
|
|
336
354
|
).toEqual([0, 100]);
|
|
@@ -340,7 +358,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
340
358
|
expect(
|
|
341
359
|
adjustLayoutByDelta({
|
|
342
360
|
delta: -50,
|
|
343
|
-
|
|
361
|
+
initialLayout: [50, 50],
|
|
344
362
|
panelConstraints: [
|
|
345
363
|
{
|
|
346
364
|
minSize: 20,
|
|
@@ -352,6 +370,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
352
370
|
},
|
|
353
371
|
],
|
|
354
372
|
pivotIndices: [0, 1],
|
|
373
|
+
prevLayout: [50, 50],
|
|
355
374
|
trigger: "imperative-api",
|
|
356
375
|
})
|
|
357
376
|
).toEqual([20, 80]);
|
|
@@ -361,7 +380,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
361
380
|
expect(
|
|
362
381
|
adjustLayoutByDelta({
|
|
363
382
|
delta: -25,
|
|
364
|
-
|
|
383
|
+
initialLayout: [50, 50],
|
|
365
384
|
panelConstraints: [
|
|
366
385
|
{
|
|
367
386
|
collapsedSize: 5,
|
|
@@ -371,6 +390,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
371
390
|
{},
|
|
372
391
|
],
|
|
373
392
|
pivotIndices: [0, 1],
|
|
393
|
+
prevLayout: [50, 50],
|
|
374
394
|
trigger: "imperative-api",
|
|
375
395
|
})
|
|
376
396
|
).toEqual([25, 75]);
|
|
@@ -380,7 +400,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
380
400
|
expect(
|
|
381
401
|
adjustLayoutByDelta({
|
|
382
402
|
delta: -30,
|
|
383
|
-
|
|
403
|
+
initialLayout: [50, 50],
|
|
384
404
|
panelConstraints: [
|
|
385
405
|
{
|
|
386
406
|
collapsedSize: 5,
|
|
@@ -390,6 +410,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
390
410
|
{},
|
|
391
411
|
],
|
|
392
412
|
pivotIndices: [0, 1],
|
|
413
|
+
prevLayout: [50, 50],
|
|
393
414
|
trigger: "imperative-api",
|
|
394
415
|
})
|
|
395
416
|
).toEqual([25, 75]);
|
|
@@ -397,7 +418,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
397
418
|
expect(
|
|
398
419
|
adjustLayoutByDelta({
|
|
399
420
|
delta: -36,
|
|
400
|
-
|
|
421
|
+
initialLayout: [50, 50],
|
|
401
422
|
panelConstraints: [
|
|
402
423
|
{
|
|
403
424
|
collapsedSize: 5,
|
|
@@ -407,6 +428,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
407
428
|
{},
|
|
408
429
|
],
|
|
409
430
|
pivotIndices: [0, 1],
|
|
431
|
+
prevLayout: [50, 50],
|
|
410
432
|
trigger: "imperative-api",
|
|
411
433
|
})
|
|
412
434
|
).toEqual([5, 95]);
|
|
@@ -418,7 +440,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
418
440
|
expect(
|
|
419
441
|
adjustLayoutByDelta({
|
|
420
442
|
delta: -30,
|
|
421
|
-
|
|
443
|
+
initialLayout: [50, 50],
|
|
422
444
|
panelConstraints: [
|
|
423
445
|
{
|
|
424
446
|
collapsedSize: 5,
|
|
@@ -428,6 +450,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
428
450
|
{ maxSize: 80 },
|
|
429
451
|
],
|
|
430
452
|
pivotIndices: [0, 1],
|
|
453
|
+
prevLayout: [50, 50],
|
|
431
454
|
trigger: "imperative-api",
|
|
432
455
|
})
|
|
433
456
|
).toEqual([25, 75]);
|
|
@@ -439,7 +462,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
439
462
|
expect(
|
|
440
463
|
adjustLayoutByDelta({
|
|
441
464
|
delta: -5,
|
|
442
|
-
|
|
465
|
+
initialLayout: [90, 10],
|
|
443
466
|
panelConstraints: [
|
|
444
467
|
{},
|
|
445
468
|
{
|
|
@@ -449,6 +472,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
449
472
|
},
|
|
450
473
|
],
|
|
451
474
|
pivotIndices: [0, 1],
|
|
475
|
+
prevLayout: [90, 10],
|
|
452
476
|
trigger: "keyboard",
|
|
453
477
|
})
|
|
454
478
|
).toEqual([75, 25]);
|
|
@@ -460,7 +484,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
460
484
|
expect(
|
|
461
485
|
adjustLayoutByDelta({
|
|
462
486
|
delta: -5,
|
|
463
|
-
|
|
487
|
+
initialLayout: [25, 75],
|
|
464
488
|
panelConstraints: [
|
|
465
489
|
{
|
|
466
490
|
collapsedSize: 10,
|
|
@@ -470,6 +494,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
470
494
|
{},
|
|
471
495
|
],
|
|
472
496
|
pivotIndices: [0, 1],
|
|
497
|
+
prevLayout: [25, 75],
|
|
473
498
|
trigger: "keyboard",
|
|
474
499
|
})
|
|
475
500
|
).toEqual([10, 90]);
|
|
@@ -479,9 +504,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
479
504
|
expect(
|
|
480
505
|
adjustLayoutByDelta({
|
|
481
506
|
delta: 1,
|
|
482
|
-
|
|
507
|
+
initialLayout: [25, 50, 25],
|
|
483
508
|
panelConstraints: [{}, {}, {}],
|
|
484
509
|
pivotIndices: [0, 1],
|
|
510
|
+
prevLayout: [25, 50, 25],
|
|
485
511
|
trigger: "imperative-api",
|
|
486
512
|
})
|
|
487
513
|
).toEqual([26, 49, 25]);
|
|
@@ -491,9 +517,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
491
517
|
expect(
|
|
492
518
|
adjustLayoutByDelta({
|
|
493
519
|
delta: 25,
|
|
494
|
-
|
|
520
|
+
initialLayout: [25, 50, 25],
|
|
495
521
|
panelConstraints: [{}, {}, {}],
|
|
496
522
|
pivotIndices: [0, 1],
|
|
523
|
+
prevLayout: [25, 50, 25],
|
|
497
524
|
trigger: "imperative-api",
|
|
498
525
|
})
|
|
499
526
|
).toEqual([50, 25, 25]);
|
|
@@ -503,9 +530,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
503
530
|
expect(
|
|
504
531
|
adjustLayoutByDelta({
|
|
505
532
|
delta: 50,
|
|
506
|
-
|
|
533
|
+
initialLayout: [25, 50, 25],
|
|
507
534
|
panelConstraints: [{}, {}, {}],
|
|
508
535
|
pivotIndices: [0, 1],
|
|
536
|
+
prevLayout: [25, 50, 25],
|
|
509
537
|
trigger: "imperative-api",
|
|
510
538
|
})
|
|
511
539
|
).toEqual([75, 0, 25]);
|
|
@@ -515,9 +543,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
515
543
|
expect(
|
|
516
544
|
adjustLayoutByDelta({
|
|
517
545
|
delta: 75,
|
|
518
|
-
|
|
546
|
+
initialLayout: [25, 50, 25],
|
|
519
547
|
panelConstraints: [{}, {}, {}],
|
|
520
548
|
pivotIndices: [0, 1],
|
|
549
|
+
prevLayout: [25, 50, 25],
|
|
521
550
|
trigger: "imperative-api",
|
|
522
551
|
})
|
|
523
552
|
).toEqual([100, 0, 0]);
|
|
@@ -527,9 +556,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
527
556
|
expect(
|
|
528
557
|
adjustLayoutByDelta({
|
|
529
558
|
delta: 25,
|
|
530
|
-
|
|
559
|
+
initialLayout: [25, 50, 25],
|
|
531
560
|
panelConstraints: [{ maxSize: 35 }, { minSize: 25 }, {}],
|
|
532
561
|
pivotIndices: [0, 1],
|
|
562
|
+
prevLayout: [25, 50, 25],
|
|
533
563
|
trigger: "imperative-api",
|
|
534
564
|
})
|
|
535
565
|
).toEqual([35, 40, 25]);
|
|
@@ -540,9 +570,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
540
570
|
expect(
|
|
541
571
|
adjustLayoutByDelta({
|
|
542
572
|
delta: 25,
|
|
543
|
-
|
|
573
|
+
initialLayout: [25, 50, 25],
|
|
544
574
|
panelConstraints: [{ maxSize: 35 }, { minSize: 25 }, {}],
|
|
545
575
|
pivotIndices: [0, 1],
|
|
576
|
+
prevLayout: [25, 50, 25],
|
|
546
577
|
trigger: "imperative-api",
|
|
547
578
|
})
|
|
548
579
|
).toEqual([35, 40, 25]);
|
|
@@ -552,7 +583,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
552
583
|
expect(
|
|
553
584
|
adjustLayoutByDelta({
|
|
554
585
|
delta: 5,
|
|
555
|
-
|
|
586
|
+
initialLayout: [25, 40, 35],
|
|
556
587
|
panelConstraints: [
|
|
557
588
|
{},
|
|
558
589
|
{
|
|
@@ -563,6 +594,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
563
594
|
{ minSize: 25 },
|
|
564
595
|
],
|
|
565
596
|
pivotIndices: [0, 1],
|
|
597
|
+
prevLayout: [25, 40, 35],
|
|
566
598
|
trigger: "imperative-api",
|
|
567
599
|
})
|
|
568
600
|
).toEqual([30, 35, 35]);
|
|
@@ -572,7 +604,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
572
604
|
expect(
|
|
573
605
|
adjustLayoutByDelta({
|
|
574
606
|
delta: 26,
|
|
575
|
-
|
|
607
|
+
initialLayout: [25, 40, 35],
|
|
576
608
|
panelConstraints: [
|
|
577
609
|
{},
|
|
578
610
|
{
|
|
@@ -583,6 +615,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
583
615
|
{ minSize: 25 },
|
|
584
616
|
],
|
|
585
617
|
pivotIndices: [0, 1],
|
|
618
|
+
prevLayout: [25, 40, 35],
|
|
586
619
|
trigger: "imperative-api",
|
|
587
620
|
})
|
|
588
621
|
).toEqual([60, 5, 35]);
|
|
@@ -592,7 +625,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
592
625
|
expect(
|
|
593
626
|
adjustLayoutByDelta({
|
|
594
627
|
delta: 80,
|
|
595
|
-
|
|
628
|
+
initialLayout: [25, 40, 35],
|
|
596
629
|
panelConstraints: [
|
|
597
630
|
{},
|
|
598
631
|
{
|
|
@@ -603,6 +636,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
603
636
|
{ minSize: 25 },
|
|
604
637
|
],
|
|
605
638
|
pivotIndices: [0, 1],
|
|
639
|
+
prevLayout: [25, 40, 35],
|
|
606
640
|
trigger: "imperative-api",
|
|
607
641
|
})
|
|
608
642
|
).toEqual([70, 5, 25]);
|
|
@@ -612,9 +646,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
612
646
|
expect(
|
|
613
647
|
adjustLayoutByDelta({
|
|
614
648
|
delta: -1,
|
|
615
|
-
|
|
649
|
+
initialLayout: [25, 50, 25],
|
|
616
650
|
panelConstraints: [{}, {}, {}],
|
|
617
651
|
pivotIndices: [0, 1],
|
|
652
|
+
prevLayout: [25, 50, 25],
|
|
618
653
|
trigger: "imperative-api",
|
|
619
654
|
})
|
|
620
655
|
).toEqual([24, 51, 25]);
|
|
@@ -624,9 +659,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
624
659
|
expect(
|
|
625
660
|
adjustLayoutByDelta({
|
|
626
661
|
delta: -25,
|
|
627
|
-
|
|
662
|
+
initialLayout: [25, 50, 25],
|
|
628
663
|
panelConstraints: [{}, {}, {}],
|
|
629
664
|
pivotIndices: [0, 1],
|
|
665
|
+
prevLayout: [25, 50, 25],
|
|
630
666
|
trigger: "imperative-api",
|
|
631
667
|
})
|
|
632
668
|
).toEqual([0, 75, 25]);
|
|
@@ -636,9 +672,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
636
672
|
expect(
|
|
637
673
|
adjustLayoutByDelta({
|
|
638
674
|
delta: -1,
|
|
639
|
-
|
|
675
|
+
initialLayout: [25, 50, 25],
|
|
640
676
|
panelConstraints: [{ minSize: 20 }, {}, {}],
|
|
641
677
|
pivotIndices: [0, 1],
|
|
678
|
+
prevLayout: [25, 50, 25],
|
|
642
679
|
trigger: "imperative-api",
|
|
643
680
|
})
|
|
644
681
|
).toEqual([24, 51, 25]);
|
|
@@ -648,9 +685,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
648
685
|
expect(
|
|
649
686
|
adjustLayoutByDelta({
|
|
650
687
|
delta: -10,
|
|
651
|
-
|
|
688
|
+
initialLayout: [25, 50, 25],
|
|
652
689
|
panelConstraints: [{ minSize: 20 }, {}, {}],
|
|
653
690
|
pivotIndices: [0, 1],
|
|
691
|
+
prevLayout: [25, 50, 25],
|
|
654
692
|
trigger: "imperative-api",
|
|
655
693
|
})
|
|
656
694
|
).toEqual([20, 55, 25]);
|
|
@@ -660,7 +698,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
660
698
|
expect(
|
|
661
699
|
adjustLayoutByDelta({
|
|
662
700
|
delta: -5,
|
|
663
|
-
|
|
701
|
+
initialLayout: [25, 50, 25],
|
|
664
702
|
panelConstraints: [
|
|
665
703
|
{
|
|
666
704
|
// Implied min size 10
|
|
@@ -669,6 +707,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
669
707
|
{ maxSize: 20 },
|
|
670
708
|
],
|
|
671
709
|
pivotIndices: [0, 1],
|
|
710
|
+
prevLayout: [25, 50, 25],
|
|
672
711
|
trigger: "imperative-api",
|
|
673
712
|
})
|
|
674
713
|
).toEqual([20, 55, 25]);
|
|
@@ -678,7 +717,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
678
717
|
expect(
|
|
679
718
|
adjustLayoutByDelta({
|
|
680
719
|
delta: -20,
|
|
681
|
-
|
|
720
|
+
initialLayout: [25, 50, 25],
|
|
682
721
|
panelConstraints: [
|
|
683
722
|
{
|
|
684
723
|
// Implied min size 10
|
|
@@ -687,6 +726,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
687
726
|
{ maxSize: 20 },
|
|
688
727
|
],
|
|
689
728
|
pivotIndices: [0, 1],
|
|
729
|
+
prevLayout: [25, 50, 25],
|
|
690
730
|
trigger: "imperative-api",
|
|
691
731
|
})
|
|
692
732
|
).toEqual([10, 65, 25]);
|
|
@@ -696,7 +736,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
696
736
|
expect(
|
|
697
737
|
adjustLayoutByDelta({
|
|
698
738
|
delta: -10,
|
|
699
|
-
|
|
739
|
+
initialLayout: [25, 50, 25],
|
|
700
740
|
panelConstraints: [
|
|
701
741
|
{
|
|
702
742
|
collapsedSize: 5,
|
|
@@ -707,6 +747,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
707
747
|
{},
|
|
708
748
|
],
|
|
709
749
|
pivotIndices: [0, 1],
|
|
750
|
+
prevLayout: [25, 50, 25],
|
|
710
751
|
trigger: "imperative-api",
|
|
711
752
|
})
|
|
712
753
|
).toEqual([15, 60, 25]);
|
|
@@ -716,7 +757,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
716
757
|
expect(
|
|
717
758
|
adjustLayoutByDelta({
|
|
718
759
|
delta: -20,
|
|
719
|
-
|
|
760
|
+
initialLayout: [25, 50, 25],
|
|
720
761
|
panelConstraints: [
|
|
721
762
|
{
|
|
722
763
|
collapsedSize: 5,
|
|
@@ -727,6 +768,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
727
768
|
{},
|
|
728
769
|
],
|
|
729
770
|
pivotIndices: [0, 1],
|
|
771
|
+
prevLayout: [25, 50, 25],
|
|
730
772
|
trigger: "imperative-api",
|
|
731
773
|
})
|
|
732
774
|
).toEqual([5, 70, 25]);
|
|
@@ -736,7 +778,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
736
778
|
expect(
|
|
737
779
|
adjustLayoutByDelta({
|
|
738
780
|
delta: -20,
|
|
739
|
-
|
|
781
|
+
initialLayout: [45, 50, 5],
|
|
740
782
|
panelConstraints: [
|
|
741
783
|
{},
|
|
742
784
|
{
|
|
@@ -749,6 +791,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
749
791
|
},
|
|
750
792
|
],
|
|
751
793
|
pivotIndices: [0, 1],
|
|
794
|
+
prevLayout: [45, 50, 5],
|
|
752
795
|
trigger: "imperative-api",
|
|
753
796
|
})
|
|
754
797
|
).toEqual([25, 50, 25]);
|
|
@@ -758,9 +801,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
758
801
|
expect(
|
|
759
802
|
adjustLayoutByDelta({
|
|
760
803
|
delta: -1,
|
|
761
|
-
|
|
804
|
+
initialLayout: [25, 50, 25],
|
|
762
805
|
panelConstraints: [{}, {}, {}],
|
|
763
806
|
pivotIndices: [1, 2],
|
|
807
|
+
prevLayout: [25, 50, 25],
|
|
764
808
|
trigger: "imperative-api",
|
|
765
809
|
})
|
|
766
810
|
).toEqual([25, 49, 26]);
|
|
@@ -770,9 +814,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
770
814
|
expect(
|
|
771
815
|
adjustLayoutByDelta({
|
|
772
816
|
delta: -25,
|
|
773
|
-
|
|
817
|
+
initialLayout: [25, 50, 25],
|
|
774
818
|
panelConstraints: [{}, {}, {}],
|
|
775
819
|
pivotIndices: [1, 2],
|
|
820
|
+
prevLayout: [25, 50, 25],
|
|
776
821
|
trigger: "imperative-api",
|
|
777
822
|
})
|
|
778
823
|
).toEqual([25, 25, 50]);
|
|
@@ -782,9 +827,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
782
827
|
expect(
|
|
783
828
|
adjustLayoutByDelta({
|
|
784
829
|
delta: -50,
|
|
785
|
-
|
|
830
|
+
initialLayout: [25, 50, 25],
|
|
786
831
|
panelConstraints: [{}, {}, {}],
|
|
787
832
|
pivotIndices: [1, 2],
|
|
833
|
+
prevLayout: [25, 50, 25],
|
|
788
834
|
trigger: "imperative-api",
|
|
789
835
|
})
|
|
790
836
|
).toEqual([25, 0, 75]);
|
|
@@ -794,9 +840,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
794
840
|
expect(
|
|
795
841
|
adjustLayoutByDelta({
|
|
796
842
|
delta: -75,
|
|
797
|
-
|
|
843
|
+
initialLayout: [25, 50, 25],
|
|
798
844
|
panelConstraints: [{}, {}, {}],
|
|
799
845
|
pivotIndices: [1, 2],
|
|
846
|
+
prevLayout: [25, 50, 25],
|
|
800
847
|
trigger: "imperative-api",
|
|
801
848
|
})
|
|
802
849
|
).toEqual([0, 0, 100]);
|
|
@@ -806,9 +853,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
806
853
|
expect(
|
|
807
854
|
adjustLayoutByDelta({
|
|
808
855
|
delta: 5,
|
|
809
|
-
|
|
856
|
+
initialLayout: [25, 50, 25],
|
|
810
857
|
panelConstraints: [{}, {}, { minSize: 15 }],
|
|
811
858
|
pivotIndices: [1, 2],
|
|
859
|
+
prevLayout: [25, 50, 25],
|
|
812
860
|
trigger: "imperative-api",
|
|
813
861
|
})
|
|
814
862
|
).toEqual([25, 55, 20]);
|
|
@@ -818,9 +866,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
818
866
|
expect(
|
|
819
867
|
adjustLayoutByDelta({
|
|
820
868
|
delta: 20,
|
|
821
|
-
|
|
869
|
+
initialLayout: [25, 50, 25],
|
|
822
870
|
panelConstraints: [{}, {}, { minSize: 15 }],
|
|
823
871
|
pivotIndices: [1, 2],
|
|
872
|
+
prevLayout: [25, 50, 25],
|
|
824
873
|
trigger: "imperative-api",
|
|
825
874
|
})
|
|
826
875
|
).toEqual([25, 60, 15]);
|
|
@@ -830,9 +879,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
830
879
|
expect(
|
|
831
880
|
adjustLayoutByDelta({
|
|
832
881
|
delta: 5,
|
|
833
|
-
|
|
882
|
+
initialLayout: [25, 50, 25],
|
|
834
883
|
panelConstraints: [{}, {}, { collapsible: true, minSize: 20 }],
|
|
835
884
|
pivotIndices: [1, 2],
|
|
885
|
+
prevLayout: [25, 50, 25],
|
|
836
886
|
trigger: "imperative-api",
|
|
837
887
|
})
|
|
838
888
|
).toEqual([25, 55, 20]);
|
|
@@ -842,9 +892,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
842
892
|
expect(
|
|
843
893
|
adjustLayoutByDelta({
|
|
844
894
|
delta: 10,
|
|
845
|
-
|
|
895
|
+
initialLayout: [25, 50, 25],
|
|
846
896
|
panelConstraints: [{}, {}, { collapsible: true, minSize: 20 }],
|
|
847
897
|
pivotIndices: [1, 2],
|
|
898
|
+
prevLayout: [25, 50, 25],
|
|
848
899
|
trigger: "imperative-api",
|
|
849
900
|
})
|
|
850
901
|
).toEqual([25, 55, 20]);
|
|
@@ -852,9 +903,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
852
903
|
expect(
|
|
853
904
|
adjustLayoutByDelta({
|
|
854
905
|
delta: 16,
|
|
855
|
-
|
|
906
|
+
initialLayout: [25, 50, 25],
|
|
856
907
|
panelConstraints: [{}, {}, { collapsible: true, minSize: 20 }],
|
|
857
908
|
pivotIndices: [1, 2],
|
|
909
|
+
prevLayout: [25, 50, 25],
|
|
858
910
|
trigger: "imperative-api",
|
|
859
911
|
})
|
|
860
912
|
).toEqual([25, 75, 0]);
|
|
@@ -864,9 +916,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
864
916
|
expect(
|
|
865
917
|
adjustLayoutByDelta({
|
|
866
918
|
delta: 1,
|
|
867
|
-
|
|
919
|
+
initialLayout: [25, 50, 25],
|
|
868
920
|
panelConstraints: [{}, {}, {}],
|
|
869
921
|
pivotIndices: [1, 2],
|
|
922
|
+
prevLayout: [25, 50, 25],
|
|
870
923
|
trigger: "imperative-api",
|
|
871
924
|
})
|
|
872
925
|
).toEqual([25, 51, 24]);
|
|
@@ -876,9 +929,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
876
929
|
expect(
|
|
877
930
|
adjustLayoutByDelta({
|
|
878
931
|
delta: 25,
|
|
879
|
-
|
|
932
|
+
initialLayout: [25, 50, 25],
|
|
880
933
|
panelConstraints: [{}, {}, {}],
|
|
881
934
|
pivotIndices: [1, 2],
|
|
935
|
+
prevLayout: [25, 50, 25],
|
|
882
936
|
trigger: "imperative-api",
|
|
883
937
|
})
|
|
884
938
|
).toEqual([25, 75, 0]);
|
|
@@ -888,9 +942,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
888
942
|
expect(
|
|
889
943
|
adjustLayoutByDelta({
|
|
890
944
|
delta: -20,
|
|
891
|
-
|
|
945
|
+
initialLayout: [25, 50, 25],
|
|
892
946
|
panelConstraints: [{}, { minSize: 40 }, {}],
|
|
893
947
|
pivotIndices: [1, 2],
|
|
948
|
+
prevLayout: [25, 50, 25],
|
|
894
949
|
trigger: "imperative-api",
|
|
895
950
|
})
|
|
896
951
|
).toEqual([15, 40, 45]);
|
|
@@ -900,9 +955,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
900
955
|
expect(
|
|
901
956
|
adjustLayoutByDelta({
|
|
902
957
|
delta: -10,
|
|
903
|
-
|
|
958
|
+
initialLayout: [25, 50, 25],
|
|
904
959
|
panelConstraints: [{}, {}, { maxSize: 30 }],
|
|
905
960
|
pivotIndices: [1, 2],
|
|
961
|
+
prevLayout: [25, 50, 25],
|
|
906
962
|
trigger: "imperative-api",
|
|
907
963
|
})
|
|
908
964
|
).toEqual([25, 45, 30]);
|
|
@@ -912,7 +968,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
912
968
|
expect(
|
|
913
969
|
adjustLayoutByDelta({
|
|
914
970
|
delta: -35,
|
|
915
|
-
|
|
971
|
+
initialLayout: [25, 50, 25],
|
|
916
972
|
panelConstraints: [
|
|
917
973
|
{},
|
|
918
974
|
{
|
|
@@ -923,6 +979,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
923
979
|
{},
|
|
924
980
|
],
|
|
925
981
|
pivotIndices: [1, 2],
|
|
982
|
+
prevLayout: [25, 50, 25],
|
|
926
983
|
trigger: "imperative-api",
|
|
927
984
|
})
|
|
928
985
|
).toEqual([20, 20, 60]);
|
|
@@ -930,7 +987,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
930
987
|
expect(
|
|
931
988
|
adjustLayoutByDelta({
|
|
932
989
|
delta: -40,
|
|
933
|
-
|
|
990
|
+
initialLayout: [25, 50, 25],
|
|
934
991
|
panelConstraints: [
|
|
935
992
|
{},
|
|
936
993
|
{
|
|
@@ -941,6 +998,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
941
998
|
{},
|
|
942
999
|
],
|
|
943
1000
|
pivotIndices: [1, 2],
|
|
1001
|
+
prevLayout: [25, 50, 25],
|
|
944
1002
|
trigger: "imperative-api",
|
|
945
1003
|
})
|
|
946
1004
|
).toEqual([25, 5, 70]);
|
|
@@ -950,7 +1008,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
950
1008
|
expect(
|
|
951
1009
|
adjustLayoutByDelta({
|
|
952
1010
|
delta: -10,
|
|
953
|
-
|
|
1011
|
+
initialLayout: [25, 0, 75],
|
|
954
1012
|
panelConstraints: [
|
|
955
1013
|
{
|
|
956
1014
|
collapsedSize: 5,
|
|
@@ -961,6 +1019,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
961
1019
|
{},
|
|
962
1020
|
],
|
|
963
1021
|
pivotIndices: [1, 2],
|
|
1022
|
+
prevLayout: [25, 0, 75],
|
|
964
1023
|
trigger: "imperative-api",
|
|
965
1024
|
})
|
|
966
1025
|
).toEqual([20, 0, 80]);
|
|
@@ -968,7 +1027,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
968
1027
|
expect(
|
|
969
1028
|
adjustLayoutByDelta({
|
|
970
1029
|
delta: -20,
|
|
971
|
-
|
|
1030
|
+
initialLayout: [25, 0, 75],
|
|
972
1031
|
panelConstraints: [
|
|
973
1032
|
{
|
|
974
1033
|
collapsedSize: 5,
|
|
@@ -979,6 +1038,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
979
1038
|
{},
|
|
980
1039
|
],
|
|
981
1040
|
pivotIndices: [1, 2],
|
|
1041
|
+
prevLayout: [25, 0, 75],
|
|
982
1042
|
trigger: "imperative-api",
|
|
983
1043
|
})
|
|
984
1044
|
).toEqual([5, 0, 95]);
|
|
@@ -989,9 +1049,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
989
1049
|
expect(
|
|
990
1050
|
adjustLayoutByDelta({
|
|
991
1051
|
delta: -100,
|
|
992
|
-
|
|
1052
|
+
initialLayout: [100 / 3, 100 / 3, 100 / 3],
|
|
993
1053
|
panelConstraints: [{}, {}, {}],
|
|
994
1054
|
pivotIndices: [1, 2],
|
|
1055
|
+
prevLayout: [100 / 3, 100 / 3, 100 / 3],
|
|
995
1056
|
trigger: "mouse-or-touch",
|
|
996
1057
|
})
|
|
997
1058
|
).toEqual([0, 0, 100]);
|
|
@@ -1001,9 +1062,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1001
1062
|
expect(
|
|
1002
1063
|
adjustLayoutByDelta({
|
|
1003
1064
|
delta: 1,
|
|
1004
|
-
|
|
1065
|
+
initialLayout: [25, 25, 25, 25],
|
|
1005
1066
|
panelConstraints: [{}, {}, {}, {}],
|
|
1006
1067
|
pivotIndices: [0, 1],
|
|
1068
|
+
prevLayout: [25, 25, 25, 25],
|
|
1007
1069
|
trigger: "imperative-api",
|
|
1008
1070
|
})
|
|
1009
1071
|
).toEqual([26, 24, 25, 25]);
|
|
@@ -1013,9 +1075,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1013
1075
|
expect(
|
|
1014
1076
|
adjustLayoutByDelta({
|
|
1015
1077
|
delta: 25,
|
|
1016
|
-
|
|
1078
|
+
initialLayout: [25, 25, 25, 25],
|
|
1017
1079
|
panelConstraints: [{}, {}, {}, {}],
|
|
1018
1080
|
pivotIndices: [0, 1],
|
|
1081
|
+
prevLayout: [25, 25, 25, 25],
|
|
1019
1082
|
trigger: "imperative-api",
|
|
1020
1083
|
})
|
|
1021
1084
|
).toEqual([50, 0, 25, 25]);
|
|
@@ -1025,9 +1088,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1025
1088
|
expect(
|
|
1026
1089
|
adjustLayoutByDelta({
|
|
1027
1090
|
delta: 50,
|
|
1028
|
-
|
|
1091
|
+
initialLayout: [25, 25, 25, 25],
|
|
1029
1092
|
panelConstraints: [{}, {}, {}, {}],
|
|
1030
1093
|
pivotIndices: [0, 1],
|
|
1094
|
+
prevLayout: [25, 25, 25, 25],
|
|
1031
1095
|
trigger: "imperative-api",
|
|
1032
1096
|
})
|
|
1033
1097
|
).toEqual([75, 0, 0, 25]);
|
|
@@ -1037,9 +1101,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1037
1101
|
expect(
|
|
1038
1102
|
adjustLayoutByDelta({
|
|
1039
1103
|
delta: 75,
|
|
1040
|
-
|
|
1104
|
+
initialLayout: [25, 25, 25, 25],
|
|
1041
1105
|
panelConstraints: [{}, {}, {}, {}],
|
|
1042
1106
|
pivotIndices: [0, 1],
|
|
1107
|
+
prevLayout: [25, 25, 25, 25],
|
|
1043
1108
|
trigger: "imperative-api",
|
|
1044
1109
|
})
|
|
1045
1110
|
).toEqual([100, 0, 0, 0]);
|
|
@@ -1049,9 +1114,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1049
1114
|
expect(
|
|
1050
1115
|
adjustLayoutByDelta({
|
|
1051
1116
|
delta: 25,
|
|
1052
|
-
|
|
1117
|
+
initialLayout: [25, 25, 25, 25],
|
|
1053
1118
|
panelConstraints: [{ maxSize: 35 }, {}, {}, {}],
|
|
1054
1119
|
pivotIndices: [0, 1],
|
|
1120
|
+
prevLayout: [25, 25, 25, 25],
|
|
1055
1121
|
trigger: "imperative-api",
|
|
1056
1122
|
})
|
|
1057
1123
|
).toEqual([35, 15, 25, 25]);
|
|
@@ -1061,7 +1127,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1061
1127
|
expect(
|
|
1062
1128
|
adjustLayoutByDelta({
|
|
1063
1129
|
delta: 100,
|
|
1064
|
-
|
|
1130
|
+
initialLayout: [25, 25, 25, 25],
|
|
1065
1131
|
panelConstraints: [
|
|
1066
1132
|
{},
|
|
1067
1133
|
{ minSize: 10 },
|
|
@@ -1069,6 +1135,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1069
1135
|
{ minSize: 10 },
|
|
1070
1136
|
],
|
|
1071
1137
|
pivotIndices: [0, 1],
|
|
1138
|
+
prevLayout: [25, 25, 25, 25],
|
|
1072
1139
|
trigger: "imperative-api",
|
|
1073
1140
|
})
|
|
1074
1141
|
).toEqual([70, 10, 10, 10]);
|
|
@@ -1078,7 +1145,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1078
1145
|
expect(
|
|
1079
1146
|
adjustLayoutByDelta({
|
|
1080
1147
|
delta: 10,
|
|
1081
|
-
|
|
1148
|
+
initialLayout: [25, 25, 25, 25],
|
|
1082
1149
|
panelConstraints: [
|
|
1083
1150
|
{},
|
|
1084
1151
|
{
|
|
@@ -1098,6 +1165,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1098
1165
|
},
|
|
1099
1166
|
],
|
|
1100
1167
|
pivotIndices: [0, 1],
|
|
1168
|
+
prevLayout: [25, 25, 25, 25],
|
|
1101
1169
|
trigger: "imperative-api",
|
|
1102
1170
|
})
|
|
1103
1171
|
).toEqual([35, 20, 20, 25]);
|
|
@@ -1105,7 +1173,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1105
1173
|
expect(
|
|
1106
1174
|
adjustLayoutByDelta({
|
|
1107
1175
|
delta: 15,
|
|
1108
|
-
|
|
1176
|
+
initialLayout: [25, 25, 25, 25],
|
|
1109
1177
|
panelConstraints: [
|
|
1110
1178
|
{},
|
|
1111
1179
|
{
|
|
@@ -1125,6 +1193,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1125
1193
|
},
|
|
1126
1194
|
],
|
|
1127
1195
|
pivotIndices: [0, 1],
|
|
1196
|
+
prevLayout: [25, 25, 25, 25],
|
|
1128
1197
|
trigger: "imperative-api",
|
|
1129
1198
|
})
|
|
1130
1199
|
).toEqual([45, 5, 25, 25]);
|
|
@@ -1134,7 +1203,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1134
1203
|
expect(
|
|
1135
1204
|
adjustLayoutByDelta({
|
|
1136
1205
|
delta: 40,
|
|
1137
|
-
|
|
1206
|
+
initialLayout: [25, 25, 25, 25],
|
|
1138
1207
|
panelConstraints: [
|
|
1139
1208
|
{},
|
|
1140
1209
|
{
|
|
@@ -1154,6 +1223,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1154
1223
|
},
|
|
1155
1224
|
],
|
|
1156
1225
|
pivotIndices: [0, 1],
|
|
1226
|
+
prevLayout: [25, 25, 25, 25],
|
|
1157
1227
|
trigger: "imperative-api",
|
|
1158
1228
|
})
|
|
1159
1229
|
).toEqual([65, 5, 5, 25]);
|
|
@@ -1163,7 +1233,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1163
1233
|
expect(
|
|
1164
1234
|
adjustLayoutByDelta({
|
|
1165
1235
|
delta: 100,
|
|
1166
|
-
|
|
1236
|
+
initialLayout: [25, 25, 25, 25],
|
|
1167
1237
|
panelConstraints: [
|
|
1168
1238
|
{},
|
|
1169
1239
|
{
|
|
@@ -1183,6 +1253,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1183
1253
|
},
|
|
1184
1254
|
],
|
|
1185
1255
|
pivotIndices: [0, 1],
|
|
1256
|
+
prevLayout: [25, 25, 25, 25],
|
|
1186
1257
|
trigger: "imperative-api",
|
|
1187
1258
|
})
|
|
1188
1259
|
).toEqual([85, 5, 5, 5]);
|
|
@@ -1192,9 +1263,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1192
1263
|
expect(
|
|
1193
1264
|
adjustLayoutByDelta({
|
|
1194
1265
|
delta: -1,
|
|
1195
|
-
|
|
1266
|
+
initialLayout: [25, 25, 25, 25],
|
|
1196
1267
|
panelConstraints: [{}, {}, {}, {}],
|
|
1197
1268
|
pivotIndices: [0, 1],
|
|
1269
|
+
prevLayout: [25, 25, 25, 25],
|
|
1198
1270
|
trigger: "imperative-api",
|
|
1199
1271
|
})
|
|
1200
1272
|
).toEqual([24, 26, 25, 25]);
|
|
@@ -1204,9 +1276,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1204
1276
|
expect(
|
|
1205
1277
|
adjustLayoutByDelta({
|
|
1206
1278
|
delta: -25,
|
|
1207
|
-
|
|
1279
|
+
initialLayout: [25, 25, 25, 25],
|
|
1208
1280
|
panelConstraints: [{}, {}, {}, {}],
|
|
1209
1281
|
pivotIndices: [0, 1],
|
|
1282
|
+
prevLayout: [25, 25, 25, 25],
|
|
1210
1283
|
trigger: "imperative-api",
|
|
1211
1284
|
})
|
|
1212
1285
|
).toEqual([0, 50, 25, 25]);
|
|
@@ -1216,9 +1289,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1216
1289
|
expect(
|
|
1217
1290
|
adjustLayoutByDelta({
|
|
1218
1291
|
delta: -10,
|
|
1219
|
-
|
|
1292
|
+
initialLayout: [25, 25, 25, 25],
|
|
1220
1293
|
panelConstraints: [{ minSize: 20 }, {}, {}, {}],
|
|
1221
1294
|
pivotIndices: [0, 1],
|
|
1295
|
+
prevLayout: [25, 25, 25, 25],
|
|
1222
1296
|
trigger: "imperative-api",
|
|
1223
1297
|
})
|
|
1224
1298
|
).toEqual([20, 30, 25, 25]);
|
|
@@ -1228,9 +1302,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1228
1302
|
expect(
|
|
1229
1303
|
adjustLayoutByDelta({
|
|
1230
1304
|
delta: -25,
|
|
1231
|
-
|
|
1305
|
+
initialLayout: [25, 25, 25, 25],
|
|
1232
1306
|
panelConstraints: [{}, { maxSize: 35 }, {}, {}],
|
|
1233
1307
|
pivotIndices: [0, 1],
|
|
1308
|
+
prevLayout: [25, 25, 25, 25],
|
|
1234
1309
|
trigger: "imperative-api",
|
|
1235
1310
|
})
|
|
1236
1311
|
).toEqual([0, 35, 40, 25]);
|
|
@@ -1240,7 +1315,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1240
1315
|
expect(
|
|
1241
1316
|
adjustLayoutByDelta({
|
|
1242
1317
|
delta: -10,
|
|
1243
|
-
|
|
1318
|
+
initialLayout: [25, 25, 25, 25],
|
|
1244
1319
|
panelConstraints: [
|
|
1245
1320
|
{
|
|
1246
1321
|
collapsedSize: 5,
|
|
@@ -1252,6 +1327,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1252
1327
|
{},
|
|
1253
1328
|
],
|
|
1254
1329
|
pivotIndices: [0, 1],
|
|
1330
|
+
prevLayout: [25, 25, 25, 25],
|
|
1255
1331
|
trigger: "imperative-api",
|
|
1256
1332
|
})
|
|
1257
1333
|
).toEqual([20, 30, 25, 25]);
|
|
@@ -1259,7 +1335,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1259
1335
|
expect(
|
|
1260
1336
|
adjustLayoutByDelta({
|
|
1261
1337
|
delta: -15,
|
|
1262
|
-
|
|
1338
|
+
initialLayout: [25, 25, 25, 25],
|
|
1263
1339
|
panelConstraints: [
|
|
1264
1340
|
{
|
|
1265
1341
|
collapsedSize: 5,
|
|
@@ -1271,6 +1347,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1271
1347
|
{},
|
|
1272
1348
|
],
|
|
1273
1349
|
pivotIndices: [0, 1],
|
|
1350
|
+
prevLayout: [25, 25, 25, 25],
|
|
1274
1351
|
trigger: "imperative-api",
|
|
1275
1352
|
})
|
|
1276
1353
|
).toEqual([5, 45, 25, 25]);
|
|
@@ -1280,7 +1357,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1280
1357
|
expect(
|
|
1281
1358
|
adjustLayoutByDelta({
|
|
1282
1359
|
delta: -10,
|
|
1283
|
-
|
|
1360
|
+
initialLayout: [25, 25, 25, 25],
|
|
1284
1361
|
panelConstraints: [
|
|
1285
1362
|
{
|
|
1286
1363
|
collapsedSize: 5,
|
|
@@ -1292,6 +1369,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1292
1369
|
{},
|
|
1293
1370
|
],
|
|
1294
1371
|
pivotIndices: [0, 1],
|
|
1372
|
+
prevLayout: [25, 25, 25, 25],
|
|
1295
1373
|
trigger: "imperative-api",
|
|
1296
1374
|
})
|
|
1297
1375
|
).toEqual([20, 30, 25, 25]);
|
|
@@ -1299,7 +1377,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1299
1377
|
expect(
|
|
1300
1378
|
adjustLayoutByDelta({
|
|
1301
1379
|
delta: -15,
|
|
1302
|
-
|
|
1380
|
+
initialLayout: [25, 25, 25, 25],
|
|
1303
1381
|
panelConstraints: [
|
|
1304
1382
|
{
|
|
1305
1383
|
collapsedSize: 5,
|
|
@@ -1311,6 +1389,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1311
1389
|
{},
|
|
1312
1390
|
],
|
|
1313
1391
|
pivotIndices: [0, 1],
|
|
1392
|
+
prevLayout: [25, 25, 25, 25],
|
|
1314
1393
|
trigger: "imperative-api",
|
|
1315
1394
|
})
|
|
1316
1395
|
).toEqual([5, 35, 35, 25]);
|
|
@@ -1326,7 +1405,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1326
1405
|
expect(
|
|
1327
1406
|
adjustLayoutByDelta({
|
|
1328
1407
|
delta: -10,
|
|
1329
|
-
|
|
1408
|
+
initialLayout: [25, 25, 25, 25],
|
|
1330
1409
|
panelConstraints: [
|
|
1331
1410
|
{
|
|
1332
1411
|
collapsedSize: 5,
|
|
@@ -1338,6 +1417,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1338
1417
|
{},
|
|
1339
1418
|
],
|
|
1340
1419
|
pivotIndices: [0, 1],
|
|
1420
|
+
prevLayout: [25, 25, 25, 25],
|
|
1341
1421
|
trigger: "imperative-api",
|
|
1342
1422
|
})
|
|
1343
1423
|
).toEqual([20, 30, 25, 25]);
|
|
@@ -1353,7 +1433,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1353
1433
|
expect(
|
|
1354
1434
|
adjustLayoutByDelta({
|
|
1355
1435
|
delta: -10,
|
|
1356
|
-
|
|
1436
|
+
initialLayout: [25, 25, 25, 25],
|
|
1357
1437
|
panelConstraints: [
|
|
1358
1438
|
{
|
|
1359
1439
|
collapsedSize: 5,
|
|
@@ -1365,6 +1445,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1365
1445
|
{},
|
|
1366
1446
|
],
|
|
1367
1447
|
pivotIndices: [0, 1],
|
|
1448
|
+
prevLayout: [25, 25, 25, 25],
|
|
1368
1449
|
trigger: "imperative-api",
|
|
1369
1450
|
})
|
|
1370
1451
|
).toEqual([20, 30, 25, 25]);
|
|
@@ -1376,7 +1457,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1376
1457
|
expect(
|
|
1377
1458
|
adjustLayoutByDelta({
|
|
1378
1459
|
delta: -10,
|
|
1379
|
-
|
|
1460
|
+
initialLayout: [25, 25, 25, 25],
|
|
1380
1461
|
panelConstraints: [
|
|
1381
1462
|
{
|
|
1382
1463
|
collapsedSize: 5,
|
|
@@ -1388,6 +1469,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1388
1469
|
{ maxSize: 35 },
|
|
1389
1470
|
],
|
|
1390
1471
|
pivotIndices: [0, 1],
|
|
1472
|
+
prevLayout: [25, 25, 25, 25],
|
|
1391
1473
|
trigger: "imperative-api",
|
|
1392
1474
|
})
|
|
1393
1475
|
).toEqual([20, 30, 25, 25]);
|
|
@@ -1398,7 +1480,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1398
1480
|
expect(
|
|
1399
1481
|
adjustLayoutByDelta({
|
|
1400
1482
|
delta: -20,
|
|
1401
|
-
|
|
1483
|
+
initialLayout: [25, 25, 25, 25],
|
|
1402
1484
|
panelConstraints: [
|
|
1403
1485
|
{
|
|
1404
1486
|
collapsedSize: 5,
|
|
@@ -1410,6 +1492,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1410
1492
|
{ maxSize: 35 },
|
|
1411
1493
|
],
|
|
1412
1494
|
pivotIndices: [0, 1],
|
|
1495
|
+
prevLayout: [25, 25, 25, 25],
|
|
1413
1496
|
trigger: "imperative-api",
|
|
1414
1497
|
})
|
|
1415
1498
|
).toEqual([5, 35, 35, 25]);
|
|
@@ -1419,9 +1502,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1419
1502
|
expect(
|
|
1420
1503
|
adjustLayoutByDelta({
|
|
1421
1504
|
delta: 10,
|
|
1422
|
-
|
|
1505
|
+
initialLayout: [25, 25, 25, 25],
|
|
1423
1506
|
panelConstraints: [{}, {}, {}, {}],
|
|
1424
1507
|
pivotIndices: [1, 2],
|
|
1508
|
+
prevLayout: [25, 25, 25, 25],
|
|
1425
1509
|
trigger: "imperative-api",
|
|
1426
1510
|
})
|
|
1427
1511
|
).toEqual([25, 35, 15, 25]);
|
|
@@ -1431,9 +1515,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1431
1515
|
expect(
|
|
1432
1516
|
adjustLayoutByDelta({
|
|
1433
1517
|
delta: 30,
|
|
1434
|
-
|
|
1518
|
+
initialLayout: [25, 25, 25, 25],
|
|
1435
1519
|
panelConstraints: [{}, {}, {}, {}],
|
|
1436
1520
|
pivotIndices: [1, 2],
|
|
1521
|
+
prevLayout: [25, 25, 25, 25],
|
|
1437
1522
|
trigger: "imperative-api",
|
|
1438
1523
|
})
|
|
1439
1524
|
).toEqual([25, 55, 0, 20]);
|
|
@@ -1443,9 +1528,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1443
1528
|
expect(
|
|
1444
1529
|
adjustLayoutByDelta({
|
|
1445
1530
|
delta: 50,
|
|
1446
|
-
|
|
1531
|
+
initialLayout: [25, 25, 25, 25],
|
|
1447
1532
|
panelConstraints: [{}, {}, {}, {}],
|
|
1448
1533
|
pivotIndices: [1, 2],
|
|
1534
|
+
prevLayout: [25, 25, 25, 25],
|
|
1449
1535
|
trigger: "imperative-api",
|
|
1450
1536
|
})
|
|
1451
1537
|
).toEqual([25, 75, 0, 0]);
|
|
@@ -1455,9 +1541,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1455
1541
|
expect(
|
|
1456
1542
|
adjustLayoutByDelta({
|
|
1457
1543
|
delta: 50,
|
|
1458
|
-
|
|
1544
|
+
initialLayout: [25, 25, 25, 25],
|
|
1459
1545
|
panelConstraints: [{}, { maxSize: 35 }, {}, {}],
|
|
1460
1546
|
pivotIndices: [1, 2],
|
|
1547
|
+
prevLayout: [25, 25, 25, 25],
|
|
1461
1548
|
trigger: "imperative-api",
|
|
1462
1549
|
})
|
|
1463
1550
|
).toEqual([65, 35, 0, 0]);
|
|
@@ -1467,9 +1554,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1467
1554
|
expect(
|
|
1468
1555
|
adjustLayoutByDelta({
|
|
1469
1556
|
delta: 50,
|
|
1470
|
-
|
|
1557
|
+
initialLayout: [25, 25, 25, 25],
|
|
1471
1558
|
panelConstraints: [{}, {}, { minSize: 20 }, {}],
|
|
1472
1559
|
pivotIndices: [1, 2],
|
|
1560
|
+
prevLayout: [25, 25, 25, 25],
|
|
1473
1561
|
trigger: "imperative-api",
|
|
1474
1562
|
})
|
|
1475
1563
|
).toEqual([25, 55, 20, 0]);
|
|
@@ -1479,7 +1567,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1479
1567
|
expect(
|
|
1480
1568
|
adjustLayoutByDelta({
|
|
1481
1569
|
delta: 10,
|
|
1482
|
-
|
|
1570
|
+
initialLayout: [25, 25, 25, 25],
|
|
1483
1571
|
panelConstraints: [
|
|
1484
1572
|
{},
|
|
1485
1573
|
{},
|
|
@@ -1491,6 +1579,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1491
1579
|
},
|
|
1492
1580
|
],
|
|
1493
1581
|
pivotIndices: [1, 2],
|
|
1582
|
+
prevLayout: [25, 25, 25, 25],
|
|
1494
1583
|
trigger: "imperative-api",
|
|
1495
1584
|
})
|
|
1496
1585
|
).toEqual([25, 35, 15, 25]);
|
|
@@ -1500,7 +1589,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1500
1589
|
expect(
|
|
1501
1590
|
adjustLayoutByDelta({
|
|
1502
1591
|
delta: 30,
|
|
1503
|
-
|
|
1592
|
+
initialLayout: [25, 25, 25, 25],
|
|
1504
1593
|
panelConstraints: [
|
|
1505
1594
|
{},
|
|
1506
1595
|
{},
|
|
@@ -1512,6 +1601,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1512
1601
|
{},
|
|
1513
1602
|
],
|
|
1514
1603
|
pivotIndices: [1, 2],
|
|
1604
|
+
prevLayout: [25, 25, 25, 25],
|
|
1515
1605
|
trigger: "imperative-api",
|
|
1516
1606
|
})
|
|
1517
1607
|
).toEqual([25, 55, 5, 15]);
|
|
@@ -1521,7 +1611,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1521
1611
|
expect(
|
|
1522
1612
|
adjustLayoutByDelta({
|
|
1523
1613
|
delta: 50,
|
|
1524
|
-
|
|
1614
|
+
initialLayout: [25, 25, 25, 25],
|
|
1525
1615
|
panelConstraints: [
|
|
1526
1616
|
{},
|
|
1527
1617
|
{},
|
|
@@ -1533,6 +1623,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1533
1623
|
{ minSize: 10 },
|
|
1534
1624
|
],
|
|
1535
1625
|
pivotIndices: [1, 2],
|
|
1626
|
+
prevLayout: [25, 25, 25, 25],
|
|
1536
1627
|
trigger: "imperative-api",
|
|
1537
1628
|
})
|
|
1538
1629
|
).toEqual([25, 60, 5, 10]);
|
|
@@ -1542,9 +1633,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1542
1633
|
expect(
|
|
1543
1634
|
adjustLayoutByDelta({
|
|
1544
1635
|
delta: -25,
|
|
1545
|
-
|
|
1636
|
+
initialLayout: [25, 25, 25, 25],
|
|
1546
1637
|
panelConstraints: [{}, {}, {}, {}],
|
|
1547
1638
|
pivotIndices: [1, 2],
|
|
1639
|
+
prevLayout: [25, 25, 25, 25],
|
|
1548
1640
|
trigger: "imperative-api",
|
|
1549
1641
|
})
|
|
1550
1642
|
).toEqual([25, 0, 50, 25]);
|
|
@@ -1554,9 +1646,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1554
1646
|
expect(
|
|
1555
1647
|
adjustLayoutByDelta({
|
|
1556
1648
|
delta: -50,
|
|
1557
|
-
|
|
1649
|
+
initialLayout: [25, 25, 25, 25],
|
|
1558
1650
|
panelConstraints: [{}, {}, {}, {}],
|
|
1559
1651
|
pivotIndices: [1, 2],
|
|
1652
|
+
prevLayout: [25, 25, 25, 25],
|
|
1560
1653
|
trigger: "imperative-api",
|
|
1561
1654
|
})
|
|
1562
1655
|
).toEqual([0, 0, 75, 25]);
|
|
@@ -1566,9 +1659,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1566
1659
|
expect(
|
|
1567
1660
|
adjustLayoutByDelta({
|
|
1568
1661
|
delta: -50,
|
|
1569
|
-
|
|
1662
|
+
initialLayout: [25, 25, 25, 25],
|
|
1570
1663
|
panelConstraints: [{}, { minSize: 20 }, {}, {}],
|
|
1571
1664
|
pivotIndices: [1, 2],
|
|
1665
|
+
prevLayout: [25, 25, 25, 25],
|
|
1572
1666
|
trigger: "imperative-api",
|
|
1573
1667
|
})
|
|
1574
1668
|
).toEqual([0, 20, 55, 25]);
|
|
@@ -1578,9 +1672,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1578
1672
|
expect(
|
|
1579
1673
|
adjustLayoutByDelta({
|
|
1580
1674
|
delta: -50,
|
|
1581
|
-
|
|
1675
|
+
initialLayout: [25, 25, 25, 25],
|
|
1582
1676
|
panelConstraints: [{ minSize: 20 }, {}, {}, {}],
|
|
1583
1677
|
pivotIndices: [1, 2],
|
|
1678
|
+
prevLayout: [25, 25, 25, 25],
|
|
1584
1679
|
trigger: "imperative-api",
|
|
1585
1680
|
})
|
|
1586
1681
|
).toEqual([20, 0, 55, 25]);
|
|
@@ -1590,9 +1685,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1590
1685
|
expect(
|
|
1591
1686
|
adjustLayoutByDelta({
|
|
1592
1687
|
delta: -50,
|
|
1593
|
-
|
|
1688
|
+
initialLayout: [25, 25, 25, 25],
|
|
1594
1689
|
panelConstraints: [{ minSize: 20 }, { minSize: 20 }, {}, {}],
|
|
1595
1690
|
pivotIndices: [1, 2],
|
|
1691
|
+
prevLayout: [25, 25, 25, 25],
|
|
1596
1692
|
trigger: "imperative-api",
|
|
1597
1693
|
})
|
|
1598
1694
|
).toEqual([20, 20, 35, 25]);
|
|
@@ -1602,7 +1698,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1602
1698
|
expect(
|
|
1603
1699
|
adjustLayoutByDelta({
|
|
1604
1700
|
delta: -5,
|
|
1605
|
-
|
|
1701
|
+
initialLayout: [25, 25, 25, 25],
|
|
1606
1702
|
panelConstraints: [
|
|
1607
1703
|
{
|
|
1608
1704
|
collapsedSize: 5,
|
|
@@ -1614,6 +1710,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1614
1710
|
{},
|
|
1615
1711
|
],
|
|
1616
1712
|
pivotIndices: [1, 2],
|
|
1713
|
+
prevLayout: [25, 25, 25, 25],
|
|
1617
1714
|
trigger: "imperative-api",
|
|
1618
1715
|
})
|
|
1619
1716
|
).toEqual([25, 20, 30, 25]);
|
|
@@ -1623,7 +1720,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1623
1720
|
expect(
|
|
1624
1721
|
adjustLayoutByDelta({
|
|
1625
1722
|
delta: -50,
|
|
1626
|
-
|
|
1723
|
+
initialLayout: [25, 25, 25, 25],
|
|
1627
1724
|
panelConstraints: [
|
|
1628
1725
|
{
|
|
1629
1726
|
collapsedSize: 5,
|
|
@@ -1635,6 +1732,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1635
1732
|
{},
|
|
1636
1733
|
],
|
|
1637
1734
|
pivotIndices: [1, 2],
|
|
1735
|
+
prevLayout: [25, 25, 25, 25],
|
|
1638
1736
|
trigger: "imperative-api",
|
|
1639
1737
|
})
|
|
1640
1738
|
).toEqual([5, 0, 70, 25]);
|
|
@@ -1644,7 +1742,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1644
1742
|
expect(
|
|
1645
1743
|
adjustLayoutByDelta({
|
|
1646
1744
|
delta: -50,
|
|
1647
|
-
|
|
1745
|
+
initialLayout: [25, 25, 25, 25],
|
|
1648
1746
|
panelConstraints: [
|
|
1649
1747
|
{},
|
|
1650
1748
|
{
|
|
@@ -1656,6 +1754,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1656
1754
|
{},
|
|
1657
1755
|
],
|
|
1658
1756
|
pivotIndices: [1, 2],
|
|
1757
|
+
prevLayout: [25, 25, 25, 25],
|
|
1659
1758
|
trigger: "imperative-api",
|
|
1660
1759
|
})
|
|
1661
1760
|
).toEqual([0, 5, 70, 25]);
|
|
@@ -1665,9 +1764,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1665
1764
|
expect(
|
|
1666
1765
|
adjustLayoutByDelta({
|
|
1667
1766
|
delta: 10,
|
|
1668
|
-
|
|
1767
|
+
initialLayout: [25, 25, 25, 25],
|
|
1669
1768
|
panelConstraints: [{}, {}, {}, {}],
|
|
1670
1769
|
pivotIndices: [2, 3],
|
|
1770
|
+
prevLayout: [25, 25, 25, 25],
|
|
1671
1771
|
trigger: "imperative-api",
|
|
1672
1772
|
})
|
|
1673
1773
|
).toEqual([25, 25, 35, 15]);
|
|
@@ -1677,9 +1777,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1677
1777
|
expect(
|
|
1678
1778
|
adjustLayoutByDelta({
|
|
1679
1779
|
delta: 30,
|
|
1680
|
-
|
|
1780
|
+
initialLayout: [25, 25, 25, 25],
|
|
1681
1781
|
panelConstraints: [{}, {}, {}, {}],
|
|
1682
1782
|
pivotIndices: [2, 3],
|
|
1783
|
+
prevLayout: [25, 25, 25, 25],
|
|
1683
1784
|
trigger: "imperative-api",
|
|
1684
1785
|
})
|
|
1685
1786
|
).toEqual([25, 25, 50, 0]);
|
|
@@ -1689,9 +1790,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1689
1790
|
expect(
|
|
1690
1791
|
adjustLayoutByDelta({
|
|
1691
1792
|
delta: 30,
|
|
1692
|
-
|
|
1793
|
+
initialLayout: [25, 25, 25, 25],
|
|
1693
1794
|
panelConstraints: [{}, {}, { maxSize: 40 }, {}],
|
|
1694
1795
|
pivotIndices: [2, 3],
|
|
1796
|
+
prevLayout: [25, 25, 25, 25],
|
|
1695
1797
|
trigger: "imperative-api",
|
|
1696
1798
|
})
|
|
1697
1799
|
).toEqual([25, 35, 40, 0]);
|
|
@@ -1701,9 +1803,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1701
1803
|
expect(
|
|
1702
1804
|
adjustLayoutByDelta({
|
|
1703
1805
|
delta: 30,
|
|
1704
|
-
|
|
1806
|
+
initialLayout: [25, 25, 25, 25],
|
|
1705
1807
|
panelConstraints: [{}, {}, {}, { minSize: 10 }],
|
|
1706
1808
|
pivotIndices: [2, 3],
|
|
1809
|
+
prevLayout: [25, 25, 25, 25],
|
|
1707
1810
|
trigger: "imperative-api",
|
|
1708
1811
|
})
|
|
1709
1812
|
).toEqual([25, 25, 40, 10]);
|
|
@@ -1713,7 +1816,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1713
1816
|
expect(
|
|
1714
1817
|
adjustLayoutByDelta({
|
|
1715
1818
|
delta: 5,
|
|
1716
|
-
|
|
1819
|
+
initialLayout: [25, 25, 25, 25],
|
|
1717
1820
|
panelConstraints: [
|
|
1718
1821
|
{},
|
|
1719
1822
|
{},
|
|
@@ -1725,6 +1828,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1725
1828
|
},
|
|
1726
1829
|
],
|
|
1727
1830
|
pivotIndices: [2, 3],
|
|
1831
|
+
prevLayout: [25, 25, 25, 25],
|
|
1728
1832
|
trigger: "imperative-api",
|
|
1729
1833
|
})
|
|
1730
1834
|
).toEqual([25, 25, 30, 20]);
|
|
@@ -1734,7 +1838,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1734
1838
|
expect(
|
|
1735
1839
|
adjustLayoutByDelta({
|
|
1736
1840
|
delta: 50,
|
|
1737
|
-
|
|
1841
|
+
initialLayout: [25, 25, 25, 25],
|
|
1738
1842
|
panelConstraints: [
|
|
1739
1843
|
{},
|
|
1740
1844
|
{},
|
|
@@ -1746,6 +1850,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1746
1850
|
},
|
|
1747
1851
|
],
|
|
1748
1852
|
pivotIndices: [2, 3],
|
|
1853
|
+
prevLayout: [25, 25, 25, 25],
|
|
1749
1854
|
trigger: "imperative-api",
|
|
1750
1855
|
})
|
|
1751
1856
|
).toEqual([25, 25, 45, 5]);
|
|
@@ -1755,9 +1860,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1755
1860
|
expect(
|
|
1756
1861
|
adjustLayoutByDelta({
|
|
1757
1862
|
delta: -10,
|
|
1758
|
-
|
|
1863
|
+
initialLayout: [25, 25, 25, 25],
|
|
1759
1864
|
panelConstraints: [{}, {}, {}, {}],
|
|
1760
1865
|
pivotIndices: [2, 3],
|
|
1866
|
+
prevLayout: [25, 25, 25, 25],
|
|
1761
1867
|
trigger: "imperative-api",
|
|
1762
1868
|
})
|
|
1763
1869
|
).toEqual([25, 25, 15, 35]);
|
|
@@ -1767,9 +1873,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1767
1873
|
expect(
|
|
1768
1874
|
adjustLayoutByDelta({
|
|
1769
1875
|
delta: -40,
|
|
1770
|
-
|
|
1876
|
+
initialLayout: [25, 25, 25, 25],
|
|
1771
1877
|
panelConstraints: [{}, {}, {}, {}],
|
|
1772
1878
|
pivotIndices: [2, 3],
|
|
1879
|
+
prevLayout: [25, 25, 25, 25],
|
|
1773
1880
|
trigger: "imperative-api",
|
|
1774
1881
|
})
|
|
1775
1882
|
).toEqual([25, 10, 0, 65]);
|
|
@@ -1779,9 +1886,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1779
1886
|
expect(
|
|
1780
1887
|
adjustLayoutByDelta({
|
|
1781
1888
|
delta: -100,
|
|
1782
|
-
|
|
1889
|
+
initialLayout: [25, 25, 25, 25],
|
|
1783
1890
|
panelConstraints: [{}, {}, {}, {}],
|
|
1784
1891
|
pivotIndices: [2, 3],
|
|
1892
|
+
prevLayout: [25, 25, 25, 25],
|
|
1785
1893
|
trigger: "imperative-api",
|
|
1786
1894
|
})
|
|
1787
1895
|
).toEqual([0, 0, 0, 100]);
|
|
@@ -1791,7 +1899,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1791
1899
|
expect(
|
|
1792
1900
|
adjustLayoutByDelta({
|
|
1793
1901
|
delta: -50,
|
|
1794
|
-
|
|
1902
|
+
initialLayout: [25, 25, 25, 25],
|
|
1795
1903
|
panelConstraints: [
|
|
1796
1904
|
{ minSize: 10 },
|
|
1797
1905
|
{ minSize: 10 },
|
|
@@ -1799,6 +1907,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1799
1907
|
{},
|
|
1800
1908
|
],
|
|
1801
1909
|
pivotIndices: [2, 3],
|
|
1910
|
+
prevLayout: [25, 25, 25, 25],
|
|
1802
1911
|
trigger: "imperative-api",
|
|
1803
1912
|
})
|
|
1804
1913
|
).toEqual([10, 10, 10, 70]);
|
|
@@ -1808,9 +1917,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1808
1917
|
expect(
|
|
1809
1918
|
adjustLayoutByDelta({
|
|
1810
1919
|
delta: -50,
|
|
1811
|
-
|
|
1920
|
+
initialLayout: [25, 25, 25, 25],
|
|
1812
1921
|
panelConstraints: [{}, {}, {}, { maxSize: 40 }],
|
|
1813
1922
|
pivotIndices: [2, 3],
|
|
1923
|
+
prevLayout: [25, 25, 25, 25],
|
|
1814
1924
|
trigger: "imperative-api",
|
|
1815
1925
|
})
|
|
1816
1926
|
).toEqual([25, 25, 10, 40]);
|
|
@@ -1820,9 +1930,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1820
1930
|
expect(
|
|
1821
1931
|
adjustLayoutByDelta({
|
|
1822
1932
|
delta: -50,
|
|
1823
|
-
|
|
1933
|
+
initialLayout: [25, 25, 25, 25],
|
|
1824
1934
|
panelConstraints: [{}, { minSize: 5 }, {}, {}],
|
|
1825
1935
|
pivotIndices: [2, 3],
|
|
1936
|
+
prevLayout: [25, 25, 25, 25],
|
|
1826
1937
|
trigger: "imperative-api",
|
|
1827
1938
|
})
|
|
1828
1939
|
).toEqual([20, 5, 0, 75]);
|
|
@@ -1832,7 +1943,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1832
1943
|
expect(
|
|
1833
1944
|
adjustLayoutByDelta({
|
|
1834
1945
|
delta: -100,
|
|
1835
|
-
|
|
1946
|
+
initialLayout: [25, 25, 25, 25],
|
|
1836
1947
|
panelConstraints: [
|
|
1837
1948
|
{
|
|
1838
1949
|
collapsedSize: 5,
|
|
@@ -1852,6 +1963,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1852
1963
|
{},
|
|
1853
1964
|
],
|
|
1854
1965
|
pivotIndices: [2, 3],
|
|
1966
|
+
prevLayout: [25, 25, 25, 25],
|
|
1855
1967
|
trigger: "imperative-api",
|
|
1856
1968
|
})
|
|
1857
1969
|
).toEqual([5, 5, 5, 85]);
|
|
@@ -1861,7 +1973,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1861
1973
|
expect(
|
|
1862
1974
|
adjustLayoutByDelta({
|
|
1863
1975
|
delta: -100,
|
|
1864
|
-
|
|
1976
|
+
initialLayout: [25, 25, 25, 25],
|
|
1865
1977
|
panelConstraints: [
|
|
1866
1978
|
{
|
|
1867
1979
|
minSize: 20,
|
|
@@ -1877,6 +1989,7 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1877
1989
|
{},
|
|
1878
1990
|
],
|
|
1879
1991
|
pivotIndices: [2, 3],
|
|
1992
|
+
prevLayout: [25, 25, 25, 25],
|
|
1880
1993
|
trigger: "imperative-api",
|
|
1881
1994
|
})
|
|
1882
1995
|
).toEqual([20, 5, 20, 55]);
|
|
@@ -1887,9 +2000,10 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1887
2000
|
expect(
|
|
1888
2001
|
adjustLayoutByDelta({
|
|
1889
2002
|
delta: 1,
|
|
1890
|
-
|
|
2003
|
+
initialLayout: [50, 50],
|
|
1891
2004
|
panelConstraints: [{ maxSize: 50 }, {}],
|
|
1892
2005
|
pivotIndices: [0, 1],
|
|
2006
|
+
prevLayout: [50, 50],
|
|
1893
2007
|
trigger: "imperative-api",
|
|
1894
2008
|
})
|
|
1895
2009
|
).toEqual([50, 50]);
|
|
@@ -1897,12 +2011,51 @@ describe("adjustLayoutByDelta", () => {
|
|
|
1897
2011
|
expect(
|
|
1898
2012
|
adjustLayoutByDelta({
|
|
1899
2013
|
delta: 1,
|
|
1900
|
-
|
|
2014
|
+
initialLayout: [50, 50],
|
|
1901
2015
|
panelConstraints: [{}, { minSize: 50 }],
|
|
1902
2016
|
pivotIndices: [0, 1],
|
|
2017
|
+
prevLayout: [50, 50],
|
|
1903
2018
|
trigger: "imperative-api",
|
|
1904
2019
|
})
|
|
1905
2020
|
).toEqual([50, 50]);
|
|
1906
2021
|
});
|
|
1907
2022
|
});
|
|
2023
|
+
|
|
2024
|
+
// Edge case (issues/311)
|
|
2025
|
+
it("should fallback to the previous layout if an intermediate layout is invalid", () => {
|
|
2026
|
+
expect(
|
|
2027
|
+
adjustLayoutByDelta({
|
|
2028
|
+
delta: 1,
|
|
2029
|
+
initialLayout: [5, 15, 40, 40],
|
|
2030
|
+
panelConstraints: [
|
|
2031
|
+
{ collapsedSize: 5, collapsible: true, minSize: 15, maxSize: 20 },
|
|
2032
|
+
{ minSize: 15, maxSize: 30 },
|
|
2033
|
+
{ minSize: 30 },
|
|
2034
|
+
{ minSize: 20, maxSize: 40 },
|
|
2035
|
+
],
|
|
2036
|
+
pivotIndices: [0, 1],
|
|
2037
|
+
prevLayout: [5, 30, 30, 36],
|
|
2038
|
+
trigger: "imperative-api",
|
|
2039
|
+
})
|
|
2040
|
+
).toEqual([5, 30, 30, 36]);
|
|
2041
|
+
});
|
|
2042
|
+
|
|
2043
|
+
// Edge case (issues/311)
|
|
2044
|
+
it("should (re)collapse an already-collapsed panel that's been expanded and (re)collapsed as part of a single drag", () => {
|
|
2045
|
+
expect(
|
|
2046
|
+
adjustLayoutByDelta({
|
|
2047
|
+
delta: -3,
|
|
2048
|
+
initialLayout: [5, 15, 40, 40],
|
|
2049
|
+
panelConstraints: [
|
|
2050
|
+
{ collapsedSize: 5, collapsible: true, minSize: 15, maxSize: 20 },
|
|
2051
|
+
{ minSize: 15, maxSize: 30 },
|
|
2052
|
+
{ minSize: 30 },
|
|
2053
|
+
{ minSize: 20, maxSize: 40 },
|
|
2054
|
+
],
|
|
2055
|
+
pivotIndices: [0, 1],
|
|
2056
|
+
prevLayout: [15, 15, 30, 36],
|
|
2057
|
+
trigger: "imperative-api",
|
|
2058
|
+
})
|
|
2059
|
+
).toEqual([5, 15, 40, 40]);
|
|
2060
|
+
});
|
|
1908
2061
|
});
|