@zeedhi/common 1.39.0 → 1.42.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 +460 -247
- package/dist/zd-common.umd.js +466 -250
- package/package.json +2 -2
- package/types/components/index.d.ts +2 -0
- package/types/components/zd-alert/alert.d.ts +2 -0
- package/types/components/zd-apex-chart/apex-chart.d.ts +11 -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-date/date-range.d.ts +1 -5
- 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-frame/frame.d.ts +1 -0
- 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-iterable/column.d.ts +4 -2
- 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-selectable-list/interfaces.d.ts +8 -0
- package/types/components/zd-selectable-list/selectable-list.d.ts +29 -0
- package/types/components/zd-steppers/interfaces.d.ts +0 -2
- package/types/components/zd-steppers/steppers.d.ts +0 -8
- package/types/components/zd-tabs/tabs.d.ts +10 -0
- 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.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccessorManager, Event, KeyMap, Metadata, FormatterParserProvider, Validation, Accessor, DatasourceFactory, I18n, MethodNotAssignedError, Loader, Mask, Config, dayjs, isEqual, Router, InstanceNotFoundError, Http, Cookie, normalize, URL as URL$1 } from '@zeedhi/core';
|
|
2
|
+
import merge from 'lodash.merge';
|
|
2
3
|
import debounce from 'lodash.debounce';
|
|
3
4
|
import isUndefined from 'lodash.isundefined';
|
|
4
|
-
import merge from 'lodash.merge';
|
|
5
5
|
import set from 'lodash.set';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -48,6 +48,14 @@ class Component {
|
|
|
48
48
|
* Controls component visibility.
|
|
49
49
|
*/
|
|
50
50
|
this.isVisible = true;
|
|
51
|
+
/**
|
|
52
|
+
* Applies the dark theme variant to the component.
|
|
53
|
+
*/
|
|
54
|
+
this.dark = false;
|
|
55
|
+
/**
|
|
56
|
+
* Applies the light theme variant to the component.
|
|
57
|
+
*/
|
|
58
|
+
this.light = false;
|
|
51
59
|
/**
|
|
52
60
|
* Define component key mapping
|
|
53
61
|
*/
|
|
@@ -63,6 +71,8 @@ class Component {
|
|
|
63
71
|
this.cssClass = this.getInitValue('cssClass', props.cssClass, this.cssClass);
|
|
64
72
|
this.cssStyle = this.getInitValue('cssStyle', props.cssStyle, this.cssStyle);
|
|
65
73
|
this.isVisible = this.getInitValue('isVisible', props.isVisible, this.isVisible);
|
|
74
|
+
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
75
|
+
this.light = this.getInitValue('light', props.light, this.light);
|
|
66
76
|
this.children = Array.isArray(props.children) ? props.children : this.children;
|
|
67
77
|
this.keyMap = KeyMap.factory(props.keyMap || this.keyMap);
|
|
68
78
|
this.createAccessors();
|
|
@@ -298,6 +308,8 @@ class Alert extends Component {
|
|
|
298
308
|
this.vertical = false;
|
|
299
309
|
this.defaultValues = {
|
|
300
310
|
name: this.name,
|
|
311
|
+
dark: this.dark,
|
|
312
|
+
light: this.light,
|
|
301
313
|
color: this.color,
|
|
302
314
|
text: this.text,
|
|
303
315
|
timeout: this.timeout,
|
|
@@ -322,6 +334,8 @@ class Alert extends Component {
|
|
|
322
334
|
assignAlertProperties(alert) {
|
|
323
335
|
this.name = this.getInitValue('name', alert.name, this.defaultValues.name);
|
|
324
336
|
this.color = this.getInitValue('color', alert.color, this.defaultValues.color);
|
|
337
|
+
this.dark = this.getInitValue('dark', alert.dark, this.defaultValues.dark);
|
|
338
|
+
this.light = this.getInitValue('light', alert.light, this.defaultValues.light);
|
|
325
339
|
this.text = this.getInitValue('text', alert.text, this.defaultValues.text);
|
|
326
340
|
this.timeout = this.getInitValue('timeout', alert.timeout, this.defaultValues.timeout);
|
|
327
341
|
this.type = this.getInitValue('type', alert.type, this.defaultValues.type);
|
|
@@ -410,8 +424,23 @@ class ApexChart extends ComponentRender {
|
|
|
410
424
|
* Defines the load progress color
|
|
411
425
|
*/
|
|
412
426
|
this.loadColor = 'primary';
|
|
427
|
+
this.defaultOptions = {
|
|
428
|
+
chart: {
|
|
429
|
+
toolbar: {
|
|
430
|
+
tools: {
|
|
431
|
+
download: 'fileDownload',
|
|
432
|
+
selection: 'zoomSelection',
|
|
433
|
+
zoom: 'zoom',
|
|
434
|
+
zoomin: 'zoomIn',
|
|
435
|
+
zoomout: 'zoomOut',
|
|
436
|
+
pan: 'zoomPanning',
|
|
437
|
+
reset: 'zoomReset',
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
};
|
|
413
442
|
this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
|
|
414
|
-
this.options = this.getInitValue('options', props.options, this.options);
|
|
443
|
+
this.options = merge(this.defaultOptions, this.getInitValue('options', props.options, this.options));
|
|
415
444
|
this.series = this.getInitValue('series', props.series, this.series);
|
|
416
445
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
417
446
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
@@ -428,6 +457,14 @@ class ApexChart extends ComponentRender {
|
|
|
428
457
|
setViewUpdate(viewUpdate) {
|
|
429
458
|
this.viewUpdate = viewUpdate;
|
|
430
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* Sets view get icon HTML method.
|
|
462
|
+
* @param viewGetIconHTML Update method
|
|
463
|
+
*/
|
|
464
|
+
setViewGetIconHTML(viewGetIconHTML) {
|
|
465
|
+
this.viewGetIconHTML = viewGetIconHTML;
|
|
466
|
+
this.updateToolbarIcons();
|
|
467
|
+
}
|
|
431
468
|
/**
|
|
432
469
|
* Update the chart
|
|
433
470
|
* @param options New options
|
|
@@ -442,6 +479,32 @@ class ApexChart extends ComponentRender {
|
|
|
442
479
|
}
|
|
443
480
|
return Promise.resolve();
|
|
444
481
|
}
|
|
482
|
+
updateToolbarIcons() {
|
|
483
|
+
var _a, _b, _c;
|
|
484
|
+
if (!this.viewGetIconHTML)
|
|
485
|
+
return this.options;
|
|
486
|
+
const getIconFn = this.viewGetIconHTML;
|
|
487
|
+
let changed = false;
|
|
488
|
+
const newOptions = Object.assign({}, this.options);
|
|
489
|
+
if ((_b = (_a = newOptions.chart) === null || _a === void 0 ? void 0 : _a.toolbar) === null || _b === void 0 ? void 0 : _b.tools) {
|
|
490
|
+
const { tools } = newOptions.chart.toolbar;
|
|
491
|
+
Object.keys(tools).forEach((key) => {
|
|
492
|
+
if (typeof tools[key] === 'string') {
|
|
493
|
+
tools[key] = getIconFn(tools[key]);
|
|
494
|
+
changed = true;
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
if ((_c = tools.customIcons) === null || _c === void 0 ? void 0 : _c.length) {
|
|
498
|
+
tools.customIcons.forEach((item) => {
|
|
499
|
+
item.icon = getIconFn(item.icon);
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (this.viewUpdate && changed) {
|
|
504
|
+
this.viewUpdate(newOptions);
|
|
505
|
+
}
|
|
506
|
+
return newOptions;
|
|
507
|
+
}
|
|
445
508
|
}
|
|
446
509
|
|
|
447
510
|
/**
|
|
@@ -492,10 +555,6 @@ class Breadcrumbs extends ComponentRender {
|
|
|
492
555
|
*/
|
|
493
556
|
constructor(props) {
|
|
494
557
|
super(props);
|
|
495
|
-
/**
|
|
496
|
-
* Applies the dark theme variant to the component.
|
|
497
|
-
*/
|
|
498
|
-
this.dark = false;
|
|
499
558
|
/**
|
|
500
559
|
* Specifies the dividing string between items.
|
|
501
560
|
*/
|
|
@@ -512,19 +571,13 @@ class Breadcrumbs extends ComponentRender {
|
|
|
512
571
|
* Increase the font-size of the breadcrumb item text to 16px.
|
|
513
572
|
*/
|
|
514
573
|
this.large = false;
|
|
515
|
-
/**
|
|
516
|
-
* Applies the light theme variant to the component.
|
|
517
|
-
*/
|
|
518
|
-
this.light = true;
|
|
519
574
|
/**
|
|
520
575
|
* Decrease the font-size of the breadcrumb item text to 12px.
|
|
521
576
|
*/
|
|
522
577
|
this.small = false;
|
|
523
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
524
578
|
this.divider = this.getInitValue('divider', props.divider, this.divider);
|
|
525
579
|
this.items = this.getInitValue('items', props.items, this.items);
|
|
526
580
|
this.large = this.getInitValue('large', props.large, this.large);
|
|
527
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
528
581
|
this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
|
|
529
582
|
this.small = this.getInitValue('small', props.small, this.small);
|
|
530
583
|
this.createAccessors();
|
|
@@ -560,10 +613,6 @@ class Button extends ComponentRender {
|
|
|
560
613
|
* It can be the name of material or css color in hexa
|
|
561
614
|
*/
|
|
562
615
|
this.color = 'primary';
|
|
563
|
-
/**
|
|
564
|
-
* Applies the dark theme variant to the button
|
|
565
|
-
*/
|
|
566
|
-
this.dark = false;
|
|
567
616
|
/**
|
|
568
617
|
* Removes the ability to click or target the button
|
|
569
618
|
*/
|
|
@@ -605,10 +654,6 @@ class Button extends ComponentRender {
|
|
|
605
654
|
* This should be used with the absolute or fixed props
|
|
606
655
|
*/
|
|
607
656
|
this.left = false;
|
|
608
|
-
/**
|
|
609
|
-
* Applies the light theme variant to the button
|
|
610
|
-
*/
|
|
611
|
-
this.light = false;
|
|
612
657
|
/**
|
|
613
658
|
* Makes the background transparent and applies a thin border
|
|
614
659
|
*/
|
|
@@ -711,10 +756,6 @@ class ButtonGroup extends ComponentRender {
|
|
|
711
756
|
* It can be the name of material or css color in hexa
|
|
712
757
|
*/
|
|
713
758
|
this.color = 'primary';
|
|
714
|
-
/**
|
|
715
|
-
* Applies the dark theme variant to the component.
|
|
716
|
-
*/
|
|
717
|
-
this.dark = false;
|
|
718
759
|
/**
|
|
719
760
|
* Reduces the button size and padding.
|
|
720
761
|
*/
|
|
@@ -724,10 +765,6 @@ class ButtonGroup extends ComponentRender {
|
|
|
724
765
|
* space between the buttons
|
|
725
766
|
*/
|
|
726
767
|
this.group = false;
|
|
727
|
-
/**
|
|
728
|
-
* Applies the light theme variant to the component.
|
|
729
|
-
*/
|
|
730
|
-
this.light = false;
|
|
731
768
|
/**
|
|
732
769
|
* Applies mandatory selected button
|
|
733
770
|
*/
|
|
@@ -761,10 +798,8 @@ class ButtonGroup extends ComponentRender {
|
|
|
761
798
|
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
762
799
|
this.borderless = this.getInitValue('block', props.borderless, this.borderless);
|
|
763
800
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
764
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
765
801
|
this.dense = this.getInitValue('disabled', props.dense, this.dense);
|
|
766
802
|
this.group = this.getInitValue('group', props.group, this.group);
|
|
767
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
768
803
|
this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
|
|
769
804
|
this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
|
|
770
805
|
this.rounded = this.getInitValue('rounded', props.rounded, this.rounded);
|
|
@@ -818,10 +853,6 @@ class Carousel extends ComponentRender {
|
|
|
818
853
|
* a non-integer number in slidesPerView, like 1.5)
|
|
819
854
|
*/
|
|
820
855
|
this.center = false;
|
|
821
|
-
/**
|
|
822
|
-
* Applies the dark theme variant to the carousel pagination
|
|
823
|
-
*/
|
|
824
|
-
this.dark = false;
|
|
825
856
|
/**
|
|
826
857
|
* Displays the pagination as a fraction in the following format: currentSlide/slidesCount.
|
|
827
858
|
* Only works when <code>showPagination</code> property is true
|
|
@@ -848,10 +879,6 @@ class Carousel extends ComponentRender {
|
|
|
848
879
|
* Allows controlling the carousel using the keyboard arrow keys
|
|
849
880
|
*/
|
|
850
881
|
this.keysControl = true;
|
|
851
|
-
/**
|
|
852
|
-
* Applies the light theme variant to the carousel
|
|
853
|
-
*/
|
|
854
|
-
this.light = true;
|
|
855
882
|
/**
|
|
856
883
|
* Allows controlling the carousel using mouse drag
|
|
857
884
|
*/
|
|
@@ -926,14 +953,12 @@ class Carousel extends ComponentRender {
|
|
|
926
953
|
this.autoPlay = this.getInitValue('autoPlay', props.autoPlay, this.autoPlay);
|
|
927
954
|
this.buttonsOutside = this.getInitValue('buttonsOutside', props.buttonsOutside, this.buttonsOutside);
|
|
928
955
|
this.center = this.getInitValue('center', props.center, this.center);
|
|
929
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
930
956
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
931
957
|
this.infiniteScroll = this.getInitValue('infiniteScroll', props.infiniteScroll, this.infiniteScroll);
|
|
932
958
|
this.initialSlide = this.getInitValue('initialSlide', props.initialSlide, this.initialSlide);
|
|
933
959
|
this.currentSlide = this.getInitValue('currentSlide', props.currentSlide, this.initialSlide);
|
|
934
960
|
this.interval = this.getInitValue('interval', props.interval, this.interval);
|
|
935
961
|
this.keysControl = this.getInitValue('keysControl', props.keysControl, this.keysControl);
|
|
936
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
937
962
|
this.mouseControl = this.getInitValue('mouseControl', props.mouseControl, this.mouseControl);
|
|
938
963
|
this.nextButton = props.nextButton || this.nextButton;
|
|
939
964
|
this.fractionPagination = this.getInitValue('fractionPagination', props.fractionPagination, this.fractionPagination);
|
|
@@ -1048,10 +1073,6 @@ class Card extends ComponentRender {
|
|
|
1048
1073
|
* Applies specified color to the control. It can be the name of material color
|
|
1049
1074
|
*/
|
|
1050
1075
|
this.color = '';
|
|
1051
|
-
/**
|
|
1052
|
-
* Applies the dark theme variant to the component
|
|
1053
|
-
*/
|
|
1054
|
-
this.dark = false;
|
|
1055
1076
|
/**
|
|
1056
1077
|
* Removes the ability to click or target the component
|
|
1057
1078
|
*/
|
|
@@ -1068,10 +1089,6 @@ class Card extends ComponentRender {
|
|
|
1068
1089
|
* Specifies an image background for the card
|
|
1069
1090
|
*/
|
|
1070
1091
|
this.img = '';
|
|
1071
|
-
/**
|
|
1072
|
-
* Applies the light theme variant to the component
|
|
1073
|
-
*/
|
|
1074
|
-
this.light = false;
|
|
1075
1092
|
/**
|
|
1076
1093
|
* Designates that the card is a link
|
|
1077
1094
|
*/
|
|
@@ -1095,7 +1112,6 @@ class Card extends ComponentRender {
|
|
|
1095
1112
|
this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
|
|
1096
1113
|
this.append = this.getInitValue('append', props.append, this.append);
|
|
1097
1114
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
1098
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
1099
1115
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
1100
1116
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
1101
1117
|
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
@@ -1103,7 +1119,6 @@ class Card extends ComponentRender {
|
|
|
1103
1119
|
this.hover = this.getInitValue('hover', props.hover, this.hover);
|
|
1104
1120
|
this.href = this.getInitValue('href', props.href, this.href);
|
|
1105
1121
|
this.img = this.getInitValue('img', props.img, this.img);
|
|
1106
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
1107
1122
|
this.link = this.getInitValue('link', props.link, this.link);
|
|
1108
1123
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
1109
1124
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
@@ -1316,10 +1331,6 @@ class Input extends ComponentRender {
|
|
|
1316
1331
|
* It can be the name of material or css color in hexa.
|
|
1317
1332
|
*/
|
|
1318
1333
|
this.color = 'primary';
|
|
1319
|
-
/**
|
|
1320
|
-
* Applies the dark theme variant to the input.
|
|
1321
|
-
*/
|
|
1322
|
-
this.dark = false;
|
|
1323
1334
|
/**
|
|
1324
1335
|
* Defines smaller input.
|
|
1325
1336
|
*/
|
|
@@ -1336,10 +1347,6 @@ class Input extends ComponentRender {
|
|
|
1336
1347
|
* Defines the input label.
|
|
1337
1348
|
*/
|
|
1338
1349
|
this.label = '';
|
|
1339
|
-
/**
|
|
1340
|
-
* Applies the light theme variant to the input.
|
|
1341
|
-
*/
|
|
1342
|
-
this.light = false;
|
|
1343
1350
|
/**
|
|
1344
1351
|
* Applies a custom character mask to the input.
|
|
1345
1352
|
*/
|
|
@@ -1408,13 +1415,11 @@ class Input extends ComponentRender {
|
|
|
1408
1415
|
this.autofocus = this.getInitValue('autofocus', props.autofocus, this.autofocus);
|
|
1409
1416
|
this.clearable = this.getInitValue('clearable', props.clearable, this.clearable);
|
|
1410
1417
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
1411
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
1412
1418
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
1413
1419
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
1414
1420
|
this.hint = this.getInitValue('hint', props.hint, this.hint);
|
|
1415
1421
|
this.autoHintDetails = this.getInitValue('autoHintDetails', props.autoHintDetails, this.autoHintDetails);
|
|
1416
1422
|
this.label = this.getInitValue('label', props.label, this.label);
|
|
1417
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
1418
1423
|
this.mask = this.getInitValue('mask', props.mask, this.mask);
|
|
1419
1424
|
this.maxLength = this.getInitValue('maxLength', props.maxLength, this.maxLength);
|
|
1420
1425
|
this.persistentHint = this.getInitValue('persistentHint', props.persistentHint, this.persistentHint);
|
|
@@ -3322,10 +3327,6 @@ class DateRange extends TextInput {
|
|
|
3322
3327
|
* Sets the locale. Accepts a string with a BCP 47 language tag.
|
|
3323
3328
|
*/
|
|
3324
3329
|
this.locale = I18n.instance.language;
|
|
3325
|
-
/**
|
|
3326
|
-
* Defines if dates should be ordered
|
|
3327
|
-
*/
|
|
3328
|
-
this.orderedDates = false;
|
|
3329
3330
|
/**
|
|
3330
3331
|
* Allows changing displayed month with mouse scroll
|
|
3331
3332
|
*/
|
|
@@ -3349,15 +3350,12 @@ class DateRange extends TextInput {
|
|
|
3349
3350
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
3350
3351
|
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
3351
3352
|
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
3352
|
-
this.orderedDates = this.getInitValue('orderedDates', props.orderedDates, this.orderedDates);
|
|
3353
3353
|
this.dateValidation = this.dateValidation.bind(this);
|
|
3354
|
-
this.dateValidateOrder = this.dateValidateOrder.bind(this);
|
|
3355
3354
|
this.displayFormat = this.getInitValue('displayFormat', props.displayFormat, this.displayFormat);
|
|
3356
3355
|
this.inputFormat = this.getInitValue('inputFormat', props.inputFormat, this.inputFormat);
|
|
3357
3356
|
this.firstDayOfWeek = this.getInitValue('firstDayOfWeek', props.firstDayOfWeek, this.firstDayOfWeek);
|
|
3358
3357
|
this.fullWidth = this.getInitValue('fullWidth', props.fullWidth, this.fullWidth);
|
|
3359
3358
|
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
3360
|
-
this.rules.push(this.dateValidation, this.dateValidateOrder);
|
|
3361
3359
|
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
3362
3360
|
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
3363
3361
|
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
@@ -3474,13 +3472,13 @@ class DateRange extends TextInput {
|
|
|
3474
3472
|
splitedValue = dates;
|
|
3475
3473
|
else
|
|
3476
3474
|
splitedValue = this.splitValues(dates);
|
|
3477
|
-
const
|
|
3475
|
+
const formattedValue = [];
|
|
3478
3476
|
splitedValue.forEach((value) => {
|
|
3479
3477
|
if (value && this.isValidDate(value, this.dateFormat)) {
|
|
3480
|
-
|
|
3478
|
+
formattedValue.push(dayjs(value, this.dateFormat, true).format(this.isoFormat));
|
|
3481
3479
|
}
|
|
3482
3480
|
});
|
|
3483
|
-
return
|
|
3481
|
+
return formattedValue;
|
|
3484
3482
|
}
|
|
3485
3483
|
parseISODateRangeValue(values) {
|
|
3486
3484
|
const parsedValue = [];
|
|
@@ -3491,19 +3489,14 @@ class DateRange extends TextInput {
|
|
|
3491
3489
|
}
|
|
3492
3490
|
});
|
|
3493
3491
|
}
|
|
3494
|
-
return parsedValue;
|
|
3492
|
+
return this.sortDates(parsedValue);
|
|
3493
|
+
}
|
|
3494
|
+
sortDates(parsedValue) {
|
|
3495
|
+
return parsedValue.sort((a, b) => (dayjs(a, this.dateFormat).isAfter(dayjs(b, this.dateFormat)) ? 1 : -1));
|
|
3495
3496
|
}
|
|
3496
3497
|
dateValidation() {
|
|
3497
3498
|
return !this.dateError || I18n.translate('VALIDATION_INVALID_DATE');
|
|
3498
3499
|
}
|
|
3499
|
-
dateValidateOrder() {
|
|
3500
|
-
if (this.value && (this.value.length === 2 && this.orderedDates)) {
|
|
3501
|
-
const date1 = dayjs(this.value[0], this.dateFormat);
|
|
3502
|
-
const date2 = dayjs(this.value[1], this.dateFormat);
|
|
3503
|
-
return (date1.isBefore(date2) || date1.isSame(date2)) || I18n.translate('VALIDATION_INVALID_ORDER_DATE');
|
|
3504
|
-
}
|
|
3505
|
-
return true;
|
|
3506
|
-
}
|
|
3507
3500
|
click(event, element) {
|
|
3508
3501
|
super.click(event, element);
|
|
3509
3502
|
if (!event.defaultPrevented) {
|
|
@@ -3511,6 +3504,7 @@ class DateRange extends TextInput {
|
|
|
3511
3504
|
}
|
|
3512
3505
|
}
|
|
3513
3506
|
blur(event, element) {
|
|
3507
|
+
this.value = this.sortDates(this.value);
|
|
3514
3508
|
this.removeDateMask();
|
|
3515
3509
|
this.setDateValue(this.displayValue);
|
|
3516
3510
|
super.blur(event, element);
|
|
@@ -3672,18 +3666,10 @@ class Divider extends ComponentRender {
|
|
|
3672
3666
|
*/
|
|
3673
3667
|
constructor(props) {
|
|
3674
3668
|
super(props);
|
|
3675
|
-
/**
|
|
3676
|
-
* Applies the dark theme variant to the component.
|
|
3677
|
-
*/
|
|
3678
|
-
this.dark = false;
|
|
3679
3669
|
/**
|
|
3680
3670
|
* Adds indentation (72px) for normal dividers, reduces max height for vertical.
|
|
3681
3671
|
*/
|
|
3682
3672
|
this.inset = false;
|
|
3683
|
-
/**
|
|
3684
|
-
* Applies the light theme variant to the component.
|
|
3685
|
-
*/
|
|
3686
|
-
this.light = false;
|
|
3687
3673
|
/**
|
|
3688
3674
|
* Displays dividers vertically.
|
|
3689
3675
|
*/
|
|
@@ -3953,10 +3939,6 @@ class Footer extends ComponentRender {
|
|
|
3953
3939
|
* Applies specified color to the control. It can be the name of material or css color in hexa.
|
|
3954
3940
|
*/
|
|
3955
3941
|
this.color = 'primary';
|
|
3956
|
-
/**
|
|
3957
|
-
* Applies the dark theme variant to footer.
|
|
3958
|
-
*/
|
|
3959
|
-
this.dark = false;
|
|
3960
3942
|
/**
|
|
3961
3943
|
* Applies position fixed to footer.
|
|
3962
3944
|
*/
|
|
@@ -3973,10 +3955,6 @@ class Footer extends ComponentRender {
|
|
|
3973
3955
|
* Render components on the left of footer.
|
|
3974
3956
|
*/
|
|
3975
3957
|
this.leftSlot = [];
|
|
3976
|
-
/**
|
|
3977
|
-
* Applies the light theme variant to the footer.
|
|
3978
|
-
*/
|
|
3979
|
-
this.light = false;
|
|
3980
3958
|
/**
|
|
3981
3959
|
* Remove all padding from the footer.
|
|
3982
3960
|
*/
|
|
@@ -4055,6 +4033,12 @@ class Frame extends ComponentRender {
|
|
|
4055
4033
|
}
|
|
4056
4034
|
});
|
|
4057
4035
|
}
|
|
4036
|
+
reload() {
|
|
4037
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4038
|
+
this.loading = true;
|
|
4039
|
+
this.getMetadata();
|
|
4040
|
+
});
|
|
4041
|
+
}
|
|
4058
4042
|
notFoundError() { }
|
|
4059
4043
|
requestPage() {
|
|
4060
4044
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4313,10 +4297,10 @@ class Column extends Component {
|
|
|
4313
4297
|
* Apply conditions
|
|
4314
4298
|
* @param row Datasource row
|
|
4315
4299
|
*/
|
|
4316
|
-
applyCondition(row) {
|
|
4300
|
+
applyCondition(row, factoredConditions = this.factoredConditions) {
|
|
4317
4301
|
const appliedConditions = {};
|
|
4318
|
-
Object.keys(
|
|
4319
|
-
const conditionFunction =
|
|
4302
|
+
Object.keys(factoredConditions).forEach((condition) => {
|
|
4303
|
+
const conditionFunction = factoredConditions[condition];
|
|
4320
4304
|
set(appliedConditions, condition, conditionFunction({ row, column: this }));
|
|
4321
4305
|
});
|
|
4322
4306
|
return appliedConditions;
|
|
@@ -4331,11 +4315,7 @@ class Column extends Component {
|
|
|
4331
4315
|
const appliedConditions = {};
|
|
4332
4316
|
Object.keys(this.actionFactoredConditions).forEach((action) => {
|
|
4333
4317
|
const factoredConditions = this.actionFactoredConditions[action];
|
|
4334
|
-
appliedConditions[action] = {};
|
|
4335
|
-
Object.keys(factoredConditions).forEach((condition) => {
|
|
4336
|
-
const conditionFunction = factoredConditions[condition];
|
|
4337
|
-
set(appliedConditions[action], condition, conditionFunction({ row }));
|
|
4338
|
-
});
|
|
4318
|
+
appliedConditions[action] = Object.assign({}, this.applyCondition(row, factoredConditions));
|
|
4339
4319
|
});
|
|
4340
4320
|
return appliedConditions;
|
|
4341
4321
|
}
|
|
@@ -4713,7 +4693,11 @@ class Grid extends Iterable {
|
|
|
4713
4693
|
/**
|
|
4714
4694
|
* Color of the header background
|
|
4715
4695
|
*/
|
|
4716
|
-
this.headerBackground = '
|
|
4696
|
+
this.headerBackground = '';
|
|
4697
|
+
/**
|
|
4698
|
+
* Color of the header cell text color
|
|
4699
|
+
*/
|
|
4700
|
+
this.headerCellTextColor = '';
|
|
4717
4701
|
/**
|
|
4718
4702
|
* Available order types
|
|
4719
4703
|
* @public
|
|
@@ -4757,6 +4741,8 @@ class Grid extends Iterable {
|
|
|
4757
4741
|
},
|
|
4758
4742
|
};
|
|
4759
4743
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
4744
|
+
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
4745
|
+
this.light = this.getInitValue('light', props.light, this.light);
|
|
4760
4746
|
this.selectable = this.getInitValue('selectable', props.selectable, this.selectable);
|
|
4761
4747
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
4762
4748
|
this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
|
|
@@ -4766,6 +4752,7 @@ class Grid extends Iterable {
|
|
|
4766
4752
|
this.showFooter = this.getInitValue('showFooter', props.showFooter, this.showFooter);
|
|
4767
4753
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
4768
4754
|
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.headerBackground);
|
|
4755
|
+
this.headerCellTextColor = this.getInitValue('headerCellTextColor', props.headerCellTextColor, this.headerCellTextColor);
|
|
4769
4756
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
4770
4757
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
4771
4758
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
@@ -4934,6 +4921,7 @@ class Grid extends Iterable {
|
|
|
4934
4921
|
var _a, _b, _c;
|
|
4935
4922
|
const rowKey = row[this.datasource.uniqueKey];
|
|
4936
4923
|
const compName = actionComponent.name;
|
|
4924
|
+
const instanceName = `${compName}_${rowKey}`;
|
|
4937
4925
|
const path = parentPath ? `${parentPath}.${compName}` : compName;
|
|
4938
4926
|
const newComponent = merge({}, actionComponent, (_b = (_a = this.actionsApplied[rowKey]) === null || _a === void 0 ? void 0 : _a[column.name]) === null || _b === void 0 ? void 0 : _b[path]);
|
|
4939
4927
|
let compEvents = {};
|
|
@@ -4948,7 +4936,16 @@ class Grid extends Iterable {
|
|
|
4948
4936
|
}
|
|
4949
4937
|
} });
|
|
4950
4938
|
const newChildren = (_c = newComponent.children) === null || _c === void 0 ? void 0 : _c.map((child) => this.getActionComponent(child, column, row, path));
|
|
4951
|
-
|
|
4939
|
+
newComponent.name = instanceName;
|
|
4940
|
+
newComponent.children = newChildren;
|
|
4941
|
+
newComponent.events = newEvents;
|
|
4942
|
+
try {
|
|
4943
|
+
Metadata.updateInstance(instanceName, newComponent);
|
|
4944
|
+
}
|
|
4945
|
+
catch (e) {
|
|
4946
|
+
// do nothing
|
|
4947
|
+
}
|
|
4948
|
+
return newComponent;
|
|
4952
4949
|
}
|
|
4953
4950
|
changeDefaultSlotNames(slot) {
|
|
4954
4951
|
slot.forEach((item) => {
|
|
@@ -5424,10 +5421,6 @@ class Header extends ComponentRender {
|
|
|
5424
5421
|
* Applies specified color to the control. It can be the name of material or css color in hexa.
|
|
5425
5422
|
*/
|
|
5426
5423
|
this.color = 'primary';
|
|
5427
|
-
/**
|
|
5428
|
-
* Applies the dark theme variant to header.
|
|
5429
|
-
*/
|
|
5430
|
-
this.dark = false;
|
|
5431
5424
|
/**
|
|
5432
5425
|
* Designates that the application menu positioned on the left is below the header.
|
|
5433
5426
|
*/
|
|
@@ -5452,10 +5445,6 @@ class Header extends ComponentRender {
|
|
|
5452
5445
|
* Render components on the left of header.
|
|
5453
5446
|
*/
|
|
5454
5447
|
this.leftSlot = [];
|
|
5455
|
-
/**
|
|
5456
|
-
* Applies the light theme variant to the header.
|
|
5457
|
-
*/
|
|
5458
|
-
this.light = false;
|
|
5459
5448
|
/**
|
|
5460
5449
|
* Removes internal padding from header.
|
|
5461
5450
|
*/
|
|
@@ -5470,13 +5459,11 @@ class Header extends ComponentRender {
|
|
|
5470
5459
|
this.clippedLeft = this.getInitValue('clippedLeft', props.clippedLeft, this.clippedLeft);
|
|
5471
5460
|
this.clippedRight = this.getInitValue('clippedRight', props.clippedRight, this.clippedRight);
|
|
5472
5461
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
5473
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5474
5462
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5475
5463
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
5476
5464
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
5477
5465
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
5478
5466
|
this.leftSlot = props.leftSlot || this.leftSlot;
|
|
5479
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
5480
5467
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
5481
5468
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
5482
5469
|
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
@@ -5510,10 +5497,6 @@ class Icon extends ComponentRender {
|
|
|
5510
5497
|
* (for example success or purple) or css color (#033 or rgba(255, 0, 0, 0.5)).
|
|
5511
5498
|
*/
|
|
5512
5499
|
this.color = '';
|
|
5513
|
-
/**
|
|
5514
|
-
* Applies the dark theme variant to the component.
|
|
5515
|
-
*/
|
|
5516
|
-
this.dark = false;
|
|
5517
5500
|
/**
|
|
5518
5501
|
* Makes icon smaller (20px)
|
|
5519
5502
|
*/
|
|
@@ -5535,10 +5518,6 @@ class Icon extends ComponentRender {
|
|
|
5535
5518
|
* of a button when placed to the left of another element or text
|
|
5536
5519
|
*/
|
|
5537
5520
|
this.left = false;
|
|
5538
|
-
/**
|
|
5539
|
-
* Applies the light theme variant to the component.
|
|
5540
|
-
*/
|
|
5541
|
-
this.light = false;
|
|
5542
5521
|
/**
|
|
5543
5522
|
* Applies appropriate margins to the icon inside of
|
|
5544
5523
|
* a button when placed to the right of another element or text
|
|
@@ -5557,13 +5536,11 @@ class Icon extends ComponentRender {
|
|
|
5557
5536
|
*/
|
|
5558
5537
|
this.tag = 'i';
|
|
5559
5538
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
5560
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5561
5539
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5562
5540
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
5563
5541
|
this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
|
|
5564
5542
|
this.large = this.getInitValue('large', props.large, this.large);
|
|
5565
5543
|
this.left = this.getInitValue('left', props.left, this.left);
|
|
5566
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
5567
5544
|
this.right = this.getInitValue('right', props.right, this.right);
|
|
5568
5545
|
this.size = this.getInitValue('size', props.size, this.size);
|
|
5569
5546
|
this.small = this.getInitValue('small', props.small, this.small);
|
|
@@ -5986,11 +5963,12 @@ class Select extends TextInput {
|
|
|
5986
5963
|
overrideGet() {
|
|
5987
5964
|
const oldGet = this.datasource.get;
|
|
5988
5965
|
this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
|
|
5989
|
-
yield oldGet.call(this.datasource);
|
|
5990
|
-
if (this.indexOf(this.value)
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5966
|
+
const response = yield oldGet.call(this.datasource);
|
|
5967
|
+
if (this.indexOf(this.value) === -1 && !this.datasource.search && !this.isFocused) {
|
|
5968
|
+
yield this.setValue(this.value, false);
|
|
5969
|
+
this.removePushedValue();
|
|
5970
|
+
}
|
|
5971
|
+
return response;
|
|
5994
5972
|
});
|
|
5995
5973
|
}
|
|
5996
5974
|
get search() {
|
|
@@ -6547,10 +6525,6 @@ class ItemNotFoundError extends Error {
|
|
|
6547
6525
|
class List extends ComponentRender {
|
|
6548
6526
|
constructor(props) {
|
|
6549
6527
|
super(props);
|
|
6550
|
-
/**
|
|
6551
|
-
* Applies the dark theme variant to the List.
|
|
6552
|
-
*/
|
|
6553
|
-
this.dark = false;
|
|
6554
6528
|
/**
|
|
6555
6529
|
* Create the list with smaller items.
|
|
6556
6530
|
*/
|
|
@@ -6563,10 +6537,6 @@ class List extends ComponentRender {
|
|
|
6563
6537
|
* Render list with dividers between the items.
|
|
6564
6538
|
*/
|
|
6565
6539
|
this.divided = false;
|
|
6566
|
-
/**
|
|
6567
|
-
* Applies the light theme variant to the List.
|
|
6568
|
-
*/
|
|
6569
|
-
this.light = false;
|
|
6570
6540
|
/**
|
|
6571
6541
|
* Increases the height of all the list items to better support three lines of text.
|
|
6572
6542
|
*/
|
|
@@ -6711,10 +6681,6 @@ class Login extends ComponentRender {
|
|
|
6711
6681
|
* It can be the name of material or css color in hexa.
|
|
6712
6682
|
*/
|
|
6713
6683
|
this.color = '';
|
|
6714
|
-
/**
|
|
6715
|
-
* Applies the dark theme.
|
|
6716
|
-
*/
|
|
6717
|
-
this.dark = false;
|
|
6718
6684
|
/**
|
|
6719
6685
|
* Card position orientation.
|
|
6720
6686
|
*/
|
|
@@ -6743,7 +6709,6 @@ class Login extends ComponentRender {
|
|
|
6743
6709
|
this.bottomLink = props.bottomLink || this.bottomLink;
|
|
6744
6710
|
this.cardWidth = this.getInitValue('cardWidth', props.cardWidth, this.cardWidth);
|
|
6745
6711
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
6746
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
6747
6712
|
this.layout = this.getInitValue('layout', props.layout, this.layout);
|
|
6748
6713
|
this.logo = this.getInitValue('logo', props.logo, this.logo);
|
|
6749
6714
|
this.logoMessage = this.getInitValue('logoMessage', props.logoMessage, this.logoMessage);
|
|
@@ -6970,10 +6935,6 @@ class Menu extends ComponentRender {
|
|
|
6970
6935
|
* Defines if the menu should have a visible container
|
|
6971
6936
|
*/
|
|
6972
6937
|
this.floating = false;
|
|
6973
|
-
/**
|
|
6974
|
-
* Applies the dark theme variant to the menu.
|
|
6975
|
-
*/
|
|
6976
|
-
this.dark = false;
|
|
6977
6938
|
/**
|
|
6978
6939
|
* Create the menu with smaller items.
|
|
6979
6940
|
*/
|
|
@@ -7056,7 +7017,6 @@ class Menu extends ComponentRender {
|
|
|
7056
7017
|
this.clipped = this.getInitValue('clipped', props.clipped, this.clipped);
|
|
7057
7018
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
7058
7019
|
this.floating = this.getInitValue('floating', props.floating, this.floating);
|
|
7059
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
7060
7020
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
7061
7021
|
this.mini = this.getInitValue('mini', props.mini, this.mini);
|
|
7062
7022
|
this.miniState = this.getInitValue('miniState', props.miniState, this.miniState);
|
|
@@ -7697,10 +7657,6 @@ class Progress extends ComponentRender {
|
|
|
7697
7657
|
* Defines the value color
|
|
7698
7658
|
*/
|
|
7699
7659
|
this.color = 'primary';
|
|
7700
|
-
/**
|
|
7701
|
-
* Applies the dark theme variant to the component
|
|
7702
|
-
*/
|
|
7703
|
-
this.dark = false;
|
|
7704
7660
|
/**
|
|
7705
7661
|
* Sets the height for the component
|
|
7706
7662
|
*/
|
|
@@ -7709,10 +7665,6 @@ class Progress extends ComponentRender {
|
|
|
7709
7665
|
* Animates the component constantly
|
|
7710
7666
|
*/
|
|
7711
7667
|
this.indeterminate = false;
|
|
7712
|
-
/**
|
|
7713
|
-
* Applies the light theme variant to the component
|
|
7714
|
-
*/
|
|
7715
|
-
this.light = false;
|
|
7716
7668
|
/**
|
|
7717
7669
|
* Render components on the progress component
|
|
7718
7670
|
*/
|
|
@@ -7724,10 +7676,8 @@ class Progress extends ComponentRender {
|
|
|
7724
7676
|
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
7725
7677
|
this.backgroundOpacity = this.getInitValue('backgroundOpacity', props.backgroundOpacity, this.backgroundOpacity);
|
|
7726
7678
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
7727
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
7728
7679
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
7729
7680
|
this.indeterminate = this.getInitValue('indeterminate', props.indeterminate, this.indeterminate);
|
|
7730
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
7731
7681
|
this.centerSlot = this.getInitValue('centerSlot', props.centerSlot, this.centerSlot);
|
|
7732
7682
|
this.value = this.getInitValue('value', props.value, this.value);
|
|
7733
7683
|
this.createAccessors();
|
|
@@ -8665,6 +8615,10 @@ class SelectTree extends TextInput {
|
|
|
8665
8615
|
* Defines if field value should be an object
|
|
8666
8616
|
*/
|
|
8667
8617
|
this.returnObject = false;
|
|
8618
|
+
/**
|
|
8619
|
+
* Prevents load select data when the input is focused
|
|
8620
|
+
*/
|
|
8621
|
+
this.preventLoadOnFocus = true;
|
|
8668
8622
|
/**
|
|
8669
8623
|
* Field used to make the item disabled
|
|
8670
8624
|
*/
|
|
@@ -8697,6 +8651,7 @@ class SelectTree extends TextInput {
|
|
|
8697
8651
|
this.dataValue = this.getInitValue('dataValue', props.dataValue, this.dataValue);
|
|
8698
8652
|
this.dataDisabled = this.getInitValue('dataDisabled', props.dataDisabled, this.dataDisabled);
|
|
8699
8653
|
this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
|
|
8654
|
+
this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
|
|
8700
8655
|
if (props.datasource && Object.keys(props.datasource).length) {
|
|
8701
8656
|
this.lazyLoad = props.datasource.lazyLoad !== false;
|
|
8702
8657
|
const searchFields = Array.isArray(this.dataText) ? this.dataText : [this.dataText];
|
|
@@ -8710,6 +8665,24 @@ class SelectTree extends TextInput {
|
|
|
8710
8665
|
}
|
|
8711
8666
|
this.createAccessors();
|
|
8712
8667
|
}
|
|
8668
|
+
focus(event, element) {
|
|
8669
|
+
const _super = Object.create(null, {
|
|
8670
|
+
focus: { get: () => super.focus }
|
|
8671
|
+
});
|
|
8672
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8673
|
+
_super.focus.call(this, event, element);
|
|
8674
|
+
this.afterFocus();
|
|
8675
|
+
});
|
|
8676
|
+
}
|
|
8677
|
+
afterFocus() {
|
|
8678
|
+
var _a;
|
|
8679
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8680
|
+
if (!this.preventLoadOnFocus) {
|
|
8681
|
+
yield ((_a = this.datasource) === null || _a === void 0 ? void 0 : _a.get());
|
|
8682
|
+
this.preventLoadOnFocus = true;
|
|
8683
|
+
}
|
|
8684
|
+
});
|
|
8685
|
+
}
|
|
8713
8686
|
createDataStructure() {
|
|
8714
8687
|
this.treeDataStructure = new TreeDataStructure({
|
|
8715
8688
|
datasource: this.datasource,
|
|
@@ -8954,6 +8927,40 @@ class SelectTreeMultiple extends SelectTree {
|
|
|
8954
8927
|
}
|
|
8955
8928
|
}
|
|
8956
8929
|
|
|
8930
|
+
/**
|
|
8931
|
+
* Base class for SelectableList component.
|
|
8932
|
+
*/
|
|
8933
|
+
class SelectableList extends List {
|
|
8934
|
+
constructor(props) {
|
|
8935
|
+
super(props);
|
|
8936
|
+
/**
|
|
8937
|
+
* Specifies whether at least one element must be selected
|
|
8938
|
+
*/
|
|
8939
|
+
this.mandatory = false;
|
|
8940
|
+
/**
|
|
8941
|
+
* Defines the maximum number of elements the list has
|
|
8942
|
+
*/
|
|
8943
|
+
this.max = undefined;
|
|
8944
|
+
/**
|
|
8945
|
+
* Defines how many elements of the list can be selected at the same time
|
|
8946
|
+
*/
|
|
8947
|
+
this.multiple = undefined;
|
|
8948
|
+
/**
|
|
8949
|
+
* Sets the active list-item inside the list-group
|
|
8950
|
+
*/
|
|
8951
|
+
this.value = undefined;
|
|
8952
|
+
this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
|
|
8953
|
+
this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
|
|
8954
|
+
this.max = this.getInitValue('max', props.max, this.max);
|
|
8955
|
+
this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
|
|
8956
|
+
this.value = this.getInitValue('value', props.value, this.value);
|
|
8957
|
+
this.createAccessors();
|
|
8958
|
+
}
|
|
8959
|
+
change(event, element) {
|
|
8960
|
+
this.callEvent('change', { event, element, component: this });
|
|
8961
|
+
}
|
|
8962
|
+
}
|
|
8963
|
+
|
|
8957
8964
|
/**
|
|
8958
8965
|
* Base class for SpeedDial component.
|
|
8959
8966
|
*/
|
|
@@ -9037,14 +9044,6 @@ class Steppers extends ComponentRender {
|
|
|
9037
9044
|
* Array of steppers items
|
|
9038
9045
|
*/
|
|
9039
9046
|
this.items = [];
|
|
9040
|
-
/**
|
|
9041
|
-
* Applies the dark theme variant to the stepper
|
|
9042
|
-
*/
|
|
9043
|
-
this.dark = false;
|
|
9044
|
-
/**
|
|
9045
|
-
* Applies the light theme variant to the stepper
|
|
9046
|
-
*/
|
|
9047
|
-
this.light = false;
|
|
9048
9047
|
/**
|
|
9049
9048
|
* Allow user to jump to any step
|
|
9050
9049
|
*/
|
|
@@ -9056,9 +9055,7 @@ class Steppers extends ComponentRender {
|
|
|
9056
9055
|
this.activeStep = this.getInitValue('activeStep', props.activeStep, this.activeStep);
|
|
9057
9056
|
this.altLabels = this.getInitValue('altLabels', props.altLabels, this.altLabels);
|
|
9058
9057
|
this.content = this.getInitValue('content', props.content, this.content);
|
|
9059
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
9060
9058
|
this.items = this.getInitValue('items', props.items, this.items);
|
|
9061
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
9062
9059
|
this.nonLinear = this.getInitValue('nonLinear', props.nonLinear, this.nonLinear);
|
|
9063
9060
|
this.vertical = this.getInitValue('vertical', props.vertical, this.vertical);
|
|
9064
9061
|
this.steps = this.getInitValue('steps', props.steps, this.steps);
|
|
@@ -9321,6 +9318,31 @@ class Tabs extends ComponentRender {
|
|
|
9321
9318
|
}
|
|
9322
9319
|
return tab;
|
|
9323
9320
|
}
|
|
9321
|
+
/**
|
|
9322
|
+
* Method for navigating to the next tab
|
|
9323
|
+
* @param loop Defines if want a loop navigation
|
|
9324
|
+
*/
|
|
9325
|
+
nextTab(loop = false) {
|
|
9326
|
+
if (loop) {
|
|
9327
|
+
this.activeTab = (this.activeTab + 1) % this.tabs.length;
|
|
9328
|
+
}
|
|
9329
|
+
else if (this.activeTab < this.tabs.length - 1) {
|
|
9330
|
+
this.activeTab += 1;
|
|
9331
|
+
}
|
|
9332
|
+
}
|
|
9333
|
+
/**
|
|
9334
|
+
* Method for navigating to the previous tab
|
|
9335
|
+
* @param loop Defines if want a loop navigation
|
|
9336
|
+
*/
|
|
9337
|
+
previousTab(loop = false) {
|
|
9338
|
+
if (loop) {
|
|
9339
|
+
const newTabIndex = (this.activeTab - 1) % this.tabs.length;
|
|
9340
|
+
this.activeTab = newTabIndex >= 0 ? newTabIndex : newTabIndex + this.tabs.length;
|
|
9341
|
+
}
|
|
9342
|
+
else if (this.activeTab > 0) {
|
|
9343
|
+
this.activeTab -= 1;
|
|
9344
|
+
}
|
|
9345
|
+
}
|
|
9324
9346
|
/**
|
|
9325
9347
|
* Triggered before tab is change.
|
|
9326
9348
|
* @param event DOM event
|
|
@@ -10617,6 +10639,12 @@ Icons.mdiIcons = {
|
|
|
10617
10639
|
tableColumns: 'mdi-table-headers-eye',
|
|
10618
10640
|
unfold: 'mdi-unfold-more-horizontal',
|
|
10619
10641
|
warning: 'mdi-exclamation',
|
|
10642
|
+
zoom: 'mdi-magnify-scan',
|
|
10643
|
+
zoomIn: 'mdi-plus-circle-outline',
|
|
10644
|
+
zoomPanning: 'mdi-hand-back-right-outline',
|
|
10645
|
+
zoomOut: 'mdi-minus-circle-outline',
|
|
10646
|
+
zoomReset: 'mdi-magnify-close',
|
|
10647
|
+
zoomSelection: 'mdi-magnify-scan',
|
|
10620
10648
|
};
|
|
10621
10649
|
Icons.faIcons = {
|
|
10622
10650
|
alertOctagon: 'fa fa-exclamation-circle',
|
|
@@ -10667,6 +10695,12 @@ Icons.faIcons = {
|
|
|
10667
10695
|
tableColumns: 'fa fa-columns',
|
|
10668
10696
|
unfold: 'fa fa-sort',
|
|
10669
10697
|
warning: 'fa fa-exclamation',
|
|
10698
|
+
zoom: 'fa fa-search',
|
|
10699
|
+
zoomIn: 'fa fa-search-plus',
|
|
10700
|
+
zoomPanning: 'fa fa-hand-paper',
|
|
10701
|
+
zoomOut: 'fa fa-search-minus',
|
|
10702
|
+
zoomReset: 'fa fa-undo',
|
|
10703
|
+
zoomSelection: 'fa fa-expand',
|
|
10670
10704
|
};
|
|
10671
10705
|
Icons.icons = (() => Icons.mdiIcons)();
|
|
10672
10706
|
|
|
@@ -10943,6 +10977,16 @@ WatchURL.watchers = {};
|
|
|
10943
10977
|
WatchURL.originalEvents = new Map();
|
|
10944
10978
|
|
|
10945
10979
|
class BaseReport {
|
|
10980
|
+
constructor() {
|
|
10981
|
+
this.expressionZeedhiToXls = {
|
|
10982
|
+
AVG: 'AVERAGE',
|
|
10983
|
+
COUNT: 'COUNTA',
|
|
10984
|
+
MAX: 'MAX',
|
|
10985
|
+
MIN: 'MIN',
|
|
10986
|
+
SUM: 'SUM',
|
|
10987
|
+
};
|
|
10988
|
+
this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
10989
|
+
}
|
|
10946
10990
|
buildColumns(columns) {
|
|
10947
10991
|
const widths = {};
|
|
10948
10992
|
let totalWidth;
|
|
@@ -11169,27 +11213,12 @@ class PDFReport extends BaseReport {
|
|
|
11169
11213
|
}
|
|
11170
11214
|
|
|
11171
11215
|
class XLSReport extends BaseReport {
|
|
11172
|
-
constructor(
|
|
11173
|
-
super();
|
|
11216
|
+
constructor() {
|
|
11217
|
+
super(...arguments);
|
|
11174
11218
|
this.route = '/generateXLS';
|
|
11175
|
-
this.expressionZeedhiToXls = {
|
|
11176
|
-
AVG: 'AVERAGE',
|
|
11177
|
-
COUNT: 'COUNTA',
|
|
11178
|
-
MAX: 'MAX',
|
|
11179
|
-
MIN: 'MIN',
|
|
11180
|
-
SUM: 'SUM',
|
|
11181
|
-
};
|
|
11182
|
-
this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
11183
|
-
this.type = type || 'xls';
|
|
11184
11219
|
}
|
|
11185
|
-
buildDataset(data, columns
|
|
11186
|
-
|
|
11187
|
-
if (this.type === 'xls') {
|
|
11188
|
-
result = this.formatRawDataSet(data, columns);
|
|
11189
|
-
}
|
|
11190
|
-
else if (metadata) {
|
|
11191
|
-
result = this.formatDataSet(metadata, data);
|
|
11192
|
-
}
|
|
11220
|
+
buildDataset(data, columns) {
|
|
11221
|
+
const result = this.formatRawDataSet(data, columns);
|
|
11193
11222
|
return JSON.stringify(result);
|
|
11194
11223
|
}
|
|
11195
11224
|
// formata o dataset para o formato "cru" xls
|
|
@@ -11233,27 +11262,55 @@ class XLSReport extends BaseReport {
|
|
|
11233
11262
|
};
|
|
11234
11263
|
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11235
11264
|
}
|
|
11236
|
-
|
|
11237
|
-
|
|
11265
|
+
}
|
|
11266
|
+
|
|
11267
|
+
// XLS with groups
|
|
11268
|
+
class XLS2Report extends BaseReport {
|
|
11269
|
+
constructor() {
|
|
11270
|
+
super(...arguments);
|
|
11271
|
+
this.route = '/generateXLS';
|
|
11238
11272
|
}
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11273
|
+
buildDataset(data, metadata) {
|
|
11274
|
+
const result = this.formatDataSet(metadata, data);
|
|
11275
|
+
return JSON.stringify(result);
|
|
11276
|
+
}
|
|
11277
|
+
buildMetadata(name, title, columns, filter) {
|
|
11278
|
+
const builtCols = this.buildColumns(columns);
|
|
11279
|
+
const builtFilters = this.buildFilter(filter || {});
|
|
11280
|
+
const lang = this.formatLangCode(I18n.instance.language);
|
|
11281
|
+
const clientLogo = '';
|
|
11282
|
+
const enterpriseLogo = '';
|
|
11283
|
+
const productLogo = '';
|
|
11284
|
+
const metadataObj = {
|
|
11285
|
+
name,
|
|
11286
|
+
title,
|
|
11287
|
+
lang,
|
|
11288
|
+
clientLogo,
|
|
11289
|
+
enterpriseLogo,
|
|
11290
|
+
productLogo,
|
|
11291
|
+
version: '1.0',
|
|
11292
|
+
words: {
|
|
11293
|
+
Page: I18n.translate('PAGE'),
|
|
11294
|
+
Report: I18n.translate('REPORT'),
|
|
11295
|
+
Version: I18n.translate('VERSION'),
|
|
11296
|
+
},
|
|
11297
|
+
staticData: {},
|
|
11298
|
+
groups: [],
|
|
11299
|
+
reportName: name,
|
|
11300
|
+
widgetLabel: title,
|
|
11301
|
+
orientation: 'PORTRAIT',
|
|
11302
|
+
columns: builtCols,
|
|
11303
|
+
filter: builtFilters,
|
|
11304
|
+
reportXLS: true,
|
|
11305
|
+
xlsMergedCell: [],
|
|
11306
|
+
};
|
|
11307
|
+
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11252
11308
|
}
|
|
11253
11309
|
// Ordenar o nome das colunas de acordo com seu index, e sempre deixando as colunas agrupadas nas primeiras posições
|
|
11254
11310
|
getColumnsName(columns, metaData, lengthGroup) {
|
|
11255
11311
|
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11256
11312
|
let columnsName = [];
|
|
11313
|
+
const columnsGroupName = [];
|
|
11257
11314
|
Object.entries(columns).forEach((row) => {
|
|
11258
11315
|
const columnName = row[0];
|
|
11259
11316
|
const index = row[1].sequence;
|
|
@@ -11261,25 +11318,21 @@ class XLSReport extends BaseReport {
|
|
|
11261
11318
|
columnsName[index + lengthGroup] = columnName;
|
|
11262
11319
|
}
|
|
11263
11320
|
else {
|
|
11264
|
-
|
|
11321
|
+
columnsGroupName.push(columnName);
|
|
11265
11322
|
}
|
|
11266
11323
|
});
|
|
11324
|
+
columnsName = columnsGroupName.concat(columnsName);
|
|
11267
11325
|
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11268
11326
|
return columnsName;
|
|
11269
11327
|
}
|
|
11270
11328
|
// Inicializa alguns valores auxiliares
|
|
11271
|
-
initVars(metaData
|
|
11329
|
+
initVars(metaData) {
|
|
11272
11330
|
metaData.xlsMergedCell = [];
|
|
11273
11331
|
const { columns } = metaData;
|
|
11274
11332
|
const lengthGroup = metaData.groups.length;
|
|
11275
11333
|
const indexLastGroup = lengthGroup - 1;
|
|
11276
11334
|
let columnsName = [];
|
|
11277
|
-
|
|
11278
|
-
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11279
|
-
}
|
|
11280
|
-
else {
|
|
11281
|
-
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11282
|
-
}
|
|
11335
|
+
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11283
11336
|
const rowValues = [];
|
|
11284
11337
|
const formatedDataSet = [];
|
|
11285
11338
|
const groups = [];
|
|
@@ -11289,33 +11342,6 @@ class XLSReport extends BaseReport {
|
|
|
11289
11342
|
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11290
11343
|
};
|
|
11291
11344
|
}
|
|
11292
|
-
// formata a linha do grupo de acordo com o formato xls3
|
|
11293
|
-
setRowGroupFormat3(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11294
|
-
let rowValues = rowValuesParam;
|
|
11295
|
-
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11296
|
-
const index = row.groupIndex;
|
|
11297
|
-
if (row.groupHeader) {
|
|
11298
|
-
rowValues[index] = label;
|
|
11299
|
-
groups[index] = { init: null, end: null };
|
|
11300
|
-
formatedDataSet.push(rowValues);
|
|
11301
|
-
rowValues = [];
|
|
11302
|
-
}
|
|
11303
|
-
else if (row.groupFooter) {
|
|
11304
|
-
if (!row.groupLabel) {
|
|
11305
|
-
rowValues.push('Total');
|
|
11306
|
-
}
|
|
11307
|
-
else {
|
|
11308
|
-
rowValues.push(`Total (${label})`);
|
|
11309
|
-
}
|
|
11310
|
-
formatedDataSet.push(rowValues);
|
|
11311
|
-
rowValues = [];
|
|
11312
|
-
const funcXls = null;
|
|
11313
|
-
columnsName.forEach((column) => {
|
|
11314
|
-
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11315
|
-
});
|
|
11316
|
-
}
|
|
11317
|
-
return rowValues;
|
|
11318
|
-
}
|
|
11319
11345
|
// formata as expressões da linha
|
|
11320
11346
|
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11321
11347
|
let funcXls = funcXlsParam;
|
|
@@ -11414,18 +11440,199 @@ class XLSReport extends BaseReport {
|
|
|
11414
11440
|
});
|
|
11415
11441
|
}
|
|
11416
11442
|
formatDataSet(metaData, dataSet) {
|
|
11417
|
-
const initVars = this.initVars(metaData
|
|
11443
|
+
const initVars = this.initVars(metaData);
|
|
11418
11444
|
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
11419
11445
|
let { rowValues } = initVars;
|
|
11420
11446
|
dataSet.forEach((row) => {
|
|
11421
11447
|
if (row.group || row.groupFooter) {
|
|
11422
|
-
|
|
11423
|
-
|
|
11448
|
+
rowValues = this.setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11449
|
+
}
|
|
11450
|
+
else {
|
|
11451
|
+
this.setIndexGroups(groups, formatedDataSet);
|
|
11452
|
+
this.setRowNormal(columnsName, rowValues, row);
|
|
11453
|
+
}
|
|
11454
|
+
if (!row.groupHeader) {
|
|
11455
|
+
formatedDataSet.push(rowValues);
|
|
11456
|
+
}
|
|
11457
|
+
rowValues = [];
|
|
11458
|
+
});
|
|
11459
|
+
return [columnsName].concat(formatedDataSet);
|
|
11460
|
+
}
|
|
11461
|
+
}
|
|
11462
|
+
|
|
11463
|
+
// Grid mirror (with groups)
|
|
11464
|
+
class XLS3Report extends BaseReport {
|
|
11465
|
+
constructor() {
|
|
11466
|
+
super(...arguments);
|
|
11467
|
+
this.route = '/generateXLS';
|
|
11468
|
+
}
|
|
11469
|
+
buildDataset(data, metadata) {
|
|
11470
|
+
const result = this.formatDataSet(metadata, data);
|
|
11471
|
+
return JSON.stringify(result);
|
|
11472
|
+
}
|
|
11473
|
+
buildMetadata(name, title, columns, filter) {
|
|
11474
|
+
const builtCols = this.buildColumns(columns);
|
|
11475
|
+
const builtFilters = this.buildFilter(filter || {});
|
|
11476
|
+
const lang = this.formatLangCode(I18n.instance.language);
|
|
11477
|
+
const clientLogo = '';
|
|
11478
|
+
const enterpriseLogo = '';
|
|
11479
|
+
const productLogo = '';
|
|
11480
|
+
const metadataObj = {
|
|
11481
|
+
name,
|
|
11482
|
+
title,
|
|
11483
|
+
lang,
|
|
11484
|
+
clientLogo,
|
|
11485
|
+
enterpriseLogo,
|
|
11486
|
+
productLogo,
|
|
11487
|
+
version: '1.0',
|
|
11488
|
+
words: {
|
|
11489
|
+
Page: I18n.translate('PAGE'),
|
|
11490
|
+
Report: I18n.translate('REPORT'),
|
|
11491
|
+
Version: I18n.translate('VERSION'),
|
|
11492
|
+
},
|
|
11493
|
+
staticData: {},
|
|
11494
|
+
groups: [],
|
|
11495
|
+
reportName: name,
|
|
11496
|
+
widgetLabel: title,
|
|
11497
|
+
orientation: 'PORTRAIT',
|
|
11498
|
+
columns: builtCols,
|
|
11499
|
+
filter: builtFilters,
|
|
11500
|
+
reportXLS: true,
|
|
11501
|
+
xlsMergedCell: [],
|
|
11502
|
+
};
|
|
11503
|
+
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11504
|
+
}
|
|
11505
|
+
// Ordenar o nome das colunas de acordo com seu index, excluindo o nome das colunas agrupadas
|
|
11506
|
+
getColumnsNameFormat3(columns, metaData) {
|
|
11507
|
+
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11508
|
+
let columnsName = [];
|
|
11509
|
+
Object.entries(columns).forEach((row) => {
|
|
11510
|
+
const columnName = row[0];
|
|
11511
|
+
if (columnsNameGroup.indexOf(columnName) === -1) {
|
|
11512
|
+
const index = row[1].sequence;
|
|
11513
|
+
columnsName[index] = columnName;
|
|
11514
|
+
}
|
|
11515
|
+
});
|
|
11516
|
+
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11517
|
+
return columnsName;
|
|
11518
|
+
}
|
|
11519
|
+
// Inicializa alguns valores auxiliares
|
|
11520
|
+
initVars(metaData) {
|
|
11521
|
+
metaData.xlsMergedCell = [];
|
|
11522
|
+
const { columns } = metaData;
|
|
11523
|
+
const lengthGroup = metaData.groups.length;
|
|
11524
|
+
const indexLastGroup = lengthGroup - 1;
|
|
11525
|
+
let columnsName = [];
|
|
11526
|
+
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11527
|
+
const rowValues = [];
|
|
11528
|
+
const formatedDataSet = [];
|
|
11529
|
+
const groups = [];
|
|
11530
|
+
groups.groupEnd = {};
|
|
11531
|
+
groups.groupEnd.cellsfunc = {};
|
|
11532
|
+
return {
|
|
11533
|
+
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11534
|
+
};
|
|
11535
|
+
}
|
|
11536
|
+
// formata a linha do grupo de acordo com o formato xls3
|
|
11537
|
+
setRowGroupFormat(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11538
|
+
let rowValues = rowValuesParam;
|
|
11539
|
+
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11540
|
+
const index = row.groupIndex;
|
|
11541
|
+
if (row.groupHeader) {
|
|
11542
|
+
rowValues[index] = label;
|
|
11543
|
+
groups[index] = { init: null, end: null };
|
|
11544
|
+
formatedDataSet.push(rowValues);
|
|
11545
|
+
rowValues = [];
|
|
11546
|
+
}
|
|
11547
|
+
else if (row.groupFooter) {
|
|
11548
|
+
if (!row.groupLabel) {
|
|
11549
|
+
rowValues.push('Total');
|
|
11550
|
+
}
|
|
11551
|
+
else {
|
|
11552
|
+
rowValues.push(`Total (${label})`);
|
|
11553
|
+
}
|
|
11554
|
+
formatedDataSet.push(rowValues);
|
|
11555
|
+
rowValues = [];
|
|
11556
|
+
const funcXls = null;
|
|
11557
|
+
columnsName.forEach((column) => {
|
|
11558
|
+
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11559
|
+
});
|
|
11560
|
+
}
|
|
11561
|
+
return rowValues;
|
|
11562
|
+
}
|
|
11563
|
+
// formata as expressões da linha
|
|
11564
|
+
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11565
|
+
let funcXls = funcXlsParam;
|
|
11566
|
+
if ((row[column] === 0 || row[column]) && index !== undefined) {
|
|
11567
|
+
const letter = this.colunmXLS[rowValues.length];
|
|
11568
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11569
|
+
const cellsfunc = `${letter + groups[index].init}:${letter}${groups[index].end}`;
|
|
11570
|
+
let expression = '';
|
|
11571
|
+
if (indexLastGroup === index) {
|
|
11572
|
+
expression = `=${funcXls}(${cellsfunc})`;
|
|
11573
|
+
}
|
|
11574
|
+
else {
|
|
11575
|
+
expression = `=${funcXls}(${groups[index].cellsfunc[column]})`;
|
|
11576
|
+
if (index === 0) {
|
|
11577
|
+
if (groups.groupEnd.cellsfunc[column]) {
|
|
11578
|
+
groups.groupEnd.cellsfunc[column] += `,${groups[index].cellsfunc[column]}`;
|
|
11579
|
+
}
|
|
11580
|
+
else {
|
|
11581
|
+
groups.groupEnd.cellsfunc[column] = groups[index].cellsfunc[column];
|
|
11582
|
+
}
|
|
11424
11583
|
}
|
|
11425
|
-
|
|
11426
|
-
|
|
11584
|
+
groups[index].cellsfunc[column] = null;
|
|
11585
|
+
}
|
|
11586
|
+
rowValues.push(expression);
|
|
11587
|
+
groups.forEach((group, indexGroup) => {
|
|
11588
|
+
if (indexGroup !== indexLastGroup) {
|
|
11589
|
+
if (!group.cellsfunc) {
|
|
11590
|
+
group.cellsfunc = {};
|
|
11591
|
+
}
|
|
11592
|
+
if (group.cellsfunc[column]) {
|
|
11593
|
+
group.cellsfunc[column] += `,${cellsfunc}`;
|
|
11594
|
+
}
|
|
11595
|
+
else {
|
|
11596
|
+
group.cellsfunc[column] = cellsfunc;
|
|
11597
|
+
}
|
|
11598
|
+
}
|
|
11599
|
+
});
|
|
11600
|
+
}
|
|
11601
|
+
else {
|
|
11602
|
+
let cell = row[column];
|
|
11603
|
+
if (row.groupSummary) {
|
|
11604
|
+
const groupEndFunc = groups.groupEnd.cellsfunc;
|
|
11605
|
+
if (groupEndFunc[column]) {
|
|
11606
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11607
|
+
cell = `=${funcXls}(${groupEndFunc[column]})`;
|
|
11427
11608
|
}
|
|
11428
11609
|
}
|
|
11610
|
+
rowValues.push(cell);
|
|
11611
|
+
}
|
|
11612
|
+
}
|
|
11613
|
+
// Defina o index dos grupos
|
|
11614
|
+
setIndexGroups(groups, formatedDataSet) {
|
|
11615
|
+
groups.forEach((group) => {
|
|
11616
|
+
if (!group.init) {
|
|
11617
|
+
group.init = formatedDataSet.length + 2;
|
|
11618
|
+
}
|
|
11619
|
+
group.end = formatedDataSet.length + 2;
|
|
11620
|
+
});
|
|
11621
|
+
}
|
|
11622
|
+
// Preenche uma linha "normal"
|
|
11623
|
+
setRowNormal(columnsName, rowValues, row) {
|
|
11624
|
+
columnsName.forEach((column) => {
|
|
11625
|
+
rowValues.push(row[column]);
|
|
11626
|
+
});
|
|
11627
|
+
}
|
|
11628
|
+
formatDataSet(metaData, dataSet) {
|
|
11629
|
+
const initVars = this.initVars(metaData);
|
|
11630
|
+
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
11631
|
+
let { rowValues } = initVars;
|
|
11632
|
+
dataSet.forEach((row) => {
|
|
11633
|
+
if (row.group || row.groupFooter) {
|
|
11634
|
+
rowValues = this.setRowGroupFormat(row, rowValues, groups, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11635
|
+
}
|
|
11429
11636
|
else {
|
|
11430
11637
|
this.setIndexGroups(groups, formatedDataSet);
|
|
11431
11638
|
this.setRowNormal(columnsName, rowValues, row);
|
|
@@ -11472,8 +11679,14 @@ class Report {
|
|
|
11472
11679
|
if (type === 'pdf') {
|
|
11473
11680
|
return new PDFReport();
|
|
11474
11681
|
}
|
|
11475
|
-
if (type === 'xls'
|
|
11476
|
-
return new XLSReport(
|
|
11682
|
+
if (type === 'xls') {
|
|
11683
|
+
return new XLSReport();
|
|
11684
|
+
}
|
|
11685
|
+
if (type === 'xls2') {
|
|
11686
|
+
return new XLS2Report();
|
|
11687
|
+
}
|
|
11688
|
+
if (type === 'xls3') {
|
|
11689
|
+
return new XLS3Report();
|
|
11477
11690
|
}
|
|
11478
11691
|
throw new Error(`Invalid report type: ${type}`);
|
|
11479
11692
|
}
|
|
@@ -11492,10 +11705,10 @@ class Report {
|
|
|
11492
11705
|
const formattedColumns = this.removeActionColumns(columns);
|
|
11493
11706
|
const metadataObj = yield reportType.buildMetadata(name, this.title, formattedColumns, datasource.filter, portrait);
|
|
11494
11707
|
let dataset;
|
|
11495
|
-
if ((reportType
|
|
11708
|
+
if ((reportType instanceof XLS2Report || reportType instanceof XLS3Report) && groupedData) {
|
|
11496
11709
|
const rowMetadata = rowObj.metaData;
|
|
11497
11710
|
const metadataObjClone = merge(rowMetadata, JSON.parse(metadataObj));
|
|
11498
|
-
dataset = reportType.buildDataset(groupedData,
|
|
11711
|
+
dataset = reportType.buildDataset(groupedData, metadataObjClone);
|
|
11499
11712
|
}
|
|
11500
11713
|
else {
|
|
11501
11714
|
dataset = reportType.buildDataset(data, formattedColumns);
|
|
@@ -11538,4 +11751,4 @@ class Report {
|
|
|
11538
11751
|
|
|
11539
11752
|
const AutoNumeric = require('@zeedhi/autonumeric/dist/autoNumeric');
|
|
11540
11753
|
|
|
11541
|
-
export { Alert, AlertService, ApexChart, AutoNumeric, Badge, Breadcrumbs, Button, ButtonGroup, CSVReport, Card, Carousel, Checkbox, CheckboxMultiple, ChildNotFoundError, Chip, CodeEditor, Col, CollapseCard, Column, Component, ComponentRender, Container, Currency, Dashboard, Date$1 as Date, DateRange, Dialog, DialogService, Divider, Dropdown, FileInput, Footer, Form, Frame, FramePage, Grid, GridColumn, GridColumnEditable, GridEditable, Header, Icon, Icons, Image, Increment, Input, Iterable, IterableColumnsButton, IterableColumnsButtonController, IterablePageComponent, IterablePageInfo, IterablePageSize, IterablePagination, List, ListGroup, ListItem, Loading, LoadingService, Login, LoginButton, MasterDetail, Menu, MenuButton, MenuGroup, MenuLink, MenuSeparator, Modal, ModalCloseButton, ModalService, Month, Number$1 as Number, PDFReport, Password, Progress, Radio, RangeSlider, Report, Row, Search, Select, SelectMultiple, SelectTree, SelectTreeMultiple, SpeedDial, Steppers, SvgMap, Switch, Tab, Table, Tabs, Tag, Text, TextInput, Textarea, Time, Toggleable, Tooltip, Tree, TreeDataStructure, TreeGrid, TreeGridEditable, WatchURL, XLSReport, initTheme };
|
|
11754
|
+
export { Alert, AlertService, ApexChart, AutoNumeric, Badge, Breadcrumbs, Button, ButtonGroup, CSVReport, Card, Carousel, Checkbox, CheckboxMultiple, ChildNotFoundError, Chip, CodeEditor, Col, CollapseCard, Column, Component, ComponentRender, Container, Currency, Dashboard, Date$1 as Date, DateRange, Dialog, DialogService, Divider, Dropdown, FileInput, Footer, Form, Frame, FramePage, Grid, GridColumn, GridColumnEditable, GridEditable, Header, Icon, Icons, Image, Increment, Input, Iterable, IterableColumnsButton, IterableColumnsButtonController, IterablePageComponent, IterablePageInfo, IterablePageSize, IterablePagination, List, ListGroup, ListItem, Loading, LoadingService, Login, LoginButton, MasterDetail, Menu, MenuButton, MenuGroup, MenuLink, MenuSeparator, Modal, ModalCloseButton, ModalService, Month, Number$1 as Number, PDFReport, Password, Progress, Radio, RangeSlider, Report, Row, Search, Select, SelectMultiple, SelectTree, SelectTreeMultiple, SelectableList, SpeedDial, Steppers, SvgMap, Switch, Tab, Table, Tabs, Tag, Text, TextInput, Textarea, Time, Toggleable, Tooltip, Tree, TreeDataStructure, TreeGrid, TreeGridEditable, WatchURL, XLS2Report, XLS3Report, XLSReport, initTheme };
|