@zeedhi/common 1.41.0 → 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/zd-common.esm.js +532 -22
  2. package/dist/zd-common.umd.js +531 -20
  3. package/package.json +2 -2
  4. package/types/components/index.d.ts +2 -0
  5. package/types/components/zd-apex-chart/apex-chart.d.ts +152 -1
  6. package/types/components/zd-apex-chart/interfaces.d.ts +35 -3
  7. package/types/components/zd-carousel/carousel.d.ts +10 -0
  8. package/types/components/zd-carousel/interfaces.d.ts +2 -0
  9. package/types/components/zd-code-editor/code-editor.d.ts +5 -1
  10. package/types/components/zd-code-editor/interfaces.d.ts +2 -1
  11. package/types/components/zd-container/container.d.ts +12 -0
  12. package/types/components/zd-container/interfaces.d.ts +3 -0
  13. package/types/components/zd-dialog/dialog.d.ts +11 -0
  14. package/types/components/zd-dialog/interfaces.d.ts +2 -0
  15. package/types/components/zd-dropdown/dropdown.d.ts +4 -0
  16. package/types/components/zd-dropdown/interfaces.d.ts +1 -0
  17. package/types/components/zd-form/form.d.ts +4 -0
  18. package/types/components/zd-form/interfaces.d.ts +1 -0
  19. package/types/components/zd-frame/frame.d.ts +3 -0
  20. package/types/components/zd-frame/interfaces.d.ts +3 -0
  21. package/types/components/zd-grid/grid-editable.d.ts +11 -1
  22. package/types/components/zd-iterable/column.d.ts +2 -0
  23. package/types/components/zd-iterable/interfaces.d.ts +1 -0
  24. package/types/components/zd-list/interfaces.d.ts +3 -0
  25. package/types/components/zd-list/list.d.ts +12 -0
  26. package/types/components/zd-menu/menu-group.d.ts +8 -0
  27. package/types/components/zd-menu/menu-link.d.ts +4 -0
  28. package/types/components/zd-menu/menu.d.ts +2 -0
  29. package/types/components/zd-modal/interfaces.d.ts +2 -0
  30. package/types/components/zd-modal/modal.d.ts +8 -0
  31. package/types/components/zd-select-tree-multiple/interfaces.d.ts +1 -0
  32. package/types/components/zd-select-tree-multiple/select-tree-multiple.d.ts +4 -0
  33. package/types/components/zd-selectable-list/interfaces.d.ts +1 -0
  34. package/types/components/zd-selectable-list/selectable-list.d.ts +4 -4
  35. package/types/components/zd-tabs/interfaces.d.ts +1 -0
  36. package/types/components/zd-tabs/tabs.d.ts +14 -0
  37. package/types/components/zd-tree-grid/tree-grid-editable.d.ts +3 -0
  38. package/types/utils/report/report-type/interfaces.d.ts +1 -0
  39. package/types/utils/themes/themes.d.ts +4 -0
@@ -444,6 +444,26 @@
444
444
  reset: 'zoomReset',
445
445
  },
446
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
+ },
447
467
  },
448
468
  };
449
469
  this.chartType = this.getInitValue('chartType', props.chartType, this.chartType);
@@ -486,6 +506,223 @@
486
506
  }
487
507
  return Promise.resolve();
488
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
+ }
489
726
  updateToolbarIcons() {
490
727
  var _a, _b, _c;
491
728
  if (!this.viewGetIconHTML)
@@ -870,6 +1107,16 @@
870
1107
  * '30em', '400', 400. Values without measurement unit will be notated in pixels by default
871
1108
  */
872
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';
873
1120
  /**
874
1121
  * Configures the carousel as infinite (the slide after the last one is the first slide, and vice-versa)
875
1122
  */
@@ -961,6 +1208,8 @@
961
1208
  this.buttonsOutside = this.getInitValue('buttonsOutside', props.buttonsOutside, this.buttonsOutside);
962
1209
  this.center = this.getInitValue('center', props.center, this.center);
963
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);
964
1213
  this.infiniteScroll = this.getInitValue('infiniteScroll', props.infiniteScroll, this.infiniteScroll);
965
1214
  this.initialSlide = this.getInitValue('initialSlide', props.initialSlide, this.initialSlide);
966
1215
  this.currentSlide = this.getInitValue('currentSlide', props.currentSlide, this.initialSlide);
@@ -1196,6 +1445,7 @@
1196
1445
  this.internalValue = {};
1197
1446
  this.align = this.getInitValue('align', props.align, this.align);
1198
1447
  this.justify = this.getInitValue('justify', props.justify, this.justify);
1448
+ this.height = this.getInitValue('height', props.height, this.height);
1199
1449
  this.internalValue = this.getInitValue('value', props.value, this.value);
1200
1450
  this.createAccessors();
1201
1451
  }
@@ -1785,6 +2035,10 @@
1785
2035
  * Max height in pixels. 'none' means no limit.
1786
2036
  */
1787
2037
  this.maxHeight = 'none';
2038
+ /**
2039
+ * Max height in pixels. 'none' means no limit.
2040
+ */
2041
+ this.height = 'auto';
1788
2042
  /**
1789
2043
  * Language code to be used for highlight (js|javascript, css, html, json, ts|typescript, bash|shell)
1790
2044
  * Other languages must be imported above
@@ -1804,6 +2058,7 @@
1804
2058
  this.staticCode = this.getInitValue('staticCode', props.staticCode, this.staticCodeValue);
1805
2059
  this.copyIcon = this.getInitValue('copyIcon', props.copyIcon, this.copyIcon);
1806
2060
  this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
2061
+ this.height = this.getInitValue('height', props.height, this.height);
1807
2062
  this.language = this.getInitValue('language', props.language, this.language);
1808
2063
  this.showLineNumbers = this.getInitValue('showLineNumbers', props.showLineNumbers, this.showLineNumbers);
1809
2064
  this.createAccessors();
@@ -2010,12 +2265,27 @@
2010
2265
  * Adds height 100% to container.
2011
2266
  */
2012
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';
2013
2280
  /**
2014
2281
  * Removes viewport maximum-width size breakpoints.
2015
2282
  */
2016
2283
  this.fluid = true;
2017
2284
  this.fluid = this.getInitValue('fluid', props.fluid, this.fluid);
2018
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);
2019
2289
  this.createAccessors();
2020
2290
  }
2021
2291
  }
@@ -2353,6 +2623,14 @@
2353
2623
  * Dialog type (normal, success, error, warning, info)
2354
2624
  */
2355
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;
2356
2634
  /**
2357
2635
  * Default dialog buttons
2358
2636
  * @private
@@ -2364,6 +2642,8 @@
2364
2642
  events: { click: () => this.hide() },
2365
2643
  }];
2366
2644
  this.defaultValues = {
2645
+ confirmButton: this.confirmButton,
2646
+ denyButton: this.denyButton,
2367
2647
  name: this.name,
2368
2648
  maxWidth: this.maxWidth,
2369
2649
  persistent: this.persistent,
@@ -2371,6 +2651,38 @@
2371
2651
  title: this.title,
2372
2652
  text: this.text,
2373
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
+ };
2374
2686
  this.assignDialogProperties(props);
2375
2687
  this.createAccessors();
2376
2688
  }
@@ -2380,6 +2692,8 @@
2380
2692
  */
2381
2693
  assignDialogProperties(dialog) {
2382
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);
2383
2697
  this.name = this.getInitValue('name', dialog.name, this.defaultValues.name);
2384
2698
  this.maxWidth = this.getInitValue('maxWidth', dialog.maxWidth, this.defaultValues.maxWidth);
2385
2699
  this.persistent = this.getInitValue('persistent', dialog.persistent, this.defaultValues.persistent);
@@ -2392,6 +2706,7 @@
2392
2706
  * Displays dialog
2393
2707
  */
2394
2708
  show() {
2709
+ core.KeyMap.bind(this.clickDefaultButtonKeyMapping, this);
2395
2710
  this.isVisible = true;
2396
2711
  }
2397
2712
  /**
@@ -2399,6 +2714,7 @@
2399
2714
  */
2400
2715
  hide() {
2401
2716
  this.isVisible = false;
2717
+ core.KeyMap.unbind(this.clickDefaultButtonKeyMapping, this);
2402
2718
  }
2403
2719
  }
2404
2720
 
@@ -3470,7 +3786,7 @@
3470
3786
  const lastValue = this.value;
3471
3787
  this.dateError = false;
3472
3788
  this.value = this.parseISODateRangeValue(newValue);
3473
- if (!core.isEqual(lastValue, this.value))
3789
+ if (!core.Utils.isEqual(lastValue, this.value))
3474
3790
  this.change(this.value);
3475
3791
  }
3476
3792
  formatISODateRangeValue(dates) {
@@ -3728,6 +4044,10 @@
3728
4044
  * Applies position fixed to the dropdown.
3729
4045
  */
3730
4046
  this.fixed = false;
4047
+ /**
4048
+ * Sets the height for the dropdown.
4049
+ */
4050
+ this.height = 'auto';
3731
4051
  /**
3732
4052
  * Offset the menu on the x-axis.
3733
4053
  */
@@ -3753,6 +4073,7 @@
3753
4073
  this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
3754
4074
  this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
3755
4075
  this.hover = this.getInitValue('hover', props.hover, this.hover);
4076
+ this.height = this.getInitValue('height', props.height, this.height);
3756
4077
  this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
3757
4078
  this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
3758
4079
  this.maxWidth = this.getInitValue('maxWidth', props.maxWidth, this.maxWidth);
@@ -4014,12 +4335,18 @@
4014
4335
  this.override = {};
4015
4336
  this.cache = false;
4016
4337
  this.cacheDuration = 2 * 60 * 60 * 1000;
4338
+ this.height = 'auto';
4339
+ this.maxHeight = 'none';
4340
+ this.minHeight = 'none';
4017
4341
  this.headerName = 'sw-fetched-on';
4018
4342
  this.path = props.path;
4019
4343
  this.local = props.local === true;
4020
4344
  this.override = props.override || this.override;
4021
4345
  this.cache = props.cache || this.cache;
4022
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);
4023
4350
  this.createAccessors();
4024
4351
  this.getMetadata();
4025
4352
  }
@@ -4156,6 +4483,8 @@
4156
4483
  this.componentProps = {};
4157
4484
  /** column style property */
4158
4485
  this.style = {};
4486
+ /** Type of XLS */
4487
+ this.xlsType = '';
4159
4488
  /* Stores lookup data to prevent unnecessary requests */
4160
4489
  this.lookupData = {};
4161
4490
  /* Stores lookup data count (only to be reactive and force column update) */
@@ -4198,6 +4527,7 @@
4198
4527
  this.loading = this.getInitValue('loading', props.loading, this.loading);
4199
4528
  this.style = this.getInitValue('style', props.style, this.style);
4200
4529
  this.componentProps = this.getInitValue('componentProps', props.componentProps, this.componentProps);
4530
+ this.xlsType = this.getInitValue('xlsType', props.xlsType, this.xlsType);
4201
4531
  this.conditions = this.getInitValue('conditions', props.conditions, this.conditions);
4202
4532
  this.createConditions();
4203
4533
  this.createActionConditions();
@@ -4536,7 +4866,7 @@
4536
4866
  if (this.componentProps.dataValueOut && ((_a = component.datasource) === null || _a === void 0 ? void 0 : _a.currentRow)) {
4537
4867
  this.componentProps.dataValueOut.forEach((columns) => {
4538
4868
  const { column, columnOnGrid } = columns;
4539
- if (!core.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
4869
+ if (!core.Utils.isEqual(newRow.originalRow[columnOnGrid], component.datasource.currentRow[column])) {
4540
4870
  newRow[`${columnOnGrid}_original`] = newRow.originalRow[columnOnGrid];
4541
4871
  newRow[columnOnGrid] = component.datasource.currentRow[column];
4542
4872
  }
@@ -4550,7 +4880,7 @@
4550
4880
  }
4551
4881
  }
4552
4882
  core.FormatterParserProvider.registerFormatter('column_ZdSelect', ({ column, value, row, componentProps, }) => {
4553
- if (!value)
4883
+ if (value === null || value === undefined)
4554
4884
  return '';
4555
4885
  const { dataText, formatterDataText, dataTextSeparator, dataValue, } = componentProps;
4556
4886
  let currentRow = row;
@@ -4598,7 +4928,7 @@
4598
4928
  });
4599
4929
  return dataTextNames.reduce((result, columnName, index) => {
4600
4930
  const rowCell = currentRow[columnName];
4601
- if (rowCell) {
4931
+ if (rowCell !== undefined && rowCell !== null) {
4602
4932
  const separator = index > 0 ? (dataTextSeparator || ' | ') : '';
4603
4933
  const mask = masks[index];
4604
4934
  const maskValue = typeof mask === 'function' ? mask(rowCell) : mask;
@@ -5017,15 +5347,36 @@
5017
5347
  * @private
5018
5348
  */
5019
5349
  this.editedRows = {};
5350
+ /**
5351
+ * Rows with newRowIdentifier
5352
+ * @private
5353
+ */
5354
+ this.addedRows = {};
5020
5355
  /**
5021
5356
  * Invalid inline components
5022
5357
  * @private
5023
5358
  */
5024
5359
  this.invalidComponents = {};
5360
+ this.cancelEditedRowsKeyMapping = {
5361
+ esc: {
5362
+ event: this.cancelEditedRows.bind(this),
5363
+ stop: true,
5364
+ input: true,
5365
+ active: true,
5366
+ },
5367
+ };
5025
5368
  this.newRowIdentifier = '__added_row';
5026
5369
  this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
5027
5370
  this.createAccessors();
5028
5371
  }
5372
+ onMounted(element) {
5373
+ super.onMounted(element);
5374
+ core.KeyMap.bind(this.cancelEditedRowsKeyMapping, this, element);
5375
+ }
5376
+ onBeforeDestroy() {
5377
+ super.onBeforeDestroy();
5378
+ core.KeyMap.unbind(this.cancelEditedRowsKeyMapping, this);
5379
+ }
5029
5380
  /**
5030
5381
  * Get Grid columns objects
5031
5382
  * @param columns Grid columns parameter
@@ -5195,7 +5546,7 @@
5195
5546
  changeEditableComponent(column, row, value, component) {
5196
5547
  const key = row[this.datasource.uniqueKey];
5197
5548
  const columnName = column.name;
5198
- if (!core.isEqual(value, row[columnName])) {
5549
+ if (!core.Utils.isEqual(value, row[columnName])) {
5199
5550
  const newRow = {};
5200
5551
  newRow[key] = Object.assign({}, this.editedRows[key]);
5201
5552
  newRow[key].originalRow = Object.assign({}, row);
@@ -5241,6 +5592,14 @@
5241
5592
  * Cancels all edited rows and enable grid components
5242
5593
  */
5243
5594
  cancelEditedRows() {
5595
+ return __awaiter(this, void 0, void 0, function* () {
5596
+ yield this.removeAddedRows();
5597
+ this.editing = false;
5598
+ this.editedRows = {};
5599
+ this.invalidComponents = {};
5600
+ });
5601
+ }
5602
+ removeAddedRows() {
5244
5603
  return __awaiter(this, void 0, void 0, function* () {
5245
5604
  const { data } = this.datasource;
5246
5605
  data.forEach((row, index) => {
@@ -5249,21 +5608,26 @@
5249
5608
  }
5250
5609
  });
5251
5610
  yield this.datasource.updateData(data);
5252
- this.editing = false;
5253
- this.editedRows = {};
5254
- this.invalidComponents = {};
5255
5611
  });
5256
5612
  }
5613
+ addDataRow(row) {
5614
+ if (this.addedRows[row[this.datasource.uniqueKey]])
5615
+ this.datasource.post(row);
5616
+ else
5617
+ this.datasource.put(row);
5618
+ }
5257
5619
  /**
5258
5620
  * Saves all edited rows if they are valid
5259
5621
  * @throws Will throw when it finds an invalid row
5260
5622
  */
5261
5623
  saveEditedRows() {
5262
5624
  return __awaiter(this, void 0, void 0, function* () {
5263
- const response = yield Promise.all(this.getEditedRows().map((row) => this.datasource.put(row)));
5625
+ yield this.removeAddedRows();
5626
+ const response = yield Promise.all(this.getEditedRows().map((row) => this.addDataRow(row)));
5264
5627
  this.editing = false;
5265
5628
  this.editedRows = {};
5266
5629
  this.invalidComponents = {};
5630
+ this.addedRows = {};
5267
5631
  yield this.datasource.get();
5268
5632
  return response;
5269
5633
  });
@@ -5275,8 +5639,11 @@
5275
5639
  getEditedRows() {
5276
5640
  const editedRows = [];
5277
5641
  Object.keys(this.editedRows).forEach((key) => {
5642
+ this.addedRows = {};
5278
5643
  const row = Object.assign(Object.assign({}, this.editedRows[key].originalRow), this.editedRows[key]);
5279
5644
  delete row.originalRow;
5645
+ if (row[this.newRowIdentifier])
5646
+ this.addedRows[key] = row;
5280
5647
  delete row[this.newRowIdentifier];
5281
5648
  Object.keys(row).forEach((attr) => {
5282
5649
  if (Object.prototype.hasOwnProperty.call(row, `${attr}_original`)) {
@@ -5970,11 +6337,12 @@
5970
6337
  overrideGet() {
5971
6338
  const oldGet = this.datasource.get;
5972
6339
  this.datasource.get = () => __awaiter(this, void 0, void 0, function* () {
5973
- yield oldGet.call(this.datasource);
5974
- if (this.indexOf(this.value) !== -1 || this.datasource.search || this.isFocused)
5975
- return;
5976
- yield this.setValue(this.value, false);
5977
- this.removePushedValue();
6340
+ const response = yield oldGet.call(this.datasource);
6341
+ if (this.indexOf(this.value) === -1 && !this.datasource.search && !this.isFocused) {
6342
+ yield this.setValue(this.value, false);
6343
+ this.removePushedValue();
6344
+ }
6345
+ return response;
5978
6346
  });
5979
6347
  }
5980
6348
  get search() {
@@ -6314,10 +6682,10 @@
6314
6682
  }
6315
6683
  }
6316
6684
  core.FormatterParserProvider.registerFormatter('ZdSelect', (value, { dataText, dataTextSeparator = ' | ', }) => {
6317
- if (!value && value !== 0) {
6685
+ if (value === null || value === undefined) {
6318
6686
  return null;
6319
6687
  }
6320
- if (typeof value === 'string' || typeof value === 'number') {
6688
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
6321
6689
  return value;
6322
6690
  }
6323
6691
  const dataTextArr = Array.isArray(dataText) ? dataText : [dataText];
@@ -6340,7 +6708,7 @@
6340
6708
  }
6341
6709
  });
6342
6710
  return dataTextNames.reduce((result, column, index) => {
6343
- if (value[column]) {
6711
+ if (value[column] !== null && value[column] !== undefined) {
6344
6712
  const separator = index > 0 ? dataTextSeparator : '';
6345
6713
  let masked = value[column];
6346
6714
  if (masks[index]) {
@@ -6559,6 +6927,18 @@
6559
6927
  * Will only collapse when explicitly closed.
6560
6928
  */
6561
6929
  this.expand = false;
6930
+ /**
6931
+ * Sets the height for the component.
6932
+ */
6933
+ this.height = 'auto';
6934
+ /**
6935
+ * Sets the maxHeight for the component.
6936
+ */
6937
+ this.maxHeight = 'none';
6938
+ /**
6939
+ * Sets the minHeight for the component.
6940
+ */
6941
+ this.minHeight = 'none';
6562
6942
  this.dark = this.getInitValue('dark', props.dark, this.dark);
6563
6943
  this.dense = this.getInitValue('dense', props.dense, this.dense);
6564
6944
  this.disabled = this.getInitValue('disabled', props.disabled, this.disabled);
@@ -6570,6 +6950,9 @@
6570
6950
  this.color = this.getInitValue('color', props.color, this.color);
6571
6951
  this.elevation = this.getInitValue('elevation', props.elevation, this.elevation);
6572
6952
  this.expand = this.getInitValue('expand', props.expand, this.expand);
6953
+ this.height = this.getInitValue('height', props.height, this.height);
6954
+ this.maxHeight = this.getInitValue('maxHeight', props.maxHeight, this.maxHeight);
6955
+ this.minHeight = this.getInitValue('minHeight', props.minHeight, this.minHeight);
6573
6956
  this.createAccessors();
6574
6957
  }
6575
6958
  /**
@@ -7019,6 +7402,8 @@
7019
7402
  this.filteredMenuItems = [];
7020
7403
  /** Search value */
7021
7404
  this.searchValue = '';
7405
+ /** Store the current item focused */
7406
+ this.currentItem = null;
7022
7407
  this.app = this.getInitValue('app', props.app, this.app);
7023
7408
  this.clipped = this.getInitValue('clipped', props.clipped, this.clipped);
7024
7409
  this.fixed = this.getInitValue('fixed', props.fixed, this.fixed);
@@ -7251,7 +7636,7 @@
7251
7636
  if (item.component === 'ZdMenuGroup') {
7252
7637
  this.searchItems(item.items);
7253
7638
  }
7254
- else if (core.normalize(core.I18n.translate(item.label)).indexOf(core.normalize(this.searchValue)) !== -1) {
7639
+ else if (core.Utils.normalize(core.I18n.translate(item.label)).indexOf(core.Utils.normalize(this.searchValue)) !== -1) {
7255
7640
  this.filteredMenuItems.push(item);
7256
7641
  }
7257
7642
  }
@@ -7298,6 +7683,15 @@
7298
7683
  if (preventDefault) {
7299
7684
  event.preventDefault();
7300
7685
  }
7686
+ this.setFocus();
7687
+ }
7688
+ /**
7689
+ * Event triggered when this item is focus
7690
+ */
7691
+ focus() {
7692
+ if (this.parentMenu) {
7693
+ this.parentMenu.currentItem = this;
7694
+ }
7301
7695
  }
7302
7696
  /**
7303
7697
  * @returns item is selected or not
@@ -7365,6 +7759,26 @@
7365
7759
  close() {
7366
7760
  this.opened = false;
7367
7761
  }
7762
+ /**
7763
+ * Event triggered when this item is clicked
7764
+ */
7765
+ click(event) {
7766
+ let preventDefault = false;
7767
+ preventDefault = this.callEvent('click', { event, component: this });
7768
+ if (preventDefault) {
7769
+ event.preventDefault();
7770
+ }
7771
+ this.setFocus();
7772
+ }
7773
+ /**
7774
+ * Event triggered when this item is focus
7775
+ */
7776
+ focus(event) {
7777
+ this.callEvent('focus', { event, component: this });
7778
+ if (this.parentMenu) {
7779
+ this.parentMenu.currentItem = this;
7780
+ }
7781
+ }
7368
7782
  }
7369
7783
 
7370
7784
  /**
@@ -7442,10 +7856,20 @@
7442
7856
  * If true the modal won't close when overlay is clicked
7443
7857
  */
7444
7858
  this.persistent = false;
7859
+ /**
7860
+ * Allows modal to be dragged around in the screen
7861
+ */
7862
+ this.draggable = false;
7863
+ /**
7864
+ * Css selector of the drag handle
7865
+ */
7866
+ this.dragHandle = '';
7445
7867
  this.title = this.getInitValue('title', props.title, this.title);
7446
7868
  this.fullscreen = this.getInitValue('fullscreen', props.fullscreen, this.fullscreen);
7447
7869
  this.grid = this.getInitValue('grid', props.grid, this.grid);
7448
7870
  this.persistent = this.getInitValue('persistent', props.persistent, this.persistent);
7871
+ this.draggable = this.getInitValue('draggable', props.draggable, this.draggable);
7872
+ this.dragHandle = this.getInitValue('dragHandle', props.dragHandle, this.dragHandle);
7449
7873
  this.isVisible = false;
7450
7874
  this.createAccessors();
7451
7875
  }
@@ -8887,8 +9311,13 @@
8887
9311
  */
8888
9312
  this.selectedNodes = [];
8889
9313
  this.selectValue = [];
9314
+ /**
9315
+ * Changes the behavior of checked nodes that will be displayed in the array of values
9316
+ */
9317
+ this.valueConsistsOf = 'LEAF_PRIORITY';
8890
9318
  this.flat = this.getInitValue('flat', props.flat, this.flat);
8891
9319
  this.limit = this.getInitValue('limit', props.limit, this.limit);
9320
+ this.valueConsistsOf = this.getInitValue('valueConsistsOf', props.valueConsistsOf, this.valueConsistsOf);
8892
9321
  this.createAccessors();
8893
9322
  }
8894
9323
  /**
@@ -8933,6 +9362,40 @@
8933
9362
  }
8934
9363
  }
8935
9364
 
9365
+ /**
9366
+ * Base class for SelectableList component.
9367
+ */
9368
+ class SelectableList extends List {
9369
+ constructor(props) {
9370
+ super(props);
9371
+ /**
9372
+ * Specifies whether at least one element must be selected
9373
+ */
9374
+ this.mandatory = false;
9375
+ /**
9376
+ * Defines the maximum number of elements the list has
9377
+ */
9378
+ this.max = undefined;
9379
+ /**
9380
+ * Defines how many elements of the list can be selected at the same time
9381
+ */
9382
+ this.multiple = undefined;
9383
+ /**
9384
+ * Sets the active list-item inside the list-group
9385
+ */
9386
+ this.value = undefined;
9387
+ this.activeClass = this.getInitValue('activeClass', props.activeClass, this.activeClass);
9388
+ this.mandatory = this.getInitValue('mandatory', props.mandatory, this.mandatory);
9389
+ this.max = this.getInitValue('max', props.max, this.max);
9390
+ this.multiple = this.getInitValue('multiple', props.multiple, this.multiple);
9391
+ this.value = this.getInitValue('value', props.value, this.value);
9392
+ this.createAccessors();
9393
+ }
9394
+ change(event, element) {
9395
+ this.callEvent('change', { event, element, component: this });
9396
+ }
9397
+ }
9398
+
8936
9399
  /**
8937
9400
  * Base class for SpeedDial component.
8938
9401
  */
@@ -9278,6 +9741,7 @@
9278
9741
  this.tabs = [];
9279
9742
  this.tabs = this.getTabs(props.tabs || []);
9280
9743
  this.activeTab = this.getInitValue('activeTab', props.activeTab, this.activeTab);
9744
+ this.height = this.getInitValue('height', props.height, this.height);
9281
9745
  this.createAccessors();
9282
9746
  }
9283
9747
  getTabs(tabs) {
@@ -9290,6 +9754,31 @@
9290
9754
  }
9291
9755
  return tab;
9292
9756
  }
9757
+ /**
9758
+ * Method for navigating to the next tab
9759
+ * @param loop Defines if want a loop navigation
9760
+ */
9761
+ nextTab(loop = false) {
9762
+ if (loop) {
9763
+ this.activeTab = (this.activeTab + 1) % this.tabs.length;
9764
+ }
9765
+ else if (this.activeTab < this.tabs.length - 1) {
9766
+ this.activeTab += 1;
9767
+ }
9768
+ }
9769
+ /**
9770
+ * Method for navigating to the previous tab
9771
+ * @param loop Defines if want a loop navigation
9772
+ */
9773
+ previousTab(loop = false) {
9774
+ if (loop) {
9775
+ const newTabIndex = (this.activeTab - 1) % this.tabs.length;
9776
+ this.activeTab = newTabIndex >= 0 ? newTabIndex : newTabIndex + this.tabs.length;
9777
+ }
9778
+ else if (this.activeTab > 0) {
9779
+ this.activeTab -= 1;
9780
+ }
9781
+ }
9293
9782
  /**
9294
9783
  * Triggered before tab is change.
9295
9784
  * @param event DOM event
@@ -10141,9 +10630,25 @@
10141
10630
  * Enter edit mode on double click
10142
10631
  */
10143
10632
  this.doubleClickEdit = false;
10633
+ this.cancelEditedRowsKeyMapping = {
10634
+ esc: {
10635
+ event: this.cancelEditedRows.bind(this),
10636
+ stop: true,
10637
+ input: true,
10638
+ active: true,
10639
+ },
10640
+ };
10144
10641
  this.doubleClickEdit = this.getInitValue('doubleClickEdit', props.doubleClickEdit, this.doubleClickEdit);
10145
10642
  this.createAccessors();
10146
10643
  }
10644
+ onMounted(element) {
10645
+ super.onMounted(element);
10646
+ core.KeyMap.bind(this.cancelEditedRowsKeyMapping, this, element);
10647
+ }
10648
+ onBeforeDestroy() {
10649
+ super.onBeforeDestroy();
10650
+ core.KeyMap.unbind(this.cancelEditedRowsKeyMapping, this);
10651
+ }
10147
10652
  /**
10148
10653
  * Get Grid columns objects
10149
10654
  * @param columns Grid columns parameter
@@ -10312,7 +10817,7 @@
10312
10817
  changeEditableComponent(column, row, value, component) {
10313
10818
  const key = row[this.datasource.uniqueKey];
10314
10819
  const columnName = column.name;
10315
- if (!core.isEqual(value, row[columnName])) {
10820
+ if (!core.Utils.isEqual(value, row[columnName])) {
10316
10821
  const newRow = {};
10317
10822
  newRow[key] = Object.assign({}, this.editedRows[key]);
10318
10823
  newRow[key].originalRow = Object.assign({}, row);
@@ -10586,7 +11091,7 @@
10586
11091
  tableColumns: 'mdi-table-headers-eye',
10587
11092
  unfold: 'mdi-unfold-more-horizontal',
10588
11093
  warning: 'mdi-exclamation',
10589
- zoom: 'mdi-magnify-scan',
11094
+ zoom: 'mdi-magnify',
10590
11095
  zoomIn: 'mdi-plus-circle-outline',
10591
11096
  zoomPanning: 'mdi-hand-back-right-outline',
10592
11097
  zoomOut: 'mdi-minus-circle-outline',
@@ -10685,10 +11190,14 @@
10685
11190
  light: {
10686
11191
  'font-color': 'var(--v-grey-darken2)',
10687
11192
  'background-base': '#F6F6F6',
11193
+ 'scrollbar-track': 'var(--v-grey-lighten5)',
11194
+ 'scrollbar-thumb': 'var(--v-grey-lighten4)',
10688
11195
  },
10689
11196
  dark: {
10690
11197
  'font-color': 'var(--v-grey-lighten3)',
10691
11198
  'background-base': '#121212',
11199
+ 'scrollbar-track': 'var(--v-grey-darken3)',
11200
+ 'scrollbar-thumb': 'var(--v-grey-base)',
10692
11201
  },
10693
11202
  variables: {
10694
11203
  'default-padding': '16px',
@@ -10962,6 +11471,7 @@
10962
11471
  sequence: index,
10963
11472
  format: this.getFormatOfColumn(col),
10964
11473
  size: `${size}%`,
11474
+ xlsType: col.xlsType,
10965
11475
  };
10966
11476
  return Object.assign(Object.assign({}, result), { [col.name]: row });
10967
11477
  }, {});
@@ -11780,6 +12290,7 @@
11780
12290
  exports.SelectMultiple = SelectMultiple;
11781
12291
  exports.SelectTree = SelectTree;
11782
12292
  exports.SelectTreeMultiple = SelectTreeMultiple;
12293
+ exports.SelectableList = SelectableList;
11783
12294
  exports.SpeedDial = SpeedDial;
11784
12295
  exports.Steppers = Steppers;
11785
12296
  exports.SvgMap = SvgMap;