@zeedhi/common 1.39.1 → 1.40.0
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/dist/style.css +1 -1
- package/dist/zd-common.esm.js +303 -212
- package/dist/zd-common.umd.js +304 -211
- package/package.json +2 -2
- package/types/components/zd-alert/alert.d.ts +2 -0
- package/types/components/zd-breadcrumbs/breadcrumbs.d.ts +0 -8
- package/types/components/zd-button/button.d.ts +0 -8
- package/types/components/zd-button/interfaces.d.ts +0 -2
- package/types/components/zd-button-group/button-group.d.ts +0 -8
- package/types/components/zd-button-group/interfaces.d.ts +0 -2
- package/types/components/zd-card/card.d.ts +0 -8
- package/types/components/zd-card/interfaces.d.ts +0 -2
- package/types/components/zd-carousel/carousel.d.ts +0 -8
- package/types/components/zd-carousel/interfaces.d.ts +0 -2
- package/types/components/zd-component/component.d.ts +8 -0
- package/types/components/zd-component/interfaces.d.ts +2 -0
- package/types/components/zd-divider/divider.d.ts +0 -8
- package/types/components/zd-divider/interfaces.d.ts +0 -2
- package/types/components/zd-footer/footer.d.ts +0 -8
- package/types/components/zd-footer/interfaces.d.ts +0 -2
- package/types/components/zd-form/form.d.ts +10 -1
- package/types/components/zd-grid/grid-column.d.ts +2 -0
- package/types/components/zd-grid/grid.d.ts +4 -0
- package/types/components/zd-grid/interfaces.d.ts +1 -0
- package/types/components/zd-header/header.d.ts +0 -8
- package/types/components/zd-icon/icon.d.ts +0 -8
- package/types/components/zd-icon/interfaces.d.ts +0 -2
- package/types/components/zd-input/input.d.ts +0 -8
- package/types/components/zd-list/interfaces.d.ts +0 -2
- package/types/components/zd-list/list.d.ts +0 -8
- package/types/components/zd-login/interfaces.d.ts +0 -1
- package/types/components/zd-login/login.d.ts +0 -4
- package/types/components/zd-menu/interfaces.d.ts +0 -1
- package/types/components/zd-menu/menu.d.ts +0 -4
- package/types/components/zd-progress/progress.d.ts +0 -8
- package/types/components/zd-select-tree/interfaces.d.ts +1 -0
- package/types/components/zd-select-tree/select-tree.d.ts +6 -0
- package/types/components/zd-steppers/interfaces.d.ts +0 -2
- package/types/components/zd-steppers/steppers.d.ts +0 -8
- package/types/utils/report/index.d.ts +2 -0
- package/types/utils/report/report-type/base-report.d.ts +3 -1
- package/types/utils/report/report-type/interfaces.d.ts +2 -1
- package/types/utils/report/report-type/xls-report.d.ts +1 -16
- package/types/utils/report/report-type/xls2-report.d.ts +16 -0
- package/types/utils/report/report-type/xls3-report.d.ts +16 -0
package/dist/zd-common.umd.js
CHANGED
|
@@ -55,6 +55,14 @@
|
|
|
55
55
|
* Controls component visibility.
|
|
56
56
|
*/
|
|
57
57
|
this.isVisible = true;
|
|
58
|
+
/**
|
|
59
|
+
* Applies the dark theme variant to the component.
|
|
60
|
+
*/
|
|
61
|
+
this.dark = false;
|
|
62
|
+
/**
|
|
63
|
+
* Applies the light theme variant to the component.
|
|
64
|
+
*/
|
|
65
|
+
this.light = false;
|
|
58
66
|
/**
|
|
59
67
|
* Define component key mapping
|
|
60
68
|
*/
|
|
@@ -70,6 +78,8 @@
|
|
|
70
78
|
this.cssClass = this.getInitValue('cssClass', props.cssClass, this.cssClass);
|
|
71
79
|
this.cssStyle = this.getInitValue('cssStyle', props.cssStyle, this.cssStyle);
|
|
72
80
|
this.isVisible = this.getInitValue('isVisible', props.isVisible, this.isVisible);
|
|
81
|
+
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
82
|
+
this.light = this.getInitValue('light', props.light, this.light);
|
|
73
83
|
this.children = Array.isArray(props.children) ? props.children : this.children;
|
|
74
84
|
this.keyMap = core.KeyMap.factory(props.keyMap || this.keyMap);
|
|
75
85
|
this.createAccessors();
|
|
@@ -305,6 +315,8 @@
|
|
|
305
315
|
this.vertical = false;
|
|
306
316
|
this.defaultValues = {
|
|
307
317
|
name: this.name,
|
|
318
|
+
dark: this.dark,
|
|
319
|
+
light: this.light,
|
|
308
320
|
color: this.color,
|
|
309
321
|
text: this.text,
|
|
310
322
|
timeout: this.timeout,
|
|
@@ -329,6 +341,8 @@
|
|
|
329
341
|
assignAlertProperties(alert) {
|
|
330
342
|
this.name = this.getInitValue('name', alert.name, this.defaultValues.name);
|
|
331
343
|
this.color = this.getInitValue('color', alert.color, this.defaultValues.color);
|
|
344
|
+
this.dark = this.getInitValue('dark', alert.dark, this.defaultValues.dark);
|
|
345
|
+
this.light = this.getInitValue('light', alert.light, this.defaultValues.light);
|
|
332
346
|
this.text = this.getInitValue('text', alert.text, this.defaultValues.text);
|
|
333
347
|
this.timeout = this.getInitValue('timeout', alert.timeout, this.defaultValues.timeout);
|
|
334
348
|
this.type = this.getInitValue('type', alert.type, this.defaultValues.type);
|
|
@@ -499,10 +513,6 @@
|
|
|
499
513
|
*/
|
|
500
514
|
constructor(props) {
|
|
501
515
|
super(props);
|
|
502
|
-
/**
|
|
503
|
-
* Applies the dark theme variant to the component.
|
|
504
|
-
*/
|
|
505
|
-
this.dark = false;
|
|
506
516
|
/**
|
|
507
517
|
* Specifies the dividing string between items.
|
|
508
518
|
*/
|
|
@@ -519,19 +529,13 @@
|
|
|
519
529
|
* Increase the font-size of the breadcrumb item text to 16px.
|
|
520
530
|
*/
|
|
521
531
|
this.large = false;
|
|
522
|
-
/**
|
|
523
|
-
* Applies the light theme variant to the component.
|
|
524
|
-
*/
|
|
525
|
-
this.light = true;
|
|
526
532
|
/**
|
|
527
533
|
* Decrease the font-size of the breadcrumb item text to 12px.
|
|
528
534
|
*/
|
|
529
535
|
this.small = false;
|
|
530
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
531
536
|
this.divider = this.getInitValue('divider', props.divider, this.divider);
|
|
532
537
|
this.items = this.getInitValue('items', props.items, this.items);
|
|
533
538
|
this.large = this.getInitValue('large', props.large, this.large);
|
|
534
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
535
539
|
this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
|
|
536
540
|
this.small = this.getInitValue('small', props.small, this.small);
|
|
537
541
|
this.createAccessors();
|
|
@@ -567,10 +571,6 @@
|
|
|
567
571
|
* It can be the name of material or css color in hexa
|
|
568
572
|
*/
|
|
569
573
|
this.color = 'primary';
|
|
570
|
-
/**
|
|
571
|
-
* Applies the dark theme variant to the button
|
|
572
|
-
*/
|
|
573
|
-
this.dark = false;
|
|
574
574
|
/**
|
|
575
575
|
* Removes the ability to click or target the button
|
|
576
576
|
*/
|
|
@@ -612,10 +612,6 @@
|
|
|
612
612
|
* This should be used with the absolute or fixed props
|
|
613
613
|
*/
|
|
614
614
|
this.left = false;
|
|
615
|
-
/**
|
|
616
|
-
* Applies the light theme variant to the button
|
|
617
|
-
*/
|
|
618
|
-
this.light = false;
|
|
619
615
|
/**
|
|
620
616
|
* Makes the background transparent and applies a thin border
|
|
621
617
|
*/
|
|
@@ -718,10 +714,6 @@
|
|
|
718
714
|
* It can be the name of material or css color in hexa
|
|
719
715
|
*/
|
|
720
716
|
this.color = 'primary';
|
|
721
|
-
/**
|
|
722
|
-
* Applies the dark theme variant to the component.
|
|
723
|
-
*/
|
|
724
|
-
this.dark = false;
|
|
725
717
|
/**
|
|
726
718
|
* Reduces the button size and padding.
|
|
727
719
|
*/
|
|
@@ -731,10 +723,6 @@
|
|
|
731
723
|
* space between the buttons
|
|
732
724
|
*/
|
|
733
725
|
this.group = false;
|
|
734
|
-
/**
|
|
735
|
-
* Applies the light theme variant to the component.
|
|
736
|
-
*/
|
|
737
|
-
this.light = false;
|
|
738
726
|
/**
|
|
739
727
|
* Applies mandatory selected button
|
|
740
728
|
*/
|
|
@@ -768,10 +756,8 @@
|
|
|
768
756
|
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
769
757
|
this.borderless = this.getInitValue('block', props.borderless, this.borderless);
|
|
770
758
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
771
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
772
759
|
this.dense = this.getInitValue('disabled', props.dense, this.dense);
|
|
773
760
|
this.group = this.getInitValue('group', props.group, this.group);
|
|
774
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
775
761
|
this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
|
|
776
762
|
this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
|
|
777
763
|
this.rounded = this.getInitValue('rounded', props.rounded, this.rounded);
|
|
@@ -825,10 +811,6 @@
|
|
|
825
811
|
* a non-integer number in slidesPerView, like 1.5)
|
|
826
812
|
*/
|
|
827
813
|
this.center = false;
|
|
828
|
-
/**
|
|
829
|
-
* Applies the dark theme variant to the carousel pagination
|
|
830
|
-
*/
|
|
831
|
-
this.dark = false;
|
|
832
814
|
/**
|
|
833
815
|
* Displays the pagination as a fraction in the following format: currentSlide/slidesCount.
|
|
834
816
|
* Only works when <code>showPagination</code> property is true
|
|
@@ -855,10 +837,6 @@
|
|
|
855
837
|
* Allows controlling the carousel using the keyboard arrow keys
|
|
856
838
|
*/
|
|
857
839
|
this.keysControl = true;
|
|
858
|
-
/**
|
|
859
|
-
* Applies the light theme variant to the carousel
|
|
860
|
-
*/
|
|
861
|
-
this.light = true;
|
|
862
840
|
/**
|
|
863
841
|
* Allows controlling the carousel using mouse drag
|
|
864
842
|
*/
|
|
@@ -933,14 +911,12 @@
|
|
|
933
911
|
this.autoPlay = this.getInitValue('autoPlay', props.autoPlay, this.autoPlay);
|
|
934
912
|
this.buttonsOutside = this.getInitValue('buttonsOutside', props.buttonsOutside, this.buttonsOutside);
|
|
935
913
|
this.center = this.getInitValue('center', props.center, this.center);
|
|
936
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
937
914
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
938
915
|
this.infiniteScroll = this.getInitValue('infiniteScroll', props.infiniteScroll, this.infiniteScroll);
|
|
939
916
|
this.initialSlide = this.getInitValue('initialSlide', props.initialSlide, this.initialSlide);
|
|
940
917
|
this.currentSlide = this.getInitValue('currentSlide', props.currentSlide, this.initialSlide);
|
|
941
918
|
this.interval = this.getInitValue('interval', props.interval, this.interval);
|
|
942
919
|
this.keysControl = this.getInitValue('keysControl', props.keysControl, this.keysControl);
|
|
943
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
944
920
|
this.mouseControl = this.getInitValue('mouseControl', props.mouseControl, this.mouseControl);
|
|
945
921
|
this.nextButton = props.nextButton || this.nextButton;
|
|
946
922
|
this.fractionPagination = this.getInitValue('fractionPagination', props.fractionPagination, this.fractionPagination);
|
|
@@ -1055,10 +1031,6 @@
|
|
|
1055
1031
|
* Applies specified color to the control. It can be the name of material color
|
|
1056
1032
|
*/
|
|
1057
1033
|
this.color = '';
|
|
1058
|
-
/**
|
|
1059
|
-
* Applies the dark theme variant to the component
|
|
1060
|
-
*/
|
|
1061
|
-
this.dark = false;
|
|
1062
1034
|
/**
|
|
1063
1035
|
* Removes the ability to click or target the component
|
|
1064
1036
|
*/
|
|
@@ -1075,10 +1047,6 @@
|
|
|
1075
1047
|
* Specifies an image background for the card
|
|
1076
1048
|
*/
|
|
1077
1049
|
this.img = '';
|
|
1078
|
-
/**
|
|
1079
|
-
* Applies the light theme variant to the component
|
|
1080
|
-
*/
|
|
1081
|
-
this.light = false;
|
|
1082
1050
|
/**
|
|
1083
1051
|
* Designates that the card is a link
|
|
1084
1052
|
*/
|
|
@@ -1102,7 +1070,6 @@
|
|
|
1102
1070
|
this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
|
|
1103
1071
|
this.append = this.getInitValue('append', props.append, this.append);
|
|
1104
1072
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
1105
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
1106
1073
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
1107
1074
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
1108
1075
|
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
@@ -1110,7 +1077,6 @@
|
|
|
1110
1077
|
this.hover = this.getInitValue('hover', props.hover, this.hover);
|
|
1111
1078
|
this.href = this.getInitValue('href', props.href, this.href);
|
|
1112
1079
|
this.img = this.getInitValue('img', props.img, this.img);
|
|
1113
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
1114
1080
|
this.link = this.getInitValue('link', props.link, this.link);
|
|
1115
1081
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
1116
1082
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
@@ -1323,10 +1289,6 @@
|
|
|
1323
1289
|
* It can be the name of material or css color in hexa.
|
|
1324
1290
|
*/
|
|
1325
1291
|
this.color = 'primary';
|
|
1326
|
-
/**
|
|
1327
|
-
* Applies the dark theme variant to the input.
|
|
1328
|
-
*/
|
|
1329
|
-
this.dark = false;
|
|
1330
1292
|
/**
|
|
1331
1293
|
* Defines smaller input.
|
|
1332
1294
|
*/
|
|
@@ -1343,10 +1305,6 @@
|
|
|
1343
1305
|
* Defines the input label.
|
|
1344
1306
|
*/
|
|
1345
1307
|
this.label = '';
|
|
1346
|
-
/**
|
|
1347
|
-
* Applies the light theme variant to the input.
|
|
1348
|
-
*/
|
|
1349
|
-
this.light = false;
|
|
1350
1308
|
/**
|
|
1351
1309
|
* Applies a custom character mask to the input.
|
|
1352
1310
|
*/
|
|
@@ -1415,13 +1373,11 @@
|
|
|
1415
1373
|
this.autofocus = this.getInitValue('autofocus', props.autofocus, this.autofocus);
|
|
1416
1374
|
this.clearable = this.getInitValue('clearable', props.clearable, this.clearable);
|
|
1417
1375
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
1418
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
1419
1376
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
1420
1377
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
1421
1378
|
this.hint = this.getInitValue('hint', props.hint, this.hint);
|
|
1422
1379
|
this.autoHintDetails = this.getInitValue('autoHintDetails', props.autoHintDetails, this.autoHintDetails);
|
|
1423
1380
|
this.label = this.getInitValue('label', props.label, this.label);
|
|
1424
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
1425
1381
|
this.mask = this.getInitValue('mask', props.mask, this.mask);
|
|
1426
1382
|
this.maxLength = this.getInitValue('maxLength', props.maxLength, this.maxLength);
|
|
1427
1383
|
this.persistentHint = this.getInitValue('persistentHint', props.persistentHint, this.persistentHint);
|
|
@@ -3679,18 +3635,10 @@
|
|
|
3679
3635
|
*/
|
|
3680
3636
|
constructor(props) {
|
|
3681
3637
|
super(props);
|
|
3682
|
-
/**
|
|
3683
|
-
* Applies the dark theme variant to the component.
|
|
3684
|
-
*/
|
|
3685
|
-
this.dark = false;
|
|
3686
3638
|
/**
|
|
3687
3639
|
* Adds indentation (72px) for normal dividers, reduces max height for vertical.
|
|
3688
3640
|
*/
|
|
3689
3641
|
this.inset = false;
|
|
3690
|
-
/**
|
|
3691
|
-
* Applies the light theme variant to the component.
|
|
3692
|
-
*/
|
|
3693
|
-
this.light = false;
|
|
3694
3642
|
/**
|
|
3695
3643
|
* Displays dividers vertically.
|
|
3696
3644
|
*/
|
|
@@ -3960,10 +3908,6 @@
|
|
|
3960
3908
|
* Applies specified color to the control. It can be the name of material or css color in hexa.
|
|
3961
3909
|
*/
|
|
3962
3910
|
this.color = 'primary';
|
|
3963
|
-
/**
|
|
3964
|
-
* Applies the dark theme variant to footer.
|
|
3965
|
-
*/
|
|
3966
|
-
this.dark = false;
|
|
3967
3911
|
/**
|
|
3968
3912
|
* Applies position fixed to footer.
|
|
3969
3913
|
*/
|
|
@@ -3980,10 +3924,6 @@
|
|
|
3980
3924
|
* Render components on the left of footer.
|
|
3981
3925
|
*/
|
|
3982
3926
|
this.leftSlot = [];
|
|
3983
|
-
/**
|
|
3984
|
-
* Applies the light theme variant to the footer.
|
|
3985
|
-
*/
|
|
3986
|
-
this.light = false;
|
|
3987
3927
|
/**
|
|
3988
3928
|
* Remove all padding from the footer.
|
|
3989
3929
|
*/
|
|
@@ -4716,7 +4656,11 @@
|
|
|
4716
4656
|
/**
|
|
4717
4657
|
* Color of the header background
|
|
4718
4658
|
*/
|
|
4719
|
-
this.headerBackground = '
|
|
4659
|
+
this.headerBackground = '';
|
|
4660
|
+
/**
|
|
4661
|
+
* Color of the header cell text color
|
|
4662
|
+
*/
|
|
4663
|
+
this.headerCellTextColor = '';
|
|
4720
4664
|
/**
|
|
4721
4665
|
* Available order types
|
|
4722
4666
|
* @public
|
|
@@ -4760,6 +4704,8 @@
|
|
|
4760
4704
|
},
|
|
4761
4705
|
};
|
|
4762
4706
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
4707
|
+
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
4708
|
+
this.light = this.getInitValue('light', props.light, this.light);
|
|
4763
4709
|
this.selectable = this.getInitValue('selectable', props.selectable, this.selectable);
|
|
4764
4710
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
4765
4711
|
this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
|
|
@@ -4769,6 +4715,7 @@
|
|
|
4769
4715
|
this.showFooter = this.getInitValue('showFooter', props.showFooter, this.showFooter);
|
|
4770
4716
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
4771
4717
|
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.headerBackground);
|
|
4718
|
+
this.headerCellTextColor = this.getInitValue('headerCellTextColor', props.headerCellTextColor, this.headerCellTextColor);
|
|
4772
4719
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
4773
4720
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
4774
4721
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
@@ -5427,10 +5374,6 @@
|
|
|
5427
5374
|
* Applies specified color to the control. It can be the name of material or css color in hexa.
|
|
5428
5375
|
*/
|
|
5429
5376
|
this.color = 'primary';
|
|
5430
|
-
/**
|
|
5431
|
-
* Applies the dark theme variant to header.
|
|
5432
|
-
*/
|
|
5433
|
-
this.dark = false;
|
|
5434
5377
|
/**
|
|
5435
5378
|
* Designates that the application menu positioned on the left is below the header.
|
|
5436
5379
|
*/
|
|
@@ -5455,10 +5398,6 @@
|
|
|
5455
5398
|
* Render components on the left of header.
|
|
5456
5399
|
*/
|
|
5457
5400
|
this.leftSlot = [];
|
|
5458
|
-
/**
|
|
5459
|
-
* Applies the light theme variant to the header.
|
|
5460
|
-
*/
|
|
5461
|
-
this.light = false;
|
|
5462
5401
|
/**
|
|
5463
5402
|
* Removes internal padding from header.
|
|
5464
5403
|
*/
|
|
@@ -5473,13 +5412,11 @@
|
|
|
5473
5412
|
this.clippedLeft = this.getInitValue('clippedLeft', props.clippedLeft, this.clippedLeft);
|
|
5474
5413
|
this.clippedRight = this.getInitValue('clippedRight', props.clippedRight, this.clippedRight);
|
|
5475
5414
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
5476
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5477
5415
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5478
5416
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
5479
5417
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
5480
5418
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
5481
5419
|
this.leftSlot = props.leftSlot || this.leftSlot;
|
|
5482
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
5483
5420
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
5484
5421
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
5485
5422
|
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
@@ -5513,10 +5450,6 @@
|
|
|
5513
5450
|
* (for example success or purple) or css color (#033 or rgba(255, 0, 0, 0.5)).
|
|
5514
5451
|
*/
|
|
5515
5452
|
this.color = '';
|
|
5516
|
-
/**
|
|
5517
|
-
* Applies the dark theme variant to the component.
|
|
5518
|
-
*/
|
|
5519
|
-
this.dark = false;
|
|
5520
5453
|
/**
|
|
5521
5454
|
* Makes icon smaller (20px)
|
|
5522
5455
|
*/
|
|
@@ -5538,10 +5471,6 @@
|
|
|
5538
5471
|
* of a button when placed to the left of another element or text
|
|
5539
5472
|
*/
|
|
5540
5473
|
this.left = false;
|
|
5541
|
-
/**
|
|
5542
|
-
* Applies the light theme variant to the component.
|
|
5543
|
-
*/
|
|
5544
|
-
this.light = false;
|
|
5545
5474
|
/**
|
|
5546
5475
|
* Applies appropriate margins to the icon inside of
|
|
5547
5476
|
* a button when placed to the right of another element or text
|
|
@@ -5560,13 +5489,11 @@
|
|
|
5560
5489
|
*/
|
|
5561
5490
|
this.tag = 'i';
|
|
5562
5491
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
5563
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5564
5492
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5565
5493
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
5566
5494
|
this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
|
|
5567
5495
|
this.large = this.getInitValue('large', props.large, this.large);
|
|
5568
5496
|
this.left = this.getInitValue('left', props.left, this.left);
|
|
5569
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
5570
5497
|
this.right = this.getInitValue('right', props.right, this.right);
|
|
5571
5498
|
this.size = this.getInitValue('size', props.size, this.size);
|
|
5572
5499
|
this.small = this.getInitValue('small', props.small, this.small);
|
|
@@ -6550,10 +6477,6 @@
|
|
|
6550
6477
|
class List extends ComponentRender {
|
|
6551
6478
|
constructor(props) {
|
|
6552
6479
|
super(props);
|
|
6553
|
-
/**
|
|
6554
|
-
* Applies the dark theme variant to the List.
|
|
6555
|
-
*/
|
|
6556
|
-
this.dark = false;
|
|
6557
6480
|
/**
|
|
6558
6481
|
* Create the list with smaller items.
|
|
6559
6482
|
*/
|
|
@@ -6566,10 +6489,6 @@
|
|
|
6566
6489
|
* Render list with dividers between the items.
|
|
6567
6490
|
*/
|
|
6568
6491
|
this.divided = false;
|
|
6569
|
-
/**
|
|
6570
|
-
* Applies the light theme variant to the List.
|
|
6571
|
-
*/
|
|
6572
|
-
this.light = false;
|
|
6573
6492
|
/**
|
|
6574
6493
|
* Increases the height of all the list items to better support three lines of text.
|
|
6575
6494
|
*/
|
|
@@ -6714,10 +6633,6 @@
|
|
|
6714
6633
|
* It can be the name of material or css color in hexa.
|
|
6715
6634
|
*/
|
|
6716
6635
|
this.color = '';
|
|
6717
|
-
/**
|
|
6718
|
-
* Applies the dark theme.
|
|
6719
|
-
*/
|
|
6720
|
-
this.dark = false;
|
|
6721
6636
|
/**
|
|
6722
6637
|
* Card position orientation.
|
|
6723
6638
|
*/
|
|
@@ -6746,7 +6661,6 @@
|
|
|
6746
6661
|
this.bottomLink = props.bottomLink || this.bottomLink;
|
|
6747
6662
|
this.cardWidth = this.getInitValue('cardWidth', props.cardWidth, this.cardWidth);
|
|
6748
6663
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
6749
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
6750
6664
|
this.layout = this.getInitValue('layout', props.layout, this.layout);
|
|
6751
6665
|
this.logo = this.getInitValue('logo', props.logo, this.logo);
|
|
6752
6666
|
this.logoMessage = this.getInitValue('logoMessage', props.logoMessage, this.logoMessage);
|
|
@@ -6973,10 +6887,6 @@
|
|
|
6973
6887
|
* Defines if the menu should have a visible container
|
|
6974
6888
|
*/
|
|
6975
6889
|
this.floating = false;
|
|
6976
|
-
/**
|
|
6977
|
-
* Applies the dark theme variant to the menu.
|
|
6978
|
-
*/
|
|
6979
|
-
this.dark = false;
|
|
6980
6890
|
/**
|
|
6981
6891
|
* Create the menu with smaller items.
|
|
6982
6892
|
*/
|
|
@@ -7059,7 +6969,6 @@
|
|
|
7059
6969
|
this.clipped = this.getInitValue('clipped', props.clipped, this.clipped);
|
|
7060
6970
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
7061
6971
|
this.floating = this.getInitValue('floating', props.floating, this.floating);
|
|
7062
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
7063
6972
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
7064
6973
|
this.mini = this.getInitValue('mini', props.mini, this.mini);
|
|
7065
6974
|
this.miniState = this.getInitValue('miniState', props.miniState, this.miniState);
|
|
@@ -7700,10 +7609,6 @@
|
|
|
7700
7609
|
* Defines the value color
|
|
7701
7610
|
*/
|
|
7702
7611
|
this.color = 'primary';
|
|
7703
|
-
/**
|
|
7704
|
-
* Applies the dark theme variant to the component
|
|
7705
|
-
*/
|
|
7706
|
-
this.dark = false;
|
|
7707
7612
|
/**
|
|
7708
7613
|
* Sets the height for the component
|
|
7709
7614
|
*/
|
|
@@ -7712,10 +7617,6 @@
|
|
|
7712
7617
|
* Animates the component constantly
|
|
7713
7618
|
*/
|
|
7714
7619
|
this.indeterminate = false;
|
|
7715
|
-
/**
|
|
7716
|
-
* Applies the light theme variant to the component
|
|
7717
|
-
*/
|
|
7718
|
-
this.light = false;
|
|
7719
7620
|
/**
|
|
7720
7621
|
* Render components on the progress component
|
|
7721
7622
|
*/
|
|
@@ -7727,10 +7628,8 @@
|
|
|
7727
7628
|
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
7728
7629
|
this.backgroundOpacity = this.getInitValue('backgroundOpacity', props.backgroundOpacity, this.backgroundOpacity);
|
|
7729
7630
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
7730
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
7731
7631
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
7732
7632
|
this.indeterminate = this.getInitValue('indeterminate', props.indeterminate, this.indeterminate);
|
|
7733
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
7734
7633
|
this.centerSlot = this.getInitValue('centerSlot', props.centerSlot, this.centerSlot);
|
|
7735
7634
|
this.value = this.getInitValue('value', props.value, this.value);
|
|
7736
7635
|
this.createAccessors();
|
|
@@ -8668,6 +8567,10 @@
|
|
|
8668
8567
|
* Defines if field value should be an object
|
|
8669
8568
|
*/
|
|
8670
8569
|
this.returnObject = false;
|
|
8570
|
+
/**
|
|
8571
|
+
* Prevents load select data when the input is focused
|
|
8572
|
+
*/
|
|
8573
|
+
this.preventLoadOnFocus = true;
|
|
8671
8574
|
/**
|
|
8672
8575
|
* Field used to make the item disabled
|
|
8673
8576
|
*/
|
|
@@ -8700,6 +8603,7 @@
|
|
|
8700
8603
|
this.dataValue = this.getInitValue('dataValue', props.dataValue, this.dataValue);
|
|
8701
8604
|
this.dataDisabled = this.getInitValue('dataDisabled', props.dataDisabled, this.dataDisabled);
|
|
8702
8605
|
this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
|
|
8606
|
+
this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
|
|
8703
8607
|
if (props.datasource && Object.keys(props.datasource).length) {
|
|
8704
8608
|
this.lazyLoad = props.datasource.lazyLoad !== false;
|
|
8705
8609
|
const searchFields = Array.isArray(this.dataText) ? this.dataText : [this.dataText];
|
|
@@ -8713,6 +8617,24 @@
|
|
|
8713
8617
|
}
|
|
8714
8618
|
this.createAccessors();
|
|
8715
8619
|
}
|
|
8620
|
+
focus(event, element) {
|
|
8621
|
+
const _super = Object.create(null, {
|
|
8622
|
+
focus: { get: () => super.focus }
|
|
8623
|
+
});
|
|
8624
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8625
|
+
_super.focus.call(this, event, element);
|
|
8626
|
+
this.afterFocus();
|
|
8627
|
+
});
|
|
8628
|
+
}
|
|
8629
|
+
afterFocus() {
|
|
8630
|
+
var _a;
|
|
8631
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8632
|
+
if (!this.preventLoadOnFocus) {
|
|
8633
|
+
yield ((_a = this.datasource) === null || _a === void 0 ? void 0 : _a.get());
|
|
8634
|
+
this.preventLoadOnFocus = true;
|
|
8635
|
+
}
|
|
8636
|
+
});
|
|
8637
|
+
}
|
|
8716
8638
|
createDataStructure() {
|
|
8717
8639
|
this.treeDataStructure = new TreeDataStructure({
|
|
8718
8640
|
datasource: this.datasource,
|
|
@@ -9040,14 +8962,6 @@
|
|
|
9040
8962
|
* Array of steppers items
|
|
9041
8963
|
*/
|
|
9042
8964
|
this.items = [];
|
|
9043
|
-
/**
|
|
9044
|
-
* Applies the dark theme variant to the stepper
|
|
9045
|
-
*/
|
|
9046
|
-
this.dark = false;
|
|
9047
|
-
/**
|
|
9048
|
-
* Applies the light theme variant to the stepper
|
|
9049
|
-
*/
|
|
9050
|
-
this.light = false;
|
|
9051
8965
|
/**
|
|
9052
8966
|
* Allow user to jump to any step
|
|
9053
8967
|
*/
|
|
@@ -9059,9 +8973,7 @@
|
|
|
9059
8973
|
this.activeStep = this.getInitValue('activeStep', props.activeStep, this.activeStep);
|
|
9060
8974
|
this.altLabels = this.getInitValue('altLabels', props.altLabels, this.altLabels);
|
|
9061
8975
|
this.content = this.getInitValue('content', props.content, this.content);
|
|
9062
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
9063
8976
|
this.items = this.getInitValue('items', props.items, this.items);
|
|
9064
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
9065
8977
|
this.nonLinear = this.getInitValue('nonLinear', props.nonLinear, this.nonLinear);
|
|
9066
8978
|
this.vertical = this.getInitValue('vertical', props.vertical, this.vertical);
|
|
9067
8979
|
this.steps = this.getInitValue('steps', props.steps, this.steps);
|
|
@@ -10946,6 +10858,16 @@
|
|
|
10946
10858
|
WatchURL.originalEvents = new Map();
|
|
10947
10859
|
|
|
10948
10860
|
class BaseReport {
|
|
10861
|
+
constructor() {
|
|
10862
|
+
this.expressionZeedhiToXls = {
|
|
10863
|
+
AVG: 'AVERAGE',
|
|
10864
|
+
COUNT: 'COUNTA',
|
|
10865
|
+
MAX: 'MAX',
|
|
10866
|
+
MIN: 'MIN',
|
|
10867
|
+
SUM: 'SUM',
|
|
10868
|
+
};
|
|
10869
|
+
this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
10870
|
+
}
|
|
10949
10871
|
buildColumns(columns) {
|
|
10950
10872
|
const widths = {};
|
|
10951
10873
|
let totalWidth;
|
|
@@ -11172,27 +11094,12 @@
|
|
|
11172
11094
|
}
|
|
11173
11095
|
|
|
11174
11096
|
class XLSReport extends BaseReport {
|
|
11175
|
-
constructor(
|
|
11176
|
-
super();
|
|
11097
|
+
constructor() {
|
|
11098
|
+
super(...arguments);
|
|
11177
11099
|
this.route = '/generateXLS';
|
|
11178
|
-
this.expressionZeedhiToXls = {
|
|
11179
|
-
AVG: 'AVERAGE',
|
|
11180
|
-
COUNT: 'COUNTA',
|
|
11181
|
-
MAX: 'MAX',
|
|
11182
|
-
MIN: 'MIN',
|
|
11183
|
-
SUM: 'SUM',
|
|
11184
|
-
};
|
|
11185
|
-
this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
11186
|
-
this.type = type || 'xls';
|
|
11187
11100
|
}
|
|
11188
|
-
buildDataset(data, columns
|
|
11189
|
-
|
|
11190
|
-
if (this.type === 'xls') {
|
|
11191
|
-
result = this.formatRawDataSet(data, columns);
|
|
11192
|
-
}
|
|
11193
|
-
else if (metadata) {
|
|
11194
|
-
result = this.formatDataSet(metadata, data);
|
|
11195
|
-
}
|
|
11101
|
+
buildDataset(data, columns) {
|
|
11102
|
+
const result = this.formatRawDataSet(data, columns);
|
|
11196
11103
|
return JSON.stringify(result);
|
|
11197
11104
|
}
|
|
11198
11105
|
// formata o dataset para o formato "cru" xls
|
|
@@ -11236,27 +11143,55 @@
|
|
|
11236
11143
|
};
|
|
11237
11144
|
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11238
11145
|
}
|
|
11239
|
-
|
|
11240
|
-
|
|
11146
|
+
}
|
|
11147
|
+
|
|
11148
|
+
// XLS with groups
|
|
11149
|
+
class XLS2Report extends BaseReport {
|
|
11150
|
+
constructor() {
|
|
11151
|
+
super(...arguments);
|
|
11152
|
+
this.route = '/generateXLS';
|
|
11241
11153
|
}
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11154
|
+
buildDataset(data, metadata) {
|
|
11155
|
+
const result = this.formatDataSet(metadata, data);
|
|
11156
|
+
return JSON.stringify(result);
|
|
11157
|
+
}
|
|
11158
|
+
buildMetadata(name, title, columns, filter) {
|
|
11159
|
+
const builtCols = this.buildColumns(columns);
|
|
11160
|
+
const builtFilters = this.buildFilter(filter || {});
|
|
11161
|
+
const lang = this.formatLangCode(core.I18n.instance.language);
|
|
11162
|
+
const clientLogo = '';
|
|
11163
|
+
const enterpriseLogo = '';
|
|
11164
|
+
const productLogo = '';
|
|
11165
|
+
const metadataObj = {
|
|
11166
|
+
name,
|
|
11167
|
+
title,
|
|
11168
|
+
lang,
|
|
11169
|
+
clientLogo,
|
|
11170
|
+
enterpriseLogo,
|
|
11171
|
+
productLogo,
|
|
11172
|
+
version: '1.0',
|
|
11173
|
+
words: {
|
|
11174
|
+
Page: core.I18n.translate('PAGE'),
|
|
11175
|
+
Report: core.I18n.translate('REPORT'),
|
|
11176
|
+
Version: core.I18n.translate('VERSION'),
|
|
11177
|
+
},
|
|
11178
|
+
staticData: {},
|
|
11179
|
+
groups: [],
|
|
11180
|
+
reportName: name,
|
|
11181
|
+
widgetLabel: title,
|
|
11182
|
+
orientation: 'PORTRAIT',
|
|
11183
|
+
columns: builtCols,
|
|
11184
|
+
filter: builtFilters,
|
|
11185
|
+
reportXLS: true,
|
|
11186
|
+
xlsMergedCell: [],
|
|
11187
|
+
};
|
|
11188
|
+
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11255
11189
|
}
|
|
11256
11190
|
// Ordenar o nome das colunas de acordo com seu index, e sempre deixando as colunas agrupadas nas primeiras posições
|
|
11257
11191
|
getColumnsName(columns, metaData, lengthGroup) {
|
|
11258
11192
|
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11259
11193
|
let columnsName = [];
|
|
11194
|
+
const columnsGroupName = [];
|
|
11260
11195
|
Object.entries(columns).forEach((row) => {
|
|
11261
11196
|
const columnName = row[0];
|
|
11262
11197
|
const index = row[1].sequence;
|
|
@@ -11264,25 +11199,21 @@
|
|
|
11264
11199
|
columnsName[index + lengthGroup] = columnName;
|
|
11265
11200
|
}
|
|
11266
11201
|
else {
|
|
11267
|
-
|
|
11202
|
+
columnsGroupName.push(columnName);
|
|
11268
11203
|
}
|
|
11269
11204
|
});
|
|
11205
|
+
columnsName = columnsGroupName.concat(columnsName);
|
|
11270
11206
|
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11271
11207
|
return columnsName;
|
|
11272
11208
|
}
|
|
11273
11209
|
// Inicializa alguns valores auxiliares
|
|
11274
|
-
initVars(metaData
|
|
11210
|
+
initVars(metaData) {
|
|
11275
11211
|
metaData.xlsMergedCell = [];
|
|
11276
11212
|
const { columns } = metaData;
|
|
11277
11213
|
const lengthGroup = metaData.groups.length;
|
|
11278
11214
|
const indexLastGroup = lengthGroup - 1;
|
|
11279
11215
|
let columnsName = [];
|
|
11280
|
-
|
|
11281
|
-
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11282
|
-
}
|
|
11283
|
-
else {
|
|
11284
|
-
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11285
|
-
}
|
|
11216
|
+
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11286
11217
|
const rowValues = [];
|
|
11287
11218
|
const formatedDataSet = [];
|
|
11288
11219
|
const groups = [];
|
|
@@ -11292,33 +11223,6 @@
|
|
|
11292
11223
|
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11293
11224
|
};
|
|
11294
11225
|
}
|
|
11295
|
-
// formata a linha do grupo de acordo com o formato xls3
|
|
11296
|
-
setRowGroupFormat3(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11297
|
-
let rowValues = rowValuesParam;
|
|
11298
|
-
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11299
|
-
const index = row.groupIndex;
|
|
11300
|
-
if (row.groupHeader) {
|
|
11301
|
-
rowValues[index] = label;
|
|
11302
|
-
groups[index] = { init: null, end: null };
|
|
11303
|
-
formatedDataSet.push(rowValues);
|
|
11304
|
-
rowValues = [];
|
|
11305
|
-
}
|
|
11306
|
-
else if (row.groupFooter) {
|
|
11307
|
-
if (!row.groupLabel) {
|
|
11308
|
-
rowValues.push('Total');
|
|
11309
|
-
}
|
|
11310
|
-
else {
|
|
11311
|
-
rowValues.push(`Total (${label})`);
|
|
11312
|
-
}
|
|
11313
|
-
formatedDataSet.push(rowValues);
|
|
11314
|
-
rowValues = [];
|
|
11315
|
-
const funcXls = null;
|
|
11316
|
-
columnsName.forEach((column) => {
|
|
11317
|
-
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11318
|
-
});
|
|
11319
|
-
}
|
|
11320
|
-
return rowValues;
|
|
11321
|
-
}
|
|
11322
11226
|
// formata as expressões da linha
|
|
11323
11227
|
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11324
11228
|
let funcXls = funcXlsParam;
|
|
@@ -11417,18 +11321,199 @@
|
|
|
11417
11321
|
});
|
|
11418
11322
|
}
|
|
11419
11323
|
formatDataSet(metaData, dataSet) {
|
|
11420
|
-
const initVars = this.initVars(metaData
|
|
11324
|
+
const initVars = this.initVars(metaData);
|
|
11421
11325
|
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
11422
11326
|
let { rowValues } = initVars;
|
|
11423
11327
|
dataSet.forEach((row) => {
|
|
11424
11328
|
if (row.group || row.groupFooter) {
|
|
11425
|
-
|
|
11426
|
-
|
|
11329
|
+
rowValues = this.setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11330
|
+
}
|
|
11331
|
+
else {
|
|
11332
|
+
this.setIndexGroups(groups, formatedDataSet);
|
|
11333
|
+
this.setRowNormal(columnsName, rowValues, row);
|
|
11334
|
+
}
|
|
11335
|
+
if (!row.groupHeader) {
|
|
11336
|
+
formatedDataSet.push(rowValues);
|
|
11337
|
+
}
|
|
11338
|
+
rowValues = [];
|
|
11339
|
+
});
|
|
11340
|
+
return [columnsName].concat(formatedDataSet);
|
|
11341
|
+
}
|
|
11342
|
+
}
|
|
11343
|
+
|
|
11344
|
+
// Grid mirror (with groups)
|
|
11345
|
+
class XLS3Report extends BaseReport {
|
|
11346
|
+
constructor() {
|
|
11347
|
+
super(...arguments);
|
|
11348
|
+
this.route = '/generateXLS';
|
|
11349
|
+
}
|
|
11350
|
+
buildDataset(data, metadata) {
|
|
11351
|
+
const result = this.formatDataSet(metadata, data);
|
|
11352
|
+
return JSON.stringify(result);
|
|
11353
|
+
}
|
|
11354
|
+
buildMetadata(name, title, columns, filter) {
|
|
11355
|
+
const builtCols = this.buildColumns(columns);
|
|
11356
|
+
const builtFilters = this.buildFilter(filter || {});
|
|
11357
|
+
const lang = this.formatLangCode(core.I18n.instance.language);
|
|
11358
|
+
const clientLogo = '';
|
|
11359
|
+
const enterpriseLogo = '';
|
|
11360
|
+
const productLogo = '';
|
|
11361
|
+
const metadataObj = {
|
|
11362
|
+
name,
|
|
11363
|
+
title,
|
|
11364
|
+
lang,
|
|
11365
|
+
clientLogo,
|
|
11366
|
+
enterpriseLogo,
|
|
11367
|
+
productLogo,
|
|
11368
|
+
version: '1.0',
|
|
11369
|
+
words: {
|
|
11370
|
+
Page: core.I18n.translate('PAGE'),
|
|
11371
|
+
Report: core.I18n.translate('REPORT'),
|
|
11372
|
+
Version: core.I18n.translate('VERSION'),
|
|
11373
|
+
},
|
|
11374
|
+
staticData: {},
|
|
11375
|
+
groups: [],
|
|
11376
|
+
reportName: name,
|
|
11377
|
+
widgetLabel: title,
|
|
11378
|
+
orientation: 'PORTRAIT',
|
|
11379
|
+
columns: builtCols,
|
|
11380
|
+
filter: builtFilters,
|
|
11381
|
+
reportXLS: true,
|
|
11382
|
+
xlsMergedCell: [],
|
|
11383
|
+
};
|
|
11384
|
+
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11385
|
+
}
|
|
11386
|
+
// Ordenar o nome das colunas de acordo com seu index, excluindo o nome das colunas agrupadas
|
|
11387
|
+
getColumnsNameFormat3(columns, metaData) {
|
|
11388
|
+
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11389
|
+
let columnsName = [];
|
|
11390
|
+
Object.entries(columns).forEach((row) => {
|
|
11391
|
+
const columnName = row[0];
|
|
11392
|
+
if (columnsNameGroup.indexOf(columnName) === -1) {
|
|
11393
|
+
const index = row[1].sequence;
|
|
11394
|
+
columnsName[index] = columnName;
|
|
11395
|
+
}
|
|
11396
|
+
});
|
|
11397
|
+
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11398
|
+
return columnsName;
|
|
11399
|
+
}
|
|
11400
|
+
// Inicializa alguns valores auxiliares
|
|
11401
|
+
initVars(metaData) {
|
|
11402
|
+
metaData.xlsMergedCell = [];
|
|
11403
|
+
const { columns } = metaData;
|
|
11404
|
+
const lengthGroup = metaData.groups.length;
|
|
11405
|
+
const indexLastGroup = lengthGroup - 1;
|
|
11406
|
+
let columnsName = [];
|
|
11407
|
+
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11408
|
+
const rowValues = [];
|
|
11409
|
+
const formatedDataSet = [];
|
|
11410
|
+
const groups = [];
|
|
11411
|
+
groups.groupEnd = {};
|
|
11412
|
+
groups.groupEnd.cellsfunc = {};
|
|
11413
|
+
return {
|
|
11414
|
+
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11415
|
+
};
|
|
11416
|
+
}
|
|
11417
|
+
// formata a linha do grupo de acordo com o formato xls3
|
|
11418
|
+
setRowGroupFormat(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11419
|
+
let rowValues = rowValuesParam;
|
|
11420
|
+
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11421
|
+
const index = row.groupIndex;
|
|
11422
|
+
if (row.groupHeader) {
|
|
11423
|
+
rowValues[index] = label;
|
|
11424
|
+
groups[index] = { init: null, end: null };
|
|
11425
|
+
formatedDataSet.push(rowValues);
|
|
11426
|
+
rowValues = [];
|
|
11427
|
+
}
|
|
11428
|
+
else if (row.groupFooter) {
|
|
11429
|
+
if (!row.groupLabel) {
|
|
11430
|
+
rowValues.push('Total');
|
|
11431
|
+
}
|
|
11432
|
+
else {
|
|
11433
|
+
rowValues.push(`Total (${label})`);
|
|
11434
|
+
}
|
|
11435
|
+
formatedDataSet.push(rowValues);
|
|
11436
|
+
rowValues = [];
|
|
11437
|
+
const funcXls = null;
|
|
11438
|
+
columnsName.forEach((column) => {
|
|
11439
|
+
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11440
|
+
});
|
|
11441
|
+
}
|
|
11442
|
+
return rowValues;
|
|
11443
|
+
}
|
|
11444
|
+
// formata as expressões da linha
|
|
11445
|
+
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11446
|
+
let funcXls = funcXlsParam;
|
|
11447
|
+
if ((row[column] === 0 || row[column]) && index !== undefined) {
|
|
11448
|
+
const letter = this.colunmXLS[rowValues.length];
|
|
11449
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11450
|
+
const cellsfunc = `${letter + groups[index].init}:${letter}${groups[index].end}`;
|
|
11451
|
+
let expression = '';
|
|
11452
|
+
if (indexLastGroup === index) {
|
|
11453
|
+
expression = `=${funcXls}(${cellsfunc})`;
|
|
11454
|
+
}
|
|
11455
|
+
else {
|
|
11456
|
+
expression = `=${funcXls}(${groups[index].cellsfunc[column]})`;
|
|
11457
|
+
if (index === 0) {
|
|
11458
|
+
if (groups.groupEnd.cellsfunc[column]) {
|
|
11459
|
+
groups.groupEnd.cellsfunc[column] += `,${groups[index].cellsfunc[column]}`;
|
|
11460
|
+
}
|
|
11461
|
+
else {
|
|
11462
|
+
groups.groupEnd.cellsfunc[column] = groups[index].cellsfunc[column];
|
|
11463
|
+
}
|
|
11427
11464
|
}
|
|
11428
|
-
|
|
11429
|
-
|
|
11465
|
+
groups[index].cellsfunc[column] = null;
|
|
11466
|
+
}
|
|
11467
|
+
rowValues.push(expression);
|
|
11468
|
+
groups.forEach((group, indexGroup) => {
|
|
11469
|
+
if (indexGroup !== indexLastGroup) {
|
|
11470
|
+
if (!group.cellsfunc) {
|
|
11471
|
+
group.cellsfunc = {};
|
|
11472
|
+
}
|
|
11473
|
+
if (group.cellsfunc[column]) {
|
|
11474
|
+
group.cellsfunc[column] += `,${cellsfunc}`;
|
|
11475
|
+
}
|
|
11476
|
+
else {
|
|
11477
|
+
group.cellsfunc[column] = cellsfunc;
|
|
11478
|
+
}
|
|
11479
|
+
}
|
|
11480
|
+
});
|
|
11481
|
+
}
|
|
11482
|
+
else {
|
|
11483
|
+
let cell = row[column];
|
|
11484
|
+
if (row.groupSummary) {
|
|
11485
|
+
const groupEndFunc = groups.groupEnd.cellsfunc;
|
|
11486
|
+
if (groupEndFunc[column]) {
|
|
11487
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11488
|
+
cell = `=${funcXls}(${groupEndFunc[column]})`;
|
|
11430
11489
|
}
|
|
11431
11490
|
}
|
|
11491
|
+
rowValues.push(cell);
|
|
11492
|
+
}
|
|
11493
|
+
}
|
|
11494
|
+
// Defina o index dos grupos
|
|
11495
|
+
setIndexGroups(groups, formatedDataSet) {
|
|
11496
|
+
groups.forEach((group) => {
|
|
11497
|
+
if (!group.init) {
|
|
11498
|
+
group.init = formatedDataSet.length + 2;
|
|
11499
|
+
}
|
|
11500
|
+
group.end = formatedDataSet.length + 2;
|
|
11501
|
+
});
|
|
11502
|
+
}
|
|
11503
|
+
// Preenche uma linha "normal"
|
|
11504
|
+
setRowNormal(columnsName, rowValues, row) {
|
|
11505
|
+
columnsName.forEach((column) => {
|
|
11506
|
+
rowValues.push(row[column]);
|
|
11507
|
+
});
|
|
11508
|
+
}
|
|
11509
|
+
formatDataSet(metaData, dataSet) {
|
|
11510
|
+
const initVars = this.initVars(metaData);
|
|
11511
|
+
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
11512
|
+
let { rowValues } = initVars;
|
|
11513
|
+
dataSet.forEach((row) => {
|
|
11514
|
+
if (row.group || row.groupFooter) {
|
|
11515
|
+
rowValues = this.setRowGroupFormat(row, rowValues, groups, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11516
|
+
}
|
|
11432
11517
|
else {
|
|
11433
11518
|
this.setIndexGroups(groups, formatedDataSet);
|
|
11434
11519
|
this.setRowNormal(columnsName, rowValues, row);
|
|
@@ -11475,8 +11560,14 @@
|
|
|
11475
11560
|
if (type === 'pdf') {
|
|
11476
11561
|
return new PDFReport();
|
|
11477
11562
|
}
|
|
11478
|
-
if (type === 'xls'
|
|
11479
|
-
return new XLSReport(
|
|
11563
|
+
if (type === 'xls') {
|
|
11564
|
+
return new XLSReport();
|
|
11565
|
+
}
|
|
11566
|
+
if (type === 'xls2') {
|
|
11567
|
+
return new XLS2Report();
|
|
11568
|
+
}
|
|
11569
|
+
if (type === 'xls3') {
|
|
11570
|
+
return new XLS3Report();
|
|
11480
11571
|
}
|
|
11481
11572
|
throw new Error(`Invalid report type: ${type}`);
|
|
11482
11573
|
}
|
|
@@ -11495,10 +11586,10 @@
|
|
|
11495
11586
|
const formattedColumns = this.removeActionColumns(columns);
|
|
11496
11587
|
const metadataObj = yield reportType.buildMetadata(name, this.title, formattedColumns, datasource.filter, portrait);
|
|
11497
11588
|
let dataset;
|
|
11498
|
-
if ((reportType
|
|
11589
|
+
if ((reportType instanceof XLS2Report || reportType instanceof XLS3Report) && groupedData) {
|
|
11499
11590
|
const rowMetadata = rowObj.metaData;
|
|
11500
11591
|
const metadataObjClone = merge__default["default"](rowMetadata, JSON.parse(metadataObj));
|
|
11501
|
-
dataset = reportType.buildDataset(groupedData,
|
|
11592
|
+
dataset = reportType.buildDataset(groupedData, metadataObjClone);
|
|
11502
11593
|
}
|
|
11503
11594
|
else {
|
|
11504
11595
|
dataset = reportType.buildDataset(data, formattedColumns);
|
|
@@ -11642,6 +11733,8 @@
|
|
|
11642
11733
|
exports.TreeGrid = TreeGrid;
|
|
11643
11734
|
exports.TreeGridEditable = TreeGridEditable;
|
|
11644
11735
|
exports.WatchURL = WatchURL;
|
|
11736
|
+
exports.XLS2Report = XLS2Report;
|
|
11737
|
+
exports.XLS3Report = XLS3Report;
|
|
11645
11738
|
exports.XLSReport = XLSReport;
|
|
11646
11739
|
exports.initTheme = initTheme;
|
|
11647
11740
|
|