-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathIJsonModel.ts
More file actions
executable file
·973 lines (680 loc) · 19.5 KB
/
Copy pathIJsonModel.ts
File metadata and controls
executable file
·973 lines (680 loc) · 19.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
import { ICloseType } from "./ICloseType";
export type IBorderLocation = "top" | "bottom" | "left" | "right";
export type ITabLocation = "top" | "bottom";
export interface IJsonModel {
global?: IGlobalAttributes;
borders?: IJsonBorderNode[];
layout: IJsonRowNode; // top level 'row' is horizontal, rows inside rows take opposite orientation to parent row (ie can act as columns)
popouts?: Record<string, IJsonPopout>;
popups?: Record<string, IJsonPopup>;
}
export interface IJsonRect {
x: number;
y: number;
width: number;
height: number;
}
export interface IJsonPopout {
layout: IJsonRowNode;
rect: IJsonRect ;
}
export interface IJsonPopup {
layout: IJsonRowNode;
rect: IJsonRect ;
}
export interface IJsonBorderNode extends IBorderAttributes {
location: IBorderLocation;
children: IJsonTabNode[];
}
export interface IJsonRowNode extends IRowAttributes {
children: (IJsonRowNode | IJsonTabSetNode)[];
}
export interface IJsonTabSetNode extends ITabSetAttributes {
/** Marks this as the active tab set, read from initial json but
* must subseqently be set on the model (only one tab set can be active)*/
active?: boolean;
/** Marks this tab set as being maximized, read from initial json but
* must subseqently be set on the model (only one tab set can be maximized) */
maximized?: boolean;
children: IJsonTabNode[];
}
export interface IJsonTabNode extends ITabAttributes {
}
//----------------------------------------------------------------------------------------------------------
// below this line is autogenerated from attributes in code via Model static method toTypescriptInterfaces()
//----------------------------------------------------------------------------------------------------------
export interface IGlobalAttributes {
/**
Value for BorderNode attribute autoSelectTabWhenClosed if not overridden
whether to select new/moved tabs in border when the border is currently closed
Default: false
*/
borderAutoSelectTabWhenClosed?: boolean;
/**
Value for BorderNode attribute autoSelectTabWhenOpen if not overridden
whether to select new/moved tabs in border when the border is already open
Default: true
*/
borderAutoSelectTabWhenOpen?: boolean;
/**
Value for BorderNode attribute className if not overridden
class applied to tab button
Default: undefined
*/
borderClassName?: string;
/**
Value for BorderNode attribute enableAutoHide if not overridden
hide border if it has zero tabs
Default: false
*/
borderEnableAutoHide?: boolean;
/**
Value for BorderNode attribute enableDrop if not overridden
whether tabs can be dropped into this border
Default: true
*/
borderEnableDrop?: boolean;
/**
Value for BorderNode attribute enableTabScrollbar if not overridden
whether to show a mini scrollbar for the tabs
Default: false
*/
borderEnableTabScrollbar?: boolean;
/**
Value for BorderNode attribute maxSize if not overridden
the maximum size of the tab area
Default: 99999
*/
borderMaxSize?: number;
/**
Value for BorderNode attribute minSize if not overridden
the minimum size of the tab area
Default: 0
*/
borderMinSize?: number;
/**
Value for BorderNode attribute size if not overridden
size of the tab area when selected
Default: 200
*/
borderSize?: number;
/**
enable docking to the edges of the layout, this will show the edge indicators
Default: true
*/
enableEdgeDock?: boolean;
/**
boolean indicating if tab icons should rotate with the text in the left and right borders
Default: true
*/
enableRotateBorderIcons?: boolean;
/**
the top level 'row' will layout horizontally by default, set this option true to make it layout vertically
Default: false
*/
rootOrientationVertical?: boolean;
/**
enable a small centralized handle on all splitters
Default: false
*/
splitterEnableHandle?: boolean;
/**
additional width in pixels of the splitter hit test area
Default: 0
*/
splitterExtra?: number;
/**
width in pixels of all splitters between tabsets/borders
Default: 8
*/
splitterSize?: number;
/**
Value for TabNode attribute borderHeight if not overridden
height when added to border, -1 will use border size
Default: -1
*/
tabBorderHeight?: number;
/**
Value for TabNode attribute borderWidth if not overridden
width when added to border, -1 will use border size
Default: -1
*/
tabBorderWidth?: number;
/**
Value for TabNode attribute className if not overridden
class applied to tab button
Default: undefined
*/
tabClassName?: string;
/**
Value for TabNode attribute closeType if not overridden
see values in ICloseType
Default: 1
*/
tabCloseType?: ICloseType;
/**
Value for TabNode attribute contentClassName if not overridden
class applied to tab content
Default: undefined
*/
tabContentClassName?: string;
/**
Default: 0.3
*/
tabDragSpeed?: number;
/**
Value for TabNode attribute enableClose if not overridden
allow user to close tab via close button
Default: true
*/
tabEnableClose?: boolean;
/**
Value for TabNode attribute enableDrag if not overridden
allow user to drag tab to new location
Default: true
*/
tabEnableDrag?: boolean;
/**
Value for TabNode attribute enablePopout if not overridden
enable popout (in popout capable browser)
Default: false
*/
tabEnablePopout?: boolean;
/**
Value for TabNode attribute enablePopoutIcon if not overridden
whether to show the popout icon in the tabset header if this tab enables popouts
Default: true
*/
tabEnablePopoutIcon?: boolean;
/**
Value for TabNode attribute enablePopoutOverlay if not overridden
if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
then enabling this option will gray out this tab
Default: false
*/
tabEnablePopoutOverlay?: boolean;
/**
Value for TabNode attribute enableRename if not overridden
allow user to rename tabs by double clicking
Default: true
*/
tabEnableRename?: boolean;
/**
Value for TabNode attribute enableRenderOnDemand if not overridden
whether to avoid rendering component until tab is visible
Default: true
*/
tabEnableRenderOnDemand?: boolean;
/**
Value for TabNode attribute icon if not overridden
the tab icon
Default: undefined
*/
tabIcon?: string;
/**
Value for TabNode attribute maxHeight if not overridden
the max height of this tab
Default: 99999
*/
tabMaxHeight?: number;
/**
Value for TabNode attribute maxWidth if not overridden
the max width of this tab
Default: 99999
*/
tabMaxWidth?: number;
/**
Value for TabNode attribute minHeight if not overridden
the min height of this tab
Default: 0
*/
tabMinHeight?: number;
/**
Value for TabNode attribute minWidth if not overridden
the min width of this tab
Default: 0
*/
tabMinWidth?: number;
/**
Value for TabSetNode attribute autoSelectTab if not overridden
whether to select new/moved tabs in tabset
Default: true
*/
tabSetAutoSelectTab?: boolean;
/**
Value for TabSetNode attribute classNameTabStrip if not overridden
a class name to apply to the tab strip
Default: undefined
*/
tabSetClassNameTabStrip?: string;
/**
Value for TabSetNode attribute enableActiveIcon if not overridden
whether the active icon (*) should be displayed when the tabset is active
Default: false
*/
tabSetEnableActiveIcon?: boolean;
/**
Value for TabSetNode attribute enableClose if not overridden
allow user to close tabset via a close button
Default: false
*/
tabSetEnableClose?: boolean;
/**
Value for TabSetNode attribute enableDeleteWhenEmpty if not overridden
whether to delete this tabset when is has no tabs
Default: true
*/
tabSetEnableDeleteWhenEmpty?: boolean;
/**
Value for TabSetNode attribute enableDivide if not overridden
allow user to drag tabs to region of this tabset, splitting into new tabset
Default: true
*/
tabSetEnableDivide?: boolean;
/**
Value for TabSetNode attribute enableDrag if not overridden
allow user to drag tabs out this tabset
Default: true
*/
tabSetEnableDrag?: boolean;
/**
Value for TabSetNode attribute enableDrop if not overridden
allow user to drag tabs into this tabset
Default: true
*/
tabSetEnableDrop?: boolean;
/**
Value for TabSetNode attribute enableMaximize if not overridden
allow user to maximize tabset to fill view via maximize button
Default: true
*/
tabSetEnableMaximize?: boolean;
/**
Value for TabSetNode attribute enableSingleTabStretch if not overridden
if the tabset has only a single tab then stretch the single tab to fill area and display in a header style
Default: false
*/
tabSetEnableSingleTabStretch?: boolean;
/**
Value for TabSetNode attribute enableTabScrollbar if not overridden
whether to show a mini scrollbar for the tabs
Default: false
*/
tabSetEnableTabScrollbar?: boolean;
/**
Value for TabSetNode attribute enableTabStrip if not overridden
enable tab strip and allow multiple tabs in this tabset
Default: true
*/
tabSetEnableTabStrip?: boolean;
/**
Value for TabSetNode attribute enableTabWrap if not overridden
wrap tabs onto multiple lines
Default: false
*/
tabSetEnableTabWrap?: boolean;
/**
Value for TabSetNode attribute maxHeight if not overridden
maximum height (in px) for this tabset
Default: 99999
*/
tabSetMaxHeight?: number;
/**
Value for TabSetNode attribute maxWidth if not overridden
maximum width (in px) for this tabset
Default: 99999
*/
tabSetMaxWidth?: number;
/**
Value for TabSetNode attribute minHeight if not overridden
minimum height (in px) for this tabset
Default: 0
*/
tabSetMinHeight?: number;
/**
Value for TabSetNode attribute minWidth if not overridden
minimum width (in px) for this tabset
Default: 0
*/
tabSetMinWidth?: number;
/**
Value for TabSetNode attribute tabLocation if not overridden
the location of the tabs either top or bottom
Default: "top"
*/
tabSetTabLocation?: ITabLocation;
}
export interface IRowAttributes {
/**
the unique id of the row, if left undefined a uuid will be assigned
Default: undefined
*/
id?: string;
/**
Fixed value: "row"
*/
type?: string;
/**
relative weight for sizing of this row in parent row
Default: 100
*/
weight?: number;
}
export interface ITabSetAttributes {
/**
whether to select new/moved tabs in tabset
Default: inherited from Global attribute tabSetAutoSelectTab (default true)
*/
autoSelectTab?: boolean;
/**
a class name to apply to the tab strip
Default: inherited from Global attribute tabSetClassNameTabStrip (default undefined)
*/
classNameTabStrip?: string;
/**
a place to hold json config used in your own code
Default: undefined
*/
config?: any;
/**
whether the active icon (*) should be displayed when the tabset is active
Default: inherited from Global attribute tabSetEnableActiveIcon (default false)
*/
enableActiveIcon?: boolean;
/**
allow user to close tabset via a close button
Default: inherited from Global attribute tabSetEnableClose (default false)
*/
enableClose?: boolean;
/**
whether to delete this tabset when is has no tabs
Default: inherited from Global attribute tabSetEnableDeleteWhenEmpty (default true)
*/
enableDeleteWhenEmpty?: boolean;
/**
allow user to drag tabs to region of this tabset, splitting into new tabset
Default: inherited from Global attribute tabSetEnableDivide (default true)
*/
enableDivide?: boolean;
/**
allow user to drag tabs out this tabset
Default: inherited from Global attribute tabSetEnableDrag (default true)
*/
enableDrag?: boolean;
/**
allow user to drag tabs into this tabset
Default: inherited from Global attribute tabSetEnableDrop (default true)
*/
enableDrop?: boolean;
/**
allow user to maximize tabset to fill view via maximize button
Default: inherited from Global attribute tabSetEnableMaximize (default true)
*/
enableMaximize?: boolean;
/**
if the tabset has only a single tab then stretch the single tab to fill area and display in a header style
Default: inherited from Global attribute tabSetEnableSingleTabStretch (default false)
*/
enableSingleTabStretch?: boolean;
/**
whether to show a mini scrollbar for the tabs
Default: inherited from Global attribute tabSetEnableTabScrollbar (default false)
*/
enableTabScrollbar?: boolean;
/**
enable tab strip and allow multiple tabs in this tabset
Default: inherited from Global attribute tabSetEnableTabStrip (default true)
*/
enableTabStrip?: boolean;
/**
wrap tabs onto multiple lines
Default: inherited from Global attribute tabSetEnableTabWrap (default false)
*/
enableTabWrap?: boolean;
/**
the unique id of the tab set, if left undefined a uuid will be assigned
Default: undefined
*/
id?: string;
/**
maximum height (in px) for this tabset
Default: inherited from Global attribute tabSetMaxHeight (default 99999)
*/
maxHeight?: number;
/**
maximum width (in px) for this tabset
Default: inherited from Global attribute tabSetMaxWidth (default 99999)
*/
maxWidth?: number;
/**
minimum height (in px) for this tabset
Default: inherited from Global attribute tabSetMinHeight (default 0)
*/
minHeight?: number;
/**
minimum width (in px) for this tabset
Default: inherited from Global attribute tabSetMinWidth (default 0)
*/
minWidth?: number;
/**
Default: undefined
*/
name?: string;
/**
index of selected/visible tab in tabset
Default: 0
*/
selected?: number;
/**
the location of the tabs either top or bottom
Default: inherited from Global attribute tabSetTabLocation (default "top")
*/
tabLocation?: ITabLocation;
/**
Fixed value: "tabset"
*/
type?: string;
/**
relative weight for sizing of this tabset in parent row
Default: 100
*/
weight?: number;
}
export interface ITabAttributes {
/**
if there is no name specifed then this value will be used in the overflow menu
Default: undefined
*/
altName?: string;
/**
height when added to border, -1 will use border size
Default: inherited from Global attribute tabBorderHeight (default -1)
*/
borderHeight?: number;
/**
width when added to border, -1 will use border size
Default: inherited from Global attribute tabBorderWidth (default -1)
*/
borderWidth?: number;
/**
class applied to tab button
Default: inherited from Global attribute tabClassName (default undefined)
*/
className?: string;
/**
see values in ICloseType
Default: inherited from Global attribute tabCloseType (default 1)
*/
closeType?: ICloseType;
/**
string identifying which component to run (for factory)
Default: undefined
*/
component?: string;
/**
a place to hold json config for the hosted component
Default: undefined
*/
config?: any;
/**
class applied to tab content
Default: inherited from Global attribute tabContentClassName (default undefined)
*/
contentClassName?: string;
/**
allow user to close tab via close button
Default: inherited from Global attribute tabEnableClose (default true)
*/
enableClose?: boolean;
/**
allow user to drag tab to new location
Default: inherited from Global attribute tabEnableDrag (default true)
*/
enableDrag?: boolean;
/**
enable popout (in popout capable browser)
Default: inherited from Global attribute tabEnablePopout (default false)
*/
enablePopout?: boolean;
/**
whether to show the popout icon in the tabset header if this tab enables popouts
Default: inherited from Global attribute tabEnablePopoutIcon (default true)
*/
enablePopoutIcon?: boolean;
/**
if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
then enabling this option will gray out this tab
Default: inherited from Global attribute tabEnablePopoutOverlay (default false)
*/
enablePopoutOverlay?: boolean;
/**
allow user to rename tabs by double clicking
Default: inherited from Global attribute tabEnableRename (default true)
*/
enableRename?: boolean;
/**
whether to avoid rendering component until tab is visible
Default: inherited from Global attribute tabEnableRenderOnDemand (default true)
*/
enableRenderOnDemand?: boolean;
/**
if enabled the tab will re-mount when popped out/in
Default: false
*/
enableWindowReMount?: boolean;
/**
An optional help text for the tab to be displayed upon tab hover.
Default: undefined
*/
helpText?: string;
/**
the tab icon
Default: inherited from Global attribute tabIcon (default undefined)
*/
icon?: string;
/**
the unique id of the tab, if left undefined a uuid will be assigned
Default: undefined
*/
id?: string;
/**
the max height of this tab
Default: inherited from Global attribute tabMaxHeight (default 99999)
*/
maxHeight?: number;
/**
the max width of this tab
Default: inherited from Global attribute tabMaxWidth (default 99999)
*/
maxWidth?: number;
/**
the min height of this tab
Default: inherited from Global attribute tabMinHeight (default 0)
*/
minHeight?: number;
/**
the min width of this tab
Default: inherited from Global attribute tabMinWidth (default 0)
*/
minWidth?: number;
/**
name of tab to be displayed in the tab button
Default: "[Unnamed Tab]"
*/
name?: string;
/**
class applied to parent tabset when this is the only tab and it is stretched to fill the tabset
Default: undefined
*/
tabsetClassName?: string;
/**
Fixed value: "tab"
*/
type?: string;
}
export interface IBorderAttributes {
/**
whether to select new/moved tabs in border when the border is currently closed
Default: inherited from Global attribute borderAutoSelectTabWhenClosed (default false)
*/
autoSelectTabWhenClosed?: boolean;
/**
whether to select new/moved tabs in border when the border is already open
Default: inherited from Global attribute borderAutoSelectTabWhenOpen (default true)
*/
autoSelectTabWhenOpen?: boolean;
/**
class applied to tab button
Default: inherited from Global attribute borderClassName (default undefined)
*/
className?: string;
/**
a place to hold json config used in your own code
Default: undefined
*/
config?: any;
/**
hide border if it has zero tabs
Default: inherited from Global attribute borderEnableAutoHide (default false)
*/
enableAutoHide?: boolean;
/**
whether tabs can be dropped into this border
Default: inherited from Global attribute borderEnableDrop (default true)
*/
enableDrop?: boolean;
/**
whether to show a mini scrollbar for the tabs
Default: inherited from Global attribute borderEnableTabScrollbar (default false)
*/
enableTabScrollbar?: boolean;
/**
the maximum size of the tab area
Default: inherited from Global attribute borderMaxSize (default 99999)
*/
maxSize?: number;
/**
the minimum size of the tab area
Default: inherited from Global attribute borderMinSize (default 0)
*/
minSize?: number;
/**
index of selected/visible tab in border; -1 means no tab selected
Default: -1
*/
selected?: number;
/**
show/hide this border
Default: true
*/
show?: boolean;
/**
size of the tab area when selected
Default: inherited from Global attribute borderSize (default 200)
*/
size?: number;
/**
Fixed value: "border"
*/
type?: string;
}