@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.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AccessorManager, Event, KeyMap, Metadata, FormatterParserProvider, Validation, Accessor, DatasourceFactory, I18n, MethodNotAssignedError, Loader, Mask, Config, dayjs,
|
|
1
|
+
import { AccessorManager, Event, KeyMap, Metadata, FormatterParserProvider, Validation, Accessor, DatasourceFactory, I18n, MethodNotAssignedError, Loader, Mask, Config, dayjs, Utils, Router, InstanceNotFoundError, Http, Cookie, URL as URL$1 } from '@zeedhi/core';
|
|
2
|
+
import merge from 'lodash.merge';
|
|
2
3
|
import debounce from 'lodash.debounce';
|
|
3
4
|
import isUndefined from 'lodash.isundefined';
|
|
4
|
-
import merge from 'lodash.merge';
|
|
5
5
|
import set from 'lodash.set';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -424,8 +424,43 @@ class ApexChart extends ComponentRender {
|
|
|
424
424
|
* Defines the load progress color
|
|
425
425
|
*/
|
|
426
426
|
this.loadColor = 'primary';
|
|
427
|
+
this.defaultOptions = {
|
|
428
|
+
chart: {
|
|
429
|
+
toolbar: {
|
|
430
|
+
tools: {
|
|
431
|
+
download: 'fileDownload',
|
|
432
|
+
selection: 'zoomSelection',
|
|
433
|
+
zoom: 'zoom',
|
|
434
|
+
zoomin: 'zoomIn',
|
|
435
|
+
zoomout: 'zoomOut',
|
|
436
|
+
pan: 'zoomPanning',
|
|
437
|
+
reset: 'zoomReset',
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
events: {
|
|
441
|
+
animationEnd: this.animationEndEvent.bind(this),
|
|
442
|
+
beforeMount: this.beforeMountEvent.bind(this),
|
|
443
|
+
mounted: this.mountedEvent.bind(this),
|
|
444
|
+
updated: this.updatedEvent.bind(this),
|
|
445
|
+
click: this.clickEvent.bind(this),
|
|
446
|
+
mouseMove: this.mouseMoveEvent.bind(this),
|
|
447
|
+
mouseLeave: this.mouseLeaveEvent.bind(this),
|
|
448
|
+
legendClick: this.legendClickEvent.bind(this),
|
|
449
|
+
markerClick: this.markerClickEvent.bind(this),
|
|
450
|
+
selection: this.selectionEvent.bind(this),
|
|
451
|
+
dataPointSelection: this.dataPointSelectionEvent.bind(this),
|
|
452
|
+
dataPointMouseEnter: this.dataPointMouseEnterEvent.bind(this),
|
|
453
|
+
dataPointMouseLeave: this.dataPointMouseLeaveEvent.bind(this),
|
|
454
|
+
beforeZoom: this.beforeZoomEvent.bind(this),
|
|
455
|
+
beforeResetZoom: this.beforeResetZoomEvent.bind(this),
|
|
456
|
+
zoomed: this.zoomedEvent.bind(this),
|
|
457
|
+
scrolled: this.scrolledEvent.bind(this),
|
|
458
|
+
brushScrolled: this.brushScrolledEvent.bind(this),
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
};
|
|
427
462
|
this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
|
|
428
|
-
this.options = this.getInitValue('options', props.options, this.options);
|
|
463
|
+
this.options = merge(this.defaultOptions, this.getInitValue('options', props.options, this.options));
|
|
429
464
|
this.series = this.getInitValue('series', props.series, this.series);
|
|
430
465
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
431
466
|
this.width = this.getInitValue('width', props.width, this.width);
|
|
@@ -442,6 +477,14 @@ class ApexChart extends ComponentRender {
|
|
|
442
477
|
setViewUpdate(viewUpdate) {
|
|
443
478
|
this.viewUpdate = viewUpdate;
|
|
444
479
|
}
|
|
480
|
+
/**
|
|
481
|
+
* Sets view get icon HTML method.
|
|
482
|
+
* @param viewGetIconHTML Update method
|
|
483
|
+
*/
|
|
484
|
+
setViewGetIconHTML(viewGetIconHTML) {
|
|
485
|
+
this.viewGetIconHTML = viewGetIconHTML;
|
|
486
|
+
this.updateToolbarIcons();
|
|
487
|
+
}
|
|
445
488
|
/**
|
|
446
489
|
* Update the chart
|
|
447
490
|
* @param options New options
|
|
@@ -456,6 +499,249 @@ class ApexChart extends ComponentRender {
|
|
|
456
499
|
}
|
|
457
500
|
return Promise.resolve();
|
|
458
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Fires when the chart’s initial animation is finished
|
|
504
|
+
* @param chartContext
|
|
505
|
+
* @param config
|
|
506
|
+
* @param element DOM Element
|
|
507
|
+
*/
|
|
508
|
+
animationEndEvent(chartContext, options) {
|
|
509
|
+
this.callEvent('chartAnimationEnd', { component: this, chartContext, options });
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Fires before the chart has been drawn on screen
|
|
513
|
+
* @param chartContext
|
|
514
|
+
* @param config
|
|
515
|
+
* @param element DOM Element
|
|
516
|
+
*/
|
|
517
|
+
beforeMountEvent(chartContext, config) {
|
|
518
|
+
this.callEvent('chartBeforeMount', {
|
|
519
|
+
component: this, chartContext, config,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Fires after the chart has been drawn on screen
|
|
524
|
+
* @param chartContext
|
|
525
|
+
* @param config
|
|
526
|
+
* @param element DOM Element
|
|
527
|
+
*/
|
|
528
|
+
mountedEvent(chartContext, config) {
|
|
529
|
+
this.callEvent('chartMounted', {
|
|
530
|
+
component: this, chartContext, config,
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Fires when the chart has been dynamically updated either with
|
|
535
|
+
* updateOptions() or updateSeries() functions
|
|
536
|
+
* @param chartContext
|
|
537
|
+
* @param config
|
|
538
|
+
* @param element DOM Element
|
|
539
|
+
*/
|
|
540
|
+
updatedEvent(chartContext, config) {
|
|
541
|
+
this.callEvent('chartUpdated', {
|
|
542
|
+
component: this, chartContext, config,
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Fires when the chart has been dynamically updated either with
|
|
547
|
+
* updateOptions() or updateSeries() functions
|
|
548
|
+
* @param event Event that triggered the click event
|
|
549
|
+
* @param chartContext
|
|
550
|
+
* @param config
|
|
551
|
+
* @param element DOM Element
|
|
552
|
+
*/
|
|
553
|
+
clickEvent(event, chartContext, config) {
|
|
554
|
+
this.callEvent('chartClick', {
|
|
555
|
+
event, component: this, chartContext, config,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Fires when user moves mouse on any area of the chart.
|
|
560
|
+
* @param event Event that triggered the click event
|
|
561
|
+
* @param chartContext
|
|
562
|
+
* @param config
|
|
563
|
+
* @param element DOM Element
|
|
564
|
+
*/
|
|
565
|
+
mouseMoveEvent(event, chartContext, config) {
|
|
566
|
+
this.callEvent('chartMouseMove', {
|
|
567
|
+
event, component: this, chartContext, config,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Fires when user moves mouse on any area of the chart.
|
|
572
|
+
* @param event Event that triggered the mouse leave
|
|
573
|
+
* @param chartContext
|
|
574
|
+
* @param config New config
|
|
575
|
+
* @param element DOM Element
|
|
576
|
+
*/
|
|
577
|
+
mouseLeaveEvent(event, chartContext, config) {
|
|
578
|
+
this.callEvent('chartMouseLeave', {
|
|
579
|
+
event, component: this, chartContext, config,
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Fires when user moves mouse on any area of the chart.
|
|
584
|
+
* @param chartContext
|
|
585
|
+
* @param seriesIndex
|
|
586
|
+
* @param config
|
|
587
|
+
* @param element DOM Element
|
|
588
|
+
*/
|
|
589
|
+
legendClickEvent(chartContext, seriesIndex, config) {
|
|
590
|
+
this.callEvent('chartLegendClick', {
|
|
591
|
+
component: this, chartContext, seriesIndex, config,
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Fires when user moves mouse on any area of the chart.
|
|
596
|
+
* @param event Event that triggered the marker click
|
|
597
|
+
* @param chartContext
|
|
598
|
+
* @param option New config
|
|
599
|
+
* @param element DOM Element
|
|
600
|
+
*/
|
|
601
|
+
markerClickEvent(event, chartContext, config) {
|
|
602
|
+
this.callEvent('chartMarkerClick', {
|
|
603
|
+
event, component: this, chartContext, config,
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Fires when user selects rect using the selection tool.
|
|
608
|
+
* The second argument
|
|
609
|
+
* @param chartContext
|
|
610
|
+
* @param config contains the yaxis and xaxis coordinates where user made the selection
|
|
611
|
+
* @param element DOM Element
|
|
612
|
+
*/
|
|
613
|
+
selectionEvent(chartContext, config) {
|
|
614
|
+
this.callEvent('chartSelection', {
|
|
615
|
+
component: this, chartContext, config,
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Fires when user clicks on a datapoint (bar/column/marker/bubble/donut-slice).
|
|
620
|
+
* @param event Event that triggered when user clicks on a datapoint
|
|
621
|
+
* @param chartContext
|
|
622
|
+
* @param config The config object, also includes additional information like
|
|
623
|
+
* which dataPointIndex was selected of which series.
|
|
624
|
+
* @param element DOM Element
|
|
625
|
+
*/
|
|
626
|
+
dataPointSelectionEvent(event, chartContext, config) {
|
|
627
|
+
this.callEvent('chartDataPointSelection', {
|
|
628
|
+
event, component: this, chartContext, config,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Fires when user clicks on a datapoint (bar/column/marker/bubble/donut-slice).
|
|
633
|
+
* @param event Event that triggered when user’s mouse enter on a datapoint
|
|
634
|
+
* @param chartContext
|
|
635
|
+
* @param config The config object, also includes additional information like
|
|
636
|
+
* which dataPointIndex was hovered of particular series.
|
|
637
|
+
* @param element DOM Element
|
|
638
|
+
*/
|
|
639
|
+
dataPointMouseEnterEvent(event, chartContext, config) {
|
|
640
|
+
this.callEvent('chartDataPointMouseEnter', {
|
|
641
|
+
event, component: this, chartContext, config,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* MouseLeave event for a datapoint (bar/column/marker/bubble/donut-slice).
|
|
646
|
+
* @param event Event that triggered the beforeSlide event
|
|
647
|
+
* @param chartContext
|
|
648
|
+
* @param config
|
|
649
|
+
* @param element DOM Element
|
|
650
|
+
*/
|
|
651
|
+
dataPointMouseLeaveEvent(event, chartContext, config) {
|
|
652
|
+
this.callEvent('chartDataPointMouseLeave', {
|
|
653
|
+
event, component: this, chartContext, config,
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* This function, if defined, runs just before zooming in/out of the chart
|
|
658
|
+
* allowing you to set a custom range for zooming in/out.
|
|
659
|
+
* @param chartContext
|
|
660
|
+
* @param config { min: timestamp, max: timestamp }
|
|
661
|
+
* @param element DOM Element
|
|
662
|
+
*/
|
|
663
|
+
beforeZoomEvent(chartContext, config) {
|
|
664
|
+
this.callEvent('chartBeforeZoom', {
|
|
665
|
+
component: this, chartContext, config,
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* This function, if defined, runs just before the user hits the HOME button
|
|
670
|
+
* on the toolbar to reset the chart to it’s original state. The function
|
|
671
|
+
* allows you to set a custom axes range for the initial view of the chart.
|
|
672
|
+
* @param chartContext
|
|
673
|
+
* @param config { min: timestamp, max: timestamp }
|
|
674
|
+
* @param element DOM Element
|
|
675
|
+
*/
|
|
676
|
+
beforeResetZoomEvent(chartContext, config) {
|
|
677
|
+
this.callEvent('chartBeforeResetZoom', {
|
|
678
|
+
component: this, chartContext, config,
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Fires when user zooms in/out the chart using either the selection zooming
|
|
683
|
+
* tool or zoom in/out buttons.
|
|
684
|
+
* The 2nd argument includes information of the new xaxis/yaxis generated after zooming.
|
|
685
|
+
* @param chartContext
|
|
686
|
+
* @param config { min: timestamp, max: timestamp }
|
|
687
|
+
* @param element DOM Element
|
|
688
|
+
*/
|
|
689
|
+
zoomedEvent(chartContext, config) {
|
|
690
|
+
this.callEvent('chartZoomed', {
|
|
691
|
+
component: this, chartContext, config,
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Fires when user scrolls using the pan tool.
|
|
696
|
+
* The 2nd argument includes information of the new xaxis generated after scrolling.
|
|
697
|
+
* @param chartContext
|
|
698
|
+
* @param config { xaxis: any }
|
|
699
|
+
* @param element DOM Element
|
|
700
|
+
*/
|
|
701
|
+
scrolledEvent(chartContext, config) {
|
|
702
|
+
this.callEvent('chartScrolled', {
|
|
703
|
+
component: this, chartContext, config,
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Fires when user drags the brush in a brush chart.
|
|
708
|
+
* The 2nd argument includes information of the new axes generated after
|
|
709
|
+
* scrolling the brush.
|
|
710
|
+
* @param chartContext
|
|
711
|
+
* @param config { xaxis: any, yaxis: any }
|
|
712
|
+
* @param element DOM Element
|
|
713
|
+
*/
|
|
714
|
+
brushScrolledEvent(chartContext, config) {
|
|
715
|
+
this.callEvent('chartBrushScrolled', {
|
|
716
|
+
component: this, chartContext, config,
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
updateToolbarIcons() {
|
|
720
|
+
var _a, _b, _c;
|
|
721
|
+
if (!this.viewGetIconHTML)
|
|
722
|
+
return this.options;
|
|
723
|
+
const getIconFn = this.viewGetIconHTML;
|
|
724
|
+
let changed = false;
|
|
725
|
+
const newOptions = Object.assign({}, this.options);
|
|
726
|
+
if ((_b = (_a = newOptions.chart) === null || _a === void 0 ? void 0 : _a.toolbar) === null || _b === void 0 ? void 0 : _b.tools) {
|
|
727
|
+
const { tools } = newOptions.chart.toolbar;
|
|
728
|
+
Object.keys(tools).forEach((key) => {
|
|
729
|
+
if (typeof tools[key] === 'string') {
|
|
730
|
+
tools[key] = getIconFn(tools[key]);
|
|
731
|
+
changed = true;
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
if ((_c = tools.customIcons) === null || _c === void 0 ? void 0 : _c.length) {
|
|
735
|
+
tools.customIcons.forEach((item) => {
|
|
736
|
+
item.icon = getIconFn(item.icon);
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (this.viewUpdate && changed) {
|
|
741
|
+
this.viewUpdate(newOptions);
|
|
742
|
+
}
|
|
743
|
+
return newOptions;
|
|
744
|
+
}
|
|
459
745
|
}
|
|
460
746
|
|
|
461
747
|
/**
|
|
@@ -814,6 +1100,16 @@ class Carousel extends ComponentRender {
|
|
|
814
1100
|
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
815
1101
|
*/
|
|
816
1102
|
this.height = 'auto';
|
|
1103
|
+
/**
|
|
1104
|
+
* Sets the carousel max height. Example values: 'auto', '100%', '400px',
|
|
1105
|
+
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
1106
|
+
*/
|
|
1107
|
+
this.maxHeight = 'none';
|
|
1108
|
+
/**
|
|
1109
|
+
* Sets the carousel min height. Example values: 'auto', '100%', '400px',
|
|
1110
|
+
* '30em', '400', 400. Values without measurement unit will be notated in pixels by default
|
|
1111
|
+
*/
|
|
1112
|
+
this.minHeight = 'none';
|
|
817
1113
|
/**
|
|
818
1114
|
* Configures the carousel as infinite (the slide after the last one is the first slide, and vice-versa)
|
|
819
1115
|
*/
|
|
@@ -905,6 +1201,8 @@ class Carousel extends ComponentRender {
|
|
|
905
1201
|
this.buttonsOutside = this.getInitValue('buttonsOutside', props.buttonsOutside, this.buttonsOutside);
|
|
906
1202
|
this.center = this.getInitValue('center', props.center, this.center);
|
|
907
1203
|
this.height = this.getInitValue('height', props.height, this.height);
|
|
1204
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
1205
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
908
1206
|
this.infiniteScroll = this.getInitValue('infiniteScroll', props.infiniteScroll, this.infiniteScroll);
|
|
909
1207
|
this.initialSlide = this.getInitValue('initialSlide', props.initialSlide, this.initialSlide);
|
|
910
1208
|
this.currentSlide = this.getInitValue('currentSlide', props.currentSlide, this.initialSlide);
|
|
@@ -1140,6 +1438,7 @@ class Form extends ComponentRender {
|
|
|
1140
1438
|
this.internalValue = {};
|
|
1141
1439
|
this.align = this.getInitValue('align', props.align, this.align);
|
|
1142
1440
|
this.justify = this.getInitValue('justify', props.justify, this.justify);
|
|
1441
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
1143
1442
|
this.internalValue = this.getInitValue('value', props.value, this.value);
|
|
1144
1443
|
this.createAccessors();
|
|
1145
1444
|
}
|
|
@@ -1729,6 +2028,10 @@ class CodeEditor extends ComponentRender {
|
|
|
1729
2028
|
* Max height in pixels. 'none' means no limit.
|
|
1730
2029
|
*/
|
|
1731
2030
|
this.maxHeight = 'none';
|
|
2031
|
+
/**
|
|
2032
|
+
* Max height in pixels. 'none' means no limit.
|
|
2033
|
+
*/
|
|
2034
|
+
this.height = 'auto';
|
|
1732
2035
|
/**
|
|
1733
2036
|
* Language code to be used for highlight (js|javascript, css, html, json, ts|typescript, bash|shell)
|
|
1734
2037
|
* Other languages must be imported above
|
|
@@ -1748,6 +2051,7 @@ class CodeEditor extends ComponentRender {
|
|
|
1748
2051
|
this.staticCode = this.getInitValue('staticCode', props.staticCode, this.staticCodeValue);
|
|
1749
2052
|
this.copyIcon = this.getInitValue('copyIcon', props.copyIcon, this.copyIcon);
|
|
1750
2053
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
2054
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
1751
2055
|
this.language = this.getInitValue('language', props.language, this.language);
|
|
1752
2056
|
this.showLineNumbers = this.getInitValue('showLineNumbers', props.showLineNumbers, this.showLineNumbers);
|
|
1753
2057
|
this.createAccessors();
|
|
@@ -1954,12 +2258,27 @@ class Container extends ComponentRender {
|
|
|
1954
2258
|
* Adds height 100% to container.
|
|
1955
2259
|
*/
|
|
1956
2260
|
this.fillHeight = false;
|
|
2261
|
+
/**
|
|
2262
|
+
* Sets the height for the component.
|
|
2263
|
+
*/
|
|
2264
|
+
this.height = 'auto';
|
|
2265
|
+
/**
|
|
2266
|
+
* Sets the maximum height for the component.
|
|
2267
|
+
*/
|
|
2268
|
+
this.maxHeight = 'none';
|
|
2269
|
+
/**
|
|
2270
|
+
* Sets the minimum height for the component.
|
|
2271
|
+
*/
|
|
2272
|
+
this.minHeight = 'none';
|
|
1957
2273
|
/**
|
|
1958
2274
|
* Removes viewport maximum-width size breakpoints.
|
|
1959
2275
|
*/
|
|
1960
2276
|
this.fluid = true;
|
|
1961
2277
|
this.fluid = this.getInitValue('fluid', props.fluid, this.fluid);
|
|
1962
2278
|
this.fillHeight = this.getInitValue('fillHeight', props.fillHeight, this.fillHeight);
|
|
2279
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
2280
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
2281
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
1963
2282
|
this.createAccessors();
|
|
1964
2283
|
}
|
|
1965
2284
|
}
|
|
@@ -2297,6 +2616,14 @@ class Dialog extends Component {
|
|
|
2297
2616
|
* Dialog type (normal, success, error, warning, info)
|
|
2298
2617
|
*/
|
|
2299
2618
|
this.type = 'normal';
|
|
2619
|
+
/**
|
|
2620
|
+
* Confirm button component name
|
|
2621
|
+
*/
|
|
2622
|
+
this.confirmButton = 'dialogButton';
|
|
2623
|
+
/**
|
|
2624
|
+
* Deny button component name
|
|
2625
|
+
*/
|
|
2626
|
+
this.denyButton = undefined;
|
|
2300
2627
|
/**
|
|
2301
2628
|
* Default dialog buttons
|
|
2302
2629
|
* @private
|
|
@@ -2308,6 +2635,8 @@ class Dialog extends Component {
|
|
|
2308
2635
|
events: { click: () => this.hide() },
|
|
2309
2636
|
}];
|
|
2310
2637
|
this.defaultValues = {
|
|
2638
|
+
confirmButton: this.confirmButton,
|
|
2639
|
+
denyButton: this.denyButton,
|
|
2311
2640
|
name: this.name,
|
|
2312
2641
|
maxWidth: this.maxWidth,
|
|
2313
2642
|
persistent: this.persistent,
|
|
@@ -2315,6 +2644,38 @@ class Dialog extends Component {
|
|
|
2315
2644
|
title: this.title,
|
|
2316
2645
|
text: this.text,
|
|
2317
2646
|
};
|
|
2647
|
+
this.clickDefaultButtonKeyMapping = {
|
|
2648
|
+
enter: {
|
|
2649
|
+
event: () => {
|
|
2650
|
+
if (this.confirmButton) {
|
|
2651
|
+
const confirmButton = Metadata.getInstance(this.confirmButton);
|
|
2652
|
+
if (confirmButton
|
|
2653
|
+
&& confirmButton.events
|
|
2654
|
+
&& confirmButton.events.click
|
|
2655
|
+
&& typeof confirmButton.events.click === 'function') {
|
|
2656
|
+
confirmButton.events.click({ component: new Button(confirmButton) });
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
},
|
|
2660
|
+
stop: true,
|
|
2661
|
+
},
|
|
2662
|
+
esc: {
|
|
2663
|
+
event: () => {
|
|
2664
|
+
if (this.denyButton) {
|
|
2665
|
+
const denyButton = Metadata.getInstance(this.denyButton);
|
|
2666
|
+
if (denyButton
|
|
2667
|
+
&& denyButton.events
|
|
2668
|
+
&& denyButton.events.click
|
|
2669
|
+
&& typeof denyButton.events.click === 'function')
|
|
2670
|
+
denyButton.events.click({ component: new Button(denyButton) });
|
|
2671
|
+
}
|
|
2672
|
+
else {
|
|
2673
|
+
this.hide();
|
|
2674
|
+
}
|
|
2675
|
+
},
|
|
2676
|
+
stop: true,
|
|
2677
|
+
},
|
|
2678
|
+
};
|
|
2318
2679
|
this.assignDialogProperties(props);
|
|
2319
2680
|
this.createAccessors();
|
|
2320
2681
|
}
|
|
@@ -2324,6 +2685,8 @@ class Dialog extends Component {
|
|
|
2324
2685
|
*/
|
|
2325
2686
|
assignDialogProperties(dialog) {
|
|
2326
2687
|
this.buttons = dialog.buttons && dialog.buttons.length ? dialog.buttons : this.defaultButtons;
|
|
2688
|
+
this.confirmButton = this.getInitValue('confirmButton', dialog.confirmButton, this.defaultValues.confirmButton);
|
|
2689
|
+
this.denyButton = this.getInitValue('denyButton', dialog.denyButton, this.defaultValues.denyButton);
|
|
2327
2690
|
this.name = this.getInitValue('name', dialog.name, this.defaultValues.name);
|
|
2328
2691
|
this.maxWidth = this.getInitValue('maxWidth', dialog.maxWidth, this.defaultValues.maxWidth);
|
|
2329
2692
|
this.persistent = this.getInitValue('persistent', dialog.persistent, this.defaultValues.persistent);
|
|
@@ -2336,6 +2699,7 @@ class Dialog extends Component {
|
|
|
2336
2699
|
* Displays dialog
|
|
2337
2700
|
*/
|
|
2338
2701
|
show() {
|
|
2702
|
+
KeyMap.bind(this.clickDefaultButtonKeyMapping, this);
|
|
2339
2703
|
this.isVisible = true;
|
|
2340
2704
|
}
|
|
2341
2705
|
/**
|
|
@@ -2343,6 +2707,7 @@ class Dialog extends Component {
|
|
|
2343
2707
|
*/
|
|
2344
2708
|
hide() {
|
|
2345
2709
|
this.isVisible = false;
|
|
2710
|
+
KeyMap.unbind(this.clickDefaultButtonKeyMapping, this);
|
|
2346
2711
|
}
|
|
2347
2712
|
}
|
|
2348
2713
|
|
|
@@ -3278,10 +3643,6 @@ class DateRange extends TextInput {
|
|
|
3278
3643
|
* Sets the locale. Accepts a string with a BCP 47 language tag.
|
|
3279
3644
|
*/
|
|
3280
3645
|
this.locale = I18n.instance.language;
|
|
3281
|
-
/**
|
|
3282
|
-
* Defines if dates should be ordered
|
|
3283
|
-
*/
|
|
3284
|
-
this.orderedDates = false;
|
|
3285
3646
|
/**
|
|
3286
3647
|
* Allows changing displayed month with mouse scroll
|
|
3287
3648
|
*/
|
|
@@ -3305,15 +3666,12 @@ class DateRange extends TextInput {
|
|
|
3305
3666
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
3306
3667
|
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
3307
3668
|
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
3308
|
-
this.orderedDates = this.getInitValue('orderedDates', props.orderedDates, this.orderedDates);
|
|
3309
3669
|
this.dateValidation = this.dateValidation.bind(this);
|
|
3310
|
-
this.dateValidateOrder = this.dateValidateOrder.bind(this);
|
|
3311
3670
|
this.displayFormat = this.getInitValue('displayFormat', props.displayFormat, this.displayFormat);
|
|
3312
3671
|
this.inputFormat = this.getInitValue('inputFormat', props.inputFormat, this.inputFormat);
|
|
3313
3672
|
this.firstDayOfWeek = this.getInitValue('firstDayOfWeek', props.firstDayOfWeek, this.firstDayOfWeek);
|
|
3314
3673
|
this.fullWidth = this.getInitValue('fullWidth', props.fullWidth, this.fullWidth);
|
|
3315
3674
|
this.locale = this.getInitValue('locale', props.locale, this.locale);
|
|
3316
|
-
this.rules.push(this.dateValidation, this.dateValidateOrder);
|
|
3317
3675
|
this.scrollable = this.getInitValue('scrollable', props.scrollable, this.scrollable);
|
|
3318
3676
|
this.showDatePicker = this.getInitValue('showDatePicker', props.showDatePicker, this.showDatePicker);
|
|
3319
3677
|
this.showWeek = this.getInitValue('showWeek', props.showWeek, this.showWeek);
|
|
@@ -3421,7 +3779,7 @@ class DateRange extends TextInput {
|
|
|
3421
3779
|
const lastValue = this.value;
|
|
3422
3780
|
this.dateError = false;
|
|
3423
3781
|
this.value = this.parseISODateRangeValue(newValue);
|
|
3424
|
-
if (!isEqual(lastValue, this.value))
|
|
3782
|
+
if (!Utils.isEqual(lastValue, this.value))
|
|
3425
3783
|
this.change(this.value);
|
|
3426
3784
|
}
|
|
3427
3785
|
formatISODateRangeValue(dates) {
|
|
@@ -3430,13 +3788,13 @@ class DateRange extends TextInput {
|
|
|
3430
3788
|
splitedValue = dates;
|
|
3431
3789
|
else
|
|
3432
3790
|
splitedValue = this.splitValues(dates);
|
|
3433
|
-
const
|
|
3791
|
+
const formattedValue = [];
|
|
3434
3792
|
splitedValue.forEach((value) => {
|
|
3435
3793
|
if (value && this.isValidDate(value, this.dateFormat)) {
|
|
3436
|
-
|
|
3794
|
+
formattedValue.push(dayjs(value, this.dateFormat, true).format(this.isoFormat));
|
|
3437
3795
|
}
|
|
3438
3796
|
});
|
|
3439
|
-
return
|
|
3797
|
+
return formattedValue;
|
|
3440
3798
|
}
|
|
3441
3799
|
parseISODateRangeValue(values) {
|
|
3442
3800
|
const parsedValue = [];
|
|
@@ -3447,19 +3805,14 @@ class DateRange extends TextInput {
|
|
|
3447
3805
|
}
|
|
3448
3806
|
});
|
|
3449
3807
|
}
|
|
3450
|
-
return parsedValue;
|
|
3808
|
+
return this.sortDates(parsedValue);
|
|
3809
|
+
}
|
|
3810
|
+
sortDates(parsedValue) {
|
|
3811
|
+
return parsedValue.sort((a, b) => (dayjs(a, this.dateFormat).isAfter(dayjs(b, this.dateFormat)) ? 1 : -1));
|
|
3451
3812
|
}
|
|
3452
3813
|
dateValidation() {
|
|
3453
3814
|
return !this.dateError || I18n.translate('VALIDATION_INVALID_DATE');
|
|
3454
3815
|
}
|
|
3455
|
-
dateValidateOrder() {
|
|
3456
|
-
if (this.value && (this.value.length === 2 && this.orderedDates)) {
|
|
3457
|
-
const date1 = dayjs(this.value[0], this.dateFormat);
|
|
3458
|
-
const date2 = dayjs(this.value[1], this.dateFormat);
|
|
3459
|
-
return (date1.isBefore(date2) || date1.isSame(date2)) || I18n.translate('VALIDATION_INVALID_ORDER_DATE');
|
|
3460
|
-
}
|
|
3461
|
-
return true;
|
|
3462
|
-
}
|
|
3463
3816
|
click(event, element) {
|
|
3464
3817
|
super.click(event, element);
|
|
3465
3818
|
if (!event.defaultPrevented) {
|
|
@@ -3467,6 +3820,7 @@ class DateRange extends TextInput {
|
|
|
3467
3820
|
}
|
|
3468
3821
|
}
|
|
3469
3822
|
blur(event, element) {
|
|
3823
|
+
this.value = this.sortDates(this.value);
|
|
3470
3824
|
this.removeDateMask();
|
|
3471
3825
|
this.setDateValue(this.displayValue);
|
|
3472
3826
|
super.blur(event, element);
|
|
@@ -3683,6 +4037,10 @@ class Dropdown extends ComponentRender {
|
|
|
3683
4037
|
* Applies position fixed to the dropdown.
|
|
3684
4038
|
*/
|
|
3685
4039
|
this.fixed = false;
|
|
4040
|
+
/**
|
|
4041
|
+
* Sets the height for the dropdown.
|
|
4042
|
+
*/
|
|
4043
|
+
this.height = 'auto';
|
|
3686
4044
|
/**
|
|
3687
4045
|
* Offset the menu on the x-axis.
|
|
3688
4046
|
*/
|
|
@@ -3708,6 +4066,7 @@ class Dropdown extends ComponentRender {
|
|
|
3708
4066
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
3709
4067
|
this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
|
|
3710
4068
|
this.hover = this.getInitValue('hover', props.hover, this.hover);
|
|
4069
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
3711
4070
|
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
3712
4071
|
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
3713
4072
|
this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
|
|
@@ -3969,12 +4328,18 @@ class Frame extends ComponentRender {
|
|
|
3969
4328
|
this.override = {};
|
|
3970
4329
|
this.cache = false;
|
|
3971
4330
|
this.cacheDuration = 2 * 60 * 60 * 1000;
|
|
4331
|
+
this.height = 'auto';
|
|
4332
|
+
this.maxHeight = 'none';
|
|
4333
|
+
this.minHeight = 'none';
|
|
3972
4334
|
this.headerName = 'sw-fetched-on';
|
|
3973
4335
|
this.path = props.path;
|
|
3974
4336
|
this.local = props.local === true;
|
|
3975
4337
|
this.override = props.override || this.override;
|
|
3976
4338
|
this.cache = props.cache || this.cache;
|
|
3977
4339
|
this.cacheDuration = this.getInitValue('cacheDuration', props.cacheDuration, this.cacheDuration);
|
|
4340
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
4341
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
4342
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
3978
4343
|
this.createAccessors();
|
|
3979
4344
|
this.getMetadata();
|
|
3980
4345
|
}
|
|
@@ -3995,6 +4360,12 @@ class Frame extends ComponentRender {
|
|
|
3995
4360
|
}
|
|
3996
4361
|
});
|
|
3997
4362
|
}
|
|
4363
|
+
reload() {
|
|
4364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4365
|
+
this.loading = true;
|
|
4366
|
+
this.getMetadata();
|
|
4367
|
+
});
|
|
4368
|
+
}
|
|
3998
4369
|
notFoundError() { }
|
|
3999
4370
|
requestPage() {
|
|
4000
4371
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4485,7 +4856,7 @@ class GridColumn extends Column {
|
|
|
4485
4856
|
if (this.componentProps.dataValueOut && ((_a = component.datasource) === null || _a === void 0 ? void 0 : _a.currentRow)) {
|
|
4486
4857
|
this.componentProps.dataValueOut.forEach((columns) => {
|
|
4487
4858
|
const { column, columnOnGrid } = columns;
|
|
4488
|
-
if (!isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
|
|
4859
|
+
if (!Utils.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
|
|
4489
4860
|
newRow[`${columnOnGrid}_original`] = newRow.originalRow[columnOnGrid];
|
|
4490
4861
|
newRow[columnOnGrid] = component.datasource.currentRow[column];
|
|
4491
4862
|
}
|
|
@@ -4499,7 +4870,7 @@ class GridColumn extends Column {
|
|
|
4499
4870
|
}
|
|
4500
4871
|
}
|
|
4501
4872
|
FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
|
|
4502
|
-
if (
|
|
4873
|
+
if (value === null || value === undefined)
|
|
4503
4874
|
return '';
|
|
4504
4875
|
const { dataText, formatterDataText, dataTextSeparator, dataValue, } = componentProps;
|
|
4505
4876
|
let currentRow = row;
|
|
@@ -4547,7 +4918,7 @@ FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, r
|
|
|
4547
4918
|
});
|
|
4548
4919
|
return dataTextNames.reduce((result, columnName, index) => {
|
|
4549
4920
|
const rowCell = currentRow[columnName];
|
|
4550
|
-
if (rowCell) {
|
|
4921
|
+
if (rowCell !== undefined && rowCell !== null) {
|
|
4551
4922
|
const separator = index > 0 ? (dataTextSeparator || ' | ') : '';
|
|
4552
4923
|
const mask = masks[index];
|
|
4553
4924
|
const maskValue = typeof mask === 'function' ? mask(rowCell) : mask;
|
|
@@ -4877,6 +5248,7 @@ class Grid extends Iterable {
|
|
|
4877
5248
|
var _a, _b, _c;
|
|
4878
5249
|
const rowKey = row[this.datasource.uniqueKey];
|
|
4879
5250
|
const compName = actionComponent.name;
|
|
5251
|
+
const instanceName = `${compName}_${rowKey}`;
|
|
4880
5252
|
const path = parentPath ? `${parentPath}.${compName}` : compName;
|
|
4881
5253
|
const newComponent = merge({}, actionComponent, (_b = (_a = this.actionsApplied[rowKey]) === null || _a === void 0 ? void 0 : _a[column.name]) === null || _b === void 0 ? void 0 : _b[path]);
|
|
4882
5254
|
let compEvents = {};
|
|
@@ -4891,7 +5263,16 @@ class Grid extends Iterable {
|
|
|
4891
5263
|
}
|
|
4892
5264
|
} });
|
|
4893
5265
|
const newChildren = (_c = newComponent.children) === null || _c === void 0 ? void 0 : _c.map((child) => this.getActionComponent(child, column, row, path));
|
|
4894
|
-
|
|
5266
|
+
newComponent.name = instanceName;
|
|
5267
|
+
newComponent.children = newChildren;
|
|
5268
|
+
newComponent.events = newEvents;
|
|
5269
|
+
try {
|
|
5270
|
+
Metadata.updateInstance(instanceName, newComponent);
|
|
5271
|
+
}
|
|
5272
|
+
catch (e) {
|
|
5273
|
+
// do nothing
|
|
5274
|
+
}
|
|
5275
|
+
return newComponent;
|
|
4895
5276
|
}
|
|
4896
5277
|
changeDefaultSlotNames(slot) {
|
|
4897
5278
|
slot.forEach((item) => {
|
|
@@ -4956,15 +5337,36 @@ class GridEditable extends Grid {
|
|
|
4956
5337
|
* @private
|
|
4957
5338
|
*/
|
|
4958
5339
|
this.editedRows = {};
|
|
5340
|
+
/**
|
|
5341
|
+
* Rows with newRowIdentifier
|
|
5342
|
+
* @private
|
|
5343
|
+
*/
|
|
5344
|
+
this.addedRows = {};
|
|
4959
5345
|
/**
|
|
4960
5346
|
* Invalid inline components
|
|
4961
5347
|
* @private
|
|
4962
5348
|
*/
|
|
4963
5349
|
this.invalidComponents = {};
|
|
5350
|
+
this.cancelEditedRowsKeyMapping = {
|
|
5351
|
+
esc: {
|
|
5352
|
+
event: this.cancelEditedRows.bind(this),
|
|
5353
|
+
stop: true,
|
|
5354
|
+
input: true,
|
|
5355
|
+
active: true,
|
|
5356
|
+
},
|
|
5357
|
+
};
|
|
4964
5358
|
this.newRowIdentifier = '__added_row';
|
|
4965
5359
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
4966
5360
|
this.createAccessors();
|
|
4967
5361
|
}
|
|
5362
|
+
onMounted(element) {
|
|
5363
|
+
super.onMounted(element);
|
|
5364
|
+
KeyMap.bind(this.cancelEditedRowsKeyMapping, this, element);
|
|
5365
|
+
}
|
|
5366
|
+
onBeforeDestroy() {
|
|
5367
|
+
super.onBeforeDestroy();
|
|
5368
|
+
KeyMap.unbind(this.cancelEditedRowsKeyMapping, this);
|
|
5369
|
+
}
|
|
4968
5370
|
/**
|
|
4969
5371
|
* Get Grid columns objects
|
|
4970
5372
|
* @param columns Grid columns parameter
|
|
@@ -5134,7 +5536,7 @@ class GridEditable extends Grid {
|
|
|
5134
5536
|
changeEditableComponent(column, row, value, component) {
|
|
5135
5537
|
const key = row[this.datasource.uniqueKey];
|
|
5136
5538
|
const columnName = column.name;
|
|
5137
|
-
if (!isEqual(value, row[columnName])) {
|
|
5539
|
+
if (!Utils.isEqual(value, row[columnName])) {
|
|
5138
5540
|
const newRow = {};
|
|
5139
5541
|
newRow[key] = Object.assign({}, this.editedRows[key]);
|
|
5140
5542
|
newRow[key].originalRow = Object.assign({}, row);
|
|
@@ -5180,6 +5582,14 @@ class GridEditable extends Grid {
|
|
|
5180
5582
|
* Cancels all edited rows and enable grid components
|
|
5181
5583
|
*/
|
|
5182
5584
|
cancelEditedRows() {
|
|
5585
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5586
|
+
yield this.removeAddedRows();
|
|
5587
|
+
this.editing = false;
|
|
5588
|
+
this.editedRows = {};
|
|
5589
|
+
this.invalidComponents = {};
|
|
5590
|
+
});
|
|
5591
|
+
}
|
|
5592
|
+
removeAddedRows() {
|
|
5183
5593
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5184
5594
|
const { data } = this.datasource;
|
|
5185
5595
|
data.forEach((row, index) => {
|
|
@@ -5188,21 +5598,26 @@ class GridEditable extends Grid {
|
|
|
5188
5598
|
}
|
|
5189
5599
|
});
|
|
5190
5600
|
yield this.datasource.updateData(data);
|
|
5191
|
-
this.editing = false;
|
|
5192
|
-
this.editedRows = {};
|
|
5193
|
-
this.invalidComponents = {};
|
|
5194
5601
|
});
|
|
5195
5602
|
}
|
|
5603
|
+
addDataRow(row) {
|
|
5604
|
+
if (this.addedRows[row[this.datasource.uniqueKey]])
|
|
5605
|
+
this.datasource.post(row);
|
|
5606
|
+
else
|
|
5607
|
+
this.datasource.put(row);
|
|
5608
|
+
}
|
|
5196
5609
|
/**
|
|
5197
5610
|
* Saves all edited rows if they are valid
|
|
5198
5611
|
* @throws Will throw when it finds an invalid row
|
|
5199
5612
|
*/
|
|
5200
5613
|
saveEditedRows() {
|
|
5201
5614
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5202
|
-
|
|
5615
|
+
yield this.removeAddedRows();
|
|
5616
|
+
const response = yield Promise.all(this.getEditedRows().map((row) => this.addDataRow(row)));
|
|
5203
5617
|
this.editing = false;
|
|
5204
5618
|
this.editedRows = {};
|
|
5205
5619
|
this.invalidComponents = {};
|
|
5620
|
+
this.addedRows = {};
|
|
5206
5621
|
yield this.datasource.get();
|
|
5207
5622
|
return response;
|
|
5208
5623
|
});
|
|
@@ -5214,8 +5629,11 @@ class GridEditable extends Grid {
|
|
|
5214
5629
|
getEditedRows() {
|
|
5215
5630
|
const editedRows = [];
|
|
5216
5631
|
Object.keys(this.editedRows).forEach((key) => {
|
|
5632
|
+
this.addedRows = {};
|
|
5217
5633
|
const row = Object.assign(Object.assign({}, this.editedRows[key].originalRow), this.editedRows[key]);
|
|
5218
5634
|
delete row.originalRow;
|
|
5635
|
+
if (row[this.newRowIdentifier])
|
|
5636
|
+
this.addedRows[key] = row;
|
|
5219
5637
|
delete row[this.newRowIdentifier];
|
|
5220
5638
|
Object.keys(row).forEach((attr) => {
|
|
5221
5639
|
if (Object.prototype.hasOwnProperty.call(row, `${attr}_original`)) {
|
|
@@ -5909,11 +6327,12 @@ class Select extends TextInput {
|
|
|
5909
6327
|
overrideGet() {
|
|
5910
6328
|
const oldGet = this.datasource.get;
|
|
5911
6329
|
this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
|
|
5912
|
-
yield oldGet.call(this.datasource);
|
|
5913
|
-
if (this.indexOf(this.value)
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
6330
|
+
const response = yield oldGet.call(this.datasource);
|
|
6331
|
+
if (this.indexOf(this.value) === -1 && !this.datasource.search && !this.isFocused) {
|
|
6332
|
+
yield this.setValue(this.value, false);
|
|
6333
|
+
this.removePushedValue();
|
|
6334
|
+
}
|
|
6335
|
+
return response;
|
|
5917
6336
|
});
|
|
5918
6337
|
}
|
|
5919
6338
|
get search() {
|
|
@@ -6253,10 +6672,10 @@ class Select extends TextInput {
|
|
|
6253
6672
|
}
|
|
6254
6673
|
}
|
|
6255
6674
|
FormatterParserProvider.registerFormatter('ZdSelect', (value, { dataText, dataTextSeparator = ' | ', }) => {
|
|
6256
|
-
if (
|
|
6675
|
+
if (value === null || value === undefined) {
|
|
6257
6676
|
return null;
|
|
6258
6677
|
}
|
|
6259
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
6678
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
6260
6679
|
return value;
|
|
6261
6680
|
}
|
|
6262
6681
|
const dataTextArr = Array.isArray(dataText) ? dataText : [dataText];
|
|
@@ -6279,7 +6698,7 @@ FormatterParserProvider.registerFormatter('ZdSelect', (value, { dataText, dataTe
|
|
|
6279
6698
|
}
|
|
6280
6699
|
});
|
|
6281
6700
|
return dataTextNames.reduce((result, column, index) => {
|
|
6282
|
-
if (value[column]) {
|
|
6701
|
+
if (value[column] !== null && value[column] !== undefined) {
|
|
6283
6702
|
const separator = index > 0 ? dataTextSeparator : '';
|
|
6284
6703
|
let masked = value[column];
|
|
6285
6704
|
if (masks[index]) {
|
|
@@ -6498,6 +6917,18 @@ class List extends ComponentRender {
|
|
|
6498
6917
|
* Will only collapse when explicitly closed.
|
|
6499
6918
|
*/
|
|
6500
6919
|
this.expand = false;
|
|
6920
|
+
/**
|
|
6921
|
+
* Sets the height for the component.
|
|
6922
|
+
*/
|
|
6923
|
+
this.height = 'auto';
|
|
6924
|
+
/**
|
|
6925
|
+
* Sets the maxHeight for the component.
|
|
6926
|
+
*/
|
|
6927
|
+
this.maxHeight = 'none';
|
|
6928
|
+
/**
|
|
6929
|
+
* Sets the minHeight for the component.
|
|
6930
|
+
*/
|
|
6931
|
+
this.minHeight = 'none';
|
|
6501
6932
|
this.dark = this.getInitValue('dark', props.dark, this.dark);
|
|
6502
6933
|
this.dense = this.getInitValue('dense', props.dense, this.dense);
|
|
6503
6934
|
this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
|
|
@@ -6509,6 +6940,9 @@ class List extends ComponentRender {
|
|
|
6509
6940
|
this.color = this.getInitValue('color', props.color, this.color);
|
|
6510
6941
|
this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
|
|
6511
6942
|
this.expand = this.getInitValue('expand', props.expand, this.expand);
|
|
6943
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
6944
|
+
this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
|
|
6945
|
+
this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
|
|
6512
6946
|
this.createAccessors();
|
|
6513
6947
|
}
|
|
6514
6948
|
/**
|
|
@@ -7190,7 +7624,7 @@ class Menu extends ComponentRender {
|
|
|
7190
7624
|
if (item.component === 'ZdMenuGroup') {
|
|
7191
7625
|
this.searchItems(item.items);
|
|
7192
7626
|
}
|
|
7193
|
-
else if (normalize(I18n.translate(item.label)).indexOf(normalize(this.searchValue)) !== -1) {
|
|
7627
|
+
else if (Utils.normalize(I18n.translate(item.label)).indexOf(Utils.normalize(this.searchValue)) !== -1) {
|
|
7194
7628
|
this.filteredMenuItems.push(item);
|
|
7195
7629
|
}
|
|
7196
7630
|
}
|
|
@@ -8872,6 +9306,40 @@ class SelectTreeMultiple extends SelectTree {
|
|
|
8872
9306
|
}
|
|
8873
9307
|
}
|
|
8874
9308
|
|
|
9309
|
+
/**
|
|
9310
|
+
* Base class for SelectableList component.
|
|
9311
|
+
*/
|
|
9312
|
+
class SelectableList extends List {
|
|
9313
|
+
constructor(props) {
|
|
9314
|
+
super(props);
|
|
9315
|
+
/**
|
|
9316
|
+
* Specifies whether at least one element must be selected
|
|
9317
|
+
*/
|
|
9318
|
+
this.mandatory = false;
|
|
9319
|
+
/**
|
|
9320
|
+
* Defines the maximum number of elements the list has
|
|
9321
|
+
*/
|
|
9322
|
+
this.max = undefined;
|
|
9323
|
+
/**
|
|
9324
|
+
* Defines how many elements of the list can be selected at the same time
|
|
9325
|
+
*/
|
|
9326
|
+
this.multiple = undefined;
|
|
9327
|
+
/**
|
|
9328
|
+
* Sets the active list-item inside the list-group
|
|
9329
|
+
*/
|
|
9330
|
+
this.value = undefined;
|
|
9331
|
+
this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
|
|
9332
|
+
this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
|
|
9333
|
+
this.max = this.getInitValue('max', props.max, this.max);
|
|
9334
|
+
this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
|
|
9335
|
+
this.value = this.getInitValue('value', props.value, this.value);
|
|
9336
|
+
this.createAccessors();
|
|
9337
|
+
}
|
|
9338
|
+
change(event, element) {
|
|
9339
|
+
this.callEvent('change', { event, element, component: this });
|
|
9340
|
+
}
|
|
9341
|
+
}
|
|
9342
|
+
|
|
8875
9343
|
/**
|
|
8876
9344
|
* Base class for SpeedDial component.
|
|
8877
9345
|
*/
|
|
@@ -9217,6 +9685,7 @@ class Tabs extends ComponentRender {
|
|
|
9217
9685
|
this.tabs = [];
|
|
9218
9686
|
this.tabs = this.getTabs(props.tabs || []);
|
|
9219
9687
|
this.activeTab = this.getInitValue('activeTab', props.activeTab, this.activeTab);
|
|
9688
|
+
this.height = this.getInitValue('height', props.height, this.height);
|
|
9220
9689
|
this.createAccessors();
|
|
9221
9690
|
}
|
|
9222
9691
|
getTabs(tabs) {
|
|
@@ -9229,6 +9698,31 @@ class Tabs extends ComponentRender {
|
|
|
9229
9698
|
}
|
|
9230
9699
|
return tab;
|
|
9231
9700
|
}
|
|
9701
|
+
/**
|
|
9702
|
+
* Method for navigating to the next tab
|
|
9703
|
+
* @param loop Defines if want a loop navigation
|
|
9704
|
+
*/
|
|
9705
|
+
nextTab(loop = false) {
|
|
9706
|
+
if (loop) {
|
|
9707
|
+
this.activeTab = (this.activeTab + 1) % this.tabs.length;
|
|
9708
|
+
}
|
|
9709
|
+
else if (this.activeTab < this.tabs.length - 1) {
|
|
9710
|
+
this.activeTab += 1;
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9713
|
+
/**
|
|
9714
|
+
* Method for navigating to the previous tab
|
|
9715
|
+
* @param loop Defines if want a loop navigation
|
|
9716
|
+
*/
|
|
9717
|
+
previousTab(loop = false) {
|
|
9718
|
+
if (loop) {
|
|
9719
|
+
const newTabIndex = (this.activeTab - 1) % this.tabs.length;
|
|
9720
|
+
this.activeTab = newTabIndex >= 0 ? newTabIndex : newTabIndex + this.tabs.length;
|
|
9721
|
+
}
|
|
9722
|
+
else if (this.activeTab > 0) {
|
|
9723
|
+
this.activeTab -= 1;
|
|
9724
|
+
}
|
|
9725
|
+
}
|
|
9232
9726
|
/**
|
|
9233
9727
|
* Triggered before tab is change.
|
|
9234
9728
|
* @param event DOM event
|
|
@@ -10080,9 +10574,25 @@ class TreeGridEditable extends TreeGrid {
|
|
|
10080
10574
|
* Enter edit mode on double click
|
|
10081
10575
|
*/
|
|
10082
10576
|
this.doubleClickEdit = false;
|
|
10577
|
+
this.cancelEditedRowsKeyMapping = {
|
|
10578
|
+
esc: {
|
|
10579
|
+
event: this.cancelEditedRows.bind(this),
|
|
10580
|
+
stop: true,
|
|
10581
|
+
input: true,
|
|
10582
|
+
active: true,
|
|
10583
|
+
},
|
|
10584
|
+
};
|
|
10083
10585
|
this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
|
|
10084
10586
|
this.createAccessors();
|
|
10085
10587
|
}
|
|
10588
|
+
onMounted(element) {
|
|
10589
|
+
super.onMounted(element);
|
|
10590
|
+
KeyMap.bind(this.cancelEditedRowsKeyMapping, this, element);
|
|
10591
|
+
}
|
|
10592
|
+
onBeforeDestroy() {
|
|
10593
|
+
super.onBeforeDestroy();
|
|
10594
|
+
KeyMap.unbind(this.cancelEditedRowsKeyMapping, this);
|
|
10595
|
+
}
|
|
10086
10596
|
/**
|
|
10087
10597
|
* Get Grid columns objects
|
|
10088
10598
|
* @param columns Grid columns parameter
|
|
@@ -10251,7 +10761,7 @@ class TreeGridEditable extends TreeGrid {
|
|
|
10251
10761
|
changeEditableComponent(column, row, value, component) {
|
|
10252
10762
|
const key = row[this.datasource.uniqueKey];
|
|
10253
10763
|
const columnName = column.name;
|
|
10254
|
-
if (!isEqual(value, row[columnName])) {
|
|
10764
|
+
if (!Utils.isEqual(value, row[columnName])) {
|
|
10255
10765
|
const newRow = {};
|
|
10256
10766
|
newRow[key] = Object.assign({}, this.editedRows[key]);
|
|
10257
10767
|
newRow[key].originalRow = Object.assign({}, row);
|
|
@@ -10525,6 +11035,12 @@ Icons.mdiIcons = {
|
|
|
10525
11035
|
tableColumns: 'mdi-table-headers-eye',
|
|
10526
11036
|
unfold: 'mdi-unfold-more-horizontal',
|
|
10527
11037
|
warning: 'mdi-exclamation',
|
|
11038
|
+
zoom: 'mdi-magnify-scan',
|
|
11039
|
+
zoomIn: 'mdi-plus-circle-outline',
|
|
11040
|
+
zoomPanning: 'mdi-hand-back-right-outline',
|
|
11041
|
+
zoomOut: 'mdi-minus-circle-outline',
|
|
11042
|
+
zoomReset: 'mdi-magnify-close',
|
|
11043
|
+
zoomSelection: 'mdi-magnify-scan',
|
|
10528
11044
|
};
|
|
10529
11045
|
Icons.faIcons = {
|
|
10530
11046
|
alertOctagon: 'fa fa-exclamation-circle',
|
|
@@ -10575,6 +11091,12 @@ Icons.faIcons = {
|
|
|
10575
11091
|
tableColumns: 'fa fa-columns',
|
|
10576
11092
|
unfold: 'fa fa-sort',
|
|
10577
11093
|
warning: 'fa fa-exclamation',
|
|
11094
|
+
zoom: 'fa fa-search',
|
|
11095
|
+
zoomIn: 'fa fa-search-plus',
|
|
11096
|
+
zoomPanning: 'fa fa-hand-paper',
|
|
11097
|
+
zoomOut: 'fa fa-search-minus',
|
|
11098
|
+
zoomReset: 'fa fa-undo',
|
|
11099
|
+
zoomSelection: 'fa fa-expand',
|
|
10578
11100
|
};
|
|
10579
11101
|
Icons.icons = (() => Icons.mdiIcons)();
|
|
10580
11102
|
|
|
@@ -10612,10 +11134,14 @@ const defaultTheme = {
|
|
|
10612
11134
|
light: {
|
|
10613
11135
|
'font-color': 'var(--v-grey-darken2)',
|
|
10614
11136
|
'background-base': '#F6F6F6',
|
|
11137
|
+
'scrollbar-track': 'var(--v-grey-lighten5)',
|
|
11138
|
+
'scrollbar-thumb': 'var(--v-grey-lighten4)',
|
|
10615
11139
|
},
|
|
10616
11140
|
dark: {
|
|
10617
11141
|
'font-color': 'var(--v-grey-lighten3)',
|
|
10618
11142
|
'background-base': '#121212',
|
|
11143
|
+
'scrollbar-track': 'var(--v-grey-darken3)',
|
|
11144
|
+
'scrollbar-thumb': 'var(--v-grey-base)',
|
|
10619
11145
|
},
|
|
10620
11146
|
variables: {
|
|
10621
11147
|
'default-padding': '16px',
|
|
@@ -11625,4 +12151,4 @@ class Report {
|
|
|
11625
12151
|
|
|
11626
12152
|
const AutoNumeric = require('@zeedhi/autonumeric/dist/autoNumeric');
|
|
11627
12153
|
|
|
11628
|
-
export { Alert, AlertService, ApexChart, AutoNumeric, Badge, Breadcrumbs, Button, ButtonGroup, CSVReport, Card, Carousel, Checkbox, CheckboxMultiple, ChildNotFoundError, Chip, CodeEditor, Col, CollapseCard, Column, Component, ComponentRender, Container, Currency, Dashboard, Date$1 as Date, DateRange, Dialog, DialogService, Divider, Dropdown, FileInput, Footer, Form, Frame, FramePage, Grid, GridColumn, GridColumnEditable, GridEditable, Header, Icon, Icons, Image, Increment, Input, Iterable, IterableColumnsButton, IterableColumnsButtonController, IterablePageComponent, IterablePageInfo, IterablePageSize, IterablePagination, List, ListGroup, ListItem, Loading, LoadingService, Login, LoginButton, MasterDetail, Menu, MenuButton, MenuGroup, MenuLink, MenuSeparator, Modal, ModalCloseButton, ModalService, Month, Number$1 as Number, PDFReport, Password, Progress, Radio, RangeSlider, Report, Row, Search, Select, SelectMultiple, SelectTree, SelectTreeMultiple, SpeedDial, Steppers, SvgMap, Switch, Tab, Table, Tabs, Tag, Text, TextInput, Textarea, Time, Toggleable, Tooltip, Tree, TreeDataStructure, TreeGrid, TreeGridEditable, WatchURL, XLS2Report, XLS3Report, XLSReport, initTheme };
|
|
12154
|
+
export { Alert, AlertService, ApexChart, AutoNumeric, Badge, Breadcrumbs, Button, ButtonGroup, CSVReport, Card, Carousel, Checkbox, CheckboxMultiple, ChildNotFoundError, Chip, CodeEditor, Col, CollapseCard, Column, Component, ComponentRender, Container, Currency, Dashboard, Date$1 as Date, DateRange, Dialog, DialogService, Divider, Dropdown, FileInput, Footer, Form, Frame, FramePage, Grid, GridColumn, GridColumnEditable, GridEditable, Header, Icon, Icons, Image, Increment, Input, Iterable, IterableColumnsButton, IterableColumnsButtonController, IterablePageComponent, IterablePageInfo, IterablePageSize, IterablePagination, List, ListGroup, ListItem, Loading, LoadingService, Login, LoginButton, MasterDetail, Menu, MenuButton, MenuGroup, MenuLink, MenuSeparator, Modal, ModalCloseButton, ModalService, Month, Number$1 as Number, PDFReport, Password, Progress, Radio, RangeSlider, Report, Row, Search, Select, SelectMultiple, SelectTree, SelectTreeMultiple, SelectableList, SpeedDial, Steppers, SvgMap, Switch, Tab, Table, Tabs, Tag, Text, TextInput, Textarea, Time, Toggleable, Tooltip, Tree, TreeDataStructure, TreeGrid, TreeGridEditable, WatchURL, XLS2Report, XLS3Report, XLSReport, initTheme };
|