@zeedhi/common 1.40.0 → 1.43.1
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/zd-common.esm.js +569 -43
- package/dist/zd-common.umd.js +572 -45
- package/package.json +2 -2
- package/types/components/index.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-carousel/carousel.d.ts +10 -0
- package/types/components/zd-carousel/interfaces.d.ts +2 -0
- 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-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-dropdown/dropdown.d.ts +4 -0
- package/types/components/zd-dropdown/interfaces.d.ts +1 -0
- package/types/components/zd-form/form.d.ts +4 -0
- 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-editable.d.ts +11 -1
- package/types/components/zd-list/interfaces.d.ts +3 -0
- package/types/components/zd-list/list.d.ts +12 -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-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/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
|
/**
|
|
@@ -431,8 +431,43 @@
|
|
|
431
431
|
* Defines the load progress color
|
|
432
432
|
*/
|
|
433
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
|
+
};
|
|
434
469
|
this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
|
|
435
|
-
this.options = this.getInitValue('options', props.options, this.options);
|
|
470
|
+
this.options = merge__default["default"](this.defaultOptions, this.getInitValue('options', props.options, this.options));
|
|
436
471
|
this.series = this.getInitValue('series', props.series, this.series);
|
|
437
472
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
438
473
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
@@ -449,6 +484,14 @@
|
|
|
449
484
|
setViewUpdate(viewUpdate) {
|
|
450
485
|
this.viewUpdate = viewUpdate;
|
|
451
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
|
+
}
|
|
452
495
|
/**
|
|
453
496
|
* Update the chart
|
|
454
497
|
* @param options New options
|
|
@@ -463,6 +506,249 @@
|
|
|
463
506
|
}
|
|
464
507
|
return Promise.resolve();
|
|
465
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
|
+
}
|
|
466
752
|
}
|
|
467
753
|
|
|
468
754
|
/**
|
|
@@ -821,6 +1107,16 @@
|
|
|
821
1107
|
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
822
1108
|
*/
|
|
823
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';
|
|
824
1120
|
/**
|
|
825
1121
|
* Configures the carousel as infinite (the slide after the last one is the first slide, and vice-versa)
|
|
826
1122
|
*/
|
|
@@ -912,6 +1208,8 @@
|
|
|
912
1208
|
this.buttonsOutside = this.getInitValue('buttonsOutside', props.buttonsOutside, this.buttonsOutside);
|
|
913
1209
|
this.center = this.getInitValue('center', props.center, this.center);
|
|
914
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);
|
|
915
1213
|
this.infiniteScroll = this.getInitValue('infiniteScroll', props.infiniteScroll, this.infiniteScroll);
|
|
916
1214
|
this.initialSlide = this.getInitValue('initialSlide', props.initialSlide, this.initialSlide);
|
|
917
1215
|
this.currentSlide = this.getInitValue('currentSlide', props.currentSlide, this.initialSlide);
|
|
@@ -1147,6 +1445,7 @@
|
|
|
1147
1445
|
this.internalValue = {};
|
|
1148
1446
|
this.align = this.getInitValue('align', props.align, this.align);
|
|
1149
1447
|
this.justify = this.getInitValue('justify', props.justify, this.justify);
|
|
1448
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
1150
1449
|
this.internalValue = this.getInitValue('value', props.value, this.value);
|
|
1151
1450
|
this.createAccessors();
|
|
1152
1451
|
}
|
|
@@ -1736,6 +2035,10 @@
|
|
|
1736
2035
|
* Max height in pixels. 'none' means no limit.
|
|
1737
2036
|
*/
|
|
1738
2037
|
this.maxHeight = 'none';
|
|
2038
|
+
/**
|
|
2039
|
+
* Max height in pixels. 'none' means no limit.
|
|
2040
|
+
*/
|
|
2041
|
+
this.height = 'auto';
|
|
1739
2042
|
/**
|
|
1740
2043
|
* Language code to be used for highlight (js|javascript, css, html, json, ts|typescript, bash|shell)
|
|
1741
2044
|
* Other languages must be imported above
|
|
@@ -1755,6 +2058,7 @@
|
|
|
1755
2058
|
this.staticCode = this.getInitValue('staticCode', props.staticCode, this.staticCodeValue);
|
|
1756
2059
|
this.copyIcon = this.getInitValue('copyIcon', props.copyIcon, this.copyIcon);
|
|
1757
2060
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
2061
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
1758
2062
|
this.language = this.getInitValue('language', props.language, this.language);
|
|
1759
2063
|
this.showLineNumbers = this.getInitValue('showLineNumbers', props.showLineNumbers, this.showLineNumbers);
|
|
1760
2064
|
this.createAccessors();
|
|
@@ -1961,12 +2265,27 @@
|
|
|
1961
2265
|
* Adds height 100% to container.
|
|
1962
2266
|
*/
|
|
1963
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';
|
|
1964
2280
|
/**
|
|
1965
2281
|
* Removes viewport maximum-width size breakpoints.
|
|
1966
2282
|
*/
|
|
1967
2283
|
this.fluid = true;
|
|
1968
2284
|
this.fluid = this.getInitValue('fluid', props.fluid, this.fluid);
|
|
1969
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);
|
|
1970
2289
|
this.createAccessors();
|
|
1971
2290
|
}
|
|
1972
2291
|
}
|
|
@@ -2304,6 +2623,14 @@
|
|
|
2304
2623
|
* Dialog type (normal, success, error, warning, info)
|
|
2305
2624
|
*/
|
|
2306
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;
|
|
2307
2634
|
/**
|
|
2308
2635
|
* Default dialog buttons
|
|
2309
2636
|
* @private
|
|
@@ -2315,6 +2642,8 @@
|
|
|
2315
2642
|
events: { click: () => this.hide() },
|
|
2316
2643
|
}];
|
|
2317
2644
|
this.defaultValues = {
|
|
2645
|
+
confirmButton: this.confirmButton,
|
|
2646
|
+
denyButton: this.denyButton,
|
|
2318
2647
|
name: this.name,
|
|
2319
2648
|
maxWidth: this.maxWidth,
|
|
2320
2649
|
persistent: this.persistent,
|
|
@@ -2322,6 +2651,38 @@
|
|
|
2322
2651
|
title: this.title,
|
|
2323
2652
|
text: this.text,
|
|
2324
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
|
+
};
|
|
2325
2686
|
this.assignDialogProperties(props);
|
|
2326
2687
|
this.createAccessors();
|
|
2327
2688
|
}
|
|
@@ -2331,6 +2692,8 @@
|
|
|
2331
2692
|
*/
|
|
2332
2693
|
assignDialogProperties(dialog) {
|
|
2333
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);
|
|
2334
2697
|
this.name = this.getInitValue('name', dialog.name, this.defaultValues.name);
|
|
2335
2698
|
this.maxWidth = this.getInitValue('maxWidth', dialog.maxWidth, this.defaultValues.maxWidth);
|
|
2336
2699
|
this.persistent = this.getInitValue('persistent', dialog.persistent, this.defaultValues.persistent);
|
|
@@ -2343,6 +2706,7 @@
|
|
|
2343
2706
|
* Displays dialog
|
|
2344
2707
|
*/
|
|
2345
2708
|
show() {
|
|
2709
|
+
core.KeyMap.bind(this.clickDefaultButtonKeyMapping, this);
|
|
2346
2710
|
this.isVisible = true;
|
|
2347
2711
|
}
|
|
2348
2712
|
/**
|
|
@@ -2350,6 +2714,7 @@
|
|
|
2350
2714
|
*/
|
|
2351
2715
|
hide() {
|
|
2352
2716
|
this.isVisible = false;
|
|
2717
|
+
core.KeyMap.unbind(this.clickDefaultButtonKeyMapping, this);
|
|
2353
2718
|
}
|
|
2354
2719
|
}
|
|
2355
2720
|
|
|
@@ -3285,10 +3650,6 @@
|
|
|
3285
3650
|
* Sets the locale. Accepts a string with a BCP 47 language tag.
|
|
3286
3651
|
*/
|
|
3287
3652
|
this.locale = core.I18n.instance.language;
|
|
3288
|
-
/**
|
|
3289
|
-
* Defines if dates should be ordered
|
|
3290
|
-
*/
|
|
3291
|
-
this.orderedDates = false;
|
|
3292
3653
|
/**
|
|
3293
3654
|
* Allows changing displayed month with mouse scroll
|
|
3294
3655
|
*/
|
|
@@ -3312,15 +3673,12 @@
|
|
|
3312
3673
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
3313
3674
|
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
3314
3675
|
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
3315
|
-
this.orderedDates = this.getInitValue('orderedDates', props.orderedDates, this.orderedDates);
|
|
3316
3676
|
this.dateValidation = this.dateValidation.bind(this);
|
|
3317
|
-
this.dateValidateOrder = this.dateValidateOrder.bind(this);
|
|
3318
3677
|
this.displayFormat = this.getInitValue('displayFormat', props.displayFormat, this.displayFormat);
|
|
3319
3678
|
this.inputFormat = this.getInitValue('inputFormat', props.inputFormat, this.inputFormat);
|
|
3320
3679
|
this.firstDayOfWeek = this.getInitValue('firstDayOfWeek', props.firstDayOfWeek, this.firstDayOfWeek);
|
|
3321
3680
|
this.fullWidth = this.getInitValue('fullWidth', props.fullWidth, this.fullWidth);
|
|
3322
3681
|
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
3323
|
-
this.rules.push(this.dateValidation, this.dateValidateOrder);
|
|
3324
3682
|
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
3325
3683
|
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
3326
3684
|
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
@@ -3428,7 +3786,7 @@
|
|
|
3428
3786
|
const lastValue = this.value;
|
|
3429
3787
|
this.dateError = false;
|
|
3430
3788
|
this.value = this.parseISODateRangeValue(newValue);
|
|
3431
|
-
if (!core.isEqual(lastValue, this.value))
|
|
3789
|
+
if (!core.Utils.isEqual(lastValue, this.value))
|
|
3432
3790
|
this.change(this.value);
|
|
3433
3791
|
}
|
|
3434
3792
|
formatISODateRangeValue(dates) {
|
|
@@ -3437,13 +3795,13 @@
|
|
|
3437
3795
|
splitedValue = dates;
|
|
3438
3796
|
else
|
|
3439
3797
|
splitedValue = this.splitValues(dates);
|
|
3440
|
-
const
|
|
3798
|
+
const formattedValue = [];
|
|
3441
3799
|
splitedValue.forEach((value) => {
|
|
3442
3800
|
if (value && this.isValidDate(value, this.dateFormat)) {
|
|
3443
|
-
|
|
3801
|
+
formattedValue.push(core.dayjs(value, this.dateFormat, true).format(this.isoFormat));
|
|
3444
3802
|
}
|
|
3445
3803
|
});
|
|
3446
|
-
return
|
|
3804
|
+
return formattedValue;
|
|
3447
3805
|
}
|
|
3448
3806
|
parseISODateRangeValue(values) {
|
|
3449
3807
|
const parsedValue = [];
|
|
@@ -3454,19 +3812,14 @@
|
|
|
3454
3812
|
}
|
|
3455
3813
|
});
|
|
3456
3814
|
}
|
|
3457
|
-
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));
|
|
3458
3819
|
}
|
|
3459
3820
|
dateValidation() {
|
|
3460
3821
|
return !this.dateError || core.I18n.translate('VALIDATION_INVALID_DATE');
|
|
3461
3822
|
}
|
|
3462
|
-
dateValidateOrder() {
|
|
3463
|
-
if (this.value && (this.value.length === 2 && this.orderedDates)) {
|
|
3464
|
-
const date1 = core.dayjs(this.value[0], this.dateFormat);
|
|
3465
|
-
const date2 = core.dayjs(this.value[1], this.dateFormat);
|
|
3466
|
-
return (date1.isBefore(date2) || date1.isSame(date2)) || core.I18n.translate('VALIDATION_INVALID_ORDER_DATE');
|
|
3467
|
-
}
|
|
3468
|
-
return true;
|
|
3469
|
-
}
|
|
3470
3823
|
click(event, element) {
|
|
3471
3824
|
super.click(event, element);
|
|
3472
3825
|
if (!event.defaultPrevented) {
|
|
@@ -3474,6 +3827,7 @@
|
|
|
3474
3827
|
}
|
|
3475
3828
|
}
|
|
3476
3829
|
blur(event, element) {
|
|
3830
|
+
this.value = this.sortDates(this.value);
|
|
3477
3831
|
this.removeDateMask();
|
|
3478
3832
|
this.setDateValue(this.displayValue);
|
|
3479
3833
|
super.blur(event, element);
|
|
@@ -3690,6 +4044,10 @@
|
|
|
3690
4044
|
* Applies position fixed to the dropdown.
|
|
3691
4045
|
*/
|
|
3692
4046
|
this.fixed = false;
|
|
4047
|
+
/**
|
|
4048
|
+
* Sets the height for the dropdown.
|
|
4049
|
+
*/
|
|
4050
|
+
this.height = 'auto';
|
|
3693
4051
|
/**
|
|
3694
4052
|
* Offset the menu on the x-axis.
|
|
3695
4053
|
*/
|
|
@@ -3715,6 +4073,7 @@
|
|
|
3715
4073
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
3716
4074
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
3717
4075
|
this.hover = this.getInitValue('hover', props.hover, this.hover);
|
|
4076
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
3718
4077
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
3719
4078
|
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
3720
4079
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
@@ -3976,12 +4335,18 @@
|
|
|
3976
4335
|
this.override = {};
|
|
3977
4336
|
this.cache = false;
|
|
3978
4337
|
this.cacheDuration = 2 * 60 * 60 * 1000;
|
|
4338
|
+
this.height = 'auto';
|
|
4339
|
+
this.maxHeight = 'none';
|
|
4340
|
+
this.minHeight = 'none';
|
|
3979
4341
|
this.headerName = 'sw-fetched-on';
|
|
3980
4342
|
this.path = props.path;
|
|
3981
4343
|
this.local = props.local === true;
|
|
3982
4344
|
this.override = props.override || this.override;
|
|
3983
4345
|
this.cache = props.cache || this.cache;
|
|
3984
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);
|
|
3985
4350
|
this.createAccessors();
|
|
3986
4351
|
this.getMetadata();
|
|
3987
4352
|
}
|
|
@@ -4002,6 +4367,12 @@
|
|
|
4002
4367
|
}
|
|
4003
4368
|
});
|
|
4004
4369
|
}
|
|
4370
|
+
reload() {
|
|
4371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4372
|
+
this.loading = true;
|
|
4373
|
+
this.getMetadata();
|
|
4374
|
+
});
|
|
4375
|
+
}
|
|
4005
4376
|
notFoundError() { }
|
|
4006
4377
|
requestPage() {
|
|
4007
4378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4492,7 +4863,7 @@
|
|
|
4492
4863
|
if (this.componentProps.dataValueOut && ((_a = component.datasource) === null || _a === void 0 ? void 0 : _a.currentRow)) {
|
|
4493
4864
|
this.componentProps.dataValueOut.forEach((columns) => {
|
|
4494
4865
|
const { column, columnOnGrid } = columns;
|
|
4495
|
-
if (!core.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
|
|
4866
|
+
if (!core.Utils.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
|
|
4496
4867
|
newRow[`${columnOnGrid}_original`] = newRow.originalRow[columnOnGrid];
|
|
4497
4868
|
newRow[columnOnGrid] = component.datasource.currentRow[column];
|
|
4498
4869
|
}
|
|
@@ -4506,7 +4877,7 @@
|
|
|
4506
4877
|
}
|
|
4507
4878
|
}
|
|
4508
4879
|
core.FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
|
|
4509
|
-
if (
|
|
4880
|
+
if (value === null || value === undefined)
|
|
4510
4881
|
return '';
|
|
4511
4882
|
const { dataText, formatterDataText, dataTextSeparator, dataValue, } = componentProps;
|
|
4512
4883
|
let currentRow = row;
|
|
@@ -4554,7 +4925,7 @@
|
|
|
4554
4925
|
});
|
|
4555
4926
|
return dataTextNames.reduce((result, columnName, index) => {
|
|
4556
4927
|
const rowCell = currentRow[columnName];
|
|
4557
|
-
if (rowCell) {
|
|
4928
|
+
if (rowCell !== undefined && rowCell !== null) {
|
|
4558
4929
|
const separator = index > 0 ? (dataTextSeparator || ' | ') : '';
|
|
4559
4930
|
const mask = masks[index];
|
|
4560
4931
|
const maskValue = typeof mask === 'function' ? mask(rowCell) : mask;
|
|
@@ -4884,6 +5255,7 @@
|
|
|
4884
5255
|
var _a, _b, _c;
|
|
4885
5256
|
const rowKey = row[this.datasource.uniqueKey];
|
|
4886
5257
|
const compName = actionComponent.name;
|
|
5258
|
+
const instanceName = `${compName}_${rowKey}`;
|
|
4887
5259
|
const path = parentPath ? `${parentPath}.${compName}` : compName;
|
|
4888
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]);
|
|
4889
5261
|
let compEvents = {};
|
|
@@ -4898,7 +5270,16 @@
|
|
|
4898
5270
|
}
|
|
4899
5271
|
} });
|
|
4900
5272
|
const newChildren = (_c = newComponent.children) === null || _c === void 0 ? void 0 : _c.map((child) => this.getActionComponent(child, column, row, path));
|
|
4901
|
-
|
|
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;
|
|
4902
5283
|
}
|
|
4903
5284
|
changeDefaultSlotNames(slot) {
|
|
4904
5285
|
slot.forEach((item) => {
|
|
@@ -4963,15 +5344,36 @@
|
|
|
4963
5344
|
* @private
|
|
4964
5345
|
*/
|
|
4965
5346
|
this.editedRows = {};
|
|
5347
|
+
/**
|
|
5348
|
+
* Rows with newRowIdentifier
|
|
5349
|
+
* @private
|
|
5350
|
+
*/
|
|
5351
|
+
this.addedRows = {};
|
|
4966
5352
|
/**
|
|
4967
5353
|
* Invalid inline components
|
|
4968
5354
|
* @private
|
|
4969
5355
|
*/
|
|
4970
5356
|
this.invalidComponents = {};
|
|
5357
|
+
this.cancelEditedRowsKeyMapping = {
|
|
5358
|
+
esc: {
|
|
5359
|
+
event: this.cancelEditedRows.bind(this),
|
|
5360
|
+
stop: true,
|
|
5361
|
+
input: true,
|
|
5362
|
+
active: true,
|
|
5363
|
+
},
|
|
5364
|
+
};
|
|
4971
5365
|
this.newRowIdentifier = '__added_row';
|
|
4972
5366
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
4973
5367
|
this.createAccessors();
|
|
4974
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
|
+
}
|
|
4975
5377
|
/**
|
|
4976
5378
|
* Get Grid columns objects
|
|
4977
5379
|
* @param columns Grid columns parameter
|
|
@@ -5141,7 +5543,7 @@
|
|
|
5141
5543
|
changeEditableComponent(column, row, value, component) {
|
|
5142
5544
|
const key = row[this.datasource.uniqueKey];
|
|
5143
5545
|
const columnName = column.name;
|
|
5144
|
-
if (!core.isEqual(value, row[columnName])) {
|
|
5546
|
+
if (!core.Utils.isEqual(value, row[columnName])) {
|
|
5145
5547
|
const newRow = {};
|
|
5146
5548
|
newRow[key] = Object.assign({}, this.editedRows[key]);
|
|
5147
5549
|
newRow[key].originalRow = Object.assign({}, row);
|
|
@@ -5187,6 +5589,14 @@
|
|
|
5187
5589
|
* Cancels all edited rows and enable grid components
|
|
5188
5590
|
*/
|
|
5189
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() {
|
|
5190
5600
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5191
5601
|
const { data } = this.datasource;
|
|
5192
5602
|
data.forEach((row, index) => {
|
|
@@ -5195,21 +5605,26 @@
|
|
|
5195
5605
|
}
|
|
5196
5606
|
});
|
|
5197
5607
|
yield this.datasource.updateData(data);
|
|
5198
|
-
this.editing = false;
|
|
5199
|
-
this.editedRows = {};
|
|
5200
|
-
this.invalidComponents = {};
|
|
5201
5608
|
});
|
|
5202
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
|
+
}
|
|
5203
5616
|
/**
|
|
5204
5617
|
* Saves all edited rows if they are valid
|
|
5205
5618
|
* @throws Will throw when it finds an invalid row
|
|
5206
5619
|
*/
|
|
5207
5620
|
saveEditedRows() {
|
|
5208
5621
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5209
|
-
|
|
5622
|
+
yield this.removeAddedRows();
|
|
5623
|
+
const response = yield Promise.all(this.getEditedRows().map((row) => this.addDataRow(row)));
|
|
5210
5624
|
this.editing = false;
|
|
5211
5625
|
this.editedRows = {};
|
|
5212
5626
|
this.invalidComponents = {};
|
|
5627
|
+
this.addedRows = {};
|
|
5213
5628
|
yield this.datasource.get();
|
|
5214
5629
|
return response;
|
|
5215
5630
|
});
|
|
@@ -5221,8 +5636,11 @@
|
|
|
5221
5636
|
getEditedRows() {
|
|
5222
5637
|
const editedRows = [];
|
|
5223
5638
|
Object.keys(this.editedRows).forEach((key) => {
|
|
5639
|
+
this.addedRows = {};
|
|
5224
5640
|
const row = Object.assign(Object.assign({}, this.editedRows[key].originalRow), this.editedRows[key]);
|
|
5225
5641
|
delete row.originalRow;
|
|
5642
|
+
if (row[this.newRowIdentifier])
|
|
5643
|
+
this.addedRows[key] = row;
|
|
5226
5644
|
delete row[this.newRowIdentifier];
|
|
5227
5645
|
Object.keys(row).forEach((attr) => {
|
|
5228
5646
|
if (Object.prototype.hasOwnProperty.call(row, `${attr}_original`)) {
|
|
@@ -5916,11 +6334,12 @@
|
|
|
5916
6334
|
overrideGet() {
|
|
5917
6335
|
const oldGet = this.datasource.get;
|
|
5918
6336
|
this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
|
|
5919
|
-
yield oldGet.call(this.datasource);
|
|
5920
|
-
if (this.indexOf(this.value)
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
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;
|
|
5924
6343
|
});
|
|
5925
6344
|
}
|
|
5926
6345
|
get search() {
|
|
@@ -6260,10 +6679,10 @@
|
|
|
6260
6679
|
}
|
|
6261
6680
|
}
|
|
6262
6681
|
core.FormatterParserProvider.registerFormatter('ZdSelect', (value, { dataText, dataTextSeparator = ' | ', }) => {
|
|
6263
|
-
if (
|
|
6682
|
+
if (value === null || value === undefined) {
|
|
6264
6683
|
return null;
|
|
6265
6684
|
}
|
|
6266
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
6685
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
6267
6686
|
return value;
|
|
6268
6687
|
}
|
|
6269
6688
|
const dataTextArr = Array.isArray(dataText) ? dataText : [dataText];
|
|
@@ -6286,7 +6705,7 @@
|
|
|
6286
6705
|
}
|
|
6287
6706
|
});
|
|
6288
6707
|
return dataTextNames.reduce((result, column, index) => {
|
|
6289
|
-
if (value[column]) {
|
|
6708
|
+
if (value[column] !== null && value[column] !== undefined) {
|
|
6290
6709
|
const separator = index > 0 ? dataTextSeparator : '';
|
|
6291
6710
|
let masked = value[column];
|
|
6292
6711
|
if (masks[index]) {
|
|
@@ -6505,6 +6924,18 @@
|
|
|
6505
6924
|
* Will only collapse when explicitly closed.
|
|
6506
6925
|
*/
|
|
6507
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';
|
|
6508
6939
|
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
6509
6940
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
6510
6941
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
@@ -6516,6 +6947,9 @@
|
|
|
6516
6947
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
6517
6948
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
6518
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);
|
|
6519
6953
|
this.createAccessors();
|
|
6520
6954
|
}
|
|
6521
6955
|
/**
|
|
@@ -7197,7 +7631,7 @@
|
|
|
7197
7631
|
if (item.component === 'ZdMenuGroup') {
|
|
7198
7632
|
this.searchItems(item.items);
|
|
7199
7633
|
}
|
|
7200
|
-
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) {
|
|
7201
7635
|
this.filteredMenuItems.push(item);
|
|
7202
7636
|
}
|
|
7203
7637
|
}
|
|
@@ -8879,6 +9313,40 @@
|
|
|
8879
9313
|
}
|
|
8880
9314
|
}
|
|
8881
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
|
+
|
|
8882
9350
|
/**
|
|
8883
9351
|
* Base class for SpeedDial component.
|
|
8884
9352
|
*/
|
|
@@ -9224,6 +9692,7 @@
|
|
|
9224
9692
|
this.tabs = [];
|
|
9225
9693
|
this.tabs = this.getTabs(props.tabs || []);
|
|
9226
9694
|
this.activeTab = this.getInitValue('activeTab', props.activeTab, this.activeTab);
|
|
9695
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
9227
9696
|
this.createAccessors();
|
|
9228
9697
|
}
|
|
9229
9698
|
getTabs(tabs) {
|
|
@@ -9236,6 +9705,31 @@
|
|
|
9236
9705
|
}
|
|
9237
9706
|
return tab;
|
|
9238
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
|
+
}
|
|
9239
9733
|
/**
|
|
9240
9734
|
* Triggered before tab is change.
|
|
9241
9735
|
* @param event DOM event
|
|
@@ -10087,9 +10581,25 @@
|
|
|
10087
10581
|
* Enter edit mode on double click
|
|
10088
10582
|
*/
|
|
10089
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
|
+
};
|
|
10090
10592
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
10091
10593
|
this.createAccessors();
|
|
10092
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
|
+
}
|
|
10093
10603
|
/**
|
|
10094
10604
|
* Get Grid columns objects
|
|
10095
10605
|
* @param columns Grid columns parameter
|
|
@@ -10258,7 +10768,7 @@
|
|
|
10258
10768
|
changeEditableComponent(column, row, value, component) {
|
|
10259
10769
|
const key = row[this.datasource.uniqueKey];
|
|
10260
10770
|
const columnName = column.name;
|
|
10261
|
-
if (!core.isEqual(value, row[columnName])) {
|
|
10771
|
+
if (!core.Utils.isEqual(value, row[columnName])) {
|
|
10262
10772
|
const newRow = {};
|
|
10263
10773
|
newRow[key] = Object.assign({}, this.editedRows[key]);
|
|
10264
10774
|
newRow[key].originalRow = Object.assign({}, row);
|
|
@@ -10532,6 +11042,12 @@
|
|
|
10532
11042
|
tableColumns: 'mdi-table-headers-eye',
|
|
10533
11043
|
unfold: 'mdi-unfold-more-horizontal',
|
|
10534
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',
|
|
10535
11051
|
};
|
|
10536
11052
|
Icons.faIcons = {
|
|
10537
11053
|
alertOctagon: 'fa fa-exclamation-circle',
|
|
@@ -10582,6 +11098,12 @@
|
|
|
10582
11098
|
tableColumns: 'fa fa-columns',
|
|
10583
11099
|
unfold: 'fa fa-sort',
|
|
10584
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',
|
|
10585
11107
|
};
|
|
10586
11108
|
Icons.icons = (() => Icons.mdiIcons)();
|
|
10587
11109
|
|
|
@@ -10619,10 +11141,14 @@
|
|
|
10619
11141
|
light: {
|
|
10620
11142
|
'font-color': 'var(--v-grey-darken2)',
|
|
10621
11143
|
'background-base': '#F6F6F6',
|
|
11144
|
+
'scrollbar-track': 'var(--v-grey-lighten5)',
|
|
11145
|
+
'scrollbar-thumb': 'var(--v-grey-lighten4)',
|
|
10622
11146
|
},
|
|
10623
11147
|
dark: {
|
|
10624
11148
|
'font-color': 'var(--v-grey-lighten3)',
|
|
10625
11149
|
'background-base': '#121212',
|
|
11150
|
+
'scrollbar-track': 'var(--v-grey-darken3)',
|
|
11151
|
+
'scrollbar-thumb': 'var(--v-grey-base)',
|
|
10626
11152
|
},
|
|
10627
11153
|
variables: {
|
|
10628
11154
|
'default-padding': '16px',
|
|
@@ -11714,6 +12240,7 @@
|
|
|
11714
12240
|
exports.SelectMultiple = SelectMultiple;
|
|
11715
12241
|
exports.SelectTree = SelectTree;
|
|
11716
12242
|
exports.SelectTreeMultiple = SelectTreeMultiple;
|
|
12243
|
+
exports.SelectableList = SelectableList;
|
|
11717
12244
|
exports.SpeedDial = SpeedDial;
|
|
11718
12245
|
exports.Steppers = Steppers;
|
|
11719
12246
|
exports.SvgMap = SvgMap;
|