@syncfusion/ej2-splitbuttons 29.1.33 → 30.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 (107) hide show
  1. package/dist/ej2-splitbuttons.min.js +2 -2
  2. package/dist/ej2-splitbuttons.umd.min.js +2 -2
  3. package/dist/ej2-splitbuttons.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-splitbuttons.es2015.js +3 -1
  5. package/dist/es6/ej2-splitbuttons.es2015.js.map +1 -1
  6. package/dist/es6/ej2-splitbuttons.es5.js +3 -1
  7. package/dist/es6/ej2-splitbuttons.es5.js.map +1 -1
  8. package/dist/global/ej2-splitbuttons.min.js +2 -2
  9. package/dist/global/ej2-splitbuttons.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/dist/ts/button-group/button-group.d.ts +38 -0
  12. package/dist/ts/button-group/button-group.ts +84 -0
  13. package/dist/ts/button-group/index.d.ts +4 -0
  14. package/dist/ts/button-group/index.ts +4 -0
  15. package/dist/ts/common/common-model.d.ts +51 -0
  16. package/dist/ts/common/common.d.ts +95 -0
  17. package/dist/ts/common/common.ts +218 -0
  18. package/dist/ts/common/index.d.ts +5 -0
  19. package/dist/ts/common/index.ts +5 -0
  20. package/dist/ts/drop-down-button/drop-down-button-model.d.ts +195 -0
  21. package/dist/ts/drop-down-button/drop-down-button.d.ts +308 -0
  22. package/dist/ts/drop-down-button/drop-down-button.ts +1110 -0
  23. package/dist/ts/drop-down-button/index.d.ts +5 -0
  24. package/dist/ts/drop-down-button/index.ts +5 -0
  25. package/dist/ts/index.d.ts +8 -0
  26. package/dist/ts/index.ts +8 -0
  27. package/dist/ts/progress-button/index.d.ts +5 -0
  28. package/dist/ts/progress-button/index.ts +5 -0
  29. package/dist/ts/progress-button/progress-button-model.d.ts +206 -0
  30. package/dist/ts/progress-button/progress-button.d.ts +323 -0
  31. package/dist/ts/progress-button/progress-button.ts +689 -0
  32. package/dist/ts/split-button/index.d.ts +5 -0
  33. package/dist/ts/split-button/index.ts +5 -0
  34. package/dist/ts/split-button/split-button-model.d.ts +133 -0
  35. package/dist/ts/split-button/split-button.d.ts +236 -0
  36. package/dist/ts/split-button/split-button.ts +535 -0
  37. package/package.json +9 -9
  38. package/src/drop-down-button/drop-down-button.js +3 -1
  39. package/styles/bds-lite.css +1 -7
  40. package/styles/bds.css +2 -7
  41. package/styles/bootstrap-dark-lite.css +0 -1
  42. package/styles/bootstrap-dark.css +0 -1
  43. package/styles/bootstrap-lite.css +0 -1
  44. package/styles/bootstrap.css +0 -1
  45. package/styles/bootstrap4-lite.css +0 -1
  46. package/styles/bootstrap4.css +3 -1
  47. package/styles/bootstrap5-dark-lite.css +2 -4
  48. package/styles/bootstrap5-dark.css +2 -4
  49. package/styles/bootstrap5-lite.css +2 -4
  50. package/styles/bootstrap5.3-lite.css +0 -2
  51. package/styles/bootstrap5.3.css +0 -2
  52. package/styles/bootstrap5.css +2 -4
  53. package/styles/drop-down-button/_layout.scss +0 -1
  54. package/styles/drop-down-button/material3-dark.css +0 -1
  55. package/styles/drop-down-button/material3.css +0 -1
  56. package/styles/fabric-dark-lite.css +0 -1
  57. package/styles/fabric-dark.css +0 -1
  58. package/styles/fabric-lite.css +0 -1
  59. package/styles/fabric.css +0 -1
  60. package/styles/fluent-dark-lite.css +0 -1
  61. package/styles/fluent-dark.css +1 -1
  62. package/styles/fluent-lite.css +0 -1
  63. package/styles/fluent.css +1 -1
  64. package/styles/fluent2-lite.css +1 -3
  65. package/styles/fluent2.css +1 -3
  66. package/styles/highcontrast-light-lite.css +0 -1
  67. package/styles/highcontrast-light.css +0 -1
  68. package/styles/highcontrast-lite.css +0 -1
  69. package/styles/highcontrast.css +0 -1
  70. package/styles/material-dark-lite.css +0 -1
  71. package/styles/material-dark.css +0 -1
  72. package/styles/material-lite.css +0 -1
  73. package/styles/material.css +0 -1
  74. package/styles/material3-dark-lite.css +3 -6
  75. package/styles/material3-dark.css +5 -8
  76. package/styles/material3-lite.css +3 -6
  77. package/styles/material3.css +5 -8
  78. package/styles/split-button/_bigger.scss +7 -1
  79. package/styles/split-button/_layout.scss +7 -13
  80. package/styles/split-button/_theme.scss +2 -8
  81. package/styles/split-button/bds.css +2 -7
  82. package/styles/split-button/bootstrap-dark.css +0 -1
  83. package/styles/split-button/bootstrap.css +0 -1
  84. package/styles/split-button/bootstrap4.css +3 -1
  85. package/styles/split-button/bootstrap5-dark.css +2 -4
  86. package/styles/split-button/bootstrap5.3.css +0 -2
  87. package/styles/split-button/bootstrap5.css +2 -4
  88. package/styles/split-button/fabric-dark.css +0 -1
  89. package/styles/split-button/fabric.css +0 -1
  90. package/styles/split-button/fluent-dark.css +1 -1
  91. package/styles/split-button/fluent.css +1 -1
  92. package/styles/split-button/fluent2.css +1 -3
  93. package/styles/split-button/highcontrast-light.css +0 -1
  94. package/styles/split-button/highcontrast.css +0 -1
  95. package/styles/split-button/material-dark.css +0 -1
  96. package/styles/split-button/material.css +0 -1
  97. package/styles/split-button/material3-dark.css +5 -7
  98. package/styles/split-button/material3.css +5 -7
  99. package/styles/split-button/tailwind-dark.css +2 -7
  100. package/styles/split-button/tailwind.css +2 -7
  101. package/styles/split-button/tailwind3.css +1 -3
  102. package/styles/tailwind-dark-lite.css +1 -7
  103. package/styles/tailwind-dark.css +2 -7
  104. package/styles/tailwind-lite.css +1 -7
  105. package/styles/tailwind.css +2 -7
  106. package/styles/tailwind3-lite.css +1 -3
  107. package/styles/tailwind3.css +1 -3
@@ -0,0 +1,535 @@
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 as number].nodeName, ele.attributes[idx as number].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.replace(/\s+/g, ' ').trim().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
+ if (this.createPopupOnClick && this.items.length === 0) {
314
+ this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
315
+ this.dropDown = this.secondaryBtnObj.dropDown;
316
+ }
317
+ const callBackPromise: Deferred = new Deferred();
318
+ this.trigger('beforeOpen', args, (observedArgs: BeforeOpenCloseMenuEventArgs) => {
319
+ callBackPromise.resolve(observedArgs);
320
+ });
321
+ return callBackPromise;
322
+ };
323
+ dropDownBtnModel.beforeClose = (args: BeforeOpenCloseMenuEventArgs): Deferred | void => {
324
+ const callBackPromise: Deferred = new Deferred();
325
+ this.trigger('beforeClose', args, (observedArgs: BeforeOpenCloseMenuEventArgs) => {
326
+ callBackPromise.resolve(observedArgs);
327
+ });
328
+ return callBackPromise;
329
+ };
330
+ this.secondaryBtnObj = new DropDownButton(dropDownBtnModel);
331
+ this.secondaryBtnObj.createElement = this.createElement;
332
+ this.secondaryBtnObj.appendTo(btnElem);
333
+ if (!this.createPopupOnClick) {
334
+ this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
335
+ this.dropDown = this.secondaryBtnObj.dropDown;
336
+ }
337
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
338
+ (this as any).isPopupCreated = (this.secondaryBtnObj as any).isPopupCreated;
339
+ this.secondaryBtnObj.activeElem = [this.element, this.secondaryBtnObj.element];
340
+ this.secondaryBtnObj.element.querySelector('.e-btn-icon').classList.remove('e-icon-right');
341
+ if (this.disabled) {
342
+ this.wrapper.classList.add('e-splitbtn-disabled');
343
+ }
344
+ }
345
+
346
+ private setAria(): void {
347
+ attributes(this.element, {
348
+ 'aria-expanded': 'false', 'aria-haspopup': 'true',
349
+ 'aria-label': this.element.textContent ? this.element.textContent + ' splitbutton' : 'splitbutton', 'aria-owns': this.element.id + '_dropdownbtn-popup'
350
+ });
351
+ }
352
+
353
+ /**
354
+ * Get component name.
355
+ *
356
+ * @returns {string} - Module Name
357
+ * @private
358
+ */
359
+ public getModuleName(): string {
360
+ return 'split-btn';
361
+ }
362
+
363
+ /**
364
+ * To open/close SplitButton popup based on current state of the SplitButton.
365
+ *
366
+ * @returns {void}
367
+ */
368
+ public toggle(): void {
369
+ this.secondaryBtnObj.toggle();
370
+ }
371
+
372
+ public destroy(): void {
373
+ let classList: string[] = [RTL];
374
+ if (this.cssClass) {
375
+ classList = classList.concat(this.cssClass.split(' '));
376
+ }
377
+ if (this.element) {
378
+ const element: Element = document.getElementById(this.element.id);
379
+ if (element && element.parentElement === this.wrapper) {
380
+ if (this.wrapper.tagName === TAGNAME) {
381
+ this.wrapper.innerHTML = '';
382
+ removeClass([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']);
383
+ removeClass([this.wrapper], this.cssClass.split(' '));
384
+ } else {
385
+ removeClass([this.element], classList);
386
+ ['aria-label', 'aria-haspopup', 'aria-expanded', 'aria-owns', 'type'].forEach((key: string) => {
387
+ this.element.removeAttribute(key);
388
+ });
389
+ this.wrapper.parentNode.insertBefore(this.element, this.wrapper);
390
+ remove(this.wrapper);
391
+ }
392
+ this.unWireEvents();
393
+ }
394
+ }
395
+ this.primaryBtnObj.destroy();
396
+ this.secondaryBtnObj.destroy();
397
+ super.destroy();
398
+ if (this.element && !this.element.getAttribute('class')) {
399
+ this.element.removeAttribute('class');
400
+ }
401
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
402
+ if (this.refreshing && (this as any).isAngular) {
403
+ this.element = this.wrapper as HTMLButtonElement;
404
+ ['e-control', 'e-split-btn', 'e-lib'].forEach((key: string) => {
405
+ this.element.classList.add(key);
406
+ });
407
+ setValue('ej2_instances', [this], this.element);
408
+ }
409
+ this.wrapper = null;
410
+ }
411
+
412
+ protected wireEvents(): void {
413
+ EventHandler.add(this.element, 'click', this.primaryBtnClickHandler, this);
414
+ new KeyboardEvents(this.element, {
415
+ keyAction: this.btnKeyBoardHandler.bind(this),
416
+ keyConfigs: {
417
+ altdownarrow: 'alt+downarrow',
418
+ enter: 'enter'
419
+ }
420
+ });
421
+ }
422
+
423
+ protected unWireEvents(): void {
424
+ EventHandler.remove(this.element, 'click', this.primaryBtnClickHandler);
425
+ (getInstance(this.element, KeyboardEvents) as KeyboardEvents).destroy();
426
+ }
427
+
428
+ private primaryBtnClickHandler(): void {
429
+ this.trigger('click', { element: this.element });
430
+ }
431
+
432
+ private btnKeyBoardHandler(e: KeyboardEventArgs): void {
433
+ switch (e.action) {
434
+ case 'altdownarrow':
435
+ this.clickHandler(e);
436
+ break;
437
+ case 'enter':
438
+ this.clickHandler(e);
439
+ if (this.getPopUpElement() && !this.getPopUpElement().classList.contains('e-popup-close')) {
440
+ this.element.classList.remove('e-active');
441
+ this.secondaryBtnObj.element.classList.add('e-active');
442
+ } else {
443
+ this.secondaryBtnObj.element.classList.remove('e-active');
444
+ }
445
+ break;
446
+ }
447
+ }
448
+
449
+ /**
450
+ * Called internally if any of the property value changed.
451
+ *
452
+ * @param {SplitButtonModel} newProp - Specifies new properties
453
+ * @param {SplitButtonModel} oldProp - Specifies old properties
454
+ * @returns {void}
455
+ */
456
+ public onPropertyChanged(newProp: SplitButtonModel, oldProp: SplitButtonModel): void {
457
+ let model: string[] = ['content', 'iconCss', 'iconPosition', 'cssClass', 'disabled', 'enableRtl'];
458
+ this.primaryBtnObj.setProperties(getModel(newProp, model));
459
+ model = ['beforeOpen', 'beforeItemRender', 'select', 'open',
460
+ 'close', 'cssClass', 'disabled', 'enableRtl', 'createPopupOnClick'];
461
+ if (Object.keys(newProp).indexOf('items') > -1) {
462
+ this.secondaryBtnObj.items = newProp.items;
463
+ this.secondaryBtnObj.dataBind();
464
+ }
465
+ this.secondaryBtnObj.setProperties(getModel(newProp, model));
466
+ for (const prop of Object.keys(newProp)) {
467
+ switch (prop) {
468
+ case 'cssClass':
469
+ if (oldProp.cssClass) {
470
+ removeClass([this.wrapper], oldProp.cssClass.split(' '));
471
+ }
472
+ addClass([this.wrapper], newProp.cssClass.replace(/\s+/g, ' ').trim().split(' '));
473
+ break;
474
+ case 'enableRtl':
475
+ if (newProp.enableRtl) {
476
+ addClass([this.wrapper], RTL);
477
+ } else {
478
+ removeClass([this.wrapper], RTL);
479
+ }
480
+ break;
481
+ case 'disabled':
482
+ if (newProp.disabled) {
483
+ addClass([this.wrapper], 'e-splitbtn-disabled');
484
+ } else {
485
+ removeClass([this.wrapper], 'e-splitbtn-disabled');
486
+ }
487
+ }
488
+ }
489
+ }
490
+
491
+ /**
492
+ * Sets the focus to SplitButton
493
+ * its native method
494
+ *
495
+ * @public
496
+ * @returns {void}
497
+ */
498
+ public focusIn(): void {
499
+ this.element.focus();
500
+ }
501
+ }
502
+ /**
503
+ * Interface for Split Button click event arguments.
504
+ */
505
+ export interface ClickEventArgs extends BaseEventArgs {
506
+ element: Element;
507
+ }
508
+ /**
509
+ * Deferred is used to handle asynchronous operation.
510
+ */
511
+ export class Deferred {
512
+ /**
513
+ * Reject a Deferred object and call failCallbacks with the given args.
514
+ */
515
+ public reject: Function;
516
+ /**
517
+ * Resolve a Deferred object and call doneCallbacks with the given args.
518
+ */
519
+ public resolve: Function;
520
+ /**
521
+ * Promise is an object that represents a value that may not be available yet, but will be resolved at some point in the future.
522
+ */
523
+ public promise: Promise<Object> = new Promise((resolve: Function, reject: Function) => {
524
+ this.resolve = resolve;
525
+ this.reject = reject;
526
+ });
527
+ /**
528
+ * Defines the callback function triggers when the Deferred object is rejected.
529
+ */
530
+ public catch: Function = this.promise.catch.bind(this.promise);
531
+ /**
532
+ * Defines the callback function triggers when the Deferred object is resolved.
533
+ */
534
+ public then: Function = this.promise.then.bind(this.promise);
535
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-splitbuttons@*",
3
- "_id": "@syncfusion/ej2-splitbuttons@28.1.33",
3
+ "_id": "@syncfusion/ej2-splitbuttons@28.2.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-9OvMrPJ+hKEkuBwonTT3478UNHR/UIBp4M824inyFJ2HjpfBQqcb5hd0ZNDYhXEUedNIgba0dKYtulVoQHdlWQ==",
5
+ "_integrity": "sha512-TvfE2XBZrIRf0OHfwArvbbgRJTxF3YSWscGWNEb2FNimdMZAQhSLGRmca36wAJ4ZGOoyKp0KXEhm4oKDt32uZQ==",
6
6
  "_location": "/@syncfusion/ej2-splitbuttons",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,7 +18,6 @@
18
18
  },
19
19
  "_requiredBy": [
20
20
  "/",
21
- "/@syncfusion/ej2",
22
21
  "/@syncfusion/ej2-angular-splitbuttons",
23
22
  "/@syncfusion/ej2-documenteditor",
24
23
  "/@syncfusion/ej2-filemanager",
@@ -26,6 +25,7 @@
26
25
  "/@syncfusion/ej2-image-editor",
27
26
  "/@syncfusion/ej2-inplace-editor",
28
27
  "/@syncfusion/ej2-inputs",
28
+ "/@syncfusion/ej2-interactive-chat",
29
29
  "/@syncfusion/ej2-pivotview",
30
30
  "/@syncfusion/ej2-querybuilder",
31
31
  "/@syncfusion/ej2-react-splitbuttons",
@@ -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-release/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-28.1.33.tgz",
37
- "_shasum": "9d2f3fe807a911970bf049c278a8ac0d8b93e54e",
36
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-development/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-28.2.0.tgz",
37
+ "_shasum": "7f4fe237f666e0f7feb08f2dd39f41de49bc6dbb",
38
38
  "_spec": "@syncfusion/ej2-splitbuttons@*",
39
- "_where": "/jenkins/workspace/elease-automation_release_29.1.1/packages/included",
39
+ "_where": "D:\\SF3992\\WFH\\Nexus\\ej2-nexus-branch-switching-dev\\release",
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": "~29.1.33",
49
- "@syncfusion/ej2-popups": "~29.1.33"
48
+ "@syncfusion/ej2-base": "~30.1.37",
49
+ "@syncfusion/ej2-popups": "~30.1.37"
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": "29.1.33",
92
+ "version": "30.1.37",
93
93
  "sideEffects": false
94
94
  }
@@ -812,7 +812,9 @@ var DropDownButton = /** @class */ (function (_super) {
812
812
  _this.element.removeAttribute('aria-owns');
813
813
  if (focusEle) {
814
814
  if (!_this.isSafari()) {
815
- focusEle.focus();
815
+ if (!(_this.isColorPicker() && e.keyCode === 27)) {
816
+ focusEle.focus();
817
+ }
816
818
  }
817
819
  else {
818
820
  focusEle.focus({ preventScroll: true });
@@ -338,11 +338,7 @@
338
338
  border-bottom-right-radius: 0;
339
339
  border-top-right-radius: 0;
340
340
  text-transform: none;
341
- z-index: 1;
342
- padding-left: 12px;
343
- padding-right: 12px;
344
- padding-left: 10px;
345
- padding-right: 10px;
341
+ padding: 3.75px 11px;
346
342
  }
347
343
  .e-split-btn-wrapper .e-split-btn:focus {
348
344
  outline-offset: 0;
@@ -388,7 +384,6 @@
388
384
  margin-left: -1px;
389
385
  padding-left: 10px;
390
386
  padding-right: 10px;
391
- z-index: 1;
392
387
  }
393
388
  .e-split-btn-wrapper .e-dropdown-btn:focus, .e-split-btn-wrapper .e-dropdown-btn:hover {
394
389
  -webkit-box-shadow: none;
@@ -463,7 +458,6 @@
463
458
  border-top-left-radius: 8px;
464
459
  border-top-right-radius: 0;
465
460
  margin-left: 0;
466
- z-index: 1;
467
461
  }
468
462
  .e-split-btn-wrapper.e-vertical {
469
463
  display: inline-block;
package/styles/bds.css CHANGED
@@ -401,11 +401,7 @@
401
401
  border-bottom-right-radius: 0;
402
402
  border-top-right-radius: 0;
403
403
  text-transform: none;
404
- z-index: 1;
405
- padding-left: 12px;
406
- padding-right: 12px;
407
- padding-left: 10px;
408
- padding-right: 10px;
404
+ padding: 3.75px 11px;
409
405
  }
410
406
  .e-split-btn-wrapper .e-split-btn:focus {
411
407
  outline-offset: 0;
@@ -451,7 +447,6 @@
451
447
  margin-left: -1px;
452
448
  padding-left: 10px;
453
449
  padding-right: 10px;
454
- z-index: 1;
455
450
  }
456
451
  .e-split-btn-wrapper .e-dropdown-btn:focus, .e-split-btn-wrapper .e-dropdown-btn:hover {
457
452
  -webkit-box-shadow: none;
@@ -526,7 +521,6 @@
526
521
  border-top-left-radius: 8px;
527
522
  border-top-right-radius: 0;
528
523
  margin-left: 0;
529
- z-index: 1;
530
524
  }
531
525
  .e-split-btn-wrapper.e-vertical {
532
526
  display: inline-block;
@@ -672,6 +666,7 @@
672
666
  .e-bigger.e-split-btn-wrapper .e-split-btn {
673
667
  padding-left: 16px;
674
668
  padding-right: 16px;
669
+ line-height: 1.781em;
675
670
  }
676
671
  .e-bigger .e-split-btn-wrapper .e-split-btn.e-top-icon-btn,
677
672
  .e-bigger.e-split-btn-wrapper .e-split-btn.e-top-icon-btn {
@@ -230,7 +230,6 @@
230
230
  border-bottom-right-radius: 0;
231
231
  border-top-right-radius: 0;
232
232
  text-transform: none;
233
- z-index: 1;
234
233
  padding-left: 10px;
235
234
  padding-right: 10px;
236
235
  }
@@ -286,7 +286,6 @@
286
286
  border-bottom-right-radius: 0;
287
287
  border-top-right-radius: 0;
288
288
  text-transform: none;
289
- z-index: 1;
290
289
  padding-left: 10px;
291
290
  padding-right: 10px;
292
291
  }
@@ -230,7 +230,6 @@
230
230
  border-bottom-right-radius: 0;
231
231
  border-top-right-radius: 0;
232
232
  text-transform: none;
233
- z-index: 1;
234
233
  padding-left: 10px;
235
234
  padding-right: 10px;
236
235
  }