@zeedhi/common 1.39.1 → 1.43.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 +868 -251
- package/dist/zd-common.umd.js +873 -253
- 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 +163 -1
- package/types/components/zd-apex-chart/interfaces.d.ts +35 -3
- 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 +10 -8
- package/types/components/zd-carousel/interfaces.d.ts +2 -2
- package/types/components/zd-code-editor/code-editor.d.ts +5 -1
- package/types/components/zd-code-editor/interfaces.d.ts +2 -1
- package/types/components/zd-component/component.d.ts +8 -0
- package/types/components/zd-component/interfaces.d.ts +2 -0
- package/types/components/zd-container/container.d.ts +12 -0
- package/types/components/zd-container/interfaces.d.ts +3 -0
- package/types/components/zd-date/date-range.d.ts +1 -5
- package/types/components/zd-dialog/dialog.d.ts +11 -0
- package/types/components/zd-dialog/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-dropdown/dropdown.d.ts +4 -0
- package/types/components/zd-dropdown/interfaces.d.ts +1 -0
- 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 +14 -1
- package/types/components/zd-form/interfaces.d.ts +1 -0
- package/types/components/zd-frame/frame.d.ts +4 -0
- package/types/components/zd-frame/interfaces.d.ts +3 -0
- package/types/components/zd-grid/grid-column.d.ts +2 -0
- package/types/components/zd-grid/grid-editable.d.ts +11 -1
- 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 +3 -2
- package/types/components/zd-list/list.d.ts +12 -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/interfaces.d.ts +1 -0
- package/types/components/zd-tabs/tabs.d.ts +14 -0
- package/types/components/zd-tree-grid/tree-grid-editable.d.ts +3 -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/types/utils/themes/themes.d.ts +4 -0
package/dist/zd-common.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('lodash.
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'lodash.
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/common"] = {}, global.core, global.
|
|
5
|
-
})(this, (function (exports, core, debounce, isUndefined,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@zeedhi/core'), require('lodash.merge'), require('lodash.debounce'), require('lodash.isundefined'), require('lodash.set')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@zeedhi/core', 'lodash.merge', 'lodash.debounce', 'lodash.isundefined', 'lodash.set'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@zeedhi/common"] = {}, global.core, global.merge, global.debounce, global.isUndefined, global.set));
|
|
5
|
+
})(this, (function (exports, core, merge, debounce, isUndefined, set) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
+
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
9
10
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
10
11
|
var isUndefined__default = /*#__PURE__*/_interopDefaultLegacy(isUndefined);
|
|
11
|
-
var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
|
|
12
12
|
var set__default = /*#__PURE__*/_interopDefaultLegacy(set);
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -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);
|
|
@@ -417,8 +431,43 @@
|
|
|
417
431
|
* Defines the load progress color
|
|
418
432
|
*/
|
|
419
433
|
this.loadColor = 'primary';
|
|
434
|
+
this.defaultOptions = {
|
|
435
|
+
chart: {
|
|
436
|
+
toolbar: {
|
|
437
|
+
tools: {
|
|
438
|
+
download: 'fileDownload',
|
|
439
|
+
selection: 'zoomSelection',
|
|
440
|
+
zoom: 'zoom',
|
|
441
|
+
zoomin: 'zoomIn',
|
|
442
|
+
zoomout: 'zoomOut',
|
|
443
|
+
pan: 'zoomPanning',
|
|
444
|
+
reset: 'zoomReset',
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
events: {
|
|
448
|
+
animationEnd: this.animationEndEvent.bind(this),
|
|
449
|
+
beforeMount: this.beforeMountEvent.bind(this),
|
|
450
|
+
mounted: this.mountedEvent.bind(this),
|
|
451
|
+
updated: this.updatedEvent.bind(this),
|
|
452
|
+
click: this.clickEvent.bind(this),
|
|
453
|
+
mouseMove: this.mouseMoveEvent.bind(this),
|
|
454
|
+
mouseLeave: this.mouseLeaveEvent.bind(this),
|
|
455
|
+
legendClick: this.legendClickEvent.bind(this),
|
|
456
|
+
markerClick: this.markerClickEvent.bind(this),
|
|
457
|
+
selection: this.selectionEvent.bind(this),
|
|
458
|
+
dataPointSelection: this.dataPointSelectionEvent.bind(this),
|
|
459
|
+
dataPointMouseEnter: this.dataPointMouseEnterEvent.bind(this),
|
|
460
|
+
dataPointMouseLeave: this.dataPointMouseLeaveEvent.bind(this),
|
|
461
|
+
beforeZoom: this.beforeZoomEvent.bind(this),
|
|
462
|
+
beforeResetZoom: this.beforeResetZoomEvent.bind(this),
|
|
463
|
+
zoomed: this.zoomedEvent.bind(this),
|
|
464
|
+
scrolled: this.scrolledEvent.bind(this),
|
|
465
|
+
brushScrolled: this.brushScrolledEvent.bind(this),
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
};
|
|
420
469
|
this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
|
|
421
|
-
this.options = this.getInitValue('options', props.options, this.options);
|
|
470
|
+
this.options = merge__default["default"](this.defaultOptions, this.getInitValue('options', props.options, this.options));
|
|
422
471
|
this.series = this.getInitValue('series', props.series, this.series);
|
|
423
472
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
424
473
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
@@ -435,6 +484,14 @@
|
|
|
435
484
|
setViewUpdate(viewUpdate) {
|
|
436
485
|
this.viewUpdate = viewUpdate;
|
|
437
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Sets view get icon HTML method.
|
|
489
|
+
* @param viewGetIconHTML Update method
|
|
490
|
+
*/
|
|
491
|
+
setViewGetIconHTML(viewGetIconHTML) {
|
|
492
|
+
this.viewGetIconHTML = viewGetIconHTML;
|
|
493
|
+
this.updateToolbarIcons();
|
|
494
|
+
}
|
|
438
495
|
/**
|
|
439
496
|
* Update the chart
|
|
440
497
|
* @param options New options
|
|
@@ -449,6 +506,249 @@
|
|
|
449
506
|
}
|
|
450
507
|
return Promise.resolve();
|
|
451
508
|
}
|
|
509
|
+
/**
|
|
510
|
+
* Fires when the chart’s initial animation is finished
|
|
511
|
+
* @param chartContext
|
|
512
|
+
* @param config
|
|
513
|
+
* @param element DOM Element
|
|
514
|
+
*/
|
|
515
|
+
animationEndEvent(chartContext, options) {
|
|
516
|
+
this.callEvent('chartAnimationEnd', { component: this, chartContext, options });
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Fires before the chart has been drawn on screen
|
|
520
|
+
* @param chartContext
|
|
521
|
+
* @param config
|
|
522
|
+
* @param element DOM Element
|
|
523
|
+
*/
|
|
524
|
+
beforeMountEvent(chartContext, config) {
|
|
525
|
+
this.callEvent('chartBeforeMount', {
|
|
526
|
+
component: this, chartContext, config,
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Fires after the chart has been drawn on screen
|
|
531
|
+
* @param chartContext
|
|
532
|
+
* @param config
|
|
533
|
+
* @param element DOM Element
|
|
534
|
+
*/
|
|
535
|
+
mountedEvent(chartContext, config) {
|
|
536
|
+
this.callEvent('chartMounted', {
|
|
537
|
+
component: this, chartContext, config,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Fires when the chart has been dynamically updated either with
|
|
542
|
+
* updateOptions() or updateSeries() functions
|
|
543
|
+
* @param chartContext
|
|
544
|
+
* @param config
|
|
545
|
+
* @param element DOM Element
|
|
546
|
+
*/
|
|
547
|
+
updatedEvent(chartContext, config) {
|
|
548
|
+
this.callEvent('chartUpdated', {
|
|
549
|
+
component: this, chartContext, config,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Fires when the chart has been dynamically updated either with
|
|
554
|
+
* updateOptions() or updateSeries() functions
|
|
555
|
+
* @param event Event that triggered the click event
|
|
556
|
+
* @param chartContext
|
|
557
|
+
* @param config
|
|
558
|
+
* @param element DOM Element
|
|
559
|
+
*/
|
|
560
|
+
clickEvent(event, chartContext, config) {
|
|
561
|
+
this.callEvent('chartClick', {
|
|
562
|
+
event, component: this, chartContext, config,
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Fires when user moves mouse on any area of the chart.
|
|
567
|
+
* @param event Event that triggered the click event
|
|
568
|
+
* @param chartContext
|
|
569
|
+
* @param config
|
|
570
|
+
* @param element DOM Element
|
|
571
|
+
*/
|
|
572
|
+
mouseMoveEvent(event, chartContext, config) {
|
|
573
|
+
this.callEvent('chartMouseMove', {
|
|
574
|
+
event, component: this, chartContext, config,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Fires when user moves mouse on any area of the chart.
|
|
579
|
+
* @param event Event that triggered the mouse leave
|
|
580
|
+
* @param chartContext
|
|
581
|
+
* @param config New config
|
|
582
|
+
* @param element DOM Element
|
|
583
|
+
*/
|
|
584
|
+
mouseLeaveEvent(event, chartContext, config) {
|
|
585
|
+
this.callEvent('chartMouseLeave', {
|
|
586
|
+
event, component: this, chartContext, config,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Fires when user moves mouse on any area of the chart.
|
|
591
|
+
* @param chartContext
|
|
592
|
+
* @param seriesIndex
|
|
593
|
+
* @param config
|
|
594
|
+
* @param element DOM Element
|
|
595
|
+
*/
|
|
596
|
+
legendClickEvent(chartContext, seriesIndex, config) {
|
|
597
|
+
this.callEvent('chartLegendClick', {
|
|
598
|
+
component: this, chartContext, seriesIndex, config,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Fires when user moves mouse on any area of the chart.
|
|
603
|
+
* @param event Event that triggered the marker click
|
|
604
|
+
* @param chartContext
|
|
605
|
+
* @param option New config
|
|
606
|
+
* @param element DOM Element
|
|
607
|
+
*/
|
|
608
|
+
markerClickEvent(event, chartContext, config) {
|
|
609
|
+
this.callEvent('chartMarkerClick', {
|
|
610
|
+
event, component: this, chartContext, config,
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Fires when user selects rect using the selection tool.
|
|
615
|
+
* The second argument
|
|
616
|
+
* @param chartContext
|
|
617
|
+
* @param config contains the yaxis and xaxis coordinates where user made the selection
|
|
618
|
+
* @param element DOM Element
|
|
619
|
+
*/
|
|
620
|
+
selectionEvent(chartContext, config) {
|
|
621
|
+
this.callEvent('chartSelection', {
|
|
622
|
+
component: this, chartContext, config,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Fires when user clicks on a datapoint (bar/column/marker/bubble/donut-slice).
|
|
627
|
+
* @param event Event that triggered when user clicks on a datapoint
|
|
628
|
+
* @param chartContext
|
|
629
|
+
* @param config The config object, also includes additional information like
|
|
630
|
+
* which dataPointIndex was selected of which series.
|
|
631
|
+
* @param element DOM Element
|
|
632
|
+
*/
|
|
633
|
+
dataPointSelectionEvent(event, chartContext, config) {
|
|
634
|
+
this.callEvent('chartDataPointSelection', {
|
|
635
|
+
event, component: this, chartContext, config,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Fires when user clicks on a datapoint (bar/column/marker/bubble/donut-slice).
|
|
640
|
+
* @param event Event that triggered when user’s mouse enter on a datapoint
|
|
641
|
+
* @param chartContext
|
|
642
|
+
* @param config The config object, also includes additional information like
|
|
643
|
+
* which dataPointIndex was hovered of particular series.
|
|
644
|
+
* @param element DOM Element
|
|
645
|
+
*/
|
|
646
|
+
dataPointMouseEnterEvent(event, chartContext, config) {
|
|
647
|
+
this.callEvent('chartDataPointMouseEnter', {
|
|
648
|
+
event, component: this, chartContext, config,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* MouseLeave event for a datapoint (bar/column/marker/bubble/donut-slice).
|
|
653
|
+
* @param event Event that triggered the beforeSlide event
|
|
654
|
+
* @param chartContext
|
|
655
|
+
* @param config
|
|
656
|
+
* @param element DOM Element
|
|
657
|
+
*/
|
|
658
|
+
dataPointMouseLeaveEvent(event, chartContext, config) {
|
|
659
|
+
this.callEvent('chartDataPointMouseLeave', {
|
|
660
|
+
event, component: this, chartContext, config,
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* This function, if defined, runs just before zooming in/out of the chart
|
|
665
|
+
* allowing you to set a custom range for zooming in/out.
|
|
666
|
+
* @param chartContext
|
|
667
|
+
* @param config { min: timestamp, max: timestamp }
|
|
668
|
+
* @param element DOM Element
|
|
669
|
+
*/
|
|
670
|
+
beforeZoomEvent(chartContext, config) {
|
|
671
|
+
this.callEvent('chartBeforeZoom', {
|
|
672
|
+
component: this, chartContext, config,
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* This function, if defined, runs just before the user hits the HOME button
|
|
677
|
+
* on the toolbar to reset the chart to it’s original state. The function
|
|
678
|
+
* allows you to set a custom axes range for the initial view of the chart.
|
|
679
|
+
* @param chartContext
|
|
680
|
+
* @param config { min: timestamp, max: timestamp }
|
|
681
|
+
* @param element DOM Element
|
|
682
|
+
*/
|
|
683
|
+
beforeResetZoomEvent(chartContext, config) {
|
|
684
|
+
this.callEvent('chartBeforeResetZoom', {
|
|
685
|
+
component: this, chartContext, config,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Fires when user zooms in/out the chart using either the selection zooming
|
|
690
|
+
* tool or zoom in/out buttons.
|
|
691
|
+
* The 2nd argument includes information of the new xaxis/yaxis generated after zooming.
|
|
692
|
+
* @param chartContext
|
|
693
|
+
* @param config { min: timestamp, max: timestamp }
|
|
694
|
+
* @param element DOM Element
|
|
695
|
+
*/
|
|
696
|
+
zoomedEvent(chartContext, config) {
|
|
697
|
+
this.callEvent('chartZoomed', {
|
|
698
|
+
component: this, chartContext, config,
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Fires when user scrolls using the pan tool.
|
|
703
|
+
* The 2nd argument includes information of the new xaxis generated after scrolling.
|
|
704
|
+
* @param chartContext
|
|
705
|
+
* @param config { xaxis: any }
|
|
706
|
+
* @param element DOM Element
|
|
707
|
+
*/
|
|
708
|
+
scrolledEvent(chartContext, config) {
|
|
709
|
+
this.callEvent('chartScrolled', {
|
|
710
|
+
component: this, chartContext, config,
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Fires when user drags the brush in a brush chart.
|
|
715
|
+
* The 2nd argument includes information of the new axes generated after
|
|
716
|
+
* scrolling the brush.
|
|
717
|
+
* @param chartContext
|
|
718
|
+
* @param config { xaxis: any, yaxis: any }
|
|
719
|
+
* @param element DOM Element
|
|
720
|
+
*/
|
|
721
|
+
brushScrolledEvent(chartContext, config) {
|
|
722
|
+
this.callEvent('chartBrushScrolled', {
|
|
723
|
+
component: this, chartContext, config,
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
updateToolbarIcons() {
|
|
727
|
+
var _a, _b, _c;
|
|
728
|
+
if (!this.viewGetIconHTML)
|
|
729
|
+
return this.options;
|
|
730
|
+
const getIconFn = this.viewGetIconHTML;
|
|
731
|
+
let changed = false;
|
|
732
|
+
const newOptions = Object.assign({}, this.options);
|
|
733
|
+
if ((_b = (_a = newOptions.chart) === null || _a === void 0 ? void 0 : _a.toolbar) === null || _b === void 0 ? void 0 : _b.tools) {
|
|
734
|
+
const { tools } = newOptions.chart.toolbar;
|
|
735
|
+
Object.keys(tools).forEach((key) => {
|
|
736
|
+
if (typeof tools[key] === 'string') {
|
|
737
|
+
tools[key] = getIconFn(tools[key]);
|
|
738
|
+
changed = true;
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
if ((_c = tools.customIcons) === null || _c === void 0 ? void 0 : _c.length) {
|
|
742
|
+
tools.customIcons.forEach((item) => {
|
|
743
|
+
item.icon = getIconFn(item.icon);
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
if (this.viewUpdate && changed) {
|
|
748
|
+
this.viewUpdate(newOptions);
|
|
749
|
+
}
|
|
750
|
+
return newOptions;
|
|
751
|
+
}
|
|
452
752
|
}
|
|
453
753
|
|
|
454
754
|
/**
|
|
@@ -499,10 +799,6 @@
|
|
|
499
799
|
*/
|
|
500
800
|
constructor(props) {
|
|
501
801
|
super(props);
|
|
502
|
-
/**
|
|
503
|
-
* Applies the dark theme variant to the component.
|
|
504
|
-
*/
|
|
505
|
-
this.dark = false;
|
|
506
802
|
/**
|
|
507
803
|
* Specifies the dividing string between items.
|
|
508
804
|
*/
|
|
@@ -519,19 +815,13 @@
|
|
|
519
815
|
* Increase the font-size of the breadcrumb item text to 16px.
|
|
520
816
|
*/
|
|
521
817
|
this.large = false;
|
|
522
|
-
/**
|
|
523
|
-
* Applies the light theme variant to the component.
|
|
524
|
-
*/
|
|
525
|
-
this.light = true;
|
|
526
818
|
/**
|
|
527
819
|
* Decrease the font-size of the breadcrumb item text to 12px.
|
|
528
820
|
*/
|
|
529
821
|
this.small = false;
|
|
530
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
531
822
|
this.divider = this.getInitValue('divider', props.divider, this.divider);
|
|
532
823
|
this.items = this.getInitValue('items', props.items, this.items);
|
|
533
824
|
this.large = this.getInitValue('large', props.large, this.large);
|
|
534
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
535
825
|
this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
|
|
536
826
|
this.small = this.getInitValue('small', props.small, this.small);
|
|
537
827
|
this.createAccessors();
|
|
@@ -567,10 +857,6 @@
|
|
|
567
857
|
* It can be the name of material or css color in hexa
|
|
568
858
|
*/
|
|
569
859
|
this.color = 'primary';
|
|
570
|
-
/**
|
|
571
|
-
* Applies the dark theme variant to the button
|
|
572
|
-
*/
|
|
573
|
-
this.dark = false;
|
|
574
860
|
/**
|
|
575
861
|
* Removes the ability to click or target the button
|
|
576
862
|
*/
|
|
@@ -612,10 +898,6 @@
|
|
|
612
898
|
* This should be used with the absolute or fixed props
|
|
613
899
|
*/
|
|
614
900
|
this.left = false;
|
|
615
|
-
/**
|
|
616
|
-
* Applies the light theme variant to the button
|
|
617
|
-
*/
|
|
618
|
-
this.light = false;
|
|
619
901
|
/**
|
|
620
902
|
* Makes the background transparent and applies a thin border
|
|
621
903
|
*/
|
|
@@ -718,10 +1000,6 @@
|
|
|
718
1000
|
* It can be the name of material or css color in hexa
|
|
719
1001
|
*/
|
|
720
1002
|
this.color = 'primary';
|
|
721
|
-
/**
|
|
722
|
-
* Applies the dark theme variant to the component.
|
|
723
|
-
*/
|
|
724
|
-
this.dark = false;
|
|
725
1003
|
/**
|
|
726
1004
|
* Reduces the button size and padding.
|
|
727
1005
|
*/
|
|
@@ -731,10 +1009,6 @@
|
|
|
731
1009
|
* space between the buttons
|
|
732
1010
|
*/
|
|
733
1011
|
this.group = false;
|
|
734
|
-
/**
|
|
735
|
-
* Applies the light theme variant to the component.
|
|
736
|
-
*/
|
|
737
|
-
this.light = false;
|
|
738
1012
|
/**
|
|
739
1013
|
* Applies mandatory selected button
|
|
740
1014
|
*/
|
|
@@ -768,10 +1042,8 @@
|
|
|
768
1042
|
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
769
1043
|
this.borderless = this.getInitValue('block', props.borderless, this.borderless);
|
|
770
1044
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
771
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
772
1045
|
this.dense = this.getInitValue('disabled', props.dense, this.dense);
|
|
773
1046
|
this.group = this.getInitValue('group', props.group, this.group);
|
|
774
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
775
1047
|
this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
|
|
776
1048
|
this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
|
|
777
1049
|
this.rounded = this.getInitValue('rounded', props.rounded, this.rounded);
|
|
@@ -825,10 +1097,6 @@
|
|
|
825
1097
|
* a non-integer number in slidesPerView, like 1.5)
|
|
826
1098
|
*/
|
|
827
1099
|
this.center = false;
|
|
828
|
-
/**
|
|
829
|
-
* Applies the dark theme variant to the carousel pagination
|
|
830
|
-
*/
|
|
831
|
-
this.dark = false;
|
|
832
1100
|
/**
|
|
833
1101
|
* Displays the pagination as a fraction in the following format: currentSlide/slidesCount.
|
|
834
1102
|
* Only works when <code>showPagination</code> property is true
|
|
@@ -839,6 +1107,16 @@
|
|
|
839
1107
|
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
840
1108
|
*/
|
|
841
1109
|
this.height = 'auto';
|
|
1110
|
+
/**
|
|
1111
|
+
* Sets the carousel max height. Example values: 'auto', '100%', '400px',
|
|
1112
|
+
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
1113
|
+
*/
|
|
1114
|
+
this.maxHeight = 'none';
|
|
1115
|
+
/**
|
|
1116
|
+
* Sets the carousel min height. Example values: 'auto', '100%', '400px',
|
|
1117
|
+
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
1118
|
+
*/
|
|
1119
|
+
this.minHeight = 'none';
|
|
842
1120
|
/**
|
|
843
1121
|
* Configures the carousel as infinite (the slide after the last one is the first slide, and vice-versa)
|
|
844
1122
|
*/
|
|
@@ -855,10 +1133,6 @@
|
|
|
855
1133
|
* Allows controlling the carousel using the keyboard arrow keys
|
|
856
1134
|
*/
|
|
857
1135
|
this.keysControl = true;
|
|
858
|
-
/**
|
|
859
|
-
* Applies the light theme variant to the carousel
|
|
860
|
-
*/
|
|
861
|
-
this.light = true;
|
|
862
1136
|
/**
|
|
863
1137
|
* Allows controlling the carousel using mouse drag
|
|
864
1138
|
*/
|
|
@@ -933,14 +1207,14 @@
|
|
|
933
1207
|
this.autoPlay = this.getInitValue('autoPlay', props.autoPlay, this.autoPlay);
|
|
934
1208
|
this.buttonsOutside = this.getInitValue('buttonsOutside', props.buttonsOutside, this.buttonsOutside);
|
|
935
1209
|
this.center = this.getInitValue('center', props.center, this.center);
|
|
936
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
937
1210
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
1211
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
1212
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
938
1213
|
this.infiniteScroll = this.getInitValue('infiniteScroll', props.infiniteScroll, this.infiniteScroll);
|
|
939
1214
|
this.initialSlide = this.getInitValue('initialSlide', props.initialSlide, this.initialSlide);
|
|
940
1215
|
this.currentSlide = this.getInitValue('currentSlide', props.currentSlide, this.initialSlide);
|
|
941
1216
|
this.interval = this.getInitValue('interval', props.interval, this.interval);
|
|
942
1217
|
this.keysControl = this.getInitValue('keysControl', props.keysControl, this.keysControl);
|
|
943
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
944
1218
|
this.mouseControl = this.getInitValue('mouseControl', props.mouseControl, this.mouseControl);
|
|
945
1219
|
this.nextButton = props.nextButton || this.nextButton;
|
|
946
1220
|
this.fractionPagination = this.getInitValue('fractionPagination', props.fractionPagination, this.fractionPagination);
|
|
@@ -1055,10 +1329,6 @@
|
|
|
1055
1329
|
* Applies specified color to the control. It can be the name of material color
|
|
1056
1330
|
*/
|
|
1057
1331
|
this.color = '';
|
|
1058
|
-
/**
|
|
1059
|
-
* Applies the dark theme variant to the component
|
|
1060
|
-
*/
|
|
1061
|
-
this.dark = false;
|
|
1062
1332
|
/**
|
|
1063
1333
|
* Removes the ability to click or target the component
|
|
1064
1334
|
*/
|
|
@@ -1075,10 +1345,6 @@
|
|
|
1075
1345
|
* Specifies an image background for the card
|
|
1076
1346
|
*/
|
|
1077
1347
|
this.img = '';
|
|
1078
|
-
/**
|
|
1079
|
-
* Applies the light theme variant to the component
|
|
1080
|
-
*/
|
|
1081
|
-
this.light = false;
|
|
1082
1348
|
/**
|
|
1083
1349
|
* Designates that the card is a link
|
|
1084
1350
|
*/
|
|
@@ -1102,7 +1368,6 @@
|
|
|
1102
1368
|
this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
|
|
1103
1369
|
this.append = this.getInitValue('append', props.append, this.append);
|
|
1104
1370
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
1105
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
1106
1371
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
1107
1372
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
1108
1373
|
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
@@ -1110,7 +1375,6 @@
|
|
|
1110
1375
|
this.hover = this.getInitValue('hover', props.hover, this.hover);
|
|
1111
1376
|
this.href = this.getInitValue('href', props.href, this.href);
|
|
1112
1377
|
this.img = this.getInitValue('img', props.img, this.img);
|
|
1113
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
1114
1378
|
this.link = this.getInitValue('link', props.link, this.link);
|
|
1115
1379
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
1116
1380
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
@@ -1181,6 +1445,7 @@
|
|
|
1181
1445
|
this.internalValue = {};
|
|
1182
1446
|
this.align = this.getInitValue('align', props.align, this.align);
|
|
1183
1447
|
this.justify = this.getInitValue('justify', props.justify, this.justify);
|
|
1448
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
1184
1449
|
this.internalValue = this.getInitValue('value', props.value, this.value);
|
|
1185
1450
|
this.createAccessors();
|
|
1186
1451
|
}
|
|
@@ -1323,10 +1588,6 @@
|
|
|
1323
1588
|
* It can be the name of material or css color in hexa.
|
|
1324
1589
|
*/
|
|
1325
1590
|
this.color = 'primary';
|
|
1326
|
-
/**
|
|
1327
|
-
* Applies the dark theme variant to the input.
|
|
1328
|
-
*/
|
|
1329
|
-
this.dark = false;
|
|
1330
1591
|
/**
|
|
1331
1592
|
* Defines smaller input.
|
|
1332
1593
|
*/
|
|
@@ -1343,10 +1604,6 @@
|
|
|
1343
1604
|
* Defines the input label.
|
|
1344
1605
|
*/
|
|
1345
1606
|
this.label = '';
|
|
1346
|
-
/**
|
|
1347
|
-
* Applies the light theme variant to the input.
|
|
1348
|
-
*/
|
|
1349
|
-
this.light = false;
|
|
1350
1607
|
/**
|
|
1351
1608
|
* Applies a custom character mask to the input.
|
|
1352
1609
|
*/
|
|
@@ -1415,13 +1672,11 @@
|
|
|
1415
1672
|
this.autofocus = this.getInitValue('autofocus', props.autofocus, this.autofocus);
|
|
1416
1673
|
this.clearable = this.getInitValue('clearable', props.clearable, this.clearable);
|
|
1417
1674
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
1418
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
1419
1675
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
1420
1676
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
1421
1677
|
this.hint = this.getInitValue('hint', props.hint, this.hint);
|
|
1422
1678
|
this.autoHintDetails = this.getInitValue('autoHintDetails', props.autoHintDetails, this.autoHintDetails);
|
|
1423
1679
|
this.label = this.getInitValue('label', props.label, this.label);
|
|
1424
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
1425
1680
|
this.mask = this.getInitValue('mask', props.mask, this.mask);
|
|
1426
1681
|
this.maxLength = this.getInitValue('maxLength', props.maxLength, this.maxLength);
|
|
1427
1682
|
this.persistentHint = this.getInitValue('persistentHint', props.persistentHint, this.persistentHint);
|
|
@@ -1780,6 +2035,10 @@
|
|
|
1780
2035
|
* Max height in pixels. 'none' means no limit.
|
|
1781
2036
|
*/
|
|
1782
2037
|
this.maxHeight = 'none';
|
|
2038
|
+
/**
|
|
2039
|
+
* Max height in pixels. 'none' means no limit.
|
|
2040
|
+
*/
|
|
2041
|
+
this.height = 'auto';
|
|
1783
2042
|
/**
|
|
1784
2043
|
* Language code to be used for highlight (js|javascript, css, html, json, ts|typescript, bash|shell)
|
|
1785
2044
|
* Other languages must be imported above
|
|
@@ -1799,6 +2058,7 @@
|
|
|
1799
2058
|
this.staticCode = this.getInitValue('staticCode', props.staticCode, this.staticCodeValue);
|
|
1800
2059
|
this.copyIcon = this.getInitValue('copyIcon', props.copyIcon, this.copyIcon);
|
|
1801
2060
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
2061
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
1802
2062
|
this.language = this.getInitValue('language', props.language, this.language);
|
|
1803
2063
|
this.showLineNumbers = this.getInitValue('showLineNumbers', props.showLineNumbers, this.showLineNumbers);
|
|
1804
2064
|
this.createAccessors();
|
|
@@ -2005,12 +2265,27 @@
|
|
|
2005
2265
|
* Adds height 100% to container.
|
|
2006
2266
|
*/
|
|
2007
2267
|
this.fillHeight = false;
|
|
2268
|
+
/**
|
|
2269
|
+
* Sets the height for the component.
|
|
2270
|
+
*/
|
|
2271
|
+
this.height = 'auto';
|
|
2272
|
+
/**
|
|
2273
|
+
* Sets the maximum height for the component.
|
|
2274
|
+
*/
|
|
2275
|
+
this.maxHeight = 'none';
|
|
2276
|
+
/**
|
|
2277
|
+
* Sets the minimum height for the component.
|
|
2278
|
+
*/
|
|
2279
|
+
this.minHeight = 'none';
|
|
2008
2280
|
/**
|
|
2009
2281
|
* Removes viewport maximum-width size breakpoints.
|
|
2010
2282
|
*/
|
|
2011
2283
|
this.fluid = true;
|
|
2012
2284
|
this.fluid = this.getInitValue('fluid', props.fluid, this.fluid);
|
|
2013
2285
|
this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
|
|
2286
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
2287
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
2288
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
2014
2289
|
this.createAccessors();
|
|
2015
2290
|
}
|
|
2016
2291
|
}
|
|
@@ -2348,6 +2623,14 @@
|
|
|
2348
2623
|
* Dialog type (normal, success, error, warning, info)
|
|
2349
2624
|
*/
|
|
2350
2625
|
this.type = 'normal';
|
|
2626
|
+
/**
|
|
2627
|
+
* Confirm button component name
|
|
2628
|
+
*/
|
|
2629
|
+
this.confirmButton = 'dialogButton';
|
|
2630
|
+
/**
|
|
2631
|
+
* Deny button component name
|
|
2632
|
+
*/
|
|
2633
|
+
this.denyButton = undefined;
|
|
2351
2634
|
/**
|
|
2352
2635
|
* Default dialog buttons
|
|
2353
2636
|
* @private
|
|
@@ -2359,6 +2642,8 @@
|
|
|
2359
2642
|
events: { click: () => this.hide() },
|
|
2360
2643
|
}];
|
|
2361
2644
|
this.defaultValues = {
|
|
2645
|
+
confirmButton: this.confirmButton,
|
|
2646
|
+
denyButton: this.denyButton,
|
|
2362
2647
|
name: this.name,
|
|
2363
2648
|
maxWidth: this.maxWidth,
|
|
2364
2649
|
persistent: this.persistent,
|
|
@@ -2366,6 +2651,38 @@
|
|
|
2366
2651
|
title: this.title,
|
|
2367
2652
|
text: this.text,
|
|
2368
2653
|
};
|
|
2654
|
+
this.clickDefaultButtonKeyMapping = {
|
|
2655
|
+
enter: {
|
|
2656
|
+
event: () => {
|
|
2657
|
+
if (this.confirmButton) {
|
|
2658
|
+
const confirmButton = core.Metadata.getInstance(this.confirmButton);
|
|
2659
|
+
if (confirmButton
|
|
2660
|
+
&& confirmButton.events
|
|
2661
|
+
&& confirmButton.events.click
|
|
2662
|
+
&& typeof confirmButton.events.click === 'function') {
|
|
2663
|
+
confirmButton.events.click({ component: new Button(confirmButton) });
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
stop: true,
|
|
2668
|
+
},
|
|
2669
|
+
esc: {
|
|
2670
|
+
event: () => {
|
|
2671
|
+
if (this.denyButton) {
|
|
2672
|
+
const denyButton = core.Metadata.getInstance(this.denyButton);
|
|
2673
|
+
if (denyButton
|
|
2674
|
+
&& denyButton.events
|
|
2675
|
+
&& denyButton.events.click
|
|
2676
|
+
&& typeof denyButton.events.click === 'function')
|
|
2677
|
+
denyButton.events.click({ component: new Button(denyButton) });
|
|
2678
|
+
}
|
|
2679
|
+
else {
|
|
2680
|
+
this.hide();
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
stop: true,
|
|
2684
|
+
},
|
|
2685
|
+
};
|
|
2369
2686
|
this.assignDialogProperties(props);
|
|
2370
2687
|
this.createAccessors();
|
|
2371
2688
|
}
|
|
@@ -2375,6 +2692,8 @@
|
|
|
2375
2692
|
*/
|
|
2376
2693
|
assignDialogProperties(dialog) {
|
|
2377
2694
|
this.buttons = dialog.buttons && dialog.buttons.length ? dialog.buttons : this.defaultButtons;
|
|
2695
|
+
this.confirmButton = this.getInitValue('confirmButton', dialog.confirmButton, this.defaultValues.confirmButton);
|
|
2696
|
+
this.denyButton = this.getInitValue('denyButton', dialog.denyButton, this.defaultValues.denyButton);
|
|
2378
2697
|
this.name = this.getInitValue('name', dialog.name, this.defaultValues.name);
|
|
2379
2698
|
this.maxWidth = this.getInitValue('maxWidth', dialog.maxWidth, this.defaultValues.maxWidth);
|
|
2380
2699
|
this.persistent = this.getInitValue('persistent', dialog.persistent, this.defaultValues.persistent);
|
|
@@ -2387,6 +2706,7 @@
|
|
|
2387
2706
|
* Displays dialog
|
|
2388
2707
|
*/
|
|
2389
2708
|
show() {
|
|
2709
|
+
core.KeyMap.bind(this.clickDefaultButtonKeyMapping, this);
|
|
2390
2710
|
this.isVisible = true;
|
|
2391
2711
|
}
|
|
2392
2712
|
/**
|
|
@@ -2394,6 +2714,7 @@
|
|
|
2394
2714
|
*/
|
|
2395
2715
|
hide() {
|
|
2396
2716
|
this.isVisible = false;
|
|
2717
|
+
core.KeyMap.unbind(this.clickDefaultButtonKeyMapping, this);
|
|
2397
2718
|
}
|
|
2398
2719
|
}
|
|
2399
2720
|
|
|
@@ -3329,10 +3650,6 @@
|
|
|
3329
3650
|
* Sets the locale. Accepts a string with a BCP 47 language tag.
|
|
3330
3651
|
*/
|
|
3331
3652
|
this.locale = core.I18n.instance.language;
|
|
3332
|
-
/**
|
|
3333
|
-
* Defines if dates should be ordered
|
|
3334
|
-
*/
|
|
3335
|
-
this.orderedDates = false;
|
|
3336
3653
|
/**
|
|
3337
3654
|
* Allows changing displayed month with mouse scroll
|
|
3338
3655
|
*/
|
|
@@ -3356,15 +3673,12 @@
|
|
|
3356
3673
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
3357
3674
|
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
3358
3675
|
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
3359
|
-
this.orderedDates = this.getInitValue('orderedDates', props.orderedDates, this.orderedDates);
|
|
3360
3676
|
this.dateValidation = this.dateValidation.bind(this);
|
|
3361
|
-
this.dateValidateOrder = this.dateValidateOrder.bind(this);
|
|
3362
3677
|
this.displayFormat = this.getInitValue('displayFormat', props.displayFormat, this.displayFormat);
|
|
3363
3678
|
this.inputFormat = this.getInitValue('inputFormat', props.inputFormat, this.inputFormat);
|
|
3364
3679
|
this.firstDayOfWeek = this.getInitValue('firstDayOfWeek', props.firstDayOfWeek, this.firstDayOfWeek);
|
|
3365
3680
|
this.fullWidth = this.getInitValue('fullWidth', props.fullWidth, this.fullWidth);
|
|
3366
3681
|
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
3367
|
-
this.rules.push(this.dateValidation, this.dateValidateOrder);
|
|
3368
3682
|
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
3369
3683
|
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
3370
3684
|
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
@@ -3472,7 +3786,7 @@
|
|
|
3472
3786
|
const lastValue = this.value;
|
|
3473
3787
|
this.dateError = false;
|
|
3474
3788
|
this.value = this.parseISODateRangeValue(newValue);
|
|
3475
|
-
if (!core.isEqual(lastValue, this.value))
|
|
3789
|
+
if (!core.Utils.isEqual(lastValue, this.value))
|
|
3476
3790
|
this.change(this.value);
|
|
3477
3791
|
}
|
|
3478
3792
|
formatISODateRangeValue(dates) {
|
|
@@ -3481,13 +3795,13 @@
|
|
|
3481
3795
|
splitedValue = dates;
|
|
3482
3796
|
else
|
|
3483
3797
|
splitedValue = this.splitValues(dates);
|
|
3484
|
-
const
|
|
3798
|
+
const formattedValue = [];
|
|
3485
3799
|
splitedValue.forEach((value) => {
|
|
3486
3800
|
if (value && this.isValidDate(value, this.dateFormat)) {
|
|
3487
|
-
|
|
3801
|
+
formattedValue.push(core.dayjs(value, this.dateFormat, true).format(this.isoFormat));
|
|
3488
3802
|
}
|
|
3489
3803
|
});
|
|
3490
|
-
return
|
|
3804
|
+
return formattedValue;
|
|
3491
3805
|
}
|
|
3492
3806
|
parseISODateRangeValue(values) {
|
|
3493
3807
|
const parsedValue = [];
|
|
@@ -3498,19 +3812,14 @@
|
|
|
3498
3812
|
}
|
|
3499
3813
|
});
|
|
3500
3814
|
}
|
|
3501
|
-
return parsedValue;
|
|
3815
|
+
return this.sortDates(parsedValue);
|
|
3816
|
+
}
|
|
3817
|
+
sortDates(parsedValue) {
|
|
3818
|
+
return parsedValue.sort((a, b) => (core.dayjs(a, this.dateFormat).isAfter(core.dayjs(b, this.dateFormat)) ? 1 : -1));
|
|
3502
3819
|
}
|
|
3503
3820
|
dateValidation() {
|
|
3504
3821
|
return !this.dateError || core.I18n.translate('VALIDATION_INVALID_DATE');
|
|
3505
3822
|
}
|
|
3506
|
-
dateValidateOrder() {
|
|
3507
|
-
if (this.value && (this.value.length === 2 && this.orderedDates)) {
|
|
3508
|
-
const date1 = core.dayjs(this.value[0], this.dateFormat);
|
|
3509
|
-
const date2 = core.dayjs(this.value[1], this.dateFormat);
|
|
3510
|
-
return (date1.isBefore(date2) || date1.isSame(date2)) || core.I18n.translate('VALIDATION_INVALID_ORDER_DATE');
|
|
3511
|
-
}
|
|
3512
|
-
return true;
|
|
3513
|
-
}
|
|
3514
3823
|
click(event, element) {
|
|
3515
3824
|
super.click(event, element);
|
|
3516
3825
|
if (!event.defaultPrevented) {
|
|
@@ -3518,6 +3827,7 @@
|
|
|
3518
3827
|
}
|
|
3519
3828
|
}
|
|
3520
3829
|
blur(event, element) {
|
|
3830
|
+
this.value = this.sortDates(this.value);
|
|
3521
3831
|
this.removeDateMask();
|
|
3522
3832
|
this.setDateValue(this.displayValue);
|
|
3523
3833
|
super.blur(event, element);
|
|
@@ -3679,18 +3989,10 @@
|
|
|
3679
3989
|
*/
|
|
3680
3990
|
constructor(props) {
|
|
3681
3991
|
super(props);
|
|
3682
|
-
/**
|
|
3683
|
-
* Applies the dark theme variant to the component.
|
|
3684
|
-
*/
|
|
3685
|
-
this.dark = false;
|
|
3686
3992
|
/**
|
|
3687
3993
|
* Adds indentation (72px) for normal dividers, reduces max height for vertical.
|
|
3688
3994
|
*/
|
|
3689
3995
|
this.inset = false;
|
|
3690
|
-
/**
|
|
3691
|
-
* Applies the light theme variant to the component.
|
|
3692
|
-
*/
|
|
3693
|
-
this.light = false;
|
|
3694
3996
|
/**
|
|
3695
3997
|
* Displays dividers vertically.
|
|
3696
3998
|
*/
|
|
@@ -3742,6 +4044,10 @@
|
|
|
3742
4044
|
* Applies position fixed to the dropdown.
|
|
3743
4045
|
*/
|
|
3744
4046
|
this.fixed = false;
|
|
4047
|
+
/**
|
|
4048
|
+
* Sets the height for the dropdown.
|
|
4049
|
+
*/
|
|
4050
|
+
this.height = 'auto';
|
|
3745
4051
|
/**
|
|
3746
4052
|
* Offset the menu on the x-axis.
|
|
3747
4053
|
*/
|
|
@@ -3767,6 +4073,7 @@
|
|
|
3767
4073
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
3768
4074
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
3769
4075
|
this.hover = this.getInitValue('hover', props.hover, this.hover);
|
|
4076
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
3770
4077
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
3771
4078
|
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
3772
4079
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
@@ -3960,10 +4267,6 @@
|
|
|
3960
4267
|
* Applies specified color to the control. It can be the name of material or css color in hexa.
|
|
3961
4268
|
*/
|
|
3962
4269
|
this.color = 'primary';
|
|
3963
|
-
/**
|
|
3964
|
-
* Applies the dark theme variant to footer.
|
|
3965
|
-
*/
|
|
3966
|
-
this.dark = false;
|
|
3967
4270
|
/**
|
|
3968
4271
|
* Applies position fixed to footer.
|
|
3969
4272
|
*/
|
|
@@ -3980,10 +4283,6 @@
|
|
|
3980
4283
|
* Render components on the left of footer.
|
|
3981
4284
|
*/
|
|
3982
4285
|
this.leftSlot = [];
|
|
3983
|
-
/**
|
|
3984
|
-
* Applies the light theme variant to the footer.
|
|
3985
|
-
*/
|
|
3986
|
-
this.light = false;
|
|
3987
4286
|
/**
|
|
3988
4287
|
* Remove all padding from the footer.
|
|
3989
4288
|
*/
|
|
@@ -4036,12 +4335,18 @@
|
|
|
4036
4335
|
this.override = {};
|
|
4037
4336
|
this.cache = false;
|
|
4038
4337
|
this.cacheDuration = 2 * 60 * 60 * 1000;
|
|
4338
|
+
this.height = 'auto';
|
|
4339
|
+
this.maxHeight = 'none';
|
|
4340
|
+
this.minHeight = 'none';
|
|
4039
4341
|
this.headerName = 'sw-fetched-on';
|
|
4040
4342
|
this.path = props.path;
|
|
4041
4343
|
this.local = props.local === true;
|
|
4042
4344
|
this.override = props.override || this.override;
|
|
4043
4345
|
this.cache = props.cache || this.cache;
|
|
4044
4346
|
this.cacheDuration = this.getInitValue('cacheDuration', props.cacheDuration, this.cacheDuration);
|
|
4347
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
4348
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
4349
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
4045
4350
|
this.createAccessors();
|
|
4046
4351
|
this.getMetadata();
|
|
4047
4352
|
}
|
|
@@ -4062,6 +4367,12 @@
|
|
|
4062
4367
|
}
|
|
4063
4368
|
});
|
|
4064
4369
|
}
|
|
4370
|
+
reload() {
|
|
4371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4372
|
+
this.loading = true;
|
|
4373
|
+
this.getMetadata();
|
|
4374
|
+
});
|
|
4375
|
+
}
|
|
4065
4376
|
notFoundError() { }
|
|
4066
4377
|
requestPage() {
|
|
4067
4378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4552,7 +4863,7 @@
|
|
|
4552
4863
|
if (this.componentProps.dataValueOut && ((_a = component.datasource) === null || _a === void 0 ? void 0 : _a.currentRow)) {
|
|
4553
4864
|
this.componentProps.dataValueOut.forEach((columns) => {
|
|
4554
4865
|
const { column, columnOnGrid } = columns;
|
|
4555
|
-
if (!core.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
|
|
4866
|
+
if (!core.Utils.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
|
|
4556
4867
|
newRow[`${columnOnGrid}_original`] = newRow.originalRow[columnOnGrid];
|
|
4557
4868
|
newRow[columnOnGrid] = component.datasource.currentRow[column];
|
|
4558
4869
|
}
|
|
@@ -4716,7 +5027,11 @@
|
|
|
4716
5027
|
/**
|
|
4717
5028
|
* Color of the header background
|
|
4718
5029
|
*/
|
|
4719
|
-
this.headerBackground = '
|
|
5030
|
+
this.headerBackground = '';
|
|
5031
|
+
/**
|
|
5032
|
+
* Color of the header cell text color
|
|
5033
|
+
*/
|
|
5034
|
+
this.headerCellTextColor = '';
|
|
4720
5035
|
/**
|
|
4721
5036
|
* Available order types
|
|
4722
5037
|
* @public
|
|
@@ -4760,6 +5075,8 @@
|
|
|
4760
5075
|
},
|
|
4761
5076
|
};
|
|
4762
5077
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5078
|
+
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5079
|
+
this.light = this.getInitValue('light', props.light, this.light);
|
|
4763
5080
|
this.selectable = this.getInitValue('selectable', props.selectable, this.selectable);
|
|
4764
5081
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
4765
5082
|
this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
|
|
@@ -4769,6 +5086,7 @@
|
|
|
4769
5086
|
this.showFooter = this.getInitValue('showFooter', props.showFooter, this.showFooter);
|
|
4770
5087
|
this.showHeader = this.getInitValue('showHeader', props.showHeader, this.showHeader);
|
|
4771
5088
|
this.headerBackground = this.getInitValue('headerBackground', props.headerBackground, this.headerBackground);
|
|
5089
|
+
this.headerCellTextColor = this.getInitValue('headerCellTextColor', props.headerCellTextColor, this.headerCellTextColor);
|
|
4772
5090
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
4773
5091
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
4774
5092
|
this.toolbarSlot = props.toolbarSlot || this.toolbarSlot;
|
|
@@ -4937,6 +5255,7 @@
|
|
|
4937
5255
|
var _a, _b, _c;
|
|
4938
5256
|
const rowKey = row[this.datasource.uniqueKey];
|
|
4939
5257
|
const compName = actionComponent.name;
|
|
5258
|
+
const instanceName = `${compName}_${rowKey}`;
|
|
4940
5259
|
const path = parentPath ? `${parentPath}.${compName}` : compName;
|
|
4941
5260
|
const newComponent = merge__default["default"]({}, actionComponent, (_b = (_a = this.actionsApplied[rowKey]) === null || _a === void 0 ? void 0 : _a[column.name]) === null || _b === void 0 ? void 0 : _b[path]);
|
|
4942
5261
|
let compEvents = {};
|
|
@@ -4951,7 +5270,16 @@
|
|
|
4951
5270
|
}
|
|
4952
5271
|
} });
|
|
4953
5272
|
const newChildren = (_c = newComponent.children) === null || _c === void 0 ? void 0 : _c.map((child) => this.getActionComponent(child, column, row, path));
|
|
4954
|
-
|
|
5273
|
+
newComponent.name = instanceName;
|
|
5274
|
+
newComponent.children = newChildren;
|
|
5275
|
+
newComponent.events = newEvents;
|
|
5276
|
+
try {
|
|
5277
|
+
core.Metadata.updateInstance(instanceName, newComponent);
|
|
5278
|
+
}
|
|
5279
|
+
catch (e) {
|
|
5280
|
+
// do nothing
|
|
5281
|
+
}
|
|
5282
|
+
return newComponent;
|
|
4955
5283
|
}
|
|
4956
5284
|
changeDefaultSlotNames(slot) {
|
|
4957
5285
|
slot.forEach((item) => {
|
|
@@ -5016,15 +5344,36 @@
|
|
|
5016
5344
|
* @private
|
|
5017
5345
|
*/
|
|
5018
5346
|
this.editedRows = {};
|
|
5347
|
+
/**
|
|
5348
|
+
* Rows with newRowIdentifier
|
|
5349
|
+
* @private
|
|
5350
|
+
*/
|
|
5351
|
+
this.addedRows = {};
|
|
5019
5352
|
/**
|
|
5020
5353
|
* Invalid inline components
|
|
5021
5354
|
* @private
|
|
5022
5355
|
*/
|
|
5023
5356
|
this.invalidComponents = {};
|
|
5024
|
-
this.
|
|
5025
|
-
|
|
5357
|
+
this.cancelEditedRowsKeyMapping = {
|
|
5358
|
+
esc: {
|
|
5359
|
+
event: this.cancelEditedRows.bind(this),
|
|
5360
|
+
stop: true,
|
|
5361
|
+
input: true,
|
|
5362
|
+
active: true,
|
|
5363
|
+
},
|
|
5364
|
+
};
|
|
5365
|
+
this.newRowIdentifier = '__added_row';
|
|
5366
|
+
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
5026
5367
|
this.createAccessors();
|
|
5027
5368
|
}
|
|
5369
|
+
onMounted(element) {
|
|
5370
|
+
super.onMounted(element);
|
|
5371
|
+
core.KeyMap.bind(this.cancelEditedRowsKeyMapping, this, element);
|
|
5372
|
+
}
|
|
5373
|
+
onBeforeDestroy() {
|
|
5374
|
+
super.onBeforeDestroy();
|
|
5375
|
+
core.KeyMap.unbind(this.cancelEditedRowsKeyMapping, this);
|
|
5376
|
+
}
|
|
5028
5377
|
/**
|
|
5029
5378
|
* Get Grid columns objects
|
|
5030
5379
|
* @param columns Grid columns parameter
|
|
@@ -5194,7 +5543,7 @@
|
|
|
5194
5543
|
changeEditableComponent(column, row, value, component) {
|
|
5195
5544
|
const key = row[this.datasource.uniqueKey];
|
|
5196
5545
|
const columnName = column.name;
|
|
5197
|
-
if (!core.isEqual(value, row[columnName])) {
|
|
5546
|
+
if (!core.Utils.isEqual(value, row[columnName])) {
|
|
5198
5547
|
const newRow = {};
|
|
5199
5548
|
newRow[key] = Object.assign({}, this.editedRows[key]);
|
|
5200
5549
|
newRow[key].originalRow = Object.assign({}, row);
|
|
@@ -5240,6 +5589,14 @@
|
|
|
5240
5589
|
* Cancels all edited rows and enable grid components
|
|
5241
5590
|
*/
|
|
5242
5591
|
cancelEditedRows() {
|
|
5592
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5593
|
+
yield this.removeAddedRows();
|
|
5594
|
+
this.editing = false;
|
|
5595
|
+
this.editedRows = {};
|
|
5596
|
+
this.invalidComponents = {};
|
|
5597
|
+
});
|
|
5598
|
+
}
|
|
5599
|
+
removeAddedRows() {
|
|
5243
5600
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5244
5601
|
const { data } = this.datasource;
|
|
5245
5602
|
data.forEach((row, index) => {
|
|
@@ -5248,21 +5605,26 @@
|
|
|
5248
5605
|
}
|
|
5249
5606
|
});
|
|
5250
5607
|
yield this.datasource.updateData(data);
|
|
5251
|
-
this.editing = false;
|
|
5252
|
-
this.editedRows = {};
|
|
5253
|
-
this.invalidComponents = {};
|
|
5254
5608
|
});
|
|
5255
5609
|
}
|
|
5610
|
+
addDataRow(row) {
|
|
5611
|
+
if (this.addedRows[row[this.datasource.uniqueKey]])
|
|
5612
|
+
this.datasource.post(row);
|
|
5613
|
+
else
|
|
5614
|
+
this.datasource.put(row);
|
|
5615
|
+
}
|
|
5256
5616
|
/**
|
|
5257
5617
|
* Saves all edited rows if they are valid
|
|
5258
5618
|
* @throws Will throw when it finds an invalid row
|
|
5259
5619
|
*/
|
|
5260
5620
|
saveEditedRows() {
|
|
5261
5621
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5262
|
-
|
|
5622
|
+
yield this.removeAddedRows();
|
|
5623
|
+
const response = yield Promise.all(this.getEditedRows().map((row) => this.addDataRow(row)));
|
|
5263
5624
|
this.editing = false;
|
|
5264
5625
|
this.editedRows = {};
|
|
5265
5626
|
this.invalidComponents = {};
|
|
5627
|
+
this.addedRows = {};
|
|
5266
5628
|
yield this.datasource.get();
|
|
5267
5629
|
return response;
|
|
5268
5630
|
});
|
|
@@ -5274,8 +5636,11 @@
|
|
|
5274
5636
|
getEditedRows() {
|
|
5275
5637
|
const editedRows = [];
|
|
5276
5638
|
Object.keys(this.editedRows).forEach((key) => {
|
|
5639
|
+
this.addedRows = {};
|
|
5277
5640
|
const row = Object.assign(Object.assign({}, this.editedRows[key].originalRow), this.editedRows[key]);
|
|
5278
5641
|
delete row.originalRow;
|
|
5642
|
+
if (row[this.newRowIdentifier])
|
|
5643
|
+
this.addedRows[key] = row;
|
|
5279
5644
|
delete row[this.newRowIdentifier];
|
|
5280
5645
|
Object.keys(row).forEach((attr) => {
|
|
5281
5646
|
if (Object.prototype.hasOwnProperty.call(row, `${attr}_original`)) {
|
|
@@ -5427,10 +5792,6 @@
|
|
|
5427
5792
|
* Applies specified color to the control. It can be the name of material or css color in hexa.
|
|
5428
5793
|
*/
|
|
5429
5794
|
this.color = 'primary';
|
|
5430
|
-
/**
|
|
5431
|
-
* Applies the dark theme variant to header.
|
|
5432
|
-
*/
|
|
5433
|
-
this.dark = false;
|
|
5434
5795
|
/**
|
|
5435
5796
|
* Designates that the application menu positioned on the left is below the header.
|
|
5436
5797
|
*/
|
|
@@ -5455,10 +5816,6 @@
|
|
|
5455
5816
|
* Render components on the left of header.
|
|
5456
5817
|
*/
|
|
5457
5818
|
this.leftSlot = [];
|
|
5458
|
-
/**
|
|
5459
|
-
* Applies the light theme variant to the header.
|
|
5460
|
-
*/
|
|
5461
|
-
this.light = false;
|
|
5462
5819
|
/**
|
|
5463
5820
|
* Removes internal padding from header.
|
|
5464
5821
|
*/
|
|
@@ -5473,13 +5830,11 @@
|
|
|
5473
5830
|
this.clippedLeft = this.getInitValue('clippedLeft', props.clippedLeft, this.clippedLeft);
|
|
5474
5831
|
this.clippedRight = this.getInitValue('clippedRight', props.clippedRight, this.clippedRight);
|
|
5475
5832
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
5476
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5477
5833
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5478
5834
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
5479
5835
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
5480
5836
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
5481
5837
|
this.leftSlot = props.leftSlot || this.leftSlot;
|
|
5482
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
5483
5838
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
5484
5839
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
5485
5840
|
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
@@ -5513,10 +5868,6 @@
|
|
|
5513
5868
|
* (for example success or purple) or css color (#033 or rgba(255, 0, 0, 0.5)).
|
|
5514
5869
|
*/
|
|
5515
5870
|
this.color = '';
|
|
5516
|
-
/**
|
|
5517
|
-
* Applies the dark theme variant to the component.
|
|
5518
|
-
*/
|
|
5519
|
-
this.dark = false;
|
|
5520
5871
|
/**
|
|
5521
5872
|
* Makes icon smaller (20px)
|
|
5522
5873
|
*/
|
|
@@ -5538,10 +5889,6 @@
|
|
|
5538
5889
|
* of a button when placed to the left of another element or text
|
|
5539
5890
|
*/
|
|
5540
5891
|
this.left = false;
|
|
5541
|
-
/**
|
|
5542
|
-
* Applies the light theme variant to the component.
|
|
5543
|
-
*/
|
|
5544
|
-
this.light = false;
|
|
5545
5892
|
/**
|
|
5546
5893
|
* Applies appropriate margins to the icon inside of
|
|
5547
5894
|
* a button when placed to the right of another element or text
|
|
@@ -5560,13 +5907,11 @@
|
|
|
5560
5907
|
*/
|
|
5561
5908
|
this.tag = 'i';
|
|
5562
5909
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
5563
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
5564
5910
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
5565
5911
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
5566
5912
|
this.iconName = this.getInitValue('iconName', props.iconName, this.iconName);
|
|
5567
5913
|
this.large = this.getInitValue('large', props.large, this.large);
|
|
5568
5914
|
this.left = this.getInitValue('left', props.left, this.left);
|
|
5569
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
5570
5915
|
this.right = this.getInitValue('right', props.right, this.right);
|
|
5571
5916
|
this.size = this.getInitValue('size', props.size, this.size);
|
|
5572
5917
|
this.small = this.getInitValue('small', props.small, this.small);
|
|
@@ -5989,11 +6334,12 @@
|
|
|
5989
6334
|
overrideGet() {
|
|
5990
6335
|
const oldGet = this.datasource.get;
|
|
5991
6336
|
this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
|
|
5992
|
-
yield oldGet.call(this.datasource);
|
|
5993
|
-
if (this.indexOf(this.value)
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
6337
|
+
const response = yield oldGet.call(this.datasource);
|
|
6338
|
+
if (this.indexOf(this.value) === -1 && !this.datasource.search && !this.isFocused) {
|
|
6339
|
+
yield this.setValue(this.value, false);
|
|
6340
|
+
this.removePushedValue();
|
|
6341
|
+
}
|
|
6342
|
+
return response;
|
|
5997
6343
|
});
|
|
5998
6344
|
}
|
|
5999
6345
|
get search() {
|
|
@@ -6550,10 +6896,6 @@
|
|
|
6550
6896
|
class List extends ComponentRender {
|
|
6551
6897
|
constructor(props) {
|
|
6552
6898
|
super(props);
|
|
6553
|
-
/**
|
|
6554
|
-
* Applies the dark theme variant to the List.
|
|
6555
|
-
*/
|
|
6556
|
-
this.dark = false;
|
|
6557
6899
|
/**
|
|
6558
6900
|
* Create the list with smaller items.
|
|
6559
6901
|
*/
|
|
@@ -6566,10 +6908,6 @@
|
|
|
6566
6908
|
* Render list with dividers between the items.
|
|
6567
6909
|
*/
|
|
6568
6910
|
this.divided = false;
|
|
6569
|
-
/**
|
|
6570
|
-
* Applies the light theme variant to the List.
|
|
6571
|
-
*/
|
|
6572
|
-
this.light = false;
|
|
6573
6911
|
/**
|
|
6574
6912
|
* Increases the height of all the list items to better support three lines of text.
|
|
6575
6913
|
*/
|
|
@@ -6586,6 +6924,18 @@
|
|
|
6586
6924
|
* Will only collapse when explicitly closed.
|
|
6587
6925
|
*/
|
|
6588
6926
|
this.expand = false;
|
|
6927
|
+
/**
|
|
6928
|
+
* Sets the height for the component.
|
|
6929
|
+
*/
|
|
6930
|
+
this.height = 'auto';
|
|
6931
|
+
/**
|
|
6932
|
+
* Sets the maxHeight for the component.
|
|
6933
|
+
*/
|
|
6934
|
+
this.maxHeight = 'none';
|
|
6935
|
+
/**
|
|
6936
|
+
* Sets the minHeight for the component.
|
|
6937
|
+
*/
|
|
6938
|
+
this.minHeight = 'none';
|
|
6589
6939
|
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
6590
6940
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
6591
6941
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
@@ -6597,6 +6947,9 @@
|
|
|
6597
6947
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
6598
6948
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
6599
6949
|
this.expand = this.getInitValue('expand', props.expand, this.expand);
|
|
6950
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
6951
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
6952
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
6600
6953
|
this.createAccessors();
|
|
6601
6954
|
}
|
|
6602
6955
|
/**
|
|
@@ -6714,10 +7067,6 @@
|
|
|
6714
7067
|
* It can be the name of material or css color in hexa.
|
|
6715
7068
|
*/
|
|
6716
7069
|
this.color = '';
|
|
6717
|
-
/**
|
|
6718
|
-
* Applies the dark theme.
|
|
6719
|
-
*/
|
|
6720
|
-
this.dark = false;
|
|
6721
7070
|
/**
|
|
6722
7071
|
* Card position orientation.
|
|
6723
7072
|
*/
|
|
@@ -6746,7 +7095,6 @@
|
|
|
6746
7095
|
this.bottomLink = props.bottomLink || this.bottomLink;
|
|
6747
7096
|
this.cardWidth = this.getInitValue('cardWidth', props.cardWidth, this.cardWidth);
|
|
6748
7097
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
6749
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
6750
7098
|
this.layout = this.getInitValue('layout', props.layout, this.layout);
|
|
6751
7099
|
this.logo = this.getInitValue('logo', props.logo, this.logo);
|
|
6752
7100
|
this.logoMessage = this.getInitValue('logoMessage', props.logoMessage, this.logoMessage);
|
|
@@ -6973,10 +7321,6 @@
|
|
|
6973
7321
|
* Defines if the menu should have a visible container
|
|
6974
7322
|
*/
|
|
6975
7323
|
this.floating = false;
|
|
6976
|
-
/**
|
|
6977
|
-
* Applies the dark theme variant to the menu.
|
|
6978
|
-
*/
|
|
6979
|
-
this.dark = false;
|
|
6980
7324
|
/**
|
|
6981
7325
|
* Create the menu with smaller items.
|
|
6982
7326
|
*/
|
|
@@ -7059,7 +7403,6 @@
|
|
|
7059
7403
|
this.clipped = this.getInitValue('clipped', props.clipped, this.clipped);
|
|
7060
7404
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
7061
7405
|
this.floating = this.getInitValue('floating', props.floating, this.floating);
|
|
7062
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
7063
7406
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
7064
7407
|
this.mini = this.getInitValue('mini', props.mini, this.mini);
|
|
7065
7408
|
this.miniState = this.getInitValue('miniState', props.miniState, this.miniState);
|
|
@@ -7288,7 +7631,7 @@
|
|
|
7288
7631
|
if (item.component === 'ZdMenuGroup') {
|
|
7289
7632
|
this.searchItems(item.items);
|
|
7290
7633
|
}
|
|
7291
|
-
else if (core.normalize(core.I18n.translate(item.label)).indexOf(core.normalize(this.searchValue)) !== -1) {
|
|
7634
|
+
else if (core.Utils.normalize(core.I18n.translate(item.label)).indexOf(core.Utils.normalize(this.searchValue)) !== -1) {
|
|
7292
7635
|
this.filteredMenuItems.push(item);
|
|
7293
7636
|
}
|
|
7294
7637
|
}
|
|
@@ -7700,10 +8043,6 @@
|
|
|
7700
8043
|
* Defines the value color
|
|
7701
8044
|
*/
|
|
7702
8045
|
this.color = 'primary';
|
|
7703
|
-
/**
|
|
7704
|
-
* Applies the dark theme variant to the component
|
|
7705
|
-
*/
|
|
7706
|
-
this.dark = false;
|
|
7707
8046
|
/**
|
|
7708
8047
|
* Sets the height for the component
|
|
7709
8048
|
*/
|
|
@@ -7712,10 +8051,6 @@
|
|
|
7712
8051
|
* Animates the component constantly
|
|
7713
8052
|
*/
|
|
7714
8053
|
this.indeterminate = false;
|
|
7715
|
-
/**
|
|
7716
|
-
* Applies the light theme variant to the component
|
|
7717
|
-
*/
|
|
7718
|
-
this.light = false;
|
|
7719
8054
|
/**
|
|
7720
8055
|
* Render components on the progress component
|
|
7721
8056
|
*/
|
|
@@ -7727,10 +8062,8 @@
|
|
|
7727
8062
|
this.backgroundColor = this.getInitValue('backgroundColor', props.backgroundColor, this.backgroundColor);
|
|
7728
8063
|
this.backgroundOpacity = this.getInitValue('backgroundOpacity', props.backgroundOpacity, this.backgroundOpacity);
|
|
7729
8064
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
7730
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
7731
8065
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
7732
8066
|
this.indeterminate = this.getInitValue('indeterminate', props.indeterminate, this.indeterminate);
|
|
7733
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
7734
8067
|
this.centerSlot = this.getInitValue('centerSlot', props.centerSlot, this.centerSlot);
|
|
7735
8068
|
this.value = this.getInitValue('value', props.value, this.value);
|
|
7736
8069
|
this.createAccessors();
|
|
@@ -8668,6 +9001,10 @@
|
|
|
8668
9001
|
* Defines if field value should be an object
|
|
8669
9002
|
*/
|
|
8670
9003
|
this.returnObject = false;
|
|
9004
|
+
/**
|
|
9005
|
+
* Prevents load select data when the input is focused
|
|
9006
|
+
*/
|
|
9007
|
+
this.preventLoadOnFocus = true;
|
|
8671
9008
|
/**
|
|
8672
9009
|
* Field used to make the item disabled
|
|
8673
9010
|
*/
|
|
@@ -8700,6 +9037,7 @@
|
|
|
8700
9037
|
this.dataValue = this.getInitValue('dataValue', props.dataValue, this.dataValue);
|
|
8701
9038
|
this.dataDisabled = this.getInitValue('dataDisabled', props.dataDisabled, this.dataDisabled);
|
|
8702
9039
|
this.disabledItems = this.getInitValue('disabledItems', props.disabledItems, this.disabledItems);
|
|
9040
|
+
this.preventLoadOnFocus = this.getInitValue('preventLoadOnFocus', props.preventLoadOnFocus, this.preventLoadOnFocus);
|
|
8703
9041
|
if (props.datasource && Object.keys(props.datasource).length) {
|
|
8704
9042
|
this.lazyLoad = props.datasource.lazyLoad !== false;
|
|
8705
9043
|
const searchFields = Array.isArray(this.dataText) ? this.dataText : [this.dataText];
|
|
@@ -8713,6 +9051,24 @@
|
|
|
8713
9051
|
}
|
|
8714
9052
|
this.createAccessors();
|
|
8715
9053
|
}
|
|
9054
|
+
focus(event, element) {
|
|
9055
|
+
const _super = Object.create(null, {
|
|
9056
|
+
focus: { get: () => super.focus }
|
|
9057
|
+
});
|
|
9058
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9059
|
+
_super.focus.call(this, event, element);
|
|
9060
|
+
this.afterFocus();
|
|
9061
|
+
});
|
|
9062
|
+
}
|
|
9063
|
+
afterFocus() {
|
|
9064
|
+
var _a;
|
|
9065
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9066
|
+
if (!this.preventLoadOnFocus) {
|
|
9067
|
+
yield ((_a = this.datasource) === null || _a === void 0 ? void 0 : _a.get());
|
|
9068
|
+
this.preventLoadOnFocus = true;
|
|
9069
|
+
}
|
|
9070
|
+
});
|
|
9071
|
+
}
|
|
8716
9072
|
createDataStructure() {
|
|
8717
9073
|
this.treeDataStructure = new TreeDataStructure({
|
|
8718
9074
|
datasource: this.datasource,
|
|
@@ -8957,6 +9313,40 @@
|
|
|
8957
9313
|
}
|
|
8958
9314
|
}
|
|
8959
9315
|
|
|
9316
|
+
/**
|
|
9317
|
+
* Base class for SelectableList component.
|
|
9318
|
+
*/
|
|
9319
|
+
class SelectableList extends List {
|
|
9320
|
+
constructor(props) {
|
|
9321
|
+
super(props);
|
|
9322
|
+
/**
|
|
9323
|
+
* Specifies whether at least one element must be selected
|
|
9324
|
+
*/
|
|
9325
|
+
this.mandatory = false;
|
|
9326
|
+
/**
|
|
9327
|
+
* Defines the maximum number of elements the list has
|
|
9328
|
+
*/
|
|
9329
|
+
this.max = undefined;
|
|
9330
|
+
/**
|
|
9331
|
+
* Defines how many elements of the list can be selected at the same time
|
|
9332
|
+
*/
|
|
9333
|
+
this.multiple = undefined;
|
|
9334
|
+
/**
|
|
9335
|
+
* Sets the active list-item inside the list-group
|
|
9336
|
+
*/
|
|
9337
|
+
this.value = undefined;
|
|
9338
|
+
this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
|
|
9339
|
+
this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
|
|
9340
|
+
this.max = this.getInitValue('max', props.max, this.max);
|
|
9341
|
+
this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
|
|
9342
|
+
this.value = this.getInitValue('value', props.value, this.value);
|
|
9343
|
+
this.createAccessors();
|
|
9344
|
+
}
|
|
9345
|
+
change(event, element) {
|
|
9346
|
+
this.callEvent('change', { event, element, component: this });
|
|
9347
|
+
}
|
|
9348
|
+
}
|
|
9349
|
+
|
|
8960
9350
|
/**
|
|
8961
9351
|
* Base class for SpeedDial component.
|
|
8962
9352
|
*/
|
|
@@ -9040,14 +9430,6 @@
|
|
|
9040
9430
|
* Array of steppers items
|
|
9041
9431
|
*/
|
|
9042
9432
|
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
9433
|
/**
|
|
9052
9434
|
* Allow user to jump to any step
|
|
9053
9435
|
*/
|
|
@@ -9059,9 +9441,7 @@
|
|
|
9059
9441
|
this.activeStep = this.getInitValue('activeStep', props.activeStep, this.activeStep);
|
|
9060
9442
|
this.altLabels = this.getInitValue('altLabels', props.altLabels, this.altLabels);
|
|
9061
9443
|
this.content = this.getInitValue('content', props.content, this.content);
|
|
9062
|
-
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
9063
9444
|
this.items = this.getInitValue('items', props.items, this.items);
|
|
9064
|
-
this.light = this.getInitValue('light', props.light, this.light);
|
|
9065
9445
|
this.nonLinear = this.getInitValue('nonLinear', props.nonLinear, this.nonLinear);
|
|
9066
9446
|
this.vertical = this.getInitValue('vertical', props.vertical, this.vertical);
|
|
9067
9447
|
this.steps = this.getInitValue('steps', props.steps, this.steps);
|
|
@@ -9312,6 +9692,7 @@
|
|
|
9312
9692
|
this.tabs = [];
|
|
9313
9693
|
this.tabs = this.getTabs(props.tabs || []);
|
|
9314
9694
|
this.activeTab = this.getInitValue('activeTab', props.activeTab, this.activeTab);
|
|
9695
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
9315
9696
|
this.createAccessors();
|
|
9316
9697
|
}
|
|
9317
9698
|
getTabs(tabs) {
|
|
@@ -9324,6 +9705,31 @@
|
|
|
9324
9705
|
}
|
|
9325
9706
|
return tab;
|
|
9326
9707
|
}
|
|
9708
|
+
/**
|
|
9709
|
+
* Method for navigating to the next tab
|
|
9710
|
+
* @param loop Defines if want a loop navigation
|
|
9711
|
+
*/
|
|
9712
|
+
nextTab(loop = false) {
|
|
9713
|
+
if (loop) {
|
|
9714
|
+
this.activeTab = (this.activeTab + 1) % this.tabs.length;
|
|
9715
|
+
}
|
|
9716
|
+
else if (this.activeTab < this.tabs.length - 1) {
|
|
9717
|
+
this.activeTab += 1;
|
|
9718
|
+
}
|
|
9719
|
+
}
|
|
9720
|
+
/**
|
|
9721
|
+
* Method for navigating to the previous tab
|
|
9722
|
+
* @param loop Defines if want a loop navigation
|
|
9723
|
+
*/
|
|
9724
|
+
previousTab(loop = false) {
|
|
9725
|
+
if (loop) {
|
|
9726
|
+
const newTabIndex = (this.activeTab - 1) % this.tabs.length;
|
|
9727
|
+
this.activeTab = newTabIndex >= 0 ? newTabIndex : newTabIndex + this.tabs.length;
|
|
9728
|
+
}
|
|
9729
|
+
else if (this.activeTab > 0) {
|
|
9730
|
+
this.activeTab -= 1;
|
|
9731
|
+
}
|
|
9732
|
+
}
|
|
9327
9733
|
/**
|
|
9328
9734
|
* Triggered before tab is change.
|
|
9329
9735
|
* @param event DOM event
|
|
@@ -10175,9 +10581,25 @@
|
|
|
10175
10581
|
* Enter edit mode on double click
|
|
10176
10582
|
*/
|
|
10177
10583
|
this.doubleClickEdit = false;
|
|
10584
|
+
this.cancelEditedRowsKeyMapping = {
|
|
10585
|
+
esc: {
|
|
10586
|
+
event: this.cancelEditedRows.bind(this),
|
|
10587
|
+
stop: true,
|
|
10588
|
+
input: true,
|
|
10589
|
+
active: true,
|
|
10590
|
+
},
|
|
10591
|
+
};
|
|
10178
10592
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
10179
10593
|
this.createAccessors();
|
|
10180
10594
|
}
|
|
10595
|
+
onMounted(element) {
|
|
10596
|
+
super.onMounted(element);
|
|
10597
|
+
core.KeyMap.bind(this.cancelEditedRowsKeyMapping, this, element);
|
|
10598
|
+
}
|
|
10599
|
+
onBeforeDestroy() {
|
|
10600
|
+
super.onBeforeDestroy();
|
|
10601
|
+
core.KeyMap.unbind(this.cancelEditedRowsKeyMapping, this);
|
|
10602
|
+
}
|
|
10181
10603
|
/**
|
|
10182
10604
|
* Get Grid columns objects
|
|
10183
10605
|
* @param columns Grid columns parameter
|
|
@@ -10346,7 +10768,7 @@
|
|
|
10346
10768
|
changeEditableComponent(column, row, value, component) {
|
|
10347
10769
|
const key = row[this.datasource.uniqueKey];
|
|
10348
10770
|
const columnName = column.name;
|
|
10349
|
-
if (!core.isEqual(value, row[columnName])) {
|
|
10771
|
+
if (!core.Utils.isEqual(value, row[columnName])) {
|
|
10350
10772
|
const newRow = {};
|
|
10351
10773
|
newRow[key] = Object.assign({}, this.editedRows[key]);
|
|
10352
10774
|
newRow[key].originalRow = Object.assign({}, row);
|
|
@@ -10620,6 +11042,12 @@
|
|
|
10620
11042
|
tableColumns: 'mdi-table-headers-eye',
|
|
10621
11043
|
unfold: 'mdi-unfold-more-horizontal',
|
|
10622
11044
|
warning: 'mdi-exclamation',
|
|
11045
|
+
zoom: 'mdi-magnify-scan',
|
|
11046
|
+
zoomIn: 'mdi-plus-circle-outline',
|
|
11047
|
+
zoomPanning: 'mdi-hand-back-right-outline',
|
|
11048
|
+
zoomOut: 'mdi-minus-circle-outline',
|
|
11049
|
+
zoomReset: 'mdi-magnify-close',
|
|
11050
|
+
zoomSelection: 'mdi-magnify-scan',
|
|
10623
11051
|
};
|
|
10624
11052
|
Icons.faIcons = {
|
|
10625
11053
|
alertOctagon: 'fa fa-exclamation-circle',
|
|
@@ -10670,6 +11098,12 @@
|
|
|
10670
11098
|
tableColumns: 'fa fa-columns',
|
|
10671
11099
|
unfold: 'fa fa-sort',
|
|
10672
11100
|
warning: 'fa fa-exclamation',
|
|
11101
|
+
zoom: 'fa fa-search',
|
|
11102
|
+
zoomIn: 'fa fa-search-plus',
|
|
11103
|
+
zoomPanning: 'fa fa-hand-paper',
|
|
11104
|
+
zoomOut: 'fa fa-search-minus',
|
|
11105
|
+
zoomReset: 'fa fa-undo',
|
|
11106
|
+
zoomSelection: 'fa fa-expand',
|
|
10673
11107
|
};
|
|
10674
11108
|
Icons.icons = (() => Icons.mdiIcons)();
|
|
10675
11109
|
|
|
@@ -10707,10 +11141,14 @@
|
|
|
10707
11141
|
light: {
|
|
10708
11142
|
'font-color': 'var(--v-grey-darken2)',
|
|
10709
11143
|
'background-base': '#F6F6F6',
|
|
11144
|
+
'scrollbar-track': 'var(--v-grey-lighten5)',
|
|
11145
|
+
'scrollbar-thumb': 'var(--v-grey-lighten4)',
|
|
10710
11146
|
},
|
|
10711
11147
|
dark: {
|
|
10712
11148
|
'font-color': 'var(--v-grey-lighten3)',
|
|
10713
11149
|
'background-base': '#121212',
|
|
11150
|
+
'scrollbar-track': 'var(--v-grey-darken3)',
|
|
11151
|
+
'scrollbar-thumb': 'var(--v-grey-base)',
|
|
10714
11152
|
},
|
|
10715
11153
|
variables: {
|
|
10716
11154
|
'default-padding': '16px',
|
|
@@ -10946,6 +11384,16 @@
|
|
|
10946
11384
|
WatchURL.originalEvents = new Map();
|
|
10947
11385
|
|
|
10948
11386
|
class BaseReport {
|
|
11387
|
+
constructor() {
|
|
11388
|
+
this.expressionZeedhiToXls = {
|
|
11389
|
+
AVG: 'AVERAGE',
|
|
11390
|
+
COUNT: 'COUNTA',
|
|
11391
|
+
MAX: 'MAX',
|
|
11392
|
+
MIN: 'MIN',
|
|
11393
|
+
SUM: 'SUM',
|
|
11394
|
+
};
|
|
11395
|
+
this.colunmXLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
11396
|
+
}
|
|
10949
11397
|
buildColumns(columns) {
|
|
10950
11398
|
const widths = {};
|
|
10951
11399
|
let totalWidth;
|
|
@@ -11172,27 +11620,12 @@
|
|
|
11172
11620
|
}
|
|
11173
11621
|
|
|
11174
11622
|
class XLSReport extends BaseReport {
|
|
11175
|
-
constructor(
|
|
11176
|
-
super();
|
|
11623
|
+
constructor() {
|
|
11624
|
+
super(...arguments);
|
|
11177
11625
|
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
11626
|
}
|
|
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
|
-
}
|
|
11627
|
+
buildDataset(data, columns) {
|
|
11628
|
+
const result = this.formatRawDataSet(data, columns);
|
|
11196
11629
|
return JSON.stringify(result);
|
|
11197
11630
|
}
|
|
11198
11631
|
// formata o dataset para o formato "cru" xls
|
|
@@ -11236,27 +11669,55 @@
|
|
|
11236
11669
|
};
|
|
11237
11670
|
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11238
11671
|
}
|
|
11239
|
-
|
|
11240
|
-
|
|
11672
|
+
}
|
|
11673
|
+
|
|
11674
|
+
// XLS with groups
|
|
11675
|
+
class XLS2Report extends BaseReport {
|
|
11676
|
+
constructor() {
|
|
11677
|
+
super(...arguments);
|
|
11678
|
+
this.route = '/generateXLS';
|
|
11241
11679
|
}
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11680
|
+
buildDataset(data, metadata) {
|
|
11681
|
+
const result = this.formatDataSet(metadata, data);
|
|
11682
|
+
return JSON.stringify(result);
|
|
11683
|
+
}
|
|
11684
|
+
buildMetadata(name, title, columns, filter) {
|
|
11685
|
+
const builtCols = this.buildColumns(columns);
|
|
11686
|
+
const builtFilters = this.buildFilter(filter || {});
|
|
11687
|
+
const lang = this.formatLangCode(core.I18n.instance.language);
|
|
11688
|
+
const clientLogo = '';
|
|
11689
|
+
const enterpriseLogo = '';
|
|
11690
|
+
const productLogo = '';
|
|
11691
|
+
const metadataObj = {
|
|
11692
|
+
name,
|
|
11693
|
+
title,
|
|
11694
|
+
lang,
|
|
11695
|
+
clientLogo,
|
|
11696
|
+
enterpriseLogo,
|
|
11697
|
+
productLogo,
|
|
11698
|
+
version: '1.0',
|
|
11699
|
+
words: {
|
|
11700
|
+
Page: core.I18n.translate('PAGE'),
|
|
11701
|
+
Report: core.I18n.translate('REPORT'),
|
|
11702
|
+
Version: core.I18n.translate('VERSION'),
|
|
11703
|
+
},
|
|
11704
|
+
staticData: {},
|
|
11705
|
+
groups: [],
|
|
11706
|
+
reportName: name,
|
|
11707
|
+
widgetLabel: title,
|
|
11708
|
+
orientation: 'PORTRAIT',
|
|
11709
|
+
columns: builtCols,
|
|
11710
|
+
filter: builtFilters,
|
|
11711
|
+
reportXLS: true,
|
|
11712
|
+
xlsMergedCell: [],
|
|
11713
|
+
};
|
|
11714
|
+
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11255
11715
|
}
|
|
11256
11716
|
// Ordenar o nome das colunas de acordo com seu index, e sempre deixando as colunas agrupadas nas primeiras posições
|
|
11257
11717
|
getColumnsName(columns, metaData, lengthGroup) {
|
|
11258
11718
|
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11259
11719
|
let columnsName = [];
|
|
11720
|
+
const columnsGroupName = [];
|
|
11260
11721
|
Object.entries(columns).forEach((row) => {
|
|
11261
11722
|
const columnName = row[0];
|
|
11262
11723
|
const index = row[1].sequence;
|
|
@@ -11264,25 +11725,21 @@
|
|
|
11264
11725
|
columnsName[index + lengthGroup] = columnName;
|
|
11265
11726
|
}
|
|
11266
11727
|
else {
|
|
11267
|
-
|
|
11728
|
+
columnsGroupName.push(columnName);
|
|
11268
11729
|
}
|
|
11269
11730
|
});
|
|
11731
|
+
columnsName = columnsGroupName.concat(columnsName);
|
|
11270
11732
|
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11271
11733
|
return columnsName;
|
|
11272
11734
|
}
|
|
11273
11735
|
// Inicializa alguns valores auxiliares
|
|
11274
|
-
initVars(metaData
|
|
11736
|
+
initVars(metaData) {
|
|
11275
11737
|
metaData.xlsMergedCell = [];
|
|
11276
11738
|
const { columns } = metaData;
|
|
11277
11739
|
const lengthGroup = metaData.groups.length;
|
|
11278
11740
|
const indexLastGroup = lengthGroup - 1;
|
|
11279
11741
|
let columnsName = [];
|
|
11280
|
-
|
|
11281
|
-
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11282
|
-
}
|
|
11283
|
-
else {
|
|
11284
|
-
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11285
|
-
}
|
|
11742
|
+
columnsName = this.getColumnsName(columns, metaData, lengthGroup);
|
|
11286
11743
|
const rowValues = [];
|
|
11287
11744
|
const formatedDataSet = [];
|
|
11288
11745
|
const groups = [];
|
|
@@ -11292,33 +11749,6 @@
|
|
|
11292
11749
|
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11293
11750
|
};
|
|
11294
11751
|
}
|
|
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
11752
|
// formata as expressões da linha
|
|
11323
11753
|
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11324
11754
|
let funcXls = funcXlsParam;
|
|
@@ -11417,18 +11847,199 @@
|
|
|
11417
11847
|
});
|
|
11418
11848
|
}
|
|
11419
11849
|
formatDataSet(metaData, dataSet) {
|
|
11420
|
-
const initVars = this.initVars(metaData
|
|
11850
|
+
const initVars = this.initVars(metaData);
|
|
11421
11851
|
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
11422
11852
|
let { rowValues } = initVars;
|
|
11423
11853
|
dataSet.forEach((row) => {
|
|
11424
11854
|
if (row.group || row.groupFooter) {
|
|
11425
|
-
|
|
11426
|
-
|
|
11855
|
+
rowValues = this.setRowGroup(row, rowValues, groups, metaData, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
11856
|
+
}
|
|
11857
|
+
else {
|
|
11858
|
+
this.setIndexGroups(groups, formatedDataSet);
|
|
11859
|
+
this.setRowNormal(columnsName, rowValues, row);
|
|
11860
|
+
}
|
|
11861
|
+
if (!row.groupHeader) {
|
|
11862
|
+
formatedDataSet.push(rowValues);
|
|
11863
|
+
}
|
|
11864
|
+
rowValues = [];
|
|
11865
|
+
});
|
|
11866
|
+
return [columnsName].concat(formatedDataSet);
|
|
11867
|
+
}
|
|
11868
|
+
}
|
|
11869
|
+
|
|
11870
|
+
// Grid mirror (with groups)
|
|
11871
|
+
class XLS3Report extends BaseReport {
|
|
11872
|
+
constructor() {
|
|
11873
|
+
super(...arguments);
|
|
11874
|
+
this.route = '/generateXLS';
|
|
11875
|
+
}
|
|
11876
|
+
buildDataset(data, metadata) {
|
|
11877
|
+
const result = this.formatDataSet(metadata, data);
|
|
11878
|
+
return JSON.stringify(result);
|
|
11879
|
+
}
|
|
11880
|
+
buildMetadata(name, title, columns, filter) {
|
|
11881
|
+
const builtCols = this.buildColumns(columns);
|
|
11882
|
+
const builtFilters = this.buildFilter(filter || {});
|
|
11883
|
+
const lang = this.formatLangCode(core.I18n.instance.language);
|
|
11884
|
+
const clientLogo = '';
|
|
11885
|
+
const enterpriseLogo = '';
|
|
11886
|
+
const productLogo = '';
|
|
11887
|
+
const metadataObj = {
|
|
11888
|
+
name,
|
|
11889
|
+
title,
|
|
11890
|
+
lang,
|
|
11891
|
+
clientLogo,
|
|
11892
|
+
enterpriseLogo,
|
|
11893
|
+
productLogo,
|
|
11894
|
+
version: '1.0',
|
|
11895
|
+
words: {
|
|
11896
|
+
Page: core.I18n.translate('PAGE'),
|
|
11897
|
+
Report: core.I18n.translate('REPORT'),
|
|
11898
|
+
Version: core.I18n.translate('VERSION'),
|
|
11899
|
+
},
|
|
11900
|
+
staticData: {},
|
|
11901
|
+
groups: [],
|
|
11902
|
+
reportName: name,
|
|
11903
|
+
widgetLabel: title,
|
|
11904
|
+
orientation: 'PORTRAIT',
|
|
11905
|
+
columns: builtCols,
|
|
11906
|
+
filter: builtFilters,
|
|
11907
|
+
reportXLS: true,
|
|
11908
|
+
xlsMergedCell: [],
|
|
11909
|
+
};
|
|
11910
|
+
return Promise.resolve(JSON.stringify(metadataObj));
|
|
11911
|
+
}
|
|
11912
|
+
// Ordenar o nome das colunas de acordo com seu index, excluindo o nome das colunas agrupadas
|
|
11913
|
+
getColumnsNameFormat3(columns, metaData) {
|
|
11914
|
+
const columnsNameGroup = metaData.groups.map((row) => row.field);
|
|
11915
|
+
let columnsName = [];
|
|
11916
|
+
Object.entries(columns).forEach((row) => {
|
|
11917
|
+
const columnName = row[0];
|
|
11918
|
+
if (columnsNameGroup.indexOf(columnName) === -1) {
|
|
11919
|
+
const index = row[1].sequence;
|
|
11920
|
+
columnsName[index] = columnName;
|
|
11921
|
+
}
|
|
11922
|
+
});
|
|
11923
|
+
columnsName = columnsName.filter((columnName) => typeof columnName === 'string');
|
|
11924
|
+
return columnsName;
|
|
11925
|
+
}
|
|
11926
|
+
// Inicializa alguns valores auxiliares
|
|
11927
|
+
initVars(metaData) {
|
|
11928
|
+
metaData.xlsMergedCell = [];
|
|
11929
|
+
const { columns } = metaData;
|
|
11930
|
+
const lengthGroup = metaData.groups.length;
|
|
11931
|
+
const indexLastGroup = lengthGroup - 1;
|
|
11932
|
+
let columnsName = [];
|
|
11933
|
+
columnsName = this.getColumnsNameFormat3(columns, metaData);
|
|
11934
|
+
const rowValues = [];
|
|
11935
|
+
const formatedDataSet = [];
|
|
11936
|
+
const groups = [];
|
|
11937
|
+
groups.groupEnd = {};
|
|
11938
|
+
groups.groupEnd.cellsfunc = {};
|
|
11939
|
+
return {
|
|
11940
|
+
columns, indexLastGroup, columnsName, rowValues, formatedDataSet, groups,
|
|
11941
|
+
};
|
|
11942
|
+
}
|
|
11943
|
+
// formata a linha do grupo de acordo com o formato xls3
|
|
11944
|
+
setRowGroupFormat(row, rowValuesParam, groups, formatedDataSet, columnsName, columns, indexLastGroup) {
|
|
11945
|
+
let rowValues = rowValuesParam;
|
|
11946
|
+
const label = `${row.groupLabel}:${row.groupValue}`;
|
|
11947
|
+
const index = row.groupIndex;
|
|
11948
|
+
if (row.groupHeader) {
|
|
11949
|
+
rowValues[index] = label;
|
|
11950
|
+
groups[index] = { init: null, end: null };
|
|
11951
|
+
formatedDataSet.push(rowValues);
|
|
11952
|
+
rowValues = [];
|
|
11953
|
+
}
|
|
11954
|
+
else if (row.groupFooter) {
|
|
11955
|
+
if (!row.groupLabel) {
|
|
11956
|
+
rowValues.push('Total');
|
|
11957
|
+
}
|
|
11958
|
+
else {
|
|
11959
|
+
rowValues.push(`Total (${label})`);
|
|
11960
|
+
}
|
|
11961
|
+
formatedDataSet.push(rowValues);
|
|
11962
|
+
rowValues = [];
|
|
11963
|
+
const funcXls = null;
|
|
11964
|
+
columnsName.forEach((column) => {
|
|
11965
|
+
this.formatRowFunc(column, columns, row, index, rowValues, funcXls, groups, indexLastGroup);
|
|
11966
|
+
});
|
|
11967
|
+
}
|
|
11968
|
+
return rowValues;
|
|
11969
|
+
}
|
|
11970
|
+
// formata as expressões da linha
|
|
11971
|
+
formatRowFunc(column, columns, row, index, rowValues, funcXlsParam, groups, indexLastGroup) {
|
|
11972
|
+
let funcXls = funcXlsParam;
|
|
11973
|
+
if ((row[column] === 0 || row[column]) && index !== undefined) {
|
|
11974
|
+
const letter = this.colunmXLS[rowValues.length];
|
|
11975
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
11976
|
+
const cellsfunc = `${letter + groups[index].init}:${letter}${groups[index].end}`;
|
|
11977
|
+
let expression = '';
|
|
11978
|
+
if (indexLastGroup === index) {
|
|
11979
|
+
expression = `=${funcXls}(${cellsfunc})`;
|
|
11980
|
+
}
|
|
11981
|
+
else {
|
|
11982
|
+
expression = `=${funcXls}(${groups[index].cellsfunc[column]})`;
|
|
11983
|
+
if (index === 0) {
|
|
11984
|
+
if (groups.groupEnd.cellsfunc[column]) {
|
|
11985
|
+
groups.groupEnd.cellsfunc[column] += `,${groups[index].cellsfunc[column]}`;
|
|
11986
|
+
}
|
|
11987
|
+
else {
|
|
11988
|
+
groups.groupEnd.cellsfunc[column] = groups[index].cellsfunc[column];
|
|
11989
|
+
}
|
|
11427
11990
|
}
|
|
11428
|
-
|
|
11429
|
-
|
|
11991
|
+
groups[index].cellsfunc[column] = null;
|
|
11992
|
+
}
|
|
11993
|
+
rowValues.push(expression);
|
|
11994
|
+
groups.forEach((group, indexGroup) => {
|
|
11995
|
+
if (indexGroup !== indexLastGroup) {
|
|
11996
|
+
if (!group.cellsfunc) {
|
|
11997
|
+
group.cellsfunc = {};
|
|
11998
|
+
}
|
|
11999
|
+
if (group.cellsfunc[column]) {
|
|
12000
|
+
group.cellsfunc[column] += `,${cellsfunc}`;
|
|
12001
|
+
}
|
|
12002
|
+
else {
|
|
12003
|
+
group.cellsfunc[column] = cellsfunc;
|
|
12004
|
+
}
|
|
12005
|
+
}
|
|
12006
|
+
});
|
|
12007
|
+
}
|
|
12008
|
+
else {
|
|
12009
|
+
let cell = row[column];
|
|
12010
|
+
if (row.groupSummary) {
|
|
12011
|
+
const groupEndFunc = groups.groupEnd.cellsfunc;
|
|
12012
|
+
if (groupEndFunc[column]) {
|
|
12013
|
+
funcXls = this.expressionZeedhiToXls[columns[column].expression];
|
|
12014
|
+
cell = `=${funcXls}(${groupEndFunc[column]})`;
|
|
11430
12015
|
}
|
|
11431
12016
|
}
|
|
12017
|
+
rowValues.push(cell);
|
|
12018
|
+
}
|
|
12019
|
+
}
|
|
12020
|
+
// Defina o index dos grupos
|
|
12021
|
+
setIndexGroups(groups, formatedDataSet) {
|
|
12022
|
+
groups.forEach((group) => {
|
|
12023
|
+
if (!group.init) {
|
|
12024
|
+
group.init = formatedDataSet.length + 2;
|
|
12025
|
+
}
|
|
12026
|
+
group.end = formatedDataSet.length + 2;
|
|
12027
|
+
});
|
|
12028
|
+
}
|
|
12029
|
+
// Preenche uma linha "normal"
|
|
12030
|
+
setRowNormal(columnsName, rowValues, row) {
|
|
12031
|
+
columnsName.forEach((column) => {
|
|
12032
|
+
rowValues.push(row[column]);
|
|
12033
|
+
});
|
|
12034
|
+
}
|
|
12035
|
+
formatDataSet(metaData, dataSet) {
|
|
12036
|
+
const initVars = this.initVars(metaData);
|
|
12037
|
+
const { columns, indexLastGroup, columnsName, formatedDataSet, groups, } = initVars;
|
|
12038
|
+
let { rowValues } = initVars;
|
|
12039
|
+
dataSet.forEach((row) => {
|
|
12040
|
+
if (row.group || row.groupFooter) {
|
|
12041
|
+
rowValues = this.setRowGroupFormat(row, rowValues, groups, formatedDataSet, columnsName, columns, indexLastGroup);
|
|
12042
|
+
}
|
|
11432
12043
|
else {
|
|
11433
12044
|
this.setIndexGroups(groups, formatedDataSet);
|
|
11434
12045
|
this.setRowNormal(columnsName, rowValues, row);
|
|
@@ -11475,8 +12086,14 @@
|
|
|
11475
12086
|
if (type === 'pdf') {
|
|
11476
12087
|
return new PDFReport();
|
|
11477
12088
|
}
|
|
11478
|
-
if (type === 'xls'
|
|
11479
|
-
return new XLSReport(
|
|
12089
|
+
if (type === 'xls') {
|
|
12090
|
+
return new XLSReport();
|
|
12091
|
+
}
|
|
12092
|
+
if (type === 'xls2') {
|
|
12093
|
+
return new XLS2Report();
|
|
12094
|
+
}
|
|
12095
|
+
if (type === 'xls3') {
|
|
12096
|
+
return new XLS3Report();
|
|
11480
12097
|
}
|
|
11481
12098
|
throw new Error(`Invalid report type: ${type}`);
|
|
11482
12099
|
}
|
|
@@ -11495,10 +12112,10 @@
|
|
|
11495
12112
|
const formattedColumns = this.removeActionColumns(columns);
|
|
11496
12113
|
const metadataObj = yield reportType.buildMetadata(name, this.title, formattedColumns, datasource.filter, portrait);
|
|
11497
12114
|
let dataset;
|
|
11498
|
-
if ((reportType
|
|
12115
|
+
if ((reportType instanceof XLS2Report || reportType instanceof XLS3Report) && groupedData) {
|
|
11499
12116
|
const rowMetadata = rowObj.metaData;
|
|
11500
12117
|
const metadataObjClone = merge__default["default"](rowMetadata, JSON.parse(metadataObj));
|
|
11501
|
-
dataset = reportType.buildDataset(groupedData,
|
|
12118
|
+
dataset = reportType.buildDataset(groupedData, metadataObjClone);
|
|
11502
12119
|
}
|
|
11503
12120
|
else {
|
|
11504
12121
|
dataset = reportType.buildDataset(data, formattedColumns);
|
|
@@ -11623,6 +12240,7 @@
|
|
|
11623
12240
|
exports.SelectMultiple = SelectMultiple;
|
|
11624
12241
|
exports.SelectTree = SelectTree;
|
|
11625
12242
|
exports.SelectTreeMultiple = SelectTreeMultiple;
|
|
12243
|
+
exports.SelectableList = SelectableList;
|
|
11626
12244
|
exports.SpeedDial = SpeedDial;
|
|
11627
12245
|
exports.Steppers = Steppers;
|
|
11628
12246
|
exports.SvgMap = SvgMap;
|
|
@@ -11642,6 +12260,8 @@
|
|
|
11642
12260
|
exports.TreeGrid = TreeGrid;
|
|
11643
12261
|
exports.TreeGridEditable = TreeGridEditable;
|
|
11644
12262
|
exports.WatchURL = WatchURL;
|
|
12263
|
+
exports.XLS2Report = XLS2Report;
|
|
12264
|
+
exports.XLS3Report = XLS3Report;
|
|
11645
12265
|
exports.XLSReport = XLSReport;
|
|
11646
12266
|
exports.initTheme = initTheme;
|
|
11647
12267
|
|