@syncfusion/ej2-splitbuttons 20.4.42 → 20.4.50

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.
@@ -1,4 +1,4 @@
1
- import { Animation, ChildProperty, Collection, Complex, Component, Event, EventHandler, KeyboardEvents, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, attributes, classList, closest, createElement, deleteObject, detach, extend, getComponent, getInstance, getUniqueID, getValue, isNullOrUndefined, remove, removeClass, rippleEffect, select, setValue } from '@syncfusion/ej2-base';
1
+ import { Animation, ChildProperty, Collection, Complex, Component, Event, EventHandler, KeyboardEvents, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, attributes, classList, closest, createElement, deleteObject, detach, extend, getComponent, getInstance, getUniqueID, getValue, isNullOrUndefined, isRippleEnabled, remove, removeClass, rippleEffect, select, setValue } from '@syncfusion/ej2-base';
2
2
  import { Button } from '@syncfusion/ej2-buttons';
3
3
  import { Popup, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
4
4
 
@@ -96,8 +96,16 @@ function isValidLI(ul, li, index, keyCode, count = 0) {
96
96
  * @param {HTMLElement} popup - Specifies the popup element.
97
97
  * @returns {void}
98
98
  */
99
- function setBlankIconStyle(popup) {
99
+ function setBlankIconStyle(popup, blankIcon) {
100
100
  const blankIconList = [].slice.call(popup.getElementsByClassName('e-blank-icon'));
101
+ if (blankIcon) {
102
+ const menuItem = [].slice.call(popup.getElementsByClassName('e-item'));
103
+ menuItem.forEach((li) => {
104
+ if (li.style.paddingLeft || li.style.paddingRight) {
105
+ li.removeAttribute('style');
106
+ }
107
+ });
108
+ }
101
109
  if (!blankIconList.length) {
102
110
  return;
103
111
  }
@@ -542,6 +550,9 @@ let DropDownButton = class DropDownButton extends Component {
542
550
  EventHandler.remove(popupElement, this.closeActionEvents, this.focusoutHandler);
543
551
  }
544
552
  }
553
+ if (isRippleEnabled && this.rippleFn) {
554
+ this.rippleFn();
555
+ }
545
556
  }
546
557
  /**
547
558
  * Handles the keyboard interactions.
@@ -794,9 +805,13 @@ let DropDownButton = class DropDownButton extends Component {
794
805
  }
795
806
  break;
796
807
  case 'cssClass':
797
- if (newProp.cssClass.indexOf(classNames.VERTICAL) > -1) {
808
+ if (newProp.cssClass.indexOf(classNames.VERTICAL) > -1 || oldProp.cssClass.indexOf(classNames.VERTICAL) > -1) {
809
+ if (!this.element.querySelector('span.e-caret')) {
810
+ this.appendArrowSpan();
811
+ }
798
812
  const arrowSpan = this.element.querySelector('span.e-caret');
799
- classList(arrowSpan, ['e-icon-bottom'], ['e-icon-right']);
813
+ newProp.cssClass.indexOf(classNames.VERTICAL) > -1 ? classList(arrowSpan, ['e-icon-bottom'], ['e-icon-right'])
814
+ : classList(arrowSpan, ['e-icon-right'], ['e-icon-bottom']);
800
815
  }
801
816
  if (this.isPopupCreated) {
802
817
  if (oldProp.cssClass) {
@@ -1061,6 +1076,10 @@ let SplitButton = class SplitButton extends DropDownButton {
1061
1076
  this.trigger('select', args);
1062
1077
  };
1063
1078
  dropDownBtnModel.beforeOpen = (args) => {
1079
+ if (this.createPopupOnClick && this.items.length == 0) {
1080
+ this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
1081
+ this.dropDown = this.secondaryBtnObj.dropDown;
1082
+ }
1064
1083
  const callBackPromise = new Deferred();
1065
1084
  this.trigger('beforeOpen', args, (observedArgs) => {
1066
1085
  callBackPromise.resolve(observedArgs);