@syncfusion/ej2-splitbuttons 30.1.37 → 30.1.39

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 (47) hide show
  1. package/.eslintrc.json +2 -0
  2. package/dist/ej2-splitbuttons.min.js +2 -2
  3. package/dist/ej2-splitbuttons.umd.min.js +2 -2
  4. package/dist/ej2-splitbuttons.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-splitbuttons.es2015.js +1 -1
  6. package/dist/es6/ej2-splitbuttons.es2015.js.map +1 -1
  7. package/dist/es6/ej2-splitbuttons.es5.js +1 -1
  8. package/dist/es6/ej2-splitbuttons.es5.js.map +1 -1
  9. package/dist/global/ej2-splitbuttons.min.js +2 -2
  10. package/dist/global/ej2-splitbuttons.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +12 -57
  13. package/src/drop-down-button/drop-down-button.js +1 -1
  14. package/styles/material3-dark-lite.css +5 -0
  15. package/styles/material3-dark.css +5 -0
  16. package/styles/material3-lite.css +5 -0
  17. package/styles/material3.css +5 -0
  18. package/styles/split-button/_layout.scss +1 -0
  19. package/styles/split-button/_theme.scss +4 -0
  20. package/styles/split-button/material3-dark.css +5 -0
  21. package/styles/split-button/material3.css +5 -0
  22. package/dist/ts/button-group/button-group.d.ts +0 -38
  23. package/dist/ts/button-group/button-group.ts +0 -84
  24. package/dist/ts/button-group/index.d.ts +0 -4
  25. package/dist/ts/button-group/index.ts +0 -4
  26. package/dist/ts/common/common-model.d.ts +0 -51
  27. package/dist/ts/common/common.d.ts +0 -95
  28. package/dist/ts/common/common.ts +0 -218
  29. package/dist/ts/common/index.d.ts +0 -5
  30. package/dist/ts/common/index.ts +0 -5
  31. package/dist/ts/drop-down-button/drop-down-button-model.d.ts +0 -195
  32. package/dist/ts/drop-down-button/drop-down-button.d.ts +0 -308
  33. package/dist/ts/drop-down-button/drop-down-button.ts +0 -1110
  34. package/dist/ts/drop-down-button/index.d.ts +0 -5
  35. package/dist/ts/drop-down-button/index.ts +0 -5
  36. package/dist/ts/index.d.ts +0 -8
  37. package/dist/ts/index.ts +0 -8
  38. package/dist/ts/progress-button/index.d.ts +0 -5
  39. package/dist/ts/progress-button/index.ts +0 -5
  40. package/dist/ts/progress-button/progress-button-model.d.ts +0 -206
  41. package/dist/ts/progress-button/progress-button.d.ts +0 -323
  42. package/dist/ts/progress-button/progress-button.ts +0 -689
  43. package/dist/ts/split-button/index.d.ts +0 -5
  44. package/dist/ts/split-button/index.ts +0 -5
  45. package/dist/ts/split-button/split-button-model.d.ts +0 -133
  46. package/dist/ts/split-button/split-button.d.ts +0 -236
  47. package/dist/ts/split-button/split-button.ts +0 -535
@@ -1,218 +0,0 @@
1
- import { ChildProperty, extend, deleteObject, Property, BaseEventArgs, addClass, isNullOrUndefined } from '@syncfusion/ej2-base';
2
- import { ItemModel } from './common-model';
3
- /**
4
- * Defines the icon position of Split Button.
5
- */
6
- export type SplitButtonIconPosition = 'Left' | 'Top';
7
-
8
- /**
9
- * @param {Object} props - Specifies the properties
10
- * @param {string[]} model - Specifies the model
11
- * @returns {Object} Component Model
12
- */
13
- export function getModel(props: Object, model: string[]): Object {
14
-
15
- const obj: Object = extend({}, props);
16
- for (const prop of Object.keys(obj)) {
17
- if ((model).indexOf(prop) < 0) {
18
- deleteObject(obj, prop);
19
- }
20
- }
21
-
22
- return obj as Object;
23
- }
24
-
25
- /** @hidden
26
- * @param {HTMLElement} ul - Specifies the UL element
27
- * @param {number} keyCode - Specifies the keycode
28
- * @returns {void}
29
- */
30
- export function upDownKeyHandler(ul: HTMLElement, keyCode: number): void {
31
- const defaultIdx: number = keyCode === 40 ? 0 : ul.childElementCount - 1;
32
- let liIdx: number = defaultIdx;
33
- let li: Element;
34
- const selectedLi: Element = ul.querySelector('.e-selected');
35
- if (selectedLi) { selectedLi.classList.remove('e-selected'); }
36
- for (let i: number = 0, len: number = ul.children.length; i < len; i++) {
37
- if (ul.children[i as number].classList.contains('e-focused')) {
38
- li = ul.children[i as number];
39
- liIdx = i;
40
- li.classList.remove('e-focused');
41
- if (keyCode === 40) {
42
- liIdx++;
43
- } else {
44
- liIdx--;
45
- }
46
- if (liIdx === (keyCode === 40 ? ul.childElementCount : -1)) {
47
- liIdx = defaultIdx;
48
- }
49
- }
50
- }
51
- li = ul.children[liIdx as number];
52
- liIdx = isValidLI(ul, li, liIdx, keyCode);
53
- if (liIdx !== -1) {
54
- addClass([ul.children[liIdx as number]], 'e-focused');
55
- (ul.children[liIdx as number] as HTMLElement).focus();
56
- }
57
- }
58
-
59
- /**
60
- * Get Valid LI element
61
- *
62
- * @param {HTMLElement} ul - Specifies the UL element
63
- * @param {Element} li - Specifies the LI element
64
- * @param {number} index - Specifies the index
65
- * @param {number} keyCode - Specifies the keycode
66
- * @param {number} count - Specifies the count
67
- * @returns {number} - Index
68
- */
69
- function isValidLI(ul: HTMLElement, li: Element, index: number, keyCode: number, count: number = 0): number {
70
- if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) {
71
- if (index === (keyCode === 40 ? ul.childElementCount - 1 : 0)) {
72
- index = keyCode === 40 ? 0 : ul.childElementCount - 1;
73
- } else {
74
- if (keyCode === 40) {
75
- index++;
76
- } else {
77
- index--;
78
- }
79
- }
80
- }
81
- li = ul.children[index as number];
82
- if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) {
83
- count++;
84
- if (count === ul.childElementCount) {
85
- return index = -1;
86
- }
87
- index = isValidLI(ul, li, index, keyCode, count);
88
- }
89
- return index;
90
- }
91
-
92
- /** @hidden
93
- * @param {HTMLElement} popup - Specifies the popup element.
94
- * @param {boolean} blankIcon - Specifies the blankIcon value.
95
- * @returns {void}
96
- */
97
- export function setBlankIconStyle(popup: HTMLElement, blankIcon?: boolean): void {
98
- const blankIconList: HTMLElement[] = [].slice.call(popup.getElementsByClassName('e-blank-icon'));
99
- if (blankIcon) {
100
- const menuItem: HTMLElement[] = [].slice.call(popup.getElementsByClassName('e-item'));
101
- menuItem.forEach((li: HTMLElement): void => {
102
- if (li.style.paddingLeft || li.style.paddingRight) {
103
- li.removeAttribute('style');
104
- }
105
- });
106
- }
107
- if (!blankIconList.length) { return; }
108
- let iconLi: HTMLElement = popup.querySelector('.e-item:not(.e-blank-icon):not(.e-separator)') as HTMLElement;
109
- if (isNullOrUndefined(iconLi)) {return; }
110
- if (iconLi.classList.contains('e-url')) { iconLi = iconLi.querySelector('.e-menu-url'); }
111
- const icon: HTMLElement = iconLi.querySelector('.e-menu-icon') as HTMLElement;
112
- let cssProp: { padding: string, margin: string };
113
- const enableRtl: boolean = popup.classList.contains('e-rtl');
114
- if (enableRtl) {
115
- cssProp = { padding: 'paddingRight', margin: 'marginLeft' };
116
- } else {
117
- cssProp = { padding: 'paddingLeft', margin: 'marginRight' };
118
- }
119
- /* eslint-disable */
120
- let size: string = `${parseInt(getComputedStyle(icon).fontSize, 10) + parseInt(
121
- (enableRtl ? (getComputedStyle(icon) as any)[cssProp.margin] : (getComputedStyle(icon) as any)[cssProp.margin]), 10)
122
- + parseInt(getComputedStyle(iconLi).paddingLeft, 10)}px`;
123
- blankIconList.forEach((li: HTMLElement): void => {
124
- if (li.classList.contains('e-url') && (li.querySelector('.e-menu-url') as HTMLElement)) {
125
- ((li.querySelector('.e-menu-url') as HTMLElement).style as any)[cssProp.padding] = size;
126
- } else {
127
- (li.style as any)[cssProp.padding] = size;
128
- }
129
- });
130
- /* eslint-enable */
131
- }
132
-
133
- /**
134
- * Defines the items of Split Button/DropDownButton.
135
- */
136
- export class Item extends ChildProperty<Item> {
137
- /**
138
- * Defines class/multiple classes separated by a space for the item that is used to include an icon.
139
- * Action item can include font icon and sprite image.
140
- *
141
- * @default ''
142
- */
143
- @Property('')
144
- public iconCss: string;
145
-
146
- /**
147
- * Specifies the id for item.
148
- *
149
- * @default ''
150
- */
151
- @Property('')
152
- public id: string;
153
-
154
- /**
155
- * Specifies separator between the items. Separator are horizontal lines used to group action items.
156
- *
157
- * @default false
158
- */
159
- @Property(false)
160
- public separator: boolean;
161
-
162
- /**
163
- * Specifies text for item.
164
- *
165
- * @default ''
166
- */
167
- @Property('')
168
- public text: string;
169
-
170
- /**
171
- * Specifies url for item that creates the anchor link to navigate to the url provided.
172
- *
173
- * @default ''
174
- */
175
- @Property('')
176
- public url: string;
177
-
178
- /**
179
- * Used to enable or disable the item.
180
- *
181
- * @default false
182
- */
183
- @Property(false)
184
- public disabled: boolean;
185
- }
186
-
187
- /**
188
- * Interface for before item render / select event.
189
- */
190
- export interface MenuEventArgs extends BaseEventArgs {
191
- element: HTMLElement;
192
- item: ItemModel;
193
- event?: Event;
194
- }
195
-
196
- /**
197
- * Interface for before open / close event.
198
- */
199
- export interface BeforeOpenCloseMenuEventArgs extends BaseEventArgs {
200
- element: HTMLElement;
201
- items: ItemModel[];
202
- event: Event;
203
- cancel?: boolean;
204
- }
205
-
206
- /**
207
- * Interface for open/close event.
208
- */
209
- export interface OpenCloseMenuEventArgs extends BaseEventArgs {
210
- element: HTMLElement;
211
- items: ItemModel[];
212
- parentItem?: ItemModel;
213
- }
214
-
215
- /**
216
- * Interface for animation effects.
217
- */
218
- export type DropDownAnimationEffect = 'None' | 'SlideDown' | 'ZoomIn' | 'FadeIn';
@@ -1,5 +0,0 @@
1
- /**
2
- * Common modules
3
- */
4
- export * from './common';
5
- export * from './common-model';
@@ -1,5 +0,0 @@
1
- /**
2
- * Common modules
3
- */
4
- export * from './common';
5
- export * from './common-model';
@@ -1,195 +0,0 @@
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
- import {ComponentModel} from '@syncfusion/ej2-base';
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
-
38
- /**
39
- * Interface for a class DropDownButton
40
- */
41
- export interface DropDownButtonModel extends ComponentModel{
42
-
43
- /**
44
- * Defines the content of the DropDownButton element that can either be a text or HTML elements.
45
- *
46
- * @default ""
47
- */
48
- content?: string;
49
-
50
- /**
51
- * Defines class/multiple classes separated by a space in the DropDownButton element. The
52
- * DropDownButton size and styles can be customized by using this.
53
- *
54
- * @default ""
55
- */
56
- cssClass?: string;
57
-
58
- /**
59
- * Specifies a value that indicates whether the DropDownButton is `disabled` or not.
60
- *
61
- * @default false.
62
- */
63
- disabled?: boolean;
64
-
65
- /**
66
- * Defines class/multiple classes separated by a space for the DropDownButton that is used to
67
- * include an icon. DropDownButton can also include font icon and sprite image.
68
- *
69
- * @default ""
70
- */
71
- iconCss?: string;
72
-
73
- /**
74
- * Positions the icon before/top of the text content in the DropDownButton. The possible values are:
75
- * * Left: The icon will be positioned to the left of the text content.
76
- * * Top: The icon will be positioned to the top of the text content.
77
- *
78
- * @default "Left"
79
- */
80
- iconPosition?: SplitButtonIconPosition;
81
-
82
- /**
83
- * Specifies whether to enable the rendering of untrusted HTML values in the DropDownButton component.
84
- * If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
85
- *
86
- * @default true
87
- */
88
- enableHtmlSanitizer?: boolean;
89
-
90
- /**
91
- * Specifies action items with its properties which will be rendered as DropDownButton popup.
92
- *
93
- * @default []
94
- */
95
- items?: ItemModel[];
96
-
97
- /**
98
- * Specifies the popup element creation on open.
99
- *
100
- * @default false
101
- */
102
- createPopupOnClick?: boolean;
103
-
104
- /**
105
- * Allows to specify the DropDownButton popup item element.
106
- *
107
- * @default ""
108
- */
109
- target?: string | Element;
110
-
111
- /**
112
- * Specifies the event to close the DropDownButton popup.
113
- *
114
- * @default ""
115
- */
116
- closeActionEvents?: string;
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
-
146
- /**
147
- * Triggers while rendering each Popup item of DropDownButton.
148
- *
149
- * @event beforeItemRender
150
- */
151
- beforeItemRender?: EmitType<MenuEventArgs>;
152
-
153
- /**
154
- * Triggers before opening the DropDownButton popup.
155
- *
156
- * @event beforeOpen
157
- */
158
- beforeOpen?: EmitType<BeforeOpenCloseMenuEventArgs>;
159
-
160
- /**
161
- * Triggers before closing the DropDownButton popup.
162
- *
163
- * @event beforeClose
164
- */
165
- beforeClose?: EmitType<BeforeOpenCloseMenuEventArgs>;
166
-
167
- /**
168
- * Triggers while closing the DropDownButton popup.
169
- *
170
- * @event close
171
- */
172
- close?: EmitType<OpenCloseMenuEventArgs>;
173
-
174
- /**
175
- * Triggers while opening the DropDownButton popup.
176
- *
177
- * @event open
178
- */
179
- open?: EmitType<OpenCloseMenuEventArgs>;
180
-
181
- /**
182
- * Triggers while selecting action item in DropDownButton popup.
183
- *
184
- * @event select
185
- */
186
- select?: EmitType<MenuEventArgs>;
187
-
188
- /**
189
- * Triggers once the component rendering is completed.
190
- *
191
- * @event created
192
- */
193
- created?: EmitType<Event>;
194
-
195
- }