@syncfusion/ej2-splitbuttons 21.2.5 → 22.1.37

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 (88) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +3 -3
  3. package/dist/ej2-splitbuttons.min.js +2 -2
  4. package/dist/ej2-splitbuttons.umd.min.js +2 -2
  5. package/dist/ej2-splitbuttons.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-splitbuttons.es2015.js +42 -5
  7. package/dist/es6/ej2-splitbuttons.es2015.js.map +1 -1
  8. package/dist/es6/ej2-splitbuttons.es5.js +42 -5
  9. package/dist/es6/ej2-splitbuttons.es5.js.map +1 -1
  10. package/dist/global/ej2-splitbuttons.min.js +2 -2
  11. package/dist/global/ej2-splitbuttons.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +7 -7
  14. package/src/drop-down-button/drop-down-button.js +29 -4
  15. package/src/progress-button/progress-button-model.d.ts +2 -1
  16. package/src/progress-button/progress-button.d.ts +2 -1
  17. package/src/split-button/split-button.js +13 -1
  18. package/styles/bootstrap-dark.css +0 -84
  19. package/styles/bootstrap.css +0 -7
  20. package/styles/bootstrap4.css +8 -5
  21. package/styles/bootstrap5-dark.css +0 -7
  22. package/styles/bootstrap5.css +0 -7
  23. package/styles/button-group/_layout.scss +7 -1
  24. package/styles/button-group/_material3-dark-definition.scss +1 -0
  25. package/styles/button-group/_material3-definition.scss +31 -0
  26. package/styles/button-group/_theme.scss +67 -1
  27. package/styles/button-group/material3-dark.css +902 -0
  28. package/styles/button-group/material3-dark.scss +5 -0
  29. package/styles/button-group/material3.css +958 -0
  30. package/styles/button-group/material3.scss +5 -0
  31. package/styles/drop-down-button/_layout.scss +7 -2
  32. package/styles/drop-down-button/_material3-dark-definition.scss +1 -0
  33. package/styles/drop-down-button/_material3-definition.scss +51 -0
  34. package/styles/drop-down-button/_theme.scss +6 -1
  35. package/styles/drop-down-button/icons/_material3-dark.scss +1 -0
  36. package/styles/drop-down-button/material3-dark.css +293 -0
  37. package/styles/drop-down-button/material3-dark.scss +7 -0
  38. package/styles/drop-down-button/material3.css +349 -0
  39. package/styles/drop-down-button/material3.scss +7 -0
  40. package/styles/fabric-dark.css +0 -84
  41. package/styles/fabric.css +0 -7
  42. package/styles/fluent-dark.css +4 -7
  43. package/styles/fluent.css +4 -7
  44. package/styles/highcontrast-light.css +0 -84
  45. package/styles/highcontrast.css +0 -84
  46. package/styles/material-dark.css +0 -84
  47. package/styles/material.css +0 -7
  48. package/styles/material3-dark.css +2000 -0
  49. package/styles/material3-dark.scss +6 -0
  50. package/styles/material3.css +2050 -0
  51. package/styles/material3.scss +6 -0
  52. package/styles/progress-button/_material3-dark-definition.scss +1 -0
  53. package/styles/progress-button/_material3-definition.scss +25 -0
  54. package/styles/progress-button/_theme.scss +220 -65
  55. package/styles/progress-button/bootstrap-dark.css +0 -84
  56. package/styles/progress-button/bootstrap.css +0 -7
  57. package/styles/progress-button/bootstrap4.css +0 -5
  58. package/styles/progress-button/bootstrap5-dark.css +0 -7
  59. package/styles/progress-button/bootstrap5.css +0 -7
  60. package/styles/progress-button/fabric-dark.css +0 -84
  61. package/styles/progress-button/fabric.css +0 -7
  62. package/styles/progress-button/fluent-dark.css +0 -7
  63. package/styles/progress-button/fluent.css +0 -7
  64. package/styles/progress-button/highcontrast-light.css +0 -84
  65. package/styles/progress-button/highcontrast.css +0 -84
  66. package/styles/progress-button/material-dark.css +0 -84
  67. package/styles/progress-button/material.css +0 -7
  68. package/styles/progress-button/material3-dark.css +557 -0
  69. package/styles/progress-button/material3-dark.scss +6 -0
  70. package/styles/progress-button/material3.css +613 -0
  71. package/styles/progress-button/material3.scss +6 -0
  72. package/styles/progress-button/tailwind-dark.css +0 -5
  73. package/styles/progress-button/tailwind.css +0 -5
  74. package/styles/split-button/_layout.scss +59 -2
  75. package/styles/split-button/_material3-dark-definition.scss +1 -0
  76. package/styles/split-button/_material3-definition.scss +26 -0
  77. package/styles/split-button/_theme.scss +21 -1
  78. package/styles/split-button/bootstrap4.css +8 -0
  79. package/styles/split-button/fluent-dark.css +4 -0
  80. package/styles/split-button/fluent.css +4 -0
  81. package/styles/split-button/material3-dark.css +413 -0
  82. package/styles/split-button/material3-dark.scss +7 -0
  83. package/styles/split-button/material3.css +463 -0
  84. package/styles/split-button/material3.scss +7 -0
  85. package/styles/split-button/tailwind-dark.css +6 -0
  86. package/styles/split-button/tailwind.css +6 -0
  87. package/styles/tailwind-dark.css +6 -5
  88. package/styles/tailwind.css +6 -5
@@ -262,6 +262,10 @@ var DropDownButton = /** @__PURE__ @class */ (function (_super) {
262
262
  if (this.canOpen()) {
263
263
  this.openPopUp();
264
264
  }
265
+ else if (this.createPopupOnClick && !this.isPopupCreated) {
266
+ this.createPopup();
267
+ this.openPopUp();
268
+ }
265
269
  else {
266
270
  this.closePopup();
267
271
  }
@@ -539,6 +543,12 @@ var DropDownButton = /** @__PURE__ @class */ (function (_super) {
539
543
  };
540
544
  DropDownButton.prototype.getPopUpElement = function () {
541
545
  var val = null;
546
+ if (!this.dropDown && this.activeElem[0].classList.contains('e-split-btn')) {
547
+ var dropDownBtn = getComponent(this.activeElem[1], 'dropdown-btn');
548
+ if (dropDownBtn) {
549
+ this.dropDown = dropDownBtn.dropDown;
550
+ }
551
+ }
542
552
  if (this.dropDown) {
543
553
  val = this.dropDown.element;
544
554
  }
@@ -560,6 +570,9 @@ var DropDownButton = /** @__PURE__ @class */ (function (_super) {
560
570
  EventHandler.add(this.element, 'keydown', this.keyBoardHandler, this);
561
571
  };
562
572
  DropDownButton.prototype.popupWireEvents = function () {
573
+ if (!this.delegateMousedownHandler) {
574
+ this.delegateMousedownHandler = this.mousedownHandler.bind(this);
575
+ }
563
576
  var popupElement = this.getPopUpElement();
564
577
  if (this.createPopupOnClick) {
565
578
  EventHandler.add(document, 'mousedown touchstart', this.delegateMousedownHandler, this);
@@ -678,7 +691,7 @@ var DropDownButton = /** @__PURE__ @class */ (function (_super) {
678
691
  DropDownButton.prototype.clickHandler = function (e) {
679
692
  var trgt = e.target;
680
693
  if (closest(trgt, '[id="' + this.element.id + '"]')) {
681
- if (!this.createPopupOnClick || (this.target && !this.isColorPicker())) {
694
+ if (!this.createPopupOnClick || (this.target && this.target !== '' && !this.isColorPicker())) {
682
695
  if (this.getPopUpElement().classList.contains('e-popup-close')) {
683
696
  this.openPopUp(e);
684
697
  }
@@ -749,6 +762,21 @@ var DropDownButton = /** @__PURE__ @class */ (function (_super) {
749
762
  if (ul_1) {
750
763
  ul_1.focus();
751
764
  }
765
+ if (_this.enableRtl && ul_1.parentElement.style.left !== '0px') {
766
+ var wrapperWidth = void 0;
767
+ if (_this.element.parentElement && _this.element.parentElement.classList.contains('e-split-btn-wrapper')) {
768
+ wrapperWidth = _this.element.parentElement.offsetWidth;
769
+ }
770
+ else {
771
+ wrapperWidth = _this.element.offsetWidth;
772
+ }
773
+ var popupRect = ul_1.parentElement.offsetWidth - wrapperWidth;
774
+ var popupLeft = parseFloat(ul_1.parentElement.style.left) - popupRect;
775
+ if (popupLeft < 0) {
776
+ popupLeft = 0;
777
+ }
778
+ ul_1.parentElement.style.left = popupLeft + "px";
779
+ }
752
780
  var openArgs = { element: ul_1, items: _this.items };
753
781
  _this.trigger('open', openArgs);
754
782
  }
@@ -791,9 +819,6 @@ var DropDownButton = /** @__PURE__ @class */ (function (_super) {
791
819
  _this.destroyPopup();
792
820
  }
793
821
  }
794
- if (_this.target) {
795
- _this.isPopupCreated = _this.createPopupOnClick ? false : true;
796
- }
797
822
  }
798
823
  else {
799
824
  if (ul) {
@@ -1160,8 +1185,13 @@ var SplitButton = /** @__PURE__ @class */ (function (_super) {
1160
1185
  this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
1161
1186
  this.dropDown = this.secondaryBtnObj.dropDown;
1162
1187
  }
1188
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1189
+ this.isPopupCreated = this.secondaryBtnObj.isPopupCreated;
1163
1190
  this.secondaryBtnObj.activeElem = [this.element, this.secondaryBtnObj.element];
1164
1191
  this.secondaryBtnObj.element.querySelector('.e-btn-icon').classList.remove('e-icon-right');
1192
+ if (this.disabled) {
1193
+ this.wrapper.classList.add('e-splitbtn-disabled');
1194
+ }
1165
1195
  };
1166
1196
  SplitButton.prototype.setAria = function () {
1167
1197
  attributes(this.element, {
@@ -1242,7 +1272,7 @@ var SplitButton = /** @__PURE__ @class */ (function (_super) {
1242
1272
  break;
1243
1273
  case 'enter':
1244
1274
  this.clickHandler(e);
1245
- if (!this.getPopUpElement().classList.contains('e-popup-close')) {
1275
+ if (this.getPopUpElement() && !this.getPopUpElement().classList.contains('e-popup-close')) {
1246
1276
  this.element.classList.remove('e-active');
1247
1277
  this.secondaryBtnObj.element.classList.add('e-active');
1248
1278
  }
@@ -1286,6 +1316,13 @@ var SplitButton = /** @__PURE__ @class */ (function (_super) {
1286
1316
  removeClass([this.wrapper], RTL);
1287
1317
  }
1288
1318
  break;
1319
+ case 'disabled':
1320
+ if (newProp.disabled) {
1321
+ addClass([this.wrapper], 'e-splitbtn-disabled');
1322
+ }
1323
+ else {
1324
+ removeClass([this.wrapper], 'e-splitbtn-disabled');
1325
+ }
1289
1326
  }
1290
1327
  }
1291
1328
  };