@syncfusion/ej2-splitbuttons 27.2.2 → 28.1.33

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 (112) hide show
  1. package/README.md +4 -4
  2. package/dist/ej2-splitbuttons.min.js +3 -3
  3. package/dist/ej2-splitbuttons.umd.min.js +3 -3
  4. package/dist/ej2-splitbuttons.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-splitbuttons.es2015.js +140 -46
  6. package/dist/es6/ej2-splitbuttons.es2015.js.map +1 -1
  7. package/dist/es6/ej2-splitbuttons.es5.js +146 -46
  8. package/dist/es6/ej2-splitbuttons.es5.js.map +1 -1
  9. package/dist/global/ej2-splitbuttons.min.js +3 -3
  10. package/dist/global/ej2-splitbuttons.min.js.map +1 -1
  11. package/dist/global/index.d.ts +2 -2
  12. package/package.json +8 -8
  13. package/src/common/common.d.ts +5 -0
  14. package/src/common/common.js +2 -2
  15. package/src/drop-down-button/drop-down-button-model.d.ts +63 -1
  16. package/src/drop-down-button/drop-down-button.d.ts +60 -3
  17. package/src/drop-down-button/drop-down-button.js +146 -45
  18. package/styles/bds-lite.css +1937 -0
  19. package/styles/bds-lite.scss +13 -0
  20. package/styles/bds.css +2148 -0
  21. package/styles/bds.scss +17 -0
  22. package/styles/bootstrap-dark-lite.css +11 -0
  23. package/styles/bootstrap-dark.css +11 -1
  24. package/styles/bootstrap-lite.css +11 -0
  25. package/styles/bootstrap.css +11 -1
  26. package/styles/bootstrap4-lite.css +11 -0
  27. package/styles/bootstrap4.css +11 -1
  28. package/styles/bootstrap5-dark-lite.css +11 -0
  29. package/styles/bootstrap5-dark.css +11 -1
  30. package/styles/bootstrap5-lite.css +11 -0
  31. package/styles/bootstrap5.3-lite.css +11 -0
  32. package/styles/bootstrap5.3.css +11 -1
  33. package/styles/bootstrap5.css +11 -1
  34. package/styles/button-group/_group-button-mixin.scss +2 -2
  35. package/styles/button-group/_layout.scss +1 -1
  36. package/styles/button-group/_tailwind3-definition.scss +31 -0
  37. package/styles/button-group/_theme.scss +83 -12
  38. package/styles/button-group/bds.css +861 -0
  39. package/styles/button-group/bds.scss +5 -0
  40. package/styles/button-group/tailwind3.css +847 -0
  41. package/styles/button-group/tailwind3.scss +5 -0
  42. package/styles/drop-down-button/_bigger.scss +20 -0
  43. package/styles/drop-down-button/_layout.scss +36 -3
  44. package/styles/drop-down-button/_tailwind3-definition.scss +53 -0
  45. package/styles/drop-down-button/_theme.scss +7 -0
  46. package/styles/drop-down-button/bds.css +372 -0
  47. package/styles/drop-down-button/bds.scss +7 -0
  48. package/styles/drop-down-button/bootstrap-dark.css +11 -1
  49. package/styles/drop-down-button/bootstrap.css +11 -1
  50. package/styles/drop-down-button/bootstrap4.css +11 -1
  51. package/styles/drop-down-button/bootstrap5-dark.css +11 -1
  52. package/styles/drop-down-button/bootstrap5.3.css +11 -1
  53. package/styles/drop-down-button/bootstrap5.css +11 -1
  54. package/styles/drop-down-button/fabric-dark.css +11 -1
  55. package/styles/drop-down-button/fabric.css +11 -1
  56. package/styles/drop-down-button/fluent-dark.css +11 -1
  57. package/styles/drop-down-button/fluent.css +11 -1
  58. package/styles/drop-down-button/fluent2.css +11 -1
  59. package/styles/drop-down-button/highcontrast-light.css +11 -1
  60. package/styles/drop-down-button/highcontrast.css +11 -1
  61. package/styles/drop-down-button/icons/_tailwind3.scss +10 -0
  62. package/styles/drop-down-button/material-dark.css +11 -1
  63. package/styles/drop-down-button/material.css +11 -1
  64. package/styles/drop-down-button/material3-dark.css +11 -1
  65. package/styles/drop-down-button/material3.css +11 -1
  66. package/styles/drop-down-button/tailwind-dark.css +11 -1
  67. package/styles/drop-down-button/tailwind.css +11 -1
  68. package/styles/drop-down-button/tailwind3.css +295 -0
  69. package/styles/drop-down-button/tailwind3.scss +7 -0
  70. package/styles/fabric-dark-lite.css +11 -0
  71. package/styles/fabric-dark.css +11 -1
  72. package/styles/fabric-lite.css +11 -0
  73. package/styles/fabric.css +11 -1
  74. package/styles/fluent-dark-lite.css +11 -0
  75. package/styles/fluent-dark.css +11 -1
  76. package/styles/fluent-lite.css +11 -0
  77. package/styles/fluent.css +11 -1
  78. package/styles/fluent2-lite.css +11 -0
  79. package/styles/fluent2.css +11 -1
  80. package/styles/highcontrast-light-lite.css +11 -0
  81. package/styles/highcontrast-light.css +11 -1
  82. package/styles/highcontrast-lite.css +11 -0
  83. package/styles/highcontrast.css +11 -1
  84. package/styles/material-dark-lite.css +11 -0
  85. package/styles/material-dark.css +11 -1
  86. package/styles/material-lite.css +11 -0
  87. package/styles/material.css +11 -1
  88. package/styles/material3-dark-lite.css +11 -0
  89. package/styles/material3-dark.css +11 -1
  90. package/styles/material3-lite.css +11 -0
  91. package/styles/material3.css +11 -1
  92. package/styles/progress-button/_tailwind3-definition.scss +20 -0
  93. package/styles/progress-button/_theme.scss +70 -0
  94. package/styles/progress-button/bds.css +683 -0
  95. package/styles/progress-button/bds.scss +6 -0
  96. package/styles/progress-button/tailwind3.css +636 -0
  97. package/styles/progress-button/tailwind3.scss +6 -0
  98. package/styles/split-button/_layout.scss +2 -2
  99. package/styles/split-button/_tailwind3-definition.scss +23 -0
  100. package/styles/split-button/_theme.scss +6 -1
  101. package/styles/split-button/bds.css +461 -0
  102. package/styles/split-button/bds.scss +7 -0
  103. package/styles/split-button/tailwind3.css +342 -0
  104. package/styles/split-button/tailwind3.scss +7 -0
  105. package/styles/tailwind-dark-lite.css +11 -0
  106. package/styles/tailwind-dark.css +11 -1
  107. package/styles/tailwind-lite.css +11 -0
  108. package/styles/tailwind.css +11 -1
  109. package/styles/tailwind3-lite.css +1891 -0
  110. package/styles/tailwind3-lite.scss +13 -0
  111. package/styles/tailwind3.css +2110 -0
  112. package/styles/tailwind3.scss +17 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.2.2
4
- * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
3
+ * version : 28.1.33
4
+ * Copyright Syncfusion Inc. 2001 - 2024. 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
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-splitbuttons@*",
3
- "_id": "@syncfusion/ej2-splitbuttons@27.1.56",
3
+ "_id": "@syncfusion/ej2-splitbuttons@19.16.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-rJZwautGwePeXpivvTf3CtX5onDTq3ICFxGlMENTp5kZrm1ni+0prSqomwv0HPC631vxxrKC8JTFC6lZOzJMcQ==",
5
+ "_integrity": "sha512-nlU99uofqoYEbrSZrSJ2vVsQu3dvNbDJD2jwInequl4EtV+qL4jhntz9CN1z5bwaz2qgDOjI1acZjuNvM/3UHQ==",
6
6
  "_location": "/@syncfusion/ej2-splitbuttons",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -33,10 +33,10 @@
33
33
  "/@syncfusion/ej2-richtexteditor",
34
34
  "/@syncfusion/ej2-vue-splitbuttons"
35
35
  ],
36
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-27.1.56.tgz",
37
- "_shasum": "c94706216183d6159818350bdeef51567ac5d2a5",
36
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-19.16.4.tgz",
37
+ "_shasum": "d9deb379c4a1e89f608eb69d21fd3151f54e71ad",
38
38
  "_spec": "@syncfusion/ej2-splitbuttons@*",
39
- "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
39
+ "_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
40
40
  "author": {
41
41
  "name": "Syncfusion Inc."
42
42
  },
@@ -45,8 +45,8 @@
45
45
  },
46
46
  "bundleDependencies": false,
47
47
  "dependencies": {
48
- "@syncfusion/ej2-base": "~27.2.2",
49
- "@syncfusion/ej2-popups": "~27.2.2"
48
+ "@syncfusion/ej2-base": "~28.1.33",
49
+ "@syncfusion/ej2-popups": "~28.1.33"
50
50
  },
51
51
  "deprecated": false,
52
52
  "description": "A package of feature-rich Essential JS 2 components such as DropDownButton, SplitButton, ProgressButton and ButtonGroup.",
@@ -89,6 +89,6 @@
89
89
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
90
90
  },
91
91
  "typings": "index.d.ts",
92
- "version": "27.2.2",
92
+ "version": "28.1.33",
93
93
  "sideEffects": false
94
94
  }
@@ -18,6 +18,7 @@ export declare function getModel(props: Object, model: string[]): Object;
18
18
  export declare function upDownKeyHandler(ul: HTMLElement, keyCode: number): void;
19
19
  /** @hidden
20
20
  * @param {HTMLElement} popup - Specifies the popup element.
21
+ * @param {boolean} blankIcon - Specifies the blankIcon value.
21
22
  * @returns {void}
22
23
  */
23
24
  export declare function setBlankIconStyle(popup: HTMLElement, blankIcon?: boolean): void;
@@ -88,3 +89,7 @@ export interface OpenCloseMenuEventArgs extends BaseEventArgs {
88
89
  items: ItemModel[];
89
90
  parentItem?: ItemModel;
90
91
  }
92
+ /**
93
+ * Interface for animation effects.
94
+ */
95
+ export declare type DropDownAnimationEffect = 'None' | 'SlideDown' | 'ZoomIn' | 'FadeIn';
@@ -104,9 +104,9 @@ function isValidLI(ul, li, index, keyCode, count) {
104
104
  }
105
105
  return index;
106
106
  }
107
- // eslint-disable-next-line jsdoc/require-param, valid-jsdoc
108
107
  /** @hidden
109
108
  * @param {HTMLElement} popup - Specifies the popup element.
109
+ * @param {boolean} blankIcon - Specifies the blankIcon value.
110
110
  * @returns {void}
111
111
  */
112
112
  export function setBlankIconStyle(popup, blankIcon) {
@@ -142,7 +142,7 @@ export function setBlankIconStyle(popup, blankIcon) {
142
142
  var size = parseInt(getComputedStyle(icon).fontSize, 10) + parseInt((enableRtl ? getComputedStyle(icon)[cssProp.margin] : getComputedStyle(icon)[cssProp.margin]), 10)
143
143
  + parseInt(getComputedStyle(iconLi).paddingLeft, 10) + "px";
144
144
  blankIconList.forEach(function (li) {
145
- if (li.classList.contains('e-url')) {
145
+ if (li.classList.contains('e-url') && li.querySelector('.e-menu-url')) {
146
146
  li.querySelector('.e-menu-url').style[cssProp.padding] = size;
147
147
  }
148
148
  else {
@@ -1,6 +1,40 @@
1
- import { Collection, Event, NotifyPropertyChanges, detach, Property, EventHandler, EmitType, isRippleEnabled, isNullOrUndefined } from '@syncfusion/ej2-base';import { addClass, INotifyPropertyChanged, getUniqueID, rippleEffect, getComponent } from '@syncfusion/ej2-base';import { attributes, Component, closest, select, KeyboardEventArgs, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { classList, removeClass } from '@syncfusion/ej2-base';import { Button } from '@syncfusion/ej2-buttons';import { Popup } from '@syncfusion/ej2-popups';import { SplitButton } from '../split-button/split-button';import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs, upDownKeyHandler } from './../common/common';import { getModel, SplitButtonIconPosition, Item, setBlankIconStyle } from './../common/common';import { ItemModel } from './../common/common-model';
1
+ import { Collection, Event, NotifyPropertyChanges, detach, Property, EventHandler, EmitType, isRippleEnabled, isNullOrUndefined, append, formatUnit, Animation } from '@syncfusion/ej2-base';import { addClass, INotifyPropertyChanged, getUniqueID, rippleEffect, getComponent, ChildProperty, Complex, AnimationModel } from '@syncfusion/ej2-base';import { attributes, Component, closest, select, KeyboardEventArgs, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { classList, removeClass, compile } from '@syncfusion/ej2-base';import { Button } from '@syncfusion/ej2-buttons';import { Popup } from '@syncfusion/ej2-popups';import { SplitButton } from '../split-button/split-button';import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs, upDownKeyHandler, DropDownAnimationEffect } from './../common/common';import { getModel, SplitButtonIconPosition, Item, setBlankIconStyle } from './../common/common';import { ItemModel } from './../common/common-model';
2
2
  import {ComponentModel} from '@syncfusion/ej2-base';
3
3
 
4
+ /**
5
+ * Interface for a class DropDownMenuAnimationSettings
6
+ */
7
+ export interface DropDownMenuAnimationSettingsModel {
8
+
9
+ /**
10
+ * Specifies the animation effect applied when the DropDownMenu is shown.
11
+ * The possible effects are:
12
+ * * None: Specifies that the DropDownMenu appears without any animation effect.
13
+ * * SlideDown: Specifies that the DropDownMenu appears with a slide down effect.
14
+ * * ZoomIn: Specifies that the DropDownMenu appears with a zoom in effect.
15
+ * * FadeIn: Specifies that the DropDownMenu appears with a fade in effect.
16
+ *
17
+ * @default 'SlideDown'
18
+ * @isEnumeration true
19
+ */
20
+ effect?: DropDownAnimationEffect;
21
+
22
+ /**
23
+ * Specifies the time duration (in milliseconds) of the animation effect when the DropDownMenu is displayed.
24
+ *
25
+ * @default 400
26
+ */
27
+ duration?: number;
28
+
29
+ /**
30
+ * Specifies the easing function applied during the animation effect of the DropDownMenu.
31
+ *
32
+ * @default 'ease'
33
+ */
34
+ easing?: string;
35
+
36
+ }
37
+
4
38
  /**
5
39
  * Interface for a class DropDownButton
6
40
  */
@@ -81,6 +115,34 @@ export interface DropDownButtonModel extends ComponentModel{
81
115
  */
82
116
  closeActionEvents?: string;
83
117
 
118
+ /**
119
+ * Specifies the template content to be displayed.
120
+ *
121
+ * @default null
122
+ * @aspType string
123
+ */
124
+ itemTemplate?: string | Function;
125
+
126
+ /**
127
+ * This property defines the width of the dropdown popup for the DropDownButton component.
128
+ *
129
+ * @property {string | number} popupWidth - A string or number representing the width of the dropdown.
130
+ * It can be a valid CSS unit such as `px`, `%`, or `rem`, or a number interpreted as pixels.
131
+ * @default "auto"
132
+ * @remarks
133
+ * The `popupWidth` property allows developers to control the width of the dropdown popup, ensuring it fits their design requirements.
134
+ * The default value of `auto` allows the popup to adjust based on the content length, but a specific width can be provided for more precise control.
135
+ */
136
+ popupWidth?: string | number;
137
+
138
+ /**
139
+ * Specifies the animation settings for opening the sub menu in the DropDownMenu.
140
+ * The settings control the duration, easing, and effect of the animation applied when the sub menu opens.
141
+ *
142
+ * @default { effect: 'None' }
143
+ */
144
+ animationSettings?: DropDownMenuAnimationSettingsModel;
145
+
84
146
  /**
85
147
  * Triggers while rendering each Popup item of DropDownButton.
86
148
  *
@@ -1,12 +1,41 @@
1
1
  import { EmitType } from '@syncfusion/ej2-base';
2
- import { INotifyPropertyChanged } from '@syncfusion/ej2-base';
2
+ import { INotifyPropertyChanged, ChildProperty } from '@syncfusion/ej2-base';
3
3
  import { Component, KeyboardEventArgs } from '@syncfusion/ej2-base';
4
4
  import { Button } from '@syncfusion/ej2-buttons';
5
5
  import { Popup } from '@syncfusion/ej2-popups';
6
- import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs } from './../common/common';
6
+ import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs, DropDownAnimationEffect } from './../common/common';
7
7
  import { SplitButtonIconPosition } from './../common/common';
8
8
  import { ItemModel } from './../common/common-model';
9
- import { DropDownButtonModel } from './drop-down-button-model';
9
+ import { DropDownButtonModel, DropDownMenuAnimationSettingsModel } from './drop-down-button-model';
10
+ /**
11
+ * Animation configuration settings.
12
+ */
13
+ export declare class DropDownMenuAnimationSettings extends ChildProperty<DropDownMenuAnimationSettings> {
14
+ /**
15
+ * Specifies the animation effect applied when the DropDownMenu is shown.
16
+ * The possible effects are:
17
+ * * None: Specifies that the DropDownMenu appears without any animation effect.
18
+ * * SlideDown: Specifies that the DropDownMenu appears with a slide down effect.
19
+ * * ZoomIn: Specifies that the DropDownMenu appears with a zoom in effect.
20
+ * * FadeIn: Specifies that the DropDownMenu appears with a fade in effect.
21
+ *
22
+ * @default 'SlideDown'
23
+ * @isEnumeration true
24
+ */
25
+ effect: DropDownAnimationEffect;
26
+ /**
27
+ * Specifies the time duration (in milliseconds) of the animation effect when the DropDownMenu is displayed.
28
+ *
29
+ * @default 400
30
+ */
31
+ duration: number;
32
+ /**
33
+ * Specifies the easing function applied during the animation effect of the DropDownMenu.
34
+ *
35
+ * @default 'ease'
36
+ */
37
+ easing: string;
38
+ }
10
39
  /**
11
40
  * DropDownButton component is used to toggle contextual overlays for displaying list of action items.
12
41
  * It can contain both text and images.
@@ -95,6 +124,31 @@ export declare class DropDownButton extends Component<HTMLButtonElement> impleme
95
124
  * @default ""
96
125
  */
97
126
  closeActionEvents: string;
127
+ /**
128
+ * Specifies the template content to be displayed.
129
+ *
130
+ * @default null
131
+ * @aspType string
132
+ */
133
+ itemTemplate: string | Function;
134
+ /**
135
+ * This property defines the width of the dropdown popup for the DropDownButton component.
136
+ *
137
+ * @property {string | number} popupWidth - A string or number representing the width of the dropdown.
138
+ * It can be a valid CSS unit such as `px`, `%`, or `rem`, or a number interpreted as pixels.
139
+ * @default "auto"
140
+ * @remarks
141
+ * The `popupWidth` property allows developers to control the width of the dropdown popup, ensuring it fits their design requirements.
142
+ * The default value of `auto` allows the popup to adjust based on the content length, but a specific width can be provided for more precise control.
143
+ */
144
+ popupWidth: string | number;
145
+ /**
146
+ * Specifies the animation settings for opening the sub menu in the DropDownMenu.
147
+ * The settings control the duration, easing, and effect of the animation applied when the sub menu opens.
148
+ *
149
+ * @default { effect: 'None' }
150
+ */
151
+ animationSettings: DropDownMenuAnimationSettingsModel;
98
152
  /**
99
153
  * Triggers while rendering each Popup item of DropDownButton.
100
154
  *
@@ -185,6 +239,7 @@ export declare class DropDownButton extends Component<HTMLButtonElement> impleme
185
239
  private createPopup;
186
240
  private getTargetElement;
187
241
  private createItems;
242
+ private compiletemplate;
188
243
  private hasIcon;
189
244
  private createAnchor;
190
245
  private initialize;
@@ -229,6 +284,8 @@ export declare class DropDownButton extends Component<HTMLButtonElement> impleme
229
284
  protected clickHandler(e: MouseEvent | KeyboardEventArgs): void;
230
285
  private triggerSelect;
231
286
  private openPopUp;
287
+ private animatePopup;
288
+ private setWidth;
232
289
  private closePopup;
233
290
  protected unWireEvents(): void;
234
291
  /**
@@ -17,10 +17,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
17
17
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
18
  return c > 3 && r && Object.defineProperty(target, key, r), r;
19
19
  };
20
- import { Collection, Event, NotifyPropertyChanges, detach, Property, EventHandler, isRippleEnabled, isNullOrUndefined } from '@syncfusion/ej2-base';
21
- import { addClass, getUniqueID, rippleEffect, getComponent } from '@syncfusion/ej2-base';
20
+ import { Collection, Event, NotifyPropertyChanges, detach, Property, EventHandler, isRippleEnabled, isNullOrUndefined, append, formatUnit, Animation } from '@syncfusion/ej2-base';
21
+ import { addClass, getUniqueID, rippleEffect, getComponent, ChildProperty, Complex } from '@syncfusion/ej2-base';
22
22
  import { attributes, Component, closest, select, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
23
- import { classList, removeClass } from '@syncfusion/ej2-base';
23
+ import { classList, removeClass, compile } from '@syncfusion/ej2-base';
24
24
  import { Button } from '@syncfusion/ej2-buttons';
25
25
  import { Popup } from '@syncfusion/ej2-popups';
26
26
  import { upDownKeyHandler } from './../common/common';
@@ -33,8 +33,29 @@ var classNames = {
33
33
  POPUP: 'e-dropdown-popup',
34
34
  RTL: 'e-rtl',
35
35
  SEPARATOR: 'e-separator',
36
- VERTICAL: 'e-vertical'
36
+ VERTICAL: 'e-vertical',
37
+ POPUPWIDTH: 'e-dropdown-popup-width'
37
38
  };
39
+ /**
40
+ * Animation configuration settings.
41
+ */
42
+ var DropDownMenuAnimationSettings = /** @class */ (function (_super) {
43
+ __extends(DropDownMenuAnimationSettings, _super);
44
+ function DropDownMenuAnimationSettings() {
45
+ return _super !== null && _super.apply(this, arguments) || this;
46
+ }
47
+ __decorate([
48
+ Property('SlideDown')
49
+ ], DropDownMenuAnimationSettings.prototype, "effect", void 0);
50
+ __decorate([
51
+ Property(400)
52
+ ], DropDownMenuAnimationSettings.prototype, "duration", void 0);
53
+ __decorate([
54
+ Property('ease')
55
+ ], DropDownMenuAnimationSettings.prototype, "easing", void 0);
56
+ return DropDownMenuAnimationSettings;
57
+ }(ChildProperty));
58
+ export { DropDownMenuAnimationSettings };
38
59
  /**
39
60
  * DropDownButton component is used to toggle contextual overlays for displaying list of action items.
40
61
  * It can contain both text and images.
@@ -154,11 +175,12 @@ var DropDownButton = /** @class */ (function (_super) {
154
175
  DropDownButton.prototype.createPopup = function () {
155
176
  var _a;
156
177
  var div = this.createElement('div', {
157
- className: classNames.POPUP,
178
+ className: this.popupWidth !== 'auto' ? classNames.POPUP + " " + classNames.POPUPWIDTH : classNames.POPUP,
158
179
  id: this.element.id + '-popup'
159
180
  });
160
181
  document.body.appendChild(div);
161
182
  this.dropDown = new Popup(div, {
183
+ width: this.popupWidth,
162
184
  relateTo: this.element,
163
185
  collision: { X: 'fit', Y: 'flip' },
164
186
  position: { X: 'left', Y: 'bottom' },
@@ -198,6 +220,7 @@ var DropDownButton = /** @class */ (function (_super) {
198
220
  return typeof (this.target) === 'string' ? select(this.target) : this.target;
199
221
  };
200
222
  DropDownButton.prototype.createItems = function (appendItems) {
223
+ var _this = this;
201
224
  var items = this.items;
202
225
  var showIcon = this.hasIcon(this.items, 'iconCss');
203
226
  var span;
@@ -213,55 +236,82 @@ var DropDownButton = /** @class */ (function (_super) {
213
236
  attrs: { 'role': 'menu', 'tabindex': '0' }
214
237
  });
215
238
  }
216
- for (var i = 0; i < items.length; i++) {
217
- item = items[i];
218
- var tempItem = item.text;
219
- li = this.createElement('li', {
220
- innerHTML: item.url ? '' : tempItem,
221
- className: item.separator ? classNames.ITEM + ' ' + classNames.SEPARATOR : classNames.ITEM,
222
- attrs: item.separator ? { 'role': 'separator', 'tabindex': '-1', 'aria-label': 'separator', 'aria-hidden': 'true' } : { 'role': 'menuitem', 'tabindex': '-1', 'aria-label': tempItem },
223
- id: item.id ? item.id : getUniqueID('e-' + this.getModuleName() + '-item')
239
+ if (this.itemTemplate) {
240
+ var compiledTemplate_1 = this.compiletemplate(this.itemTemplate);
241
+ items.forEach(function (item) {
242
+ var li = _this.createElement('li', {
243
+ className: item.separator ? classNames.ITEM + ' ' + classNames.SEPARATOR : classNames.ITEM,
244
+ attrs: item.separator
245
+ ? { 'role': 'separator', 'tabindex': '-1', 'aria-label': 'separator', 'aria-hidden': 'true' }
246
+ : { 'role': 'menuitem', 'tabindex': '-1', 'aria-label': item.text },
247
+ id: item.id ? item.id : getUniqueID('e-' + _this.getModuleName() + '-item')
248
+ });
249
+ var compiledElement = compiledTemplate_1(item, _this, 'template', null, false, null, li);
250
+ if (compiledElement) {
251
+ append(compiledElement, li);
252
+ }
253
+ if (item.disabled) {
254
+ li.classList.add('e-disabled');
255
+ }
256
+ var eventArgs = { item: item, element: li };
257
+ _this.trigger('beforeItemRender', eventArgs);
258
+ if (eventArgs.item.disabled !== item.disabled) {
259
+ li.classList[eventArgs.item.disabled ? 'add' : 'remove']('e-disabled');
260
+ }
261
+ ul.appendChild(li);
224
262
  });
225
- if (this.enableHtmlSanitizer) {
226
- li.textContent = item.url ? '' : tempItem;
227
- }
228
- else {
229
- li.innerHTML = item.url ? '' : tempItem;
230
- }
231
- if (item.url) {
232
- li.appendChild(this.createAnchor(item));
233
- li.classList.add('e-url');
234
- }
235
- if (item.iconCss) {
236
- span = this.createElement('span', { className: classNames.ICON + ' ' + item.iconCss });
237
- if (item.url) {
238
- li.childNodes[0].appendChild(span);
263
+ }
264
+ else {
265
+ for (var i = 0; i < items.length; i++) {
266
+ item = items[i];
267
+ var tempItem = item.text;
268
+ li = this.createElement('li', {
269
+ innerHTML: item.url ? '' : tempItem,
270
+ className: item.separator ? classNames.ITEM + ' ' + classNames.SEPARATOR : classNames.ITEM,
271
+ attrs: item.separator ? { 'role': 'separator', 'tabindex': '-1', 'aria-label': 'separator', 'aria-hidden': 'true' } : { 'role': 'menuitem', 'tabindex': '-1', 'aria-label': tempItem },
272
+ id: item.id ? item.id : getUniqueID('e-' + this.getModuleName() + '-item')
273
+ });
274
+ if (this.enableHtmlSanitizer) {
275
+ li.textContent = item.url ? '' : tempItem;
239
276
  }
240
277
  else {
241
- li.insertBefore(span, li.childNodes[0]);
278
+ li.innerHTML = item.url ? '' : tempItem;
242
279
  }
243
- }
244
- else {
245
- if (showIcon && !item.separator) {
246
- li.classList.add('e-blank-icon');
280
+ if (item.url) {
281
+ li.appendChild(this.createAnchor(item));
282
+ li.classList.add('e-url');
247
283
  }
248
- }
249
- var beforeDisabled = item.disabled;
250
- if (item.disabled) {
251
- li.classList.add('e-disabled');
252
- }
253
- eventArgs = { item: item, element: li };
254
- this.trigger('beforeItemRender', eventArgs);
255
- var afterDisabled = eventArgs.item.disabled;
256
- if (beforeDisabled !== afterDisabled) {
257
- if (eventArgs.item.disabled) {
258
- li.classList.add('e-disabled');
284
+ if (item.iconCss) {
285
+ span = this.createElement('span', { className: classNames.ICON + ' ' + item.iconCss });
286
+ if (item.url) {
287
+ li.childNodes[0].appendChild(span);
288
+ }
289
+ else {
290
+ li.insertBefore(span, li.childNodes[0]);
291
+ }
259
292
  }
260
293
  else {
261
- li.classList.remove('e-disabled');
294
+ if (showIcon && !item.separator) {
295
+ li.classList.add('e-blank-icon');
296
+ }
262
297
  }
298
+ var beforeDisabled = item.disabled;
299
+ if (item.disabled) {
300
+ li.classList.add('e-disabled');
301
+ }
302
+ eventArgs = { item: item, element: li };
303
+ this.trigger('beforeItemRender', eventArgs);
304
+ var afterDisabled = eventArgs.item.disabled;
305
+ if (beforeDisabled !== afterDisabled) {
306
+ if (eventArgs.item.disabled) {
307
+ li.classList.add('e-disabled');
308
+ }
309
+ else {
310
+ li.classList.remove('e-disabled');
311
+ }
312
+ }
313
+ ul.appendChild(li);
263
314
  }
264
- ul.appendChild(li);
265
315
  }
266
316
  if (appendItems) {
267
317
  this.getPopUpElement().appendChild(ul);
@@ -270,6 +320,24 @@ var DropDownButton = /** @class */ (function (_super) {
270
320
  setBlankIconStyle(this.getPopUpElement());
271
321
  }
272
322
  };
323
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
324
+ DropDownButton.prototype.compiletemplate = function (template) {
325
+ if (!this.itemTemplate) {
326
+ return undefined;
327
+ }
328
+ try {
329
+ if (typeof this.itemTemplate !== 'function') {
330
+ var templateElement = document.querySelector(this.itemTemplate);
331
+ if (templateElement) {
332
+ return compile(templateElement.innerHTML.trim());
333
+ }
334
+ }
335
+ return compile(template);
336
+ }
337
+ catch (_a) {
338
+ return compile(template);
339
+ }
340
+ };
273
341
  DropDownButton.prototype.hasIcon = function (items, field) {
274
342
  for (var i = 0, len = items.length; i < len; i++) {
275
343
  if (items[i]["" + field]) {
@@ -609,6 +677,9 @@ var DropDownButton = /** @class */ (function (_super) {
609
677
  if (e === void 0) { e = null; }
610
678
  var isReact = false;
611
679
  var popupElem = this.getPopUpElement();
680
+ if (this.activeElem[0] && this.activeElem[0].classList.contains('e-dropdown-btn') && popupElem.style.width && popupElem.style.width !== 'auto') {
681
+ this.setWidth(popupElem);
682
+ }
612
683
  if (!this.target) {
613
684
  this.createItems(true);
614
685
  }
@@ -646,6 +717,13 @@ var DropDownButton = /** @class */ (function (_super) {
646
717
  this.trigger('beforeOpen', beforeOpenArgs, function (observedArgs) {
647
718
  if (!observedArgs.cancel) {
648
719
  var ul_1 = _this.getULElement();
720
+ var animationOptions = _this.animationSettings.effect !== 'None' ? {
721
+ name: _this.animationSettings.effect, duration: _this.animationSettings.duration,
722
+ timingFunction: _this.animationSettings.easing
723
+ } : null;
724
+ if (animationOptions) {
725
+ _this.animatePopup(animationOptions, ul_1);
726
+ }
649
727
  _this.dropDown.show(null, _this.element);
650
728
  addClass([_this.element], 'e-active');
651
729
  _this.element.setAttribute('aria-expanded', 'true');
@@ -676,6 +754,20 @@ var DropDownButton = /** @class */ (function (_super) {
676
754
  }
677
755
  });
678
756
  };
757
+ DropDownButton.prototype.animatePopup = function (animationOptions, element) {
758
+ new Animation(animationOptions).animate(element, {
759
+ begin: function (args) {
760
+ args.element.parentElement.style.height = args.element.parentElement.offsetHeight + 'px';
761
+ }
762
+ });
763
+ };
764
+ DropDownButton.prototype.setWidth = function (popupElem) {
765
+ var width = formatUnit(popupElem.style.width);
766
+ if (width.indexOf('%') > -1) {
767
+ var btnWidth = this.element.offsetWidth * parseFloat(width) / 100;
768
+ popupElem.style.width = btnWidth + "px";
769
+ }
770
+ };
679
771
  DropDownButton.prototype.closePopup = function (e, focusEle) {
680
772
  var _this = this;
681
773
  if (e === void 0) { e = null; }
@@ -851,6 +943,15 @@ var DropDownButton = /** @class */ (function (_super) {
851
943
  __decorate([
852
944
  Property('')
853
945
  ], DropDownButton.prototype, "closeActionEvents", void 0);
946
+ __decorate([
947
+ Property(null)
948
+ ], DropDownButton.prototype, "itemTemplate", void 0);
949
+ __decorate([
950
+ Property('auto')
951
+ ], DropDownButton.prototype, "popupWidth", void 0);
952
+ __decorate([
953
+ Complex({ effect: 'None' }, DropDownMenuAnimationSettings)
954
+ ], DropDownButton.prototype, "animationSettings", void 0);
854
955
  __decorate([
855
956
  Event()
856
957
  ], DropDownButton.prototype, "beforeItemRender", void 0);