-
Notifications
You must be signed in to change notification settings - Fork 15
/
QlikSense-Sheet-Styler-Lite_old.js
2785 lines (2747 loc) · 107 KB
/
QlikSense-Sheet-Styler-Lite_old.js
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
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
define(["qlik", "ng!$q"], function(qlik, ng) {
"use strict";
console.time('qlik Function start #1');
console.timeEnd('qlik Function start #1');
var objectlist1 = ['barchart', 'combochart', 'table', 'pivot-table', 'waterfallchart', 'treemap', 'map', 'linechart', 'scatterplot', 'piechart', 'gauge', 'histogram', 'distributionplot', 'boxplot', 'kpi', 'text-image'],
objectlist = [];
var sheetId = qlik.navigation.getCurrentSheetId().sheetId;
var app = qlik.currApp();
function resizeGrid(rows, cols) {
app.getObject(sheetId).then(function(obj) {
obj.applyPatches([{
qOp: 'replace',
qPath: '/columns',
qValue: '"' + cols + '"'
}, {
qPath: '/rows',
qOp: 'replace',
qValue: '"' + rows + '"'
}], false);
}).then(function() {
app.doSave();
});
}
// end resizeGrid()
var input_rows = {
ref: "sheetrows",
label: "Number of rows",
type: "integer",
defaultValue: "12"
};
var input_cols = {
ref: "sheetcols",
label: "Number of columns",
type: "integer",
defaultValue: "24"
};
var actionbutton = {
label: "Resize Sheet",
component: "button",
action: function(data) {
console.log('Resize screen :- rows : ' + data.sheetrows + ', cols : ' + data.sheetcols);
resizeGrid(data.sheetrows, data.sheetcols);
}
};
var screenresizer = {
component: "items",
label: "Screen Resizer(use at your own Risk)",
items: {
//screenresizer : {
//type : "items",
//label : "Screen Resizer(use carefully)",
//items : {
input_rows: input_rows,
input_cols: input_cols,
actionbtn: actionbutton
//}
//}
}
};
// exit
var getSheetList = function() {
var defer = ng.defer();
app.getAppObjectList('sheet', function(reply) {
var str = "";
$.each(reply.qAppObjectList.qItems, function(key, value) {
var sheet = value.qInfo.qId + '';
if (sheet == sheetId) {
var objlist = [];
//str += value.qData.title + ' ';
$.each(value.qData.cells, function(k, v) {
objlist.push({
value: v.type,
label: v.type,
});
});
return defer.resolve(objlist);
}
});
});
return defer.promise;
};
var getSheetobjidList = function() {
var defer = ng.defer();
app.getAppObjectList('sheet', function(reply) {
var str = "";
$.each(reply.qAppObjectList.qItems, function(key, value) {
var sheet = value.qInfo.qId + '';
if (sheet == sheetId) {
var objlist = [];
//str += value.qData.title + ' ';
$.each(value.qData.cells, function(k, v) {
objlist.push({
value: v.name,
label: v.name+' : '+v.type,
});
});
return defer.resolve(objlist);
}
});
});
return defer.promise;
};
var getTableList = function() {
var defer = ng.defer();
app.getAppObjectList('sheet', function(reply) {
var str = "";
$.each(reply.qAppObjectList.qItems, function(key, value) {
var sheet = value.qInfo.qId + '';
if (sheet == sheetId) {
var objlist = [];
//str += value.qData.title + ' ';
$.each(value.qData.cells, function(k, v) {
console.log(value);
if(v.type == "table" || v.type == 'table' || v.type == "pivot-table" || v.type == 'pivot-table'){
objlist.push({
value: v.name,
label: v.name+' : '+v.type,
});
}
});
return defer.resolve(objlist);
}
});
});
return defer.promise;
};
var objectlst = {
type: "string",
component: "dropdown",
label: "Select Objects in Current Sheet to apply Style",
ref: "selectedSheetObj",
options: function() {
return getSheetList().then(function(items) {
return items;
});
}
};
var objectlst2 = {
type: "string",
component: "dropdown",
label: "Select Objects in Current Sheet to apply Style",
ref: "selectedSheetObj",
options: function() {
return getSheetobjidList().then(function(items) {
return items;
});
}
};
var tablelst = {
type: "string",
component: "dropdown",
label: "Select Objects in Current Sheet to apply Style",
ref: "selectedTableObject",
options: function() {
return getTableList().then(function(items) {
return items;
});
}
};
function getBasePath() {
var prefix = window.location.pathname.substr(0, window.location.pathname.toLowerCase().lastIndexOf("/sense") + 1);
var url = window.location.href;
url = url.split("/");
return url[0] + "//" + url[2] + ((prefix[prefix.length - 1] === "/") ? prefix.substr(0, prefix.length - 1) : prefix);
}
function addStyleLinkToHeader(linkUrl, id) {
if (id && !_.isEmpty(id)) {
if (!$('#' + id).length) {
var $styleLink = $(document.createElement('link'));
$styleLink.attr('rel', 'stylesheet');
$styleLink.attr('type', 'text/css');
$styleLink.attr('href', linkUrl);
if (id && !_.isEmpty(id)) {
$styleLink.attr('id', id);
}
$('head').append($styleLink);
}
}
}
var getFontList = function() {
var fontstyle = ["ABeeZee", "Abel", "Abhaya Libre", "Abril Fatface", "Aclonica", "Acme", "Actor", "Adamina", "Advent Pro", "Aguafina Script", "Akronim", "Aladin", "Aldrich", "Alef", "Alegreya", "Alegreya SC", "Alegreya Sans", "Alegreya Sans SC", "Alex Brush", "Alfa Slab One", "Alice", "Alike", "Alike Angular", "Allan", "Allerta", "Allerta Stencil", "Allura", "Almendra", "Almendra Display", "Almendra SC", "Amarante", "Amaranth", "Amatic SC", "Amatica SC", "Amethysta", "Amiko", "Amiri", "Amita", "Anaheim", "Andada", "Andika", "Angkor", "Annie Use Your Telescope", "Anonymous Pro", "Antic", "Antic Didone", "Antic Slab", "Anton", "Arapey", "Arbutus", "Arbutus Slab", "Architects Daughter", "Archivo", "Archivo Black", "Archivo Narrow", "Aref Ruqaa", "Arima Madurai", "Arimo", "Arizonia", "Armata", "Arsenal", "Artifika", "Arvo", "Arya", "Asap", "Asap Condensed", "Asar", "Asset", "Assistant", "Astloch", "Asul", "Athiti", "Atma", "Atomic Age", "Aubrey", "Audiowide", "Autour One", "Average", "Average Sans", "Averia Gruesa Libre", "Averia Libre", "Averia Sans Libre", "Averia Serif Libre", "Bad Script", "Bahiana", "Baloo", "Baloo Bhai", "Baloo Bhaijaan", "Baloo Bhaina", "Baloo Chettan", "Baloo Da", "Baloo Paaji", "Baloo Tamma", "Baloo Tammudu", "Baloo Thambi", "Balthazar", "Bangers", "Barrio", "Basic", "Battambang", "Baumans", "Bayon", "Belgrano", "Bellefair", "Belleza", "BenchNine", "Bentham", "Berkshire Swash", "Bevan", "Bigelow Rules", "Bigshot One", "Bilbo", "Bilbo Swash Caps", "BioRhyme", "BioRhyme Expanded", "Biryani", "Bitter", "Black Ops One", "Bokor", "Bonbon", "Boogaloo", "Bowlby One", "Bowlby One SC", "Brawler", "Bree Serif", "Bubblegum Sans", "Bubbler One", "Buda", "Buenard", "Bungee", "Bungee Hairline", "Bungee Inline", "Bungee Outline", "Bungee Shade", "Butcherman", "Butterfly Kids", "Cabin", "Cabin Condensed", "Cabin Sketch", "Caesar Dressing", "Cagliostro", "Cairo", "Calligraffitti", "Cambay", "Cambo", "Candal", "Cantarell", "Cantata One", "Cantora One", "Capriola", "Cardo", "Carme", "Carrois Gothic", "Carrois Gothic SC", "Carter One", "Catamaran", "Caudex", "Caveat", "Caveat Brush", "Cedarville Cursive", "Ceviche One", "Changa", "Changa One", "Chango", "Chathura", "Chau Philomene One", "Chela One", "Chelsea Market", "Chenla", "Cherry Cream Soda", "Cherry Swash", "Chewy", "Chicle", "Chivo", "Chonburi", "Cinzel", "Cinzel Decorative", "Clicker Script", "Coda", "Coda Caption", "Codystar", "Coiny", "Combo", "Comfortaa", "Coming Soon", "Concert One", "Condiment", "Content", "Contrail One", "Convergence", "Cookie", "Copse", "Corben", "Cormorant", "Cormorant Garamond", "Cormorant Infant", "Cormorant SC", "Cormorant Unicase", "Cormorant Upright", "Courgette", "Cousine", "Coustard", "Covered By Your Grace", "Crafty Girls", "Creepster", "Crete Round", "Crimson Text", "Croissant One", "Crushed", "Cuprum", "Cutive", "Cutive Mono", "Damion", "Dancing Script", "Dangrek", "David Libre", "Dawning of a New Day", "Days One", "Dekko", "Delius", "Delius Swash Caps", "Delius Unicase", "Della Respira", "Denk One", "Devonshire", "Dhurjati", "Didact Gothic", "Diplomata", "Diplomata SC", "Domine", "Donegal One", "Doppio One", "Dorsa", "Dosis", "Dr Sugiyama", "Droid Sans", "Droid Sans Mono", "Droid Serif", "Duru Sans", "Dynalight", "EB Garamond", "Eagle Lake", "Eater", "Economica", "Eczar", "El Messiri", "Electrolize", "Elsie", "Elsie Swash Caps", "Emblema One", "Emilys Candy", "Encode Sans", "Encode Sans Condensed", "Encode Sans Expanded", "Encode Sans Semi Condensed", "Encode Sans Semi Expanded", "Engagement", "Englebert", "Enriqueta", "Erica One", "Esteban", "Euphoria Script", "Ewert", "Exo", "Exo 2", "Expletus Sans", "Fanwood Text", "Farsan", "Fascinate", "Fascinate Inline", "Faster One", "Fasthand", "Fauna One", "Faustina", "Federant", "Federo", "Felipa", "Fenix", "Finger Paint", "Fira Mono", "Fira Sans", "Fira Sans Condensed", "Fira Sans Extra Condensed", "Fjalla One", "Fjord One", "Flamenco", "Flavors", "Fondamento", "Fontdiner Swanky", "Forum", "Francois One", "Frank Ruhl Libre", "Freckle Face", "Fredericka the Great", "Fredoka One", "Freehand", "Fresca", "Frijole", "Fruktur", "Fugaz One", "GFS Didot", "GFS Neohellenic", "Gabriela", "Gafata", "Galada", "Galdeano", "Galindo", "Gentium Basic", "Gentium Book Basic", "Geo", "Geostar", "Geostar Fill", "Germania One", "Gidugu", "Gilda Display", "Give You Glory", "Glass Antiqua", "Glegoo", "Gloria Hallelujah", "Goblin One", "Gochi Hand", "Gorditas", "Goudy Bookletter 1911", "Graduate", "Grand Hotel", "Gravitas One", "Great Vibes", "Griffy", "Gruppo", "Gudea", "Gurajada", "Habibi", "Halant", "Hammersmith One", "Hanalei", "Hanalei Fill", "Handlee", "Hanuman", "Happy Monkey", "Harmattan", "Headland One", "Heebo", "Henny Penny", "Herr Von Muellerhoff", "Hind", "Hind Guntur", "Hind Madurai", "Hind Siliguri", "Hind Vadodara", "Holtwood One SC", "Homemade Apple", "Homenaje", "IM Fell DW Pica", "IM Fell DW Pica SC", "IM Fell Double Pica", "IM Fell Double Pica SC", "IM Fell English", "IM Fell English SC", "IM Fell French Canon", "IM Fell French Canon SC", "IM Fell Great Primer", "IM Fell Great Primer SC", "Iceberg", "Iceland", "Imprima", "Inconsolata", "Inder", "Indie Flower", "Inika", "Inknut Antiqua", "Irish Grover", "Istok Web", "Italiana", "Italianno", "Itim", "Jacques Francois", "Jacques Francois Shadow", "Jaldi", "Jim Nightshade", "Jockey One", "Jolly Lodger", "Jomhuria", "Josefin Sans", "Josefin Slab", "Joti One", "Judson", "Julee", "Julius Sans One", "Junge", "Jura", "Just Another Hand", "Just Me Again Down Here", "Kadwa", "Kalam", "Kameron", "Kanit", "Kantumruy", "Karla", "Karma", "Katibeh", "Kaushan Script", "Kavivanar", "Kavoon", "Kdam Thmor", "Keania One", "Kelly Slab", "Kenia", "Khand", "Khmer", "Khula", "Kite One", "Knewave", "Kotta One", "Koulen", "Kranky", "Kreon", "Kristi", "Krona One", "Kumar One", "Kumar One Outline", "Kurale", "La Belle Aurore", "Laila", "Lakki Reddy", "Lalezar", "Lancelot", "Lateef", "Lato", "League Script", "Leckerli One", "Ledger", "Lekton", "Lemon", "Lemonada", "Libre Barcode 128", "Libre Barcode 128 Text", "Libre Barcode 39", "Libre Barcode 39 Extended", "Libre Barcode 39 Extended Text", "Libre Barcode 39 Text", "Libre Baskerville", "Libre Franklin", "Life Savers", "Lilita One", "Lily Script One", "Limelight", "Linden Hill", "Lobster", "Lobster Two", "Londrina Outline", "Londrina Shadow", "Londrina Sketch", "Londrina Solid", "Lora", "Love Ya Like A Sister", "Loved by the King", "Lovers Quarrel", "Luckiest Guy", "Lusitana", "Lustria", "Macondo", "Macondo Swash Caps", "Mada", "Magra", "Maiden Orange", "Maitree", "Mako", "Mallanna", "Mandali", "Manuale", "Marcellus", "Marcellus SC", "Marck Script", "Margarine", "Marko One", "Marmelad", "Martel", "Martel Sans", "Marvel", "Mate", "Mate SC", "Maven Pro", "McLaren", "Meddon", "MedievalSharp", "Medula One", "Meera Inimai", "Megrim", "Meie Script", "Merienda", "Merienda One", "Merriweather", "Merriweather Sans", "Metal", "Metal Mania", "Metamorphous", "Metrophobic", "Michroma", "Milonga", "Miltonian", "Miltonian Tattoo", "Miniver", "Miriam Libre", "Mirza", "Miss Fajardose", "Mitr", "Modak", "Modern Antiqua", "Mogra", "Molengo", "Molle", "Monda", "Monofett", "Monoton", "Monsieur La Doulaise", "Montaga", "Montez", "Montserrat", "Montserrat Alternates", "Montserrat Subrayada", "Moul", "Moulpali", "Mountains of Christmas", "Mouse Memoirs", "Mr Bedfort", "Mr Dafoe", "Mr De Haviland", "Mrs Saint Delafield", "Mrs Sheppards", "Mukta", "Mukta Mahee", "Mukta Malar", "Mukta Vaani", "Muli", "Mystery Quest", "NTR", "Neucha", "Neuton", "New Rocker", "News Cycle", "Niconne", "Nixie One", "Nobile", "Nokora", "Norican", "Nosifer", "Nothing You Could Do", "Noticia Text", "Noto Sans", "Noto Serif", "Nova Cut", "Nova Flat", "Nova Mono", "Nova Oval", "Nova Round", "Nova Script", "Nova Slim", "Nova Square", "Numans", "Nunito", "Nunito Sans", "Odor Mean Chey", "Offside", "Old Standard TT", "Oldenburg", "Oleo Script", "Oleo Script Swash Caps", "Open Sans", "Open Sans Condensed", "Oranienbaum", "Orbitron", "Oregano", "Orienta", "Original Surfer", "Oswald", "Over the Rainbow", "Overlock", "Overlock SC", "Overpass", "Overpass Mono", "Ovo", "Oxygen", "Oxygen Mono", "PT Mono", "PT Sans", "PT Sans Caption", "PT Sans Narrow", "PT Serif", "PT Serif Caption", "Pacifico", "Padauk", "Palanquin", "Palanquin Dark", "Pangolin", "Paprika", "Parisienne", "Passero One", "Passion One", "Pathway Gothic One", "Patrick Hand", "Patrick Hand SC", "Pattaya", "Patua One", "Pavanam", "Paytone One", "Peddana", "Peralta", "Permanent Marker", "Petit Formal Script", "Petrona", "Philosopher", "Piedra", "Pinyon Script", "Pirata One", "Plaster", "Play", "Playball", "Playfair Display", "Playfair Display SC", "Podkova", "Poiret One", "Poller One", "Poly", "Pompiere", "Pontano Sans", "Poppins", "Port Lligat Sans", "Port Lligat Slab", "Pragati Narrow", "Prata", "Preahvihear", "Press Start 2P", "Pridi", "Princess Sofia", "Prociono", "Prompt", "Prosto One", "Proza Libre", "Puritan", "Purple Purse", "Quando", "Quantico", "Quattrocento", "Quattrocento Sans", "Questrial", "Quicksand", "Quintessential", "Qwigley", "Racing Sans One", "Radley", "Rajdhani", "Rakkas", "Raleway", "Raleway Dots", "Ramabhadra", "Ramaraja", "Rambla", "Rammetto One", "Ranchers", "Rancho", "Ranga", "Rasa", "Rationale", "Ravi Prakash", "Redressed", "Reem Kufi", "Reenie Beanie", "Revalia", "Rhodium Libre", "Ribeye", "Ribeye Marrow", "Righteous", "Risque", "Roboto", "Roboto Condensed", "Roboto Mono", "Roboto Slab", "Rochester", "Rock Salt", "Rokkitt", "Romanesco", "Ropa Sans", "Rosario", "Rosarivo", "Rouge Script", "Rozha One", "Rubik", "Rubik Mono One", "Ruda", "Rufina", "Ruge Boogie", "Ruluko", "Rum Raisin", "Ruslan Display", "Russo One", "Ruthie", "Rye", "Sacramento", "Sahitya", "Sail", "Saira", "Saira Condensed", "Saira Extra Condensed", "Saira Semi Condensed", "Salsa", "Sanchez", "Sancreek", "Sansita", "Sarala", "Sarina", "Sarpanch", "Satisfy", "Scada", "Scheherazade", "Schoolbell", "Scope One", "Seaweed Script", "Secular One", "Sedgwick Ave", "Sedgwick Ave Display", "Sevillana", "Seymour One", "Shadows Into Light", "Shadows Into Light Two", "Shanti", "Share", "Share Tech", "Share Tech Mono", "Shojumaru", "Short Stack", "Shrikhand", "Siemreap", "Sigmar One", "Signika", "Signika Negative", "Simonetta", "Sintony", "Sirin Stencil", "Six Caps", "Skranji", "Slabo 13px", "Slabo 27px", "Slackey", "Smokum", "Smythe", "Sniglet", "Snippet", "Snowburst One", "Sofadi One", "Sofia", "Sonsie One", "Sorts Mill Goudy", "Source Code Pro", "Source Sans Pro", "Source Serif Pro", "Space Mono", "Special Elite", "Spectral", "Spicy Rice", "Spinnaker", "Spirax", "Squada One", "Sree Krushnadevaraya", "Sriracha", "Stalemate", "Stalinist One", "Stardos Stencil", "Stint Ultra Condensed", "Stint Ultra Expanded", "Stoke", "Strait", "Sue Ellen Francisco", "Suez One", "Sumana", "Sunshiney", "Supermercado One", "Sura", "Suranna", "Suravaram", "Suwannaphum", "Swanky and Moo Moo", "Syncopate", "Tangerine", "Taprom", "Tauri", "Taviraj", "Teko", "Telex", "Tenali Ramakrishna", "Tenor Sans", "Text Me One", "The Girl Next Door", "Tienne", "Tillana", "Timmana", "Tinos", "Titan One", "Titillium Web", "Trade Winds", "Trirong", "Trocchi", "Trochut", "Trykker", "Tulpen One", "Ubuntu", "Ubuntu Condensed", "Ubuntu Mono", "Ultra", "Uncial Antiqua", "Underdog", "Unica One", "UnifrakturCook", "UnifrakturMaguntia", "Unkempt", "Unlock", "Unna", "VT323", "Vampiro One", "Varela", "Varela Round", "Vast Shadow", "Vesper Libre", "Vibur", "Vidaloka", "Viga", "Voces", "Volkhov", "Vollkorn", "Voltaire", "Waiting for the Sunrise", "Wallpoet", "Walter Turncoat", "Warnes", "Wellfleet", "Wendy One", "Wire One", "Work Sans", "Yanone Kaffeesatz", "Yantramanav", "Yatra One", "Yellowtail", "Yeseva One", "Yesteryear", "Yrsa", "Zeyada", "Zilla Slab", "Zilla Slab Highlight"];
var defer = ng.defer();
var list = [];
$.each(fontstyle, function(no, value) {
// console.log(value);
list.push({
value: value,
label: value
});
return defer.resolve(list);
});
return defer.promise;
};
return {
initialProperties: {
listItems: [],
listItems2: [],
listItems3: [],
customtablestyle: []
},
definition: {
type: "items",
component: "accordion",
items: {
selectstyle: {
label: 'Select Style Type',
items: {
CustomLayoutforobjects: {
ref: "CustomLayoutforobjects",
type: "boolean",
component: "checkbox",
label: "Custom Layout Style For Each Object",
defaultValue: false
},
getobjectidbadge: {
ref: "getobjectidbadge",
type: "boolean",
component: "checkbox",
label: "Show Object ID",
defaultValue: false,
show: function(data) {
if (data.CustomLayoutforobjects || data.customtablestyleenable) {
return true;
} else {
return false;
}
}
},
// CustomLayoutforobjects start
MyList3: {
type: "array",
ref: "listItems3",
label: "Style Objects Manually",
itemTitleRef: "label",
allowAdd: true,
allowRemove: true,
addTranslation: "Add Objects",
min: 1,
show: function(data) {
if (data.CustomLayoutforobjects) {
return true;
} else {
return false;
}
},
items: {
label: {
type: "string",
ref: "label",
label: "Label",
expression: "optional"
},
// start
objectlst: objectlst2,
headerbgcolor: {
type: "string",
ref: "headerbgcolor",
label: "Object Title Background color",
expression: "optional",
defaultValue: '#4477aa'
},
headercolor: {
type: "string",
ref: "headercolor",
label: "Object Title color",
expression: "optional",
defaultValue: '#fff'
},
headerfontsize: {
type: "number",
component: "slider",
label: "Object Title Font Size",
ref: "headerfontsize",
min: 10,
max: 100,
step: 1,
defaultValue: 15
},
headerfontweight: {
type: "number",
component: "slider",
label: "Object Title Font Width",
ref: "headerfontweight",
min: 300,
max: 900,
step: 1,
defaultValue: 300
},
headertextalin: {
type: "string",
component: "dropdown",
label: "Title Text Align",
ref: "headertextalin",
options: [{
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}]
},
headerpaddingtop: {
type: "number",
component: "slider",
label: "Object Title Padding Top",
ref: "headerpaddingtop",
min: 0,
max: 100,
step: 1,
defaultValue: 11
},
headerpaddingbottom: {
type: "number",
component: "slider",
label: "Object Title Padding Bottom",
ref: "headerpaddingbottom",
min: 0,
max: 100,
step: 1,
defaultValue: 11
},
headerpaddingright: {
type: "number",
component: "slider",
label: "Object Title Padding Right",
ref: "headerpaddingright",
min: 0,
max: 100,
step: 1,
defaultValue: 11
},
headerpaddingleft: {
type: "number",
component: "slider",
label: "Object Title Padding Left",
ref: "headerpaddingleft",
min: 0,
max: 100,
step: 1,
defaultValue: 11
},
containerbgcolor: {
type: "string",
ref: "containerbgcolor",
label: "Object's container Background Color",
expression: "optional",
defaultValue: '#fff'
},
// end
}
},
// end
customtablestyleenable: {
ref: "customtablestyleenable",
type: "boolean",
component: "checkbox",
label: "Style Table Manually",
defaultValue: false
},
customtablestyle: {
type: "array",
ref: "customtablestyle",
label: "Style Table Manually",
itemTitleRef: "label",
allowAdd: true,
allowRemove: true,
addTranslation: "Add Objects",
min: 1,
show: function(data) {
if (data.customtablestyleenable) {
return true;
} else {
return false;
}
},
items: {
label: {
type: "string",
ref: "label",
label: "Label",
expression: "optional"
},
// start
objectlst: tablelst,
// select
tablesupport: {
ref: "tablesupport",
type: "boolean",
component: "checkbox",
label: "Apply style for Table?",
defaultValue: false
},
pivotsupport: {
ref: "pivotsupport",
type: "boolean",
component: "checkbox",
label: "Apply style for Pivot?",
defaultValue: false,
show: function(data) {
if (data.tablesupport) {
return false;
} else {
return true;
}
}
},
// table
// new 11/6/2018
tablenumericalign: {
type: "string",
component: "dropdown",
label: "Numeric Measure Text Align",
ref: "tablenumericalign",
options: [{
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletextalign: {
type: "string",
component: "dropdown",
label: "Text Dim Align",
ref: "tabletextalign",
options: [{
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablecustomalign: {
type: "string",
component: "dropdown",
label: "Custom Text Align",
ref: "tablecustomalign",
options: [{
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablecolumnalign: {
type: "string",
component: "dropdown",
label: "Column Align",
ref: "tablecolumnalign",
options: [{
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablecellstyle: {
type: "string",
component: "dropdown",
label: "Data Cell Size",
ref: "tablecellstyle",
options: [{
value: "standard",
label: "Standard"
}, {
value: "small",
label: "Small"
}, {
value: "medium",
label: "Medium"
}, {
value: "large",
label: "Large"
}],
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
},
defaultValue: "small"
},
tablecellfontsize: {
type: "string",
component: "dropdown",
label: "Data Font Size",
ref: "tablecellfontsize",
options: [{
value: "standard",
label: "Standard"
}, {
value: "small",
label: "Small"
}, {
value: "medium",
label: "Medium"
}, {
value: "large",
label: "Large"
}],
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
},
defaultValue: "small"
},
// end
tablecolor: {
type: "string",
label: "Table color",
ref: "tablecolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablebgcolor: {
type: "string",
label: "Table Background color",
ref: "tablebgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablehoverbgcolor: {
type: "string",
label: "Table Hover Background color",
ref: "tablehoverbgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablehovercolor: {
type: "string",
label: "Table Hover color",
ref: "tablehovercolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalcolor: {
type: "string",
label: "Total Top color",
ref: "tabletotalcolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalbgcolor: {
type: "string",
label: "Total Top Background color",
ref: "tabletotalbgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalhovercolor: {
type: "string",
label: "Total Top Hover color",
ref: "tabletotalhovercolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalhoverbgcolor: {
type: "string",
label: "Total Top Hover Background color",
ref: "tabletotalhoverbgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalbottomcolor: {
type: "string",
label: "Total Bottom color",
ref: "tabletotalbottomcolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalbottombgcolor: {
type: "string",
label: "Total Bottom Background color",
ref: "tabletotalbottombgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalhoverbottomcolor: {
type: "string",
label: "Total Bottom Hover color",
ref: "tabletotalhoverbottomcolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tabletotalhoverbottombgcolor: {
type: "string",
label: "Total Bottom Hover Background color",
ref: "tabletotalhoverbottombgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablecolumwidthadjuster: {
type: "string",
label: "Table Column width Adjuster in PX",
ref: "tablecolumwidthadjuster",
defaultValue: "1",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tablecolumwidthadjustercolor: {
type: "string",
label: "Table Column width Adjuster Color",
ref: "tablecolumwidthadjustercolor",
defaultValue: "black",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tableheaderborder: {
type: "string",
label: "Table Header Border",
ref: "tableheaderborder",
defaultValue: "1px solid #000",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tableoddcolor: {
type: "string",
label: "Total Odd color",
ref: "tableoddcolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
tableevencolor: {
type: "string",
label: "Total Even color",
ref: "tableevencolor",
defaultValue: "#f2f2f2",
expression: "optional",
show: function(data) {
if (data.tablesupport) {
return true;
} else {
return false;
}
}
},
// pivot
pivottablecolor: {
type: "string",
label: "Pivot Table color",
ref: "pivottablecolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottablebgcolor: {
type: "string",
label: "Pivot Table Background color",
ref: "pivottablebgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottablehoverbgcolor: {
type: "string",
label: "Pivot Table Hover Background color",
ref: "tablehoverbgcolor",
defaultValue: "#c9cacc",
expression: "optional",
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottablehovercolor: {
type: "string",
label: "Pivot Table Hover color",
ref: "tablehovercolor",
defaultValue: "#fff",
expression: "optional",
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
// 11/6/2018
pivottableoddcolor: {
label: "Row Odd color",
component: "color-picker",
ref: "pivottableoddcolor",
type: "object",
dualOutput: true,
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottableevencolor: {
label: "Row Even color",
component: "color-picker",
ref: "pivottableevencolor",
type: "object",
dualOutput: true,
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottableheaderalign: {
type: "string",
component: "dropdown",
label: "Coloumn Text Align",
ref: "pivottableheaderalign",
options: [{
value: "Default",
label: "Default"
}, {
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottableheaderweight: {
type: "string",
component: "dropdown",
label: "Column Text Weight",
ref: "pivottableheaderweight",
options: [{
value: "Default",
label: "Default"
}, {
value: "bold",
label: "Bold"
}, {
value: "lighter",
label: "Lighter"
}],
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottableheaderfontsize: {
type: "string",
ref: "pivottableheaderfontsize",
label: "Coloumn Text Size in PX",
expression: "optional",
defaultValue: "14",
},
pivottabledataheaderalign: {
type: "string",
component: "dropdown",
label: "Text Align",
ref: "pivottabledataheaderalign",
options: [{
value: "Default",
label: "Default"
}, {
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}
}
},
pivottablenumericalign: {
type: "string",
component: "dropdown",
label: "Number Text Align",
ref: "pivottablenumericalign",
options: [{
value: "Default",
label: "Default"
}, {
value: "Left",
label: "Left"
}, {
value: "Right",
label: "Right"
}, {
value: "Center",
label: "Center"
}],
show: function(data) {
if (data.pivotsupport) {
return true;
} else {
return false;
}