forked from mediassarQlikBranch/SimpleFieldSelect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproperties.def.js
1874 lines (1855 loc) · 62.2 KB
/
properties.def.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
//Properties definitions
define( ["ng!$q"], function ($q) {
'use strict';
var debug = false;
//calc variable name IF this is variable selection - should be removed and changed
function findVariableName(listobject,props){
props.variableName = listobject.qDef.qFieldDefs[0];
if (typeof props.variableName == 'string' && props.variableName){
if (debug) console.log(typeof props.variableName);
props.variableName = props.variableName.replace("=",'');
} else {
props.variableName = '';
}
if(debug){ console.log(listobject); console.log(props); console.log(listobject.qDef.qFieldDefs[0]);}
if (props.hideFromSelectionRealField && props.hideFromSelectionRealField != ''){
props.variableName = props.hideFromSelectionRealField;
}
if (props.variableName == '' || !props.variableName){
//listobject.variableName = listobject.qDimensionInfo.qGroupFieldDefs[0]; //try this one if not defined.
props.variableName = listobject.qDef.qFieldDefs[0];
if(debug){ console.log(typeof props.variableName); }
if (typeof props.variableName !== 'undefined' && typeof props.variableName !== 'object'){
props.variableName = props.variableName.replace("=",'');
} else {
props.variableName = '';
}
}
}
var paddingoptions = [{value: "-",label: "default"},{value: "0",label: "0px"},{value: "2",label: "2px"},
{value: "4",label: "4px"},{value: "6",label: "6px"},{value: "8",label: "8px"},
{value: "10",label: "10px"},{value: "12",label: "12px"},{value: "16",label: "16px"}];
var paddingoptions2 = [{value: "-",label: "default"},{value: "2",label: "2px"},{value: "4",label: "4px"},{value: "5",label: "5px"},{value: "6",label: "6px"},
{value: "8",label: "8px"}, {value: "10",label: "10px"},{value: "14",label: "14px"},{value: "15",label: "15px"},{value: "18",label: "18px"},
{value: "20",label: "20px"},{value: "22",label: "22px"},{value: "26",label: "26px"},{value: "30",label: "30px"},
{value: "36",label: "36px"},{value: "42",label: "42px"},{value: "50",label: "50px"}];
var sortoptions = [ {value: 1,label: "Ascending"}, {value: 0,label: "No"}, {value: -1,label: "Descending"}];
var padandheader = {
type: "items",
label: "Paddings and header",
grouped:true,
items: {
containercontent: {
type: "items",
items: {
contentpadding: {
type: "string",
component: "dropdown",
label: "Padding for the content",
ref: "props.contentpadding",
options: paddingoptions,
defaultValue: "-"
},
leftpadding: {
type: "string",
component: "dropdown",
label: "Left padding, default margin",
ref: "props.leftpadding",
options: paddingoptions,
defaultValue: "-"
},
bottompadding: {
type: "string",
component: "dropdown",
label: "Bottom padding, default margin",
ref: "props.bottompadding",
options: paddingoptions,
defaultValue: "-"
},
rightpadding: {
type: "string",
component: "dropdown",
label: "Right padding, default margin",
ref: "props.rightpadding",
options: paddingoptions,
defaultValue: "-"
},
showHeader: {
ref: "props.showHeader",
type: "boolean",
label: "Show default header?",
defaultValue: true
/*change: function(data){
$("#sfs"+data.qInfo.qId).parent().parent().parent().prev().toggle();
}*/
},
headerheightsize: {
type: "string",
component: "dropdown",
label: "Header height in pixels",
ref: "props.headerSize",
options: paddingoptions2,
defaultValue: "-",
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.showHeader;
}
},
headerbottompadding: {
type: "string",
component: "dropdown",
label: "Header bottom padding",
ref: "props.headerBpadding",
options: paddingoptions2,
defaultValue: "-",
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.showHeader;
}
},
headertoppadding: {
type: "string",
component: "dropdown",
label: "Header H1 top padding (global will overwrite this)",
ref: "props.headerTpadding",
options: paddingoptions2,
defaultValue: "-",
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.showHeader;
}
}
}
},
objectlvlsettings: {
type: "items",
items: {
objectlvltxt: {
component: "text",label: "Object level settings"
},
elementpadding: {
type:"number",
//type: "string",
//component: "dropdown",
label: "Padding for the element (px, inside)",
ref: "props.elementpadding",
//options: paddingoptions,
defaultValue: 0
},
elementmargin: {
type:"number",
//type: "string",
//component: "dropdown",
label: "Margin for the element (px, outside)",
ref: "props.elementmargin",
//options: paddingoptions,
defaultValue: 0
}
}
}
}
};
var globalsettings = {
component: "expandable-items",
label: "Global modifications",
items: {
generalglobal:{
type: "items",
label: "Enable",
items: {
aboutglobal:{
component: "text",
label: "Global modifications let you to customize overall visual theme of the document. You don't need a separate extension for this. Only one Simple Field Select element should have global parameters enabled on one sheet. If you disable, reload page."
},
enableGlobals: {
ref: "props.enableGlobals",
component: "switch",
type: "boolean",
label: "Enable global modifications?",
defaultValue: false,
options: [{value: true,label: "Enabled"}, {value: false,label: "Disabled"}]
},
propagationInfo:{
component: "text",
label: "Most of the following settings are inherited from this sheet to others when user changes sheet. You need to have same settings on other sheets too to have the same effect on every possible landing sheet. Use master items for same settings on every sheet. Changing some of the values back to default requires browser refresh.",
},
errorglobal: { //cannot be shown when editing masterobject
component: "text",
label: "This sheet has two or more global modifications enabled. Use only one",
show: function(){
return $(".sfsglobalcss").length>1;
}
}
}
},
globalSheet: {
type: "items",
label: "Sheet settings",
show: function ( data ) {
return data.props && data.props.enableGlobals ;
},
items: {
global_bgcolor: {
type: "string",
label: "Sheet background color",
ref: "props.global_bgcolor",
defaultValue: '',
expression:"optional"
},
/*global_bgcolor2: {
type: "string",
label: "Sheet background color 2",
ref: "props.global_bgcolor2",
defaultValue: '',
expression:"optional"
},*/
global_bgcss: {
type: "string",
label: "Sheet background CSS",
ref: "props.global_bgcss",
defaultValue: '',
expression:"optional"
},
global_fontcolor: {
type: "string",
label: "Font color for the sheet",
ref: "props.global_fontcolor",
defaultValue: '',
expression:"optional"
},
fontfamily_global: {
ref: "props.fontfamily_global",
type: "string",
label: "Font-family css parameter for the whole sheet",
defaultValue: ""
},
hideSheetTitle: {
ref: "props.hideSheetTitle",
component: "switch",
type: "boolean",
label: "Hide sheet title?",
defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Show"}],
change: function(data){
if (!data.props.hideSheetTitle){
$(".sheet-title-container").show();
}
}
},
removeSheetTitlePadding: {
ref: "props.removeSheetTitlePadding",
component: "switch",
type: "boolean",
label: "Remove sheet title padding?",
defaultValue: false,
options: [{value: true,label: "Remove padding"}, {value: false,label: "Default padding"}],
show: function ( data ) {
return data.props && !data.props.hideSheetTitle;
}
},
sheetTitleFontSize: {
ref: "props.sheetTitleFontSize",
//component: "dropdown",
label: "Sheet title font size in px (-1 default)",
type: "integer",expression:"optional",
defaultValue: -1,
show: function ( data ) {
return data.props && !data.props.hideSheetTitle;
}
},
sheetTitleheight: {
ref: "props.sheetTitleheight",
//component: "dropdown",
label: "Sheet title height in px (-1 default)",
type: "integer",expression:"optional",
defaultValue: -1,
show: function ( data ) {
return !data.props.hideSheetTitle;
}
},
sheetTitleExtraText: {
ref: "props.sheetTitleExtraText",
expression:"optional",
type: "string",
label: "Sheet title extra text element",
defaultValue: '',
show: function ( data ) {
return !data.props.hideSheetTitle;
}
}
}
},
globalother: {
type: "items",
label: "Other",
show: function ( data ) {
return data.props && data.props.enableGlobals ;
},
items: {
hidepivotTableSelectors: {
ref: "props.hidepivotTableSelectors", component: "switch", type: "boolean", label: "Pivot table, remove \"selectors\"", defaultValue: false,
options: [{value: true,label: "Remove"}, {value: false,label: "Default"}]
},
hideFieldsFromSelectionBar: {
ref: "props.hideFieldsFromSelectionBar",
type: "string",
label: "Hide following fields from the selection bar. Separate by ;",
defaultValue: ""
},
clearAllSelOnFirstLoad: {
ref: "props.clearAllSelOnFirstLoad",
type: "boolean",
label: "Clear all selections on first load / refresh",
defaultValue: false
},
clearAllSelOnLeave: {
ref: "props.clearAllSelOnLeave",
type: "boolean",
label: "Clear all selections on sheet leave (requires refresh after this setting has been changed)",
defaultValue: false
},
keepaliver: {
ref: "props.keepaliver",
label: "Keepalive, send message to server in minutes",
type: "integer",
expression:"optional",
defaultValue: 0
}
}
},
selectionandcontrol: {
type: "items",
label: "Selection bar and controls",
show: function ( data ) {
return data.props && data.props.enableGlobals ;
},
items: {
hideSelectionBar: {
ref: "props.hideSelectionBar",
component: "switch",
type: "boolean",
label: "Hide whole selection bar?",
defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Show"}],
change: function(data){
if (!data.props.hideSelectionBar){
$(".qvt-selections").show();
}
}
},
selBarExtraText: {
ref: "props.selBarExtraText",
expression:"optional",
type: "string",
label: "Selection bar extra text element",
defaultValue: '',
show: function ( data ) { return !data.props.hideSelectionBar; }
},
selBarExtraTextcss: {
ref: "props.selBarExtraTextcss",
expression:"optional",
type: "string",
label: "Custom CSS for Selection bar extra text",
defaultValue: '',
show: function ( data ) { return !data.props.hideSelectionBar; }
},
selBarExtraTextQlikStyle: {
ref: "props.selBarExtraTextQlikStyle",
type: "boolean",
label: "Apply Qlik style to Selection bar extra text",
defaultValue: false,
show: function ( data ) {
return !data.props.hideSelectionBar;
}
},
hideInsightsButton: {
ref: "props.hideInsightsButton", component: "switch", type: "boolean", label: "Hide Insights button", defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Default"}],show: function ( data ) { return !data.props.hideSelectionBar; }
},
hideSelectionsTool: {
ref: "props.hideSelectionsTool",component: "switch", type: "boolean", label: "Hide Selections tool button", defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Default"}],show: function ( data ) { return !data.props.hideSelectionBar; }
},
hideSmartSearchButton: {
ref: "props.hideSmartSearchButton",component: "switch", type: "boolean", label: "Hide Smart Search button", defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Default"}],show: function ( data ) { return !data.props.hideSelectionBar; }
},
hideGuiToolbar: {
ref: "props.hideGuiToolbar",
component: "switch",
type: "boolean",
label: "Hide whole main toolbar?",
defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Show"}],
change: function(data){
if (!data.props.hideGuiToolbar){
$(".qui-toolbar").show();
}
}
},
toolbarheight: {
ref: "props.toolbarheight",
//component: "dropdown",
label: "Main toolbar height in px (default -1)",
type: "integer",expression: "optional",
defaultValue: -1,
show: function ( data ) {
return !data.props.hideGuiToolbar;
}
},
toolbarTxt: {
ref: "props.toolbarTxt",
expression:"optional",
type: "string",
label: "Main toolbar extra text field",
defaultValue: '',
show: function ( data ) {
return !data.props.hideGuiToolbar;
}
},
hideToolbarCenter: {
ref: "props.hideToolbarCenter",
component: "switch",
type: "boolean",
label: "Hide center part of main toolbar? (data, analysis, story)",
defaultValue: false,
options: [{value: true,label: "Hide"}, {value: false,label: "Show"}],
show: function ( data ) {
return !data.props.hideGuiToolbar;
}
},
hideguitoolbarInfo:{
component: "text",
label: "When main toolbar is hidden you cannot access Edit mode. You have to change last part of the url to /state/edit . Toolbar will be hidden only when not in Edit mode.",
show: function ( data ) {
return data.props && data.props.hideGuiToolbar;
}
}
}
},
globalobject: {
type: "items",
label: "Global object settings",
show: function ( data ) {
return data.props && data.props.enableGlobals ;
},
items: {
globalobjectgeneral:{
component: "text",
label: "Global object related modifications which will be applied to all objects on the sheet:"
},
global_elementbgcolor:{
type: "string",
label: "Object background color",
ref: "props.global_elementbgcolor",
defaultValue: '',
expression:"optional"
},
global_bordercolor: {
type: "string",
label: "Border color",
ref: "props.global_bordercolor",
defaultValue: '',
expression:"optional"
},
global_bordercolor2: {
type: "string",
label: "Border color 2",
ref: "props.global_bordercolor2",
defaultValue: '',
expression:"optional"
},
global_borderwidth: {
type: "string",
component: "dropdown",
label: "Border width",
ref: "props.global_borderwidth",
options: [
{value: "-",label: "default"},
{value: "0",label: "0px"},
{value: "1",label: "1px"},
{value: "2",label: "2px"},
{value: "3",label: "3px"},
{value: "4",label: "4px"},
{value: "5",label: "5px"},
{value: "6",label: "6px"},
{value: "8",label: "8px"}],
defaultValue: "-"
},
removeHeaderFromTextImageObjects: {
ref: "props.removeHeaderFromTextImageObjects",
component: "switch",
type: "boolean",
label: "Text & Image objects: remove header",
defaultValue: false,
options: [{value: true,label: "Remove headers"}, {value: false,label: "Default headers"}]
},
removeHeaderFromAllObjects: {
ref: "props.removeHeaderFromAllObjects",
component: "switch",
type: "boolean",
label: "Remove header from all objects",
defaultValue: false,
options: [{value: true,label: "Remove headers"}, {value: false,label: "Default headers"}]
},
removeHeaderIfNoText: {
ref: "props.removeHeaderIfNoText",
component: "switch",
type: "boolean",
label: "Remove header if empty (no header text)",
defaultValue: false,
options: [{value: true,label: "Remove"}, {value: false,label: "Default headers"}],
show: function ( data ) {
return data.props && !data.props.removeHeaderFromAllObjects;
}
},
headerfontcolor_global: {
type: "string",
label: "Header font color",
ref: "props.headerfontcolor_global",
defaultValue: '',
expression:"optional",
show: function ( data ) {
return data.props && !data.props.removeHeaderFromAllObjects;
}
},
headerbgcolor_global: {
type: "string",
label: "Header background color",
ref: "props.headerbgcolor_global",
defaultValue: '',
expression:"optional",
show: function ( data ) {
return data.props && !data.props.removeHeaderFromAllObjects;
}
},
headerpaddingAdjustTxt:{
component: "text",
label: "You can adjust sheet's every objects' padding settings of the default header (Focus Theme)."
},
headertoppadding_global: {
type: "string",
component: "dropdown",
label: "Header top padding",
ref: "props.headerTpadding_global",
options: paddingoptions2,
defaultValue: "-",
show: function ( data ) {
return data.props && !data.props.removeHeaderFromAllObjects;
}
},
headerbottompadding_global: {
type: "string",
component: "dropdown",
label: "Header bottom padding",
ref: "props.headerBpadding_global",
options: paddingoptions2,
defaultValue: "-",
show: function ( data ) {
return data.props && !data.props.removeHeaderFromAllObjects;
}
},
leftpadding_global: {
type: "string",
component: "dropdown",
label: "Left padding, object content",
ref: "props.leftpadding_global",
options: paddingoptions,
defaultValue: "-"
},
rightpadding_global: {
type: "string",
component: "dropdown",
label: "Right padding, object content",
ref: "props.rightpadding_global",
options: paddingoptions,
defaultValue: "-"
}
}
}
}
};
return {
type: "items",
component: "accordion",
items: {
dimensions: {
type: "items",
label: "Dimensions",
ref: "qListObjectDef",
min: 0,
max: 1,
items: {
field: {
type: "string",
expression: "optional",
expressionType: "dimension",
ref: "qListObjectDef.qDef.qFieldDefs.0",
label: "Field or variable name",
show: function ( data ) {
return data.qListObjectDef && !data.qListObjectDef.qLibraryId;
},
change: function(data) {
if (data.props.dimensionIsVariable){
findVariableName(data.qListObjectDef,data.props);
data.variableValue = data.variableValue || {};
if (data.props.variableName && typeof data.props.variableName !== 'object'){
data.variableValue.qStringExpression = '=' + data.props.variableName;
} else {
data.variableValue.qStringExpression = '';
}
if(debug){ console.log('variable name is '+data.qListObjectDef.variableName); console.log('variable expression: '+data.variableValue.qStringExpression); console.log(data);}
}
}
},
/*disableDimensionSelection: {
ref: "qListObjectDef.qDef.qExpressions.0.qExpr",
label: "Disable dimension selection",
type: "string",
expression: 'optional',
defaultValue: '=count(1)'
},
bgcolor: {
type: "string",
component: 'expression',
expression: "optional",
label: "Background color (css string)",
//expression: "always",
ref: 'qListObjectDef.qDef.qAttributeExpression.0.qExpression',
defaultValue: ''
},*/
dimensionIsVariable: {
ref: "props.dimensionIsVariable",
type: "boolean",
label: "Target field is variable",
defaultValue: false,
change: function(data) {
if (data.props.dimensionIsVariable){
findVariableName(data.qListObjectDef,data.props);
//data.props.variableName = data.props.variableName.replace("=",''); //remove mark if exists.
data.variableValue = data.variableValue || {};
data.variableValue.qStringExpression = '=' + data.props.variableName; //.qDef.qFieldDefs[0];
if(debug) console.log('variable expression is =' + data.props.variableName);
}
}
},
variableIsDate: {
ref: "props.variableIsDate",
type: "boolean",
label: "Variable is a date selector?",
defaultValue: false,
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.dimensionIsVariable;
}
},
variableEmptyAlreadySelected: {
ref: "props.variableEmptyAlreadySelected",
type: "boolean",
label: "Set variable to empty string when already selected is selected again?",
defaultValue: false,
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.dimensionIsVariable && !data.props.variableIsDate && data.props.visualizationType!='input';
}
},
VisualizationType: {
type: "string",
component: "dropdown",
label: "Visualization",
ref: "props.visualizationType",
options: [{
value: "checkbox",label: "Checkbox"}, {
value: "vlist",label: "Vertical QlikSense list"}, {
value: "hlist",label: "Horizontal QlikSense list"}, {
value: "dropdown",label: "Dropdown"}, {
value: "btn",label: "Standard HTML button"}, {
value: "radio",label: "Standard HTML radio button"}, {
value: "input",label: "Standard HTML5 input (numbers, text, sliders)"}, {
value: "select2",label: "Select2 dropdown"}, {
value: "luiswitch",label: "Qlik Switch"}, {
value: "luicheckbox",label: "Qlik Checkbox"}, {
value: "luiradio",label: "Qlik Radio button"}, {
value: "txtonly",label: "Only a textarea"}
//, {value: "actions",label: "Actions and functions"}
],
defaultValue: "hlist",
show: function ( data ) {
return data.qListObjectDef && data.props && !(data.props.dimensionIsVariable && (data.props.variableIsDate ));
}
},
textareaonlytext: {
component: "textarea",
rows: 10,
defaultValue: '',
label: "Text",
expression:"optional",
ref: "props.textareaonlytext",
maxlength: 2000,
show: function ( data ) {
return data.props.visualizationType=='txtonly';
}
},
textareaonlytext2: {
type: "string",
defaultValue: '',
label: "Another text (with expression possibility)",
expression:"optional",
ref: "props.textareaonlytext2",
show: function ( data ) {
return data.props.visualizationType=='txtonly';
}
},
textareaonlyinfo:{
component: "text",
label: "Textarea can have html markup also. It may include javascript, like <script>alert('Hei');</script> ",
show: function ( data ) {
return data.props.visualizationType=='txtonly';
}
},
textareaonlyinfo2:{
component: "text",
label: "or CSS element like: <div id=\"a\">Some text</div> <style>#a {background-color:green; color:#fff; padding:10px;}</style> Remember that do not break Qlik styles or code! Many settings of this extension do apply to this component too. Some parameters visible do not have effect.",
show: function ( data ) {
return data.props.visualizationType=='txtonly';
}
},
visInputFieldType: {
ref: "props.visInputFieldType",
component: "dropdown",
label: "Input field type",
options: [{
value: "text",label: "Text"}, {
value: "number",label: "Number"}, {
value: "range",label: "Range slider"}, {
value: "color",label: "Color"}, {
value: "date",label: "Date"}, {
value: "time",label: "Time"}, {
value: "week",label: "Week"}, {
value: "month",label: "Month"}, {
value: "password",label: "Password"
}],
defaultValue: 'text',
show: function ( data ) {
return data.props && data.props.dimensionIsVariable && !data.props.variableIsDate && data.props.visualizationType=='input';
}
},
aboutinputs:{
component: "text",
label: "You can set predefined values from Variable options. Values for the variable values to be selected and keys for the labels.",
show: function ( data ) {
return data.props && data.props.dimensionIsVariable && data.props.visualizationType=='input';
}
},
visInputRangeSliderValuefield: {
ref: "props.visInputRangeSliderValuefield",
type: "boolean",
label: "Show value next to slider?",
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.dimensionIsVariable && data.props.visualizationType=='input' && data.props.visInputFieldType=='range';
}
},
visInputPlaceholdertxt: {
type: "string",
label: "Placeholder text, hint for the user",
ref: "props.visInputPlaceholdertxt",
defaultValue: '',
expression:"optional",
show: function ( data ) {
return (data.props && data.props.dimensionIsVariable && (data.props.visualizationType=='input' || data.props.variableIsDate) && !data.props.visInputFieldType=='range')
|| (data.props && data.props.visualizationType=='select2');
}
},
htmlinputoptions:{
type: "items",
label: "Input options",
show: function ( data ) {
return data.qListObjectDef && data.props && (data.props.visualizationType=='input' && !(data.props.visInputFieldType=='text' || data.props.visInputFieldType=='color' || data.props.visInputFieldType=='password' ) || data.props.variableIsDate);
},
items:{
aboutnumbers:{
component: "text",
label: "HTML5 number inputs are not always stabile because of the browsers... You can set min and max values for number. If you use them for date, use standard format 2017-09-25, for week 2017-W41, for month 2017-09. Step value defines step between numbers, Min and Max must be defined. Step value can be 'any' or positive floating point like '0.01' or '10'.",
show: function ( data ) {
return !data.props.variableIsDate;
}
},
visInputNumberMin: {
type: "string",
label: "Min value (optional)",
ref: "props.visInputNumberMin",
defaultValue: '',
expression:"optional"
},
visInputNumberMax: {
type: "string",
label: "Max value (optional)",
ref: "props.visInputNumberMax",
defaultValue: '',
expression:"optional"
},
visInputNumberStep: {
type: "string",
label: "Step ('any' or positive float)",
ref: "props.visInputNumberStep",
defaultValue: '',
expression:"optional",
show: function ( data ) {
return !data.props.variableIsDate;
}
}
}
},
DropdownValueForNoSelect: {
type: "string",
label: "No selection -text in drop down menu, if empty nothing is shown",
ref: "props.dropdownValueForNoSelect",
defaultValue: 'Select',
expression:"optional",
show: function ( data ) {
return data.qListObjectDef && data.props && (data.props.visualizationType=='dropdown' || data.props.visualizationType=='select2') && !data.props.selectmultiselect;
}
},
selectmultiselect: {
ref: "props.selectmultiselect",
type: "boolean",
label: "Allow multiple selections?",
show: function ( data ) {
return data.props && (data.props.visualizationType=='dropdown' || data.props.visualizationType=='select2') && !(data.props.dimensionIsVariable && !data.props.varMultiselectAllow);
}
},
select2options:{
type: "items",
label: "Select2 options",
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.visualizationType=='select2';
},
items:{
aboutselect2:{
component: "text",
label: "Select2 jQuery plugin (https://select2.org) allows for example multiselect (for non-variable selections) and search"
},
select2allowClear: {
ref: "props.select2allowClear",
type: "boolean",
label: "Show clear button?",
defaultValue: false,
show: function ( data ) {
return !data.props.dimensionIsVariable;
}
},
select2enableSerach: {
ref: "props.select2enableSerach",
type: "boolean",
label: "Enable search?",
defaultValue: true,
show: function ( data ) {
return !data.props.dimensionIsVariable && !data.props.selectmultiselect;
}
}
}
}
/*vizactiontype: {
},
actions: {
}*/
}
},
settings: {
uses: "settings",
items: {
sorting: {
type: "items",
label: "Sorting",
show: function ( data ) {
return data.qListObjectDef && data.props && !(data.props.dimensionIsVariable) && data.props.visualizationType != 'txtonly';
},
items: {
qSortByState: {
type: "numeric", component: "dropdown",
label: "Sort by state",
ref: "qListObjectDef.qDef.qSortCriterias.0.qSortByState",
options: sortoptions,
defaultValue: 0
},
qSortByNumeric: {
type: "numeric", component: "dropdown",
label: "Sort by numeric value",
ref: "qListObjectDef.qDef.qSortCriterias.0.qSortByNumeric",
options: sortoptions,
defaultValue: 0
},
qSortByLoadOrder: {
type: "numeric", component: "dropdown",
label: "Sort by load order",
ref: "qListObjectDef.qDef.qSortCriterias.0.qSortByLoadOrder",
options: sortoptions,
defaultValue: 0
},
qSortByAscii: {
type: "numeric", component: "dropdown",
label: "Sort by text",
ref: "qListObjectDef.qDef.qSortCriterias.0.qSortByAscii",
options: sortoptions,
defaultValue: 0
},
qSortByFrequency: {
type: "numeric", component: "dropdown",
label: "Sort by frequency",
ref: "qListObjectDef.qDef.qSortCriterias.0.qSortByFrequency",
options: sortoptions,
defaultValue: 0
}
}
},
padandheader: padandheader,
Visualization: {
type: "items",
label: "Other visual",
items: {
addLeonardoUIclass:{
ref: "props.addLUIclasses",
type: "boolean",
label: "Add Qlik default Leonardo UI class (works on part of the objects)",
defaultValue: false
},
fontsize: {
type: "string",
component: "dropdown",
label: "Font size",
ref: "props.fontsizeChange",
options: [
{value: "75",label: "75%"},
{value: "100",label: "100%"},
{value: "125",label: "125%"}],
defaultValue: "100"
},
responsivefontsize:{
ref: "props.responsivefontsize",
type: "boolean",
label: "Responsive font size",
defaultValue: false
},
responsivefonttype: {
type: "string",
component: "dropdown",
label: "Font size calculation",
ref: "props.responsivefonttype",
options: [
{value: "vw",label: "% of viewport width"},
{value: "vh",label: "% of viewport height"},
{value: "vmin",label: "whichever is smaller"},
{value: "vmax",label: "whichever is larger"}],
defaultValue: "vw",
show: function ( data ) { return data.props.responsivefontsize; }
},
responsivefontvalue: {
type: "number",
label: "Number value (like 1.1)",
ref: "props.responsivefontvalue",
defaultValue: 1.0,
show: function ( data ) { return data.props.responsivefontsize; }
},
mobileRemoveZoom: {
ref: "props.mobileRemoveZoom",
type: "boolean",
label: "Disable mobile zoom effect? (less clicking)",
defaultValue: true
},
mobileContainerHeight: {
ref: "props.mobileCustomHeightCSS",
type: "string",
label: "Custom height css parameter for mobile (65px or 50%)",
defaultValue: ''
},
hlistRoundedcorners: {
ref: "props.hlistRoundedcorners",
type: "boolean",
label: "Rounded corners in horizontal list?",
defaultValue: true,
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.visualizationType=='hlist' && !data.props.variableIsDate;
}
},
hlistMarginBetween: {
type: "string",
component: "dropdown",
label: "Margin between horizontal list elements",
ref: "props.hlistMarginBetween",
options: [
{value: "0",label: "0px"},
{value: "1",label: "1px"},
{value: "2",label: "2px"},
{value: "3",label: "3px"},
{value: "4",label: "4px"},
{value: "5",label: "5px"},
{value: "6",label: "6px"},
{value: "7",label: "7px"},
{value: "8",label: "8px"}],
defaultValue: "1",
show: function ( data ) {
return data.qListObjectDef && data.props && data.props.visualizationType=='hlist' && !data.props.variableIsDate;
}