@syncfusion/ej2-splitbuttons 34.1.29 → 34.1.31

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,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 34.1.29
3
+ * version : 34.1.31
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-splitbuttons",
3
- "version": "34.1.29",
3
+ "version": "34.1.31",
4
4
  "description": "A package of feature-rich Essential JS 2 components such as DropDownButton, SplitButton, ProgressButton and ButtonGroup.",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,7 +8,7 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-splitbuttons.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~34.1.29",
11
+ "@syncfusion/ej2-base": "~34.1.30",
12
12
  "@syncfusion/ej2-popups": "~34.1.29"
13
13
  },
14
14
  "devDependencies": {},
@@ -572,6 +572,11 @@ var DropDownButton = /** @class */ (function (_super) {
572
572
  if (e.target === this.element && (e.keyCode === 9 || (!e.altKey && e.keyCode === 40) || e.keyCode === 38)) {
573
573
  return;
574
574
  }
575
+ var splitButton = getComponent(this.activeElem[0], 'split-btn');
576
+ if (splitButton && (e.keyCode === 13 || e.keyCode === 40 || e.keyCode === 38)) {
577
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
578
+ splitButton.issecondaryBtnClick = true;
579
+ }
575
580
  if (e.target && (e.target.classList.contains('e-item') || (e.target.parentElement && e.target.parentElement.classList.contains('e-split-btn-wrapper'))) && e.keyCode === 13) {
576
581
  e.preventDefault();
577
582
  }
@@ -604,10 +609,13 @@ var DropDownButton = /** @class */ (function (_super) {
604
609
  upDownKeyHandler(this.getULElement(), e.keyCode);
605
610
  };
606
611
  DropDownButton.prototype.keyEventHandler = function (e) {
612
+ var isSplitbutton = this.activeElem[0].classList.contains('e-split-btn');
607
613
  if (this.target && (e.keyCode === 13 || e.keyCode === 9)) {
608
- return;
614
+ if (!isSplitbutton) {
615
+ return;
616
+ }
609
617
  }
610
- if (e.keyCode === 13 && this.activeElem[0].classList.contains('e-split-btn')) {
618
+ if (e.keyCode === 13 && isSplitbutton) {
611
619
  this.triggerSelect(e);
612
620
  this.activeElem[0].focus();
613
621
  return;
@@ -655,6 +663,11 @@ var DropDownButton = /** @class */ (function (_super) {
655
663
  }
656
664
  };
657
665
  DropDownButton.prototype.clickHandler = function (e) {
666
+ var splitButton = getComponent(this.activeElem[0], 'split-btn');
667
+ if (splitButton) {
668
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
669
+ splitButton.issecondaryBtnClick = false;
670
+ }
658
671
  var trgt = e.target;
659
672
  if (closest(trgt, '[id="' + this.element.id + '"]')) {
660
673
  if (!this.createPopupOnClick || (this.target && this.target !== '' && !this.isColorPicker() && !this.createPopupOnClick)) {
@@ -737,6 +750,7 @@ var DropDownButton = /** @class */ (function (_super) {
737
750
  }
738
751
  }
739
752
  var ul = this.getULElement();
753
+ var isSplitbutton = Boolean(this.element.parentElement && this.element.parentElement.classList.contains('e-split-btn-wrapper'));
740
754
  this.popupWireEvents();
741
755
  var beforeOpenArgs = { element: ul, items: this.items, event: e, cancel: false };
742
756
  this.trigger('beforeOpen', beforeOpenArgs, function (observedArgs) {
@@ -754,11 +768,24 @@ var DropDownButton = /** @class */ (function (_super) {
754
768
  _this.element.setAttribute('aria-expanded', 'true');
755
769
  _this.element.setAttribute('aria-owns', _this.getPopUpElement().id);
756
770
  if (ul_1 && !_this.isSafari()) {
757
- ul_1.focus({ preventScroll: observedArgs.preventScroll });
771
+ if (_this.target && isSplitbutton) {
772
+ if (ul_1.tagName === 'UL') {
773
+ ul_1.focus({ preventScroll: observedArgs.preventScroll });
774
+ }
775
+ else {
776
+ var focusableChild = ul_1.querySelector('ul');
777
+ if (focusableChild) {
778
+ focusableChild.focus({ preventScroll: observedArgs.preventScroll });
779
+ }
780
+ }
781
+ }
782
+ else {
783
+ ul_1.focus({ preventScroll: observedArgs.preventScroll });
784
+ }
758
785
  }
759
786
  if (_this.enableRtl && ul_1.parentElement.style.left !== '0px') {
760
787
  var wrapperWidth = void 0;
761
- if (_this.element.parentElement && _this.element.parentElement.classList.contains('e-split-btn-wrapper')) {
788
+ if (isSplitbutton) {
762
789
  wrapperWidth = _this.element.parentElement.offsetWidth;
763
790
  }
764
791
  else {
@@ -24,6 +24,7 @@ export declare class SplitButton extends DropDownButton implements INotifyProper
24
24
  private wrapper;
25
25
  private primaryBtnObj;
26
26
  private secondaryBtnObj;
27
+ private issecondaryBtnClick;
27
28
  /**
28
29
  * Defines the content of the SplitButton primary action button can either be a text or HTML elements.
29
30
  *
@@ -51,7 +51,9 @@ var SplitButton = /** @class */ (function (_super) {
51
51
  * @hidden
52
52
  */
53
53
  function SplitButton(options, element) {
54
- return _super.call(this, options, element) || this;
54
+ var _this = _super.call(this, options, element) || this;
55
+ _this.issecondaryBtnClick = false;
56
+ return _this;
55
57
  }
56
58
  /**
57
59
  * Initialize Angular support.
@@ -305,16 +307,20 @@ var SplitButton = /** @class */ (function (_super) {
305
307
  SplitButton.prototype.btnKeyBoardHandler = function (e) {
306
308
  switch (e.action) {
307
309
  case 'altdownarrow':
308
- this.clickHandler(e);
310
+ if (this.issecondaryBtnClick) {
311
+ this.clickHandler(e);
312
+ }
309
313
  break;
310
314
  case 'enter':
311
- this.clickHandler(e);
312
- if (this.getPopUpElement() && !this.getPopUpElement().classList.contains('e-popup-close')) {
313
- this.element.classList.remove('e-active');
314
- this.secondaryBtnObj.element.classList.add('e-active');
315
- }
316
- else {
317
- this.secondaryBtnObj.element.classList.remove('e-active');
315
+ if (this.issecondaryBtnClick) {
316
+ this.clickHandler(e);
317
+ if (this.getPopUpElement() && !this.getPopUpElement().classList.contains('e-popup-close')) {
318
+ this.element.classList.remove('e-active');
319
+ this.secondaryBtnObj.element.classList.add('e-active');
320
+ }
321
+ else {
322
+ this.secondaryBtnObj.element.classList.remove('e-active');
323
+ }
318
324
  }
319
325
  break;
320
326
  }
@@ -720,6 +720,7 @@
720
720
  background: var(--color-sf-secondary-bg-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
721
721
  border-color: var(--color-sf-secondary-border-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
722
722
  color: var(--color-sf-secondary-text-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
723
+ outline: none !important; /* stylelint-disable-line declaration-no-important */
723
724
  border-color: var(--color-sf-secondary-border-color);
724
725
  }
725
726
  .e-btn-group .e-btn:disabled.e-outline.e-primary,
@@ -1229,6 +1229,7 @@
1229
1229
  background: var(--color-sf-secondary-bg-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
1230
1230
  border-color: var(--color-sf-secondary-border-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
1231
1231
  color: var(--color-sf-secondary-text-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
1232
+ outline: none !important; /* stylelint-disable-line declaration-no-important */
1232
1233
  border-color: var(--color-sf-secondary-border-color);
1233
1234
  }
1234
1235
  .e-btn-group .e-btn:disabled.e-outline.e-primary,
@@ -1361,6 +1361,7 @@
1361
1361
  background: var(--color-sf-secondary-bg-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
1362
1362
  border-color: var(--color-sf-secondary-border-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
1363
1363
  color: var(--color-sf-secondary-text-color-disabled) !important; /* stylelint-disable-line declaration-no-important */
1364
+ outline: none !important; /* stylelint-disable-line declaration-no-important */
1364
1365
  border-color: var(--color-sf-secondary-border-color);
1365
1366
  }
1366
1367
  .e-btn-group .e-btn:disabled.e-outline.e-primary,