dialogshift-webchat-sdk 2.9.8 → 2.10.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.
@@ -1714,7 +1714,9 @@ var WidgetManager = /** @class */ (function () {
1714
1714
  if (_this.iframeBoxWidget.isVisible()) {
1715
1715
  _this.iframeBoxWidget.hide();
1716
1716
  }
1717
- _this.chatButtonWidget.toggle(false);
1717
+ if (_this.chatButtonWidget) {
1718
+ _this.chatButtonWidget.toggle(false);
1719
+ }
1718
1720
  if (_this.getWebchatService()) {
1719
1721
  _this.getWebchatService().setMinimized(true);
1720
1722
  }
@@ -2778,16 +2780,31 @@ var ActionButtonWidget = /** @class */ (function (_super) {
2778
2780
  teaserButton: true,
2779
2781
  });
2780
2782
  });
2783
+ this.getBoxElem().addEventListener('keydown', function (event) {
2784
+ if (event.key === 'Enter') {
2785
+ _this.app.triggerElement({
2786
+ successor: _this.actionButton.getSuccessor(),
2787
+ teaserButton: true,
2788
+ });
2789
+ }
2790
+ });
2781
2791
  }
2782
2792
  if (this.actionButton.getType() === _models__WEBPACK_IMPORTED_MODULE_2__.ActionButtonType.callback) {
2783
2793
  this.getBoxElem().addEventListener('click', function () {
2784
2794
  var callback = _this.actionButton.getCallback();
2785
2795
  callback();
2786
2796
  });
2797
+ this.getBoxElem().addEventListener('keydown', function (event) {
2798
+ if (event.key === 'Enter') {
2799
+ var callback = _this.actionButton.getCallback();
2800
+ callback();
2801
+ }
2802
+ });
2787
2803
  }
2788
2804
  };
2789
2805
  ActionButtonWidget.prototype.render = function () {
2790
2806
  _super.prototype.render.call(this);
2807
+ this.getBoxElem().tabIndex = 0;
2791
2808
  this.bindEvents();
2792
2809
  };
2793
2810
  ActionButtonWidget.prototype.getBaseCls = function () {
@@ -2851,6 +2868,11 @@ var ChatButtonWidget = /** @class */ (function (_super) {
2851
2868
  this.getBoxElem().addEventListener('click', function () {
2852
2869
  _this.toggle();
2853
2870
  });
2871
+ this.getBoxElem().addEventListener('keydown', function (event) {
2872
+ if (event.key === 'Enter') {
2873
+ _this.toggle();
2874
+ }
2875
+ });
2854
2876
  };
2855
2877
  ChatButtonWidget.prototype.getBaseCls = function () {
2856
2878
  return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonCls;
@@ -2859,6 +2881,7 @@ var ChatButtonWidget = /** @class */ (function (_super) {
2859
2881
  var boxElem = this.getBoxElem();
2860
2882
  var iconContainer = document.createElement('div');
2861
2883
  iconContainer.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonIconContainerCls);
2884
+ iconContainer.tabIndex = 0;
2862
2885
  iconContainer.innerHTML = _consts__WEBPACK_IMPORTED_MODULE_2__.iconSvg;
2863
2886
  boxElem.appendChild(iconContainer);
2864
2887
  boxElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonLogoCls);
@@ -3133,9 +3156,16 @@ var HeaderCloseButtonWidget = /** @class */ (function (_super) {
3133
3156
  this.getBoxElem().addEventListener('click', function () {
3134
3157
  _this.fire('click');
3135
3158
  });
3159
+ this.getBoxElem().addEventListener('keydown', function (event) {
3160
+ if (event.key === 'Enter') {
3161
+ _this.fire('click');
3162
+ }
3163
+ });
3136
3164
  };
3137
3165
  HeaderCloseButtonWidget.prototype.render = function () {
3138
3166
  _super.prototype.render.call(this);
3167
+ this.getBoxElem().tabIndex = 0;
3168
+ this.getBoxElem().ariaLabel = 'Close Chat';
3139
3169
  this.bindEvents();
3140
3170
  };
3141
3171
  HeaderCloseButtonWidget.prototype.getBaseCls = function () {
@@ -3506,6 +3536,8 @@ var TeaserWidget = /** @class */ (function (_super) {
3506
3536
  TeaserWidget.prototype.render = function () {
3507
3537
  this.crossElem = this.createNode();
3508
3538
  this.crossElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.teaserCrossCls);
3539
+ this.crossElem.tabIndex = 0;
3540
+ this.crossElem.ariaLabel = 'Close Chat Teaser';
3509
3541
  this.bindEvents();
3510
3542
  this.getBoxElem().appendChild(this.crossElem);
3511
3543
  _super.prototype.render.call(this);
@@ -3579,7 +3611,18 @@ var TeaserWidget = /** @class */ (function (_super) {
3579
3611
  event.stopPropagation();
3580
3612
  _this.hide();
3581
3613
  });
3614
+ this.crossElem.addEventListener('keydown', function (event) {
3615
+ if (event.key === 'Enter') {
3616
+ event.stopPropagation();
3617
+ _this.hide();
3618
+ }
3619
+ });
3582
3620
  this.getBoxElem().addEventListener('click', function () { return _this.fire('click'); });
3621
+ this.getBoxElem().addEventListener('keydown', function (event) {
3622
+ if (event.key === 'Enter') {
3623
+ _this.fire('click');
3624
+ }
3625
+ });
3583
3626
  };
3584
3627
  return TeaserWidget;
3585
3628
  }(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));