@syncfusion/ej2-splitbuttons 20.2.45 → 20.3.52

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 (118) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/ej2-splitbuttons.min.js +10 -0
  3. package/dist/ej2-splitbuttons.umd.min.js +1 -1
  4. package/dist/global/ej2-splitbuttons.min.js +1 -1
  5. package/dist/global/index.d.ts +1 -1
  6. package/dist/ts/button-group/button-group.ts +84 -0
  7. package/dist/ts/common/common.ts +203 -0
  8. package/dist/ts/drop-down-button/drop-down-button.ts +831 -0
  9. package/dist/ts/progress-button/progress-button.ts +689 -0
  10. package/dist/ts/split-button/split-button.ts +501 -0
  11. package/package.json +10 -9
  12. package/src/drop-down-button/drop-down-button-model.d.ts +4 -4
  13. package/styles/bootstrap-dark.css +26 -5
  14. package/styles/bootstrap.css +21 -0
  15. package/styles/bootstrap4.css +22 -1
  16. package/styles/bootstrap5-dark.css +23 -0
  17. package/styles/bootstrap5.css +23 -0
  18. package/styles/button-group/_bootstrap-dark-definition.scss +2 -1
  19. package/styles/button-group/_fabric-dark-definition.scss +2 -1
  20. package/styles/button-group/_group-button-mixin.scss +3 -3
  21. package/styles/button-group/_highcontrast-light-definition.scss +3 -3
  22. package/styles/button-group/_layout.scss +1 -1
  23. package/styles/button-group/_material-dark-definition.scss +2 -1
  24. package/styles/button-group/_theme.scss +1 -1
  25. package/styles/button-group/bootstrap-dark.css +2 -0
  26. package/styles/button-group/bootstrap.css +2 -0
  27. package/styles/button-group/bootstrap4.css +2 -0
  28. package/styles/button-group/bootstrap5-dark.css +2 -0
  29. package/styles/button-group/bootstrap5.css +2 -0
  30. package/styles/button-group/fabric-dark.css +2 -0
  31. package/styles/button-group/fabric.css +2 -0
  32. package/styles/button-group/fluent-dark.css +2 -0
  33. package/styles/button-group/fluent.css +2 -0
  34. package/styles/button-group/highcontrast-light.css +2 -0
  35. package/styles/button-group/highcontrast.css +2 -0
  36. package/styles/button-group/material-dark.css +2 -0
  37. package/styles/button-group/material.css +2 -0
  38. package/styles/button-group/tailwind-dark.css +2 -0
  39. package/styles/button-group/tailwind.css +2 -0
  40. package/styles/drop-down-button/_all.scss +1 -1
  41. package/styles/drop-down-button/_bootstrap-dark-definition.scss +1 -0
  42. package/styles/drop-down-button/_bootstrap4-definition.scss +2 -2
  43. package/styles/drop-down-button/_bootstrap5-definition.scss +0 -1
  44. package/styles/drop-down-button/_fabric-dark-definition.scss +2 -1
  45. package/styles/drop-down-button/_fluent-definition.scss +1 -1
  46. package/styles/drop-down-button/_fusionnew-definition.scss +0 -1
  47. package/styles/drop-down-button/_highcontrast-definition.scss +0 -1
  48. package/styles/drop-down-button/_highcontrast-light-definition.scss +2 -1
  49. package/styles/drop-down-button/_layout.scss +3 -2
  50. package/styles/drop-down-button/_material-dark-definition.scss +2 -1
  51. package/styles/drop-down-button/_material3-definition.scss +0 -1
  52. package/styles/drop-down-button/_tailwind-definition.scss +0 -1
  53. package/styles/drop-down-button/_theme.scss +21 -0
  54. package/styles/drop-down-button/bootstrap-dark.css +18 -0
  55. package/styles/drop-down-button/bootstrap.css +18 -0
  56. package/styles/drop-down-button/bootstrap4.css +18 -0
  57. package/styles/drop-down-button/bootstrap5-dark.css +19 -0
  58. package/styles/drop-down-button/bootstrap5.css +19 -0
  59. package/styles/drop-down-button/fabric-dark.css +18 -0
  60. package/styles/drop-down-button/fabric.css +18 -0
  61. package/styles/drop-down-button/fluent-dark.css +19 -0
  62. package/styles/drop-down-button/fluent.css +19 -0
  63. package/styles/drop-down-button/highcontrast-light.css +18 -0
  64. package/styles/drop-down-button/highcontrast.css +18 -0
  65. package/styles/drop-down-button/material-dark.css +18 -0
  66. package/styles/drop-down-button/material.css +18 -0
  67. package/styles/drop-down-button/tailwind-dark.css +19 -0
  68. package/styles/drop-down-button/tailwind.css +19 -0
  69. package/styles/fabric-dark.css +21 -0
  70. package/styles/fabric.css +21 -0
  71. package/styles/fluent-dark.css +23 -0
  72. package/styles/fluent.css +23 -0
  73. package/styles/highcontrast-light.css +21 -0
  74. package/styles/highcontrast.css +23 -2
  75. package/styles/material-dark.css +21 -0
  76. package/styles/material.css +21 -0
  77. package/styles/progress-button/_bootstrap-dark-definition.scss +6 -5
  78. package/styles/progress-button/_bootstrap4-definition.scss +1 -1
  79. package/styles/progress-button/_fabric-dark-definition.scss +1 -0
  80. package/styles/progress-button/_highcontrast-definition.scss +1 -1
  81. package/styles/progress-button/_layout.scss +43 -42
  82. package/styles/progress-button/_material-dark-definition.scss +1 -0
  83. package/styles/progress-button/_theme.scss +23 -22
  84. package/styles/progress-button/bootstrap-dark.css +6 -5
  85. package/styles/progress-button/bootstrap.css +1 -0
  86. package/styles/progress-button/bootstrap4.css +2 -1
  87. package/styles/progress-button/bootstrap5-dark.css +1 -0
  88. package/styles/progress-button/bootstrap5.css +1 -0
  89. package/styles/progress-button/fabric-dark.css +1 -0
  90. package/styles/progress-button/fabric.css +1 -0
  91. package/styles/progress-button/fluent-dark.css +1 -0
  92. package/styles/progress-button/fluent.css +1 -0
  93. package/styles/progress-button/highcontrast-light.css +1 -0
  94. package/styles/progress-button/highcontrast.css +3 -2
  95. package/styles/progress-button/material-dark.css +1 -0
  96. package/styles/progress-button/material.css +1 -0
  97. package/styles/progress-button/tailwind-dark.css +1 -0
  98. package/styles/progress-button/tailwind.css +1 -0
  99. package/styles/split-button/_bootstrap-dark-definition.scss +2 -1
  100. package/styles/split-button/_bootstrap4-definition.scss +2 -1
  101. package/styles/split-button/_bootstrap5-definition.scss +0 -1
  102. package/styles/split-button/_fabric-dark-definition.scss +1 -0
  103. package/styles/split-button/_fluent-definition.scss +0 -1
  104. package/styles/split-button/_fusionnew-definition.scss +0 -1
  105. package/styles/split-button/_highcontrast-light-definition.scss +2 -2
  106. package/styles/split-button/_layout.scss +2 -1
  107. package/styles/split-button/_material-dark-definition.scss +2 -1
  108. package/styles/split-button/_material3-definition.scss +0 -1
  109. package/styles/split-button/_tailwind-definition.scss +0 -1
  110. package/styles/split-button/_theme.scss +1 -1
  111. package/styles/split-button/bootstrap5-dark.css +1 -0
  112. package/styles/split-button/bootstrap5.css +1 -0
  113. package/styles/split-button/fluent-dark.css +1 -0
  114. package/styles/split-button/fluent.css +1 -0
  115. package/styles/split-button/tailwind-dark.css +1 -0
  116. package/styles/split-button/tailwind.css +1 -0
  117. package/styles/tailwind-dark.css +23 -0
  118. package/styles/tailwind.css +23 -0
@@ -0,0 +1,501 @@
1
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
2
+ /// <reference path='../drop-down-button/drop-down-button-model.d.ts'/>
3
+ import { Event, EmitType, remove, addClass, removeClass, detach, getValue, setValue } from '@syncfusion/ej2-base';
4
+ import { EventHandler, Collection, BaseEventArgs, NotifyPropertyChanges, INotifyPropertyChanged, Property } from '@syncfusion/ej2-base';
5
+ import { attributes, getUniqueID, getInstance, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';
6
+ import { Button, ButtonModel } from '@syncfusion/ej2-buttons';
7
+ import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs } from './../common/common';
8
+ import { getModel, SplitButtonIconPosition, Item } from './../common/common';
9
+ import { DropDownButton } from '../drop-down-button/drop-down-button';
10
+ import { ItemModel } from './../common/common-model';
11
+ import { SplitButtonModel } from './split-button-model';
12
+
13
+ const RTL: string = 'e-rtl';
14
+
15
+ const TAGNAME: string = 'EJS-SPLITBUTTON';
16
+
17
+ /**
18
+ * SplitButton component has primary and secondary button. Primary button is used to select
19
+ * default action and secondary button is used to toggle contextual overlays for displaying list of
20
+ * action items. It can contain both text and images.
21
+ * ```html
22
+ * <button id="element"></button>
23
+ * ```
24
+ * ```typescript
25
+ * <script>
26
+ * var splitBtnObj = new SplitButton({content: 'SplitButton'});
27
+ * splitBtnObj.appendTo("#element");
28
+ * </script>
29
+ * ```
30
+ */
31
+ @NotifyPropertyChanges
32
+ export class SplitButton extends DropDownButton implements INotifyPropertyChanged {
33
+ private wrapper: HTMLElement;
34
+ private primaryBtnObj: Button;
35
+ private secondaryBtnObj: DropDownButton;
36
+
37
+ /**
38
+ * Defines the content of the SplitButton primary action button can either be a text or HTML elements.
39
+ *
40
+ * @default ""
41
+ */
42
+ @Property('')
43
+ public content: string;
44
+
45
+ /**
46
+ * Defines class/multiple classes separated by a space in the SplitButton element. The SplitButton
47
+ * size and styles can be customized by using this.
48
+ *
49
+ * @default ""
50
+ */
51
+ @Property('')
52
+ public cssClass: string;
53
+
54
+ /**
55
+ * Specifies a value that indicates whether the SplitButton is disabled or not.
56
+ *
57
+ * @default false.
58
+ */
59
+ @Property(false)
60
+ public disabled: boolean;
61
+
62
+ /**
63
+ * Defines class/multiple classes separated by a space for the SplitButton that is used to include an
64
+ * icon. SplitButton can also include font icon and sprite image.
65
+ *
66
+ * @default ""
67
+ */
68
+ @Property('')
69
+ public iconCss: string;
70
+
71
+ /**
72
+ * Positions the icon before/top of the text content in the SplitButton. The possible values are
73
+ * * Left: The icon will be positioned to the left of the text content.
74
+ * * Top: The icon will be positioned to the top of the text content.
75
+ *
76
+ * @default "Left"
77
+ */
78
+ @Property('Left')
79
+ public iconPosition: SplitButtonIconPosition;
80
+
81
+ /**
82
+ * Specifies the popup element creation on open.
83
+ *
84
+ * @default false
85
+ */
86
+ @Property(false)
87
+ public createPopupOnClick: boolean;
88
+
89
+ /**
90
+ * Specifies action items with its properties which will be rendered as SplitButton secondary button popup.
91
+ *
92
+ * @default []
93
+ */
94
+ @Collection<ItemModel>([], Item)
95
+ public items: ItemModel[];
96
+
97
+ /**
98
+ * Allows to specify the SplitButton popup item element.
99
+ *
100
+ * @default ""
101
+ */
102
+ @Property('')
103
+ public target: string | Element;
104
+
105
+ /**
106
+ * Triggers while rendering each Popup item of SplitButton.
107
+ *
108
+ * @event beforeItemRender
109
+ */
110
+ @Event()
111
+ public beforeItemRender: EmitType<MenuEventArgs>;
112
+
113
+ /**
114
+ * Triggers before opening the SplitButton popup.
115
+ *
116
+ * @event beforeOpen
117
+ */
118
+ @Event()
119
+ public beforeOpen: EmitType<BeforeOpenCloseMenuEventArgs>;
120
+
121
+ /**
122
+ * Triggers before closing the SplitButton popup.
123
+ *
124
+ * @event beforeClose
125
+ */
126
+ @Event()
127
+ public beforeClose: EmitType<BeforeOpenCloseMenuEventArgs>;
128
+
129
+ /**
130
+ * Triggers when the primary button of SplitButton has been clicked.
131
+ *
132
+ * @event click
133
+ */
134
+ @Event()
135
+ public click: EmitType<ClickEventArgs>;
136
+
137
+ /**
138
+ * Triggers while closing the SplitButton popup.
139
+ *
140
+ * @event close
141
+ */
142
+ @Event()
143
+ public close: EmitType<OpenCloseMenuEventArgs>;
144
+
145
+ /**
146
+ * Triggers while opening the SplitButton popup.
147
+ *
148
+ * @event open
149
+ */
150
+ @Event()
151
+ public open: EmitType<OpenCloseMenuEventArgs>;
152
+
153
+ /**
154
+ * Triggers while selecting action item of SplitButton popup.
155
+ *
156
+ * @event select
157
+ */
158
+ @Event()
159
+ public select: EmitType<MenuEventArgs>;
160
+
161
+ /**
162
+ * Triggers once the component rendering is completed.
163
+ *
164
+ * @event created
165
+ */
166
+ @Event()
167
+ public created: EmitType<Event>;
168
+
169
+ /**
170
+ * Constructor for creating the widget
171
+ *
172
+ * @param {SplitButtonModel} options - Specifies the splitbutton model
173
+ * @param {string|HTMLButtonElement} element - Specifies the element
174
+ * @hidden
175
+ */
176
+ public constructor(options?: SplitButtonModel, element?: string | HTMLButtonElement) {
177
+ super(options, <string | HTMLButtonElement>element);
178
+ }
179
+
180
+ /**
181
+ * Initialize Angular support.
182
+ *
183
+ * @private
184
+ * @returns {void}
185
+ */
186
+ protected preRender(): void {
187
+ let ele: Element = this.element;
188
+ if (ele.tagName === TAGNAME) {
189
+ const ejInstance: Object = getValue('ej2_instances', ele);
190
+ const btn: Element = this.createElement('button', { attrs: { 'type': 'button' } });
191
+ const wrapper: HTMLElement = this.createElement(TAGNAME, { className: 'e-' + this.getModuleName() + '-wrapper' });
192
+ for (let idx: number = 0, len: number = ele.attributes.length; idx < len; idx++) {
193
+ btn.setAttribute(ele.attributes[idx].nodeName, ele.attributes[idx].nodeValue);
194
+ }
195
+ ele.parentNode.insertBefore(wrapper, ele);
196
+ detach(ele);
197
+ ele = btn;
198
+ wrapper.appendChild(ele);
199
+ setValue('ej2_instances', ejInstance, ele);
200
+ this.wrapper = wrapper;
201
+ this.element = ele as HTMLButtonElement;
202
+ }
203
+ if (!this.element.id) {
204
+ this.element.id = getUniqueID('e-' + this.getModuleName());
205
+ }
206
+ }
207
+ /**
208
+ * Initialize the Component rendering.
209
+ *
210
+ * @returns {void}
211
+ * @private
212
+ */
213
+ public render(): void {
214
+ this.initWrapper();
215
+ this.createPrimaryButton();
216
+ this.renderControl();
217
+ }
218
+
219
+ private renderControl(): void {
220
+ this.createSecondaryButton();
221
+ this.setActiveElem([this.element, this.secondaryBtnObj.element]);
222
+ this.setAria();
223
+ this.wireEvents();
224
+ this.renderComplete();
225
+ }
226
+ /**
227
+ * Adds a new item to the menu. By default, new item appends to the list as the last item,
228
+ * but you can insert based on the text parameter.
229
+ *
230
+ * @param { ItemModel[] } items - Specifies an array of JSON data.
231
+ * @param { string } text - Specifies the text to insert the newly added item in the menu.
232
+ * @returns {void}.
233
+ */
234
+ public addItems(items: ItemModel[], text?: string): void {
235
+ super.addItems(items, text);
236
+ this.secondaryBtnObj.items = this.items;
237
+ }
238
+ /**
239
+ * Removes the items from the menu.
240
+ *
241
+ * @param { string[] } items - Specifies an array of string to remove the items.
242
+ * @param { string } isUniqueId - Set `true` if specified items is a collection of unique id.
243
+ * @returns {void}.
244
+ */
245
+ public removeItems(items: string[], isUniqueId?: boolean): void {
246
+ super.removeItems(items, isUniqueId);
247
+ this.secondaryBtnObj.items = this.items;
248
+ }
249
+
250
+ private initWrapper(): void {
251
+ if (!this.wrapper) {
252
+ this.wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-wrapper' });
253
+ this.element.parentNode.insertBefore(this.wrapper, this.element);
254
+ }
255
+ this.element.classList.remove('e-' + this.getModuleName());
256
+ if (this.enableRtl) {
257
+ this.wrapper.classList.add(RTL);
258
+ }
259
+ if (this.cssClass) {
260
+ addClass([this.wrapper], this.cssClass.split(' '));
261
+ }
262
+ }
263
+
264
+ private createPrimaryButton(): void {
265
+ const btnModel: ButtonModel = {
266
+ cssClass: this.cssClass,
267
+ enableRtl: this.enableRtl,
268
+ iconCss: this.iconCss,
269
+ iconPosition: this.iconPosition,
270
+ content: this.content,
271
+ disabled: this.disabled
272
+ };
273
+ this.primaryBtnObj = new Button(btnModel);
274
+ this.primaryBtnObj.createElement = this.createElement;
275
+ this.primaryBtnObj.appendTo(this.element);
276
+ this.element.classList.add('e-' + this.getModuleName());
277
+ this.element.type = 'button';
278
+ this.wrapper.appendChild(this.element);
279
+ }
280
+
281
+ private createSecondaryButton(): void {
282
+ const btnElem : HTMLButtonElement = this.createElement('button', {
283
+ className: 'e-icon-btn',
284
+ attrs: { 'tabindex': '-1' },
285
+ id: this.element.id + '_dropdownbtn'
286
+ }) as HTMLButtonElement;
287
+ this.wrapper.appendChild(btnElem);
288
+ const dropDownBtnModel: SplitButtonModel = {
289
+ cssClass: this.cssClass,
290
+ disabled: this.disabled,
291
+ enableRtl: this.enableRtl,
292
+ items: this.items,
293
+ target: this.target,
294
+ createPopupOnClick: this.createPopupOnClick
295
+ };
296
+ dropDownBtnModel.beforeItemRender = (args: MenuEventArgs): void => {
297
+ if (this.createPopupOnClick) {
298
+ this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
299
+ this.dropDown = this.secondaryBtnObj.dropDown;
300
+ }
301
+ this.trigger('beforeItemRender', args);
302
+ };
303
+ dropDownBtnModel.open = (args: OpenCloseMenuEventArgs): void => {
304
+ this.trigger('open', args);
305
+ };
306
+ dropDownBtnModel.close = (args: OpenCloseMenuEventArgs): void => {
307
+ this.trigger('close', args);
308
+ };
309
+ dropDownBtnModel.select = (args: MenuEventArgs): void => {
310
+ this.trigger('select', args);
311
+ };
312
+ dropDownBtnModel.beforeOpen = (args: BeforeOpenCloseMenuEventArgs): Deferred | void => {
313
+ const callBackPromise: Deferred = new Deferred();
314
+ this.trigger('beforeOpen', args, (observedArgs: BeforeOpenCloseMenuEventArgs) => {
315
+ callBackPromise.resolve(observedArgs);
316
+ });
317
+ return callBackPromise;
318
+ };
319
+ dropDownBtnModel.beforeClose = (args: BeforeOpenCloseMenuEventArgs): Deferred | void => {
320
+ const callBackPromise: Deferred = new Deferred();
321
+ this.trigger('beforeClose', args, (observedArgs: BeforeOpenCloseMenuEventArgs) => {
322
+ callBackPromise.resolve(observedArgs);
323
+ });
324
+ return callBackPromise;
325
+ };
326
+ this.secondaryBtnObj = new DropDownButton(dropDownBtnModel);
327
+ this.secondaryBtnObj.createElement = this.createElement;
328
+ this.secondaryBtnObj.appendTo(btnElem);
329
+ if (!this.createPopupOnClick) {
330
+ this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
331
+ this.dropDown = this.secondaryBtnObj.dropDown;
332
+ }
333
+ this.secondaryBtnObj.activeElem = [this.element, this.secondaryBtnObj.element];
334
+ this.secondaryBtnObj.element.querySelector('.e-btn-icon').classList.remove('e-icon-right');
335
+ }
336
+
337
+ private setAria(): void {
338
+ attributes(this.element, {
339
+ 'aria-expanded': 'false', 'aria-haspopup': 'true',
340
+ 'aria-label': this.element.textContent + ' splitbutton', 'aria-owns': this.element.id + '_dropdownbtn-popup'
341
+ });
342
+ }
343
+
344
+ /**
345
+ * Get component name.
346
+ *
347
+ * @returns {string} - Module Name
348
+ * @private
349
+ */
350
+ public getModuleName(): string {
351
+ return 'split-btn';
352
+ }
353
+
354
+ /**
355
+ * To open/close SplitButton popup based on current state of the SplitButton.
356
+ *
357
+ * @returns {void}
358
+ */
359
+ public toggle(): void {
360
+ this.secondaryBtnObj.toggle();
361
+ }
362
+
363
+ public destroy(): void {
364
+ let classList: string[] = [RTL];
365
+ if (this.cssClass) {
366
+ classList = classList.concat(this.cssClass.split(' '));
367
+ }
368
+ if (this.element) {
369
+ const element: Element = document.getElementById(this.element.id);
370
+ if (element && element.parentElement === this.wrapper) {
371
+ if (this.wrapper.tagName === TAGNAME) {
372
+ this.wrapper.innerHTML = '';
373
+ removeClass([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']);
374
+ removeClass([this.wrapper], this.cssClass.split(' '));
375
+ } else {
376
+ removeClass([this.element], classList);
377
+ ['aria-label', 'aria-haspopup', 'aria-expanded', 'aria-owns', 'type'].forEach((key: string) => {
378
+ this.element.removeAttribute(key);
379
+ });
380
+ this.wrapper.parentNode.insertBefore(this.element, this.wrapper);
381
+ remove(this.wrapper);
382
+ }
383
+ this.unWireEvents();
384
+ }
385
+ }
386
+ this.primaryBtnObj.destroy();
387
+ this.secondaryBtnObj.destroy();
388
+ super.destroy();
389
+ if (!this.element.getAttribute('class')) {
390
+ this.element.removeAttribute('class');
391
+ }
392
+ }
393
+
394
+ protected wireEvents(): void {
395
+ EventHandler.add(this.element, 'click', this.primaryBtnClickHandler, this);
396
+ new KeyboardEvents(this.element, {
397
+ keyAction: this.btnKeyBoardHandler.bind(this),
398
+ keyConfigs: {
399
+ altdownarrow: 'alt+downarrow'
400
+ }
401
+ });
402
+ }
403
+
404
+ protected unWireEvents(): void {
405
+ EventHandler.remove(this.element, 'click', this.primaryBtnClickHandler);
406
+ (getInstance(this.element, KeyboardEvents) as KeyboardEvents).destroy();
407
+ }
408
+
409
+ private primaryBtnClickHandler(): void {
410
+ this.trigger('click', { element: this.element });
411
+ }
412
+
413
+ private btnKeyBoardHandler(e: KeyboardEventArgs): void {
414
+ switch (e.action) {
415
+ case 'altdownarrow':
416
+ this.clickHandler(e);
417
+ break;
418
+ }
419
+ }
420
+
421
+ /**
422
+ * Called internally if any of the property value changed.
423
+ *
424
+ * @param {SplitButtonModel} newProp - Specifies new properties
425
+ * @param {SplitButtonModel} oldProp - Specifies old properties
426
+ * @returns {void}
427
+ */
428
+ public onPropertyChanged(newProp: SplitButtonModel, oldProp: SplitButtonModel): void {
429
+ let model: string[] = ['content', 'iconCss', 'iconPosition', 'cssClass', 'disabled', 'enableRtl'];
430
+ this.primaryBtnObj.setProperties(getModel(newProp, model));
431
+ model = ['beforeOpen', 'beforeItemRender', 'select', 'open',
432
+ 'close', 'cssClass', 'disabled', 'enableRtl', 'createPopupOnClick'];
433
+ if (Object.keys(newProp).indexOf('items') > -1) {
434
+ this.secondaryBtnObj.items = newProp.items;
435
+ this.secondaryBtnObj.dataBind();
436
+ }
437
+ this.secondaryBtnObj.setProperties(getModel(newProp, model));
438
+ for (const prop of Object.keys(newProp)) {
439
+ switch (prop) {
440
+ case 'cssClass':
441
+ if (oldProp.cssClass) {
442
+ removeClass([this.wrapper], oldProp.cssClass.split(' '));
443
+ }
444
+ addClass([this.wrapper], newProp.cssClass.split(' '));
445
+ break;
446
+ case 'enableRtl':
447
+ if (newProp.enableRtl) {
448
+ addClass([this.wrapper], RTL);
449
+ } else {
450
+ removeClass([this.wrapper], RTL);
451
+ }
452
+ break;
453
+ }
454
+ }
455
+ }
456
+
457
+ /**
458
+ * Sets the focus to SplitButton
459
+ * its native method
460
+ *
461
+ * @public
462
+ * @returns {void}
463
+ */
464
+ public focusIn(): void {
465
+ this.element.focus();
466
+ }
467
+ }
468
+ /**
469
+ * Interface for Split Button click event arguments.
470
+ */
471
+ export interface ClickEventArgs extends BaseEventArgs {
472
+ element: Element;
473
+ }
474
+ /**
475
+ * Deferred is used to handle asynchronous operation.
476
+ */
477
+ export class Deferred {
478
+ /**
479
+ * Reject a Deferred object and call failCallbacks with the given args.
480
+ */
481
+ public reject: Function;
482
+ /**
483
+ * Resolve a Deferred object and call doneCallbacks with the given args.
484
+ */
485
+ public resolve: Function;
486
+ /**
487
+ * Promise is an object that represents a value that may not be available yet, but will be resolved at some point in the future.
488
+ */
489
+ public promise: Promise<Object> = new Promise((resolve: Function, reject: Function) => {
490
+ this.resolve = resolve;
491
+ this.reject = reject;
492
+ });
493
+ /**
494
+ * Defines the callback function triggers when the Deferred object is rejected.
495
+ */
496
+ public catch: Function = this.promise.catch.bind(this.promise);
497
+ /**
498
+ * Defines the callback function triggers when the Deferred object is resolved.
499
+ */
500
+ public then: Function = this.promise.then.bind(this.promise);
501
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-splitbuttons@*",
3
- "_id": "@syncfusion/ej2-splitbuttons@20.2.38",
3
+ "_id": "@syncfusion/ej2-splitbuttons@20.3.1",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-vDJOw9dEFF22KXMDqyQwphs4kEFWn8MpFqnjPW5HJbDLqGEDPIcB43GGyGLqQWocLdr9CXAj89C9xCCJEDosqA==",
5
+ "_integrity": "sha512-Yu7aMHoyRQccmIxNZlvmIpa4xpnvoCoMNDJI3rS0qSeG9sR6g7PFu19R1EShTwrxr8FYnRKtcnXMIh6QJ70Wwg==",
6
6
  "_location": "/@syncfusion/ej2-splitbuttons",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,6 +23,7 @@
23
23
  "/@syncfusion/ej2-documenteditor",
24
24
  "/@syncfusion/ej2-filemanager",
25
25
  "/@syncfusion/ej2-grids",
26
+ "/@syncfusion/ej2-image-editor",
26
27
  "/@syncfusion/ej2-inplace-editor",
27
28
  "/@syncfusion/ej2-inputs",
28
29
  "/@syncfusion/ej2-pivotview",
@@ -31,10 +32,10 @@
31
32
  "/@syncfusion/ej2-richtexteditor",
32
33
  "/@syncfusion/ej2-vue-splitbuttons"
33
34
  ],
34
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-20.2.38.tgz",
35
- "_shasum": "a906817eb0b66a3876af13d3a8f3551740778e8a",
35
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-20.3.1.tgz",
36
+ "_shasum": "6bb5b467a8be0d8a370a4c27370a491335732ed0",
36
37
  "_spec": "@syncfusion/ej2-splitbuttons@*",
37
- "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
38
+ "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
38
39
  "author": {
39
40
  "name": "Syncfusion Inc."
40
41
  },
@@ -43,13 +44,13 @@
43
44
  },
44
45
  "bundleDependencies": false,
45
46
  "dependencies": {
46
- "@syncfusion/ej2-base": "~20.2.45",
47
- "@syncfusion/ej2-popups": "~20.2.45"
47
+ "@syncfusion/ej2-base": "~20.3.50",
48
+ "@syncfusion/ej2-popups": "~20.3.50"
48
49
  },
49
50
  "deprecated": false,
50
51
  "description": "A package of feature-rich Essential JS 2 components such as DropDownButton, SplitButton, ProgressButton and ButtonGroup.",
51
52
  "devDependencies": {},
52
- "es2015": "./dist/es6/ej2-splitbuttons.es2015.js",
53
+ "es2015": "./dist/es6/ej2-splitbuttons.es5.js",
53
54
  "homepage": "https://github.com/syncfusion/ej2-javascript-ui-controls#readme",
54
55
  "keywords": [
55
56
  "ej2",
@@ -87,6 +88,6 @@
87
88
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
88
89
  },
89
90
  "typings": "index.d.ts",
90
- "version": "20.2.45",
91
+ "version": "20.3.52",
91
92
  "sideEffects": false
92
93
  }
@@ -74,10 +74,10 @@ export interface DropDownButtonModel extends ComponentModel{
74
74
  target?: string | Element;
75
75
 
76
76
  /**
77
- * Specifies the event to close the DropDownButton popup.
78
- *
79
- * @default ""
80
- */
77
+ * Specifies the event to close the DropDownButton popup.
78
+ *
79
+ * @default ""
80
+ */
81
81
  closeActionEvents?: string;
82
82
 
83
83
  /**
@@ -212,6 +212,24 @@
212
212
  border-bottom-color: #414141;
213
213
  }
214
214
 
215
+ .e-dropdown-btn.e-inherit,
216
+ .e-dropdown-btn.e-btn.e-inherit {
217
+ background: inherit;
218
+ border-color: transparent;
219
+ box-shadow: none;
220
+ color: inherit;
221
+ }
222
+ .e-dropdown-btn.e-inherit:hover, .e-dropdown-btn.e-inherit:focus, .e-dropdown-btn.e-inherit:active, .e-dropdown-btn.e-inherit.e-active,
223
+ .e-dropdown-btn.e-btn.e-inherit:hover,
224
+ .e-dropdown-btn.e-btn.e-inherit:focus,
225
+ .e-dropdown-btn.e-btn.e-inherit:active,
226
+ .e-dropdown-btn.e-btn.e-inherit.e-active {
227
+ background-color: rgba(0, 0, 0, 0.056);
228
+ border-color: transparent;
229
+ box-shadow: none;
230
+ color: inherit;
231
+ }
232
+
215
233
  /*! splitbutton layout */
216
234
  .e-split-btn-wrapper {
217
235
  display: -ms-inline-flexbox;
@@ -522,6 +540,7 @@
522
540
  border-left-color: #676767;
523
541
  }
524
542
 
543
+ /* stylelint-disable */
525
544
  *.e-btn-group,
526
545
  *.e-css.e-btn-group {
527
546
  display: -ms-inline-flexbox;
@@ -758,6 +777,7 @@
758
777
  font-size: 14px;
759
778
  }
760
779
 
780
+ /* stylelint-disable */
761
781
  .e-btn-group:not(.e-outline),
762
782
  .e-css.e-btn-group:not(.e-outline) {
763
783
  box-shadow: none;
@@ -1273,6 +1293,7 @@
1273
1293
  border-right: transparent;
1274
1294
  }
1275
1295
 
1296
+ /* stylelint-disable property-no-vendor-prefix */
1276
1297
  @keyframes material-spinner-rotate {
1277
1298
  0% {
1278
1299
  transform: rotate(0);
@@ -1771,19 +1792,19 @@
1771
1792
  }
1772
1793
 
1773
1794
  *.e-flat.e-primary .e-progress {
1774
- background-color: rgba(255, 255, 255, 0.2);
1795
+ background-color: rgba(255, 64, 129, 0.2);
1775
1796
  }
1776
1797
  *.e-flat.e-success .e-progress {
1777
- background-color: rgba(255, 255, 255, 0.2);
1798
+ background-color: rgba(77, 132, 29, 0.2);
1778
1799
  }
1779
1800
  *.e-flat.e-info .e-progress {
1780
- background-color: rgba(255, 255, 255, 0.2);
1801
+ background-color: rgba(3, 120, 213, 0.2);
1781
1802
  }
1782
1803
  *.e-flat.e-warning .e-progress {
1783
- background-color: rgba(255, 255, 255, 0.2);
1804
+ background-color: rgba(193, 87, 0, 0.2);
1784
1805
  }
1785
1806
  *.e-flat.e-danger .e-progress {
1786
- background-color: rgba(255, 255, 255, 0.2);
1807
+ background-color: rgba(214, 65, 19, 0.2);
1787
1808
  }
1788
1809
 
1789
1810
  *.e-outline:not(:focus).e-primary .e-progress {
@@ -212,6 +212,24 @@
212
212
  border-bottom-color: #e6e6e6;
213
213
  }
214
214
 
215
+ .e-dropdown-btn.e-inherit,
216
+ .e-dropdown-btn.e-btn.e-inherit {
217
+ background: inherit;
218
+ border-color: transparent;
219
+ box-shadow: none;
220
+ color: inherit;
221
+ }
222
+ .e-dropdown-btn.e-inherit:hover, .e-dropdown-btn.e-inherit:focus, .e-dropdown-btn.e-inherit:active, .e-dropdown-btn.e-inherit.e-active,
223
+ .e-dropdown-btn.e-btn.e-inherit:hover,
224
+ .e-dropdown-btn.e-btn.e-inherit:focus,
225
+ .e-dropdown-btn.e-btn.e-inherit:active,
226
+ .e-dropdown-btn.e-btn.e-inherit.e-active {
227
+ background-color: rgba(0, 0, 0, 0.056);
228
+ border-color: transparent;
229
+ box-shadow: none;
230
+ color: inherit;
231
+ }
232
+
215
233
  /*! splitbutton layout */
216
234
  .e-split-btn-wrapper {
217
235
  display: -ms-inline-flexbox;
@@ -522,6 +540,7 @@
522
540
  border-left-color: #adadad;
523
541
  }
524
542
 
543
+ /* stylelint-disable */
525
544
  *.e-btn-group,
526
545
  *.e-css.e-btn-group {
527
546
  display: -ms-inline-flexbox;
@@ -758,6 +777,7 @@
758
777
  font-size: 14px;
759
778
  }
760
779
 
780
+ /* stylelint-disable */
761
781
  .e-btn-group:not(.e-outline),
762
782
  .e-css.e-btn-group:not(.e-outline) {
763
783
  box-shadow: none;
@@ -1246,6 +1266,7 @@
1246
1266
  border-color: #4e0d14;
1247
1267
  outline-color: inherit;
1248
1268
  }
1269
+ /* stylelint-disable property-no-vendor-prefix */
1249
1270
  @keyframes material-spinner-rotate {
1250
1271
  0% {
1251
1272
  transform: rotate(0);