@syncfusion/ej2-navigations 31.1.17 → 31.1.18

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 (171) hide show
  1. package/dist/ej2-navigations.min.js +1 -1
  2. package/dist/ej2-navigations.umd.min.js +1 -1
  3. package/dist/global/ej2-navigations.min.js +1 -1
  4. package/dist/global/index.d.ts +1 -1
  5. package/package.json +11 -64
  6. package/styles/bds-lite.css +2 -1
  7. package/styles/bds.css +2 -1
  8. package/styles/bootstrap-dark-lite.css +2 -1
  9. package/styles/bootstrap-dark.css +2 -1
  10. package/styles/bootstrap-lite.css +2 -1
  11. package/styles/bootstrap.css +2 -1
  12. package/styles/bootstrap4-lite.css +2 -1
  13. package/styles/bootstrap4.css +2 -1
  14. package/styles/bootstrap5-dark-lite.css +2 -1
  15. package/styles/bootstrap5-dark.css +2 -1
  16. package/styles/bootstrap5-lite.css +2 -1
  17. package/styles/bootstrap5.3-lite.css +2 -1
  18. package/styles/bootstrap5.3.css +2 -1
  19. package/styles/bootstrap5.css +2 -1
  20. package/styles/fabric-dark-lite.css +2 -1
  21. package/styles/fabric-dark.css +2 -1
  22. package/styles/fabric-lite.css +2 -1
  23. package/styles/fabric.css +2 -1
  24. package/styles/fluent-dark-lite.css +3 -2
  25. package/styles/fluent-dark.css +3 -2
  26. package/styles/fluent-lite.css +3 -2
  27. package/styles/fluent.css +3 -2
  28. package/styles/fluent2-lite.css +3 -2
  29. package/styles/fluent2.css +3 -2
  30. package/styles/highcontrast-light-lite.css +2 -1
  31. package/styles/highcontrast-light.css +2 -1
  32. package/styles/highcontrast-lite.css +2 -1
  33. package/styles/highcontrast.css +2 -1
  34. package/styles/material-dark-lite.css +2 -1
  35. package/styles/material-dark.css +2 -1
  36. package/styles/material-lite.css +2 -1
  37. package/styles/material.css +2 -1
  38. package/styles/material3-dark-lite.css +3 -2
  39. package/styles/material3-dark.css +3 -2
  40. package/styles/material3-lite.css +3 -2
  41. package/styles/material3.css +3 -2
  42. package/styles/menu/_bootstrap-dark-definition.scss +1 -0
  43. package/styles/menu/_bootstrap-definition.scss +1 -0
  44. package/styles/menu/_fluent-definition.scss +1 -1
  45. package/styles/menu/_fluent2-definition.scss +1 -1
  46. package/styles/menu/_layout.scss +7 -1
  47. package/styles/menu/_material3-definition.scss +1 -1
  48. package/styles/menu/bds.css +1 -0
  49. package/styles/menu/bootstrap-dark.css +1 -0
  50. package/styles/menu/bootstrap.css +1 -0
  51. package/styles/menu/bootstrap4.css +1 -0
  52. package/styles/menu/bootstrap5-dark.css +1 -0
  53. package/styles/menu/bootstrap5.3.css +1 -0
  54. package/styles/menu/bootstrap5.css +1 -0
  55. package/styles/menu/fabric-dark.css +1 -0
  56. package/styles/menu/fabric.css +1 -0
  57. package/styles/menu/fluent-dark.css +2 -1
  58. package/styles/menu/fluent.css +2 -1
  59. package/styles/menu/fluent2.css +2 -1
  60. package/styles/menu/highcontrast-light.css +1 -0
  61. package/styles/menu/highcontrast.css +1 -0
  62. package/styles/menu/material-dark.css +1 -0
  63. package/styles/menu/material.css +1 -0
  64. package/styles/menu/material3-dark.css +2 -1
  65. package/styles/menu/material3.css +2 -1
  66. package/styles/menu/tailwind-dark.css +1 -0
  67. package/styles/menu/tailwind.css +1 -0
  68. package/styles/menu/tailwind3.css +1 -0
  69. package/styles/tailwind-dark-lite.css +2 -1
  70. package/styles/tailwind-dark.css +2 -1
  71. package/styles/tailwind-lite.css +2 -1
  72. package/styles/tailwind.css +2 -1
  73. package/styles/tailwind3-lite.css +2 -1
  74. package/styles/tailwind3.css +2 -1
  75. package/styles/treeview/_layout.scss +1 -1
  76. package/styles/treeview/bds.css +1 -1
  77. package/styles/treeview/bootstrap-dark.css +1 -1
  78. package/styles/treeview/bootstrap.css +1 -1
  79. package/styles/treeview/bootstrap4.css +1 -1
  80. package/styles/treeview/bootstrap5-dark.css +1 -1
  81. package/styles/treeview/bootstrap5.3.css +1 -1
  82. package/styles/treeview/bootstrap5.css +1 -1
  83. package/styles/treeview/fabric-dark.css +1 -1
  84. package/styles/treeview/fabric.css +1 -1
  85. package/styles/treeview/fluent-dark.css +1 -1
  86. package/styles/treeview/fluent.css +1 -1
  87. package/styles/treeview/fluent2.css +1 -1
  88. package/styles/treeview/highcontrast-light.css +1 -1
  89. package/styles/treeview/highcontrast.css +1 -1
  90. package/styles/treeview/material-dark.css +1 -1
  91. package/styles/treeview/material.css +1 -1
  92. package/styles/treeview/material3-dark.css +1 -1
  93. package/styles/treeview/material3.css +1 -1
  94. package/styles/treeview/tailwind-dark.css +1 -1
  95. package/styles/treeview/tailwind.css +1 -1
  96. package/styles/treeview/tailwind3.css +1 -1
  97. package/dist/ts/accordion/accordion-model.d.ts +0 -285
  98. package/dist/ts/accordion/accordion.d.ts +0 -458
  99. package/dist/ts/accordion/accordion.ts +0 -1580
  100. package/dist/ts/accordion/index.d.ts +0 -5
  101. package/dist/ts/accordion/index.ts +0 -5
  102. package/dist/ts/appbar/appbar-model.d.ts +0 -76
  103. package/dist/ts/appbar/appbar.d.ts +0 -115
  104. package/dist/ts/appbar/appbar.ts +0 -281
  105. package/dist/ts/appbar/index.d.ts +0 -3
  106. package/dist/ts/appbar/index.ts +0 -3
  107. package/dist/ts/breadcrumb/breadcrumb-model.d.ts +0 -170
  108. package/dist/ts/breadcrumb/breadcrumb.d.ts +0 -297
  109. package/dist/ts/breadcrumb/breadcrumb.ts +0 -959
  110. package/dist/ts/breadcrumb/index.d.ts +0 -5
  111. package/dist/ts/breadcrumb/index.ts +0 -5
  112. package/dist/ts/carousel/carousel-model.d.ts +0 -282
  113. package/dist/ts/carousel/carousel.d.ts +0 -439
  114. package/dist/ts/carousel/carousel.ts +0 -1633
  115. package/dist/ts/carousel/index.d.ts +0 -3
  116. package/dist/ts/carousel/index.ts +0 -3
  117. package/dist/ts/common/h-scroll-model.d.ts +0 -16
  118. package/dist/ts/common/h-scroll.d.ts +0 -105
  119. package/dist/ts/common/h-scroll.ts +0 -481
  120. package/dist/ts/common/index.d.ts +0 -9
  121. package/dist/ts/common/index.ts +0 -10
  122. package/dist/ts/common/menu-base-model.d.ts +0 -308
  123. package/dist/ts/common/menu-base.d.ts +0 -558
  124. package/dist/ts/common/menu-base.ts +0 -2736
  125. package/dist/ts/common/menu-scroll.d.ts +0 -29
  126. package/dist/ts/common/menu-scroll.ts +0 -105
  127. package/dist/ts/common/v-scroll-model.d.ts +0 -16
  128. package/dist/ts/common/v-scroll.d.ts +0 -106
  129. package/dist/ts/common/v-scroll.ts +0 -454
  130. package/dist/ts/context-menu/context-menu-model.d.ts +0 -47
  131. package/dist/ts/context-menu/context-menu.d.ts +0 -102
  132. package/dist/ts/context-menu/context-menu.ts +0 -165
  133. package/dist/ts/context-menu/index.d.ts +0 -5
  134. package/dist/ts/context-menu/index.ts +0 -5
  135. package/dist/ts/index.d.ts +0 -16
  136. package/dist/ts/index.ts +0 -16
  137. package/dist/ts/menu/index.d.ts +0 -5
  138. package/dist/ts/menu/index.ts +0 -5
  139. package/dist/ts/menu/menu-model.d.ts +0 -70
  140. package/dist/ts/menu/menu.d.ts +0 -127
  141. package/dist/ts/menu/menu.ts +0 -313
  142. package/dist/ts/sidebar/index.d.ts +0 -5
  143. package/dist/ts/sidebar/index.ts +0 -5
  144. package/dist/ts/sidebar/sidebar-model.d.ts +0 -200
  145. package/dist/ts/sidebar/sidebar.d.ts +0 -336
  146. package/dist/ts/sidebar/sidebar.ts +0 -907
  147. package/dist/ts/stepper/index.d.ts +0 -3
  148. package/dist/ts/stepper/index.ts +0 -3
  149. package/dist/ts/stepper/stepper-model.d.ts +0 -159
  150. package/dist/ts/stepper/stepper.d.ts +0 -381
  151. package/dist/ts/stepper/stepper.ts +0 -1350
  152. package/dist/ts/stepper-base/index.d.ts +0 -5
  153. package/dist/ts/stepper-base/index.ts +0 -6
  154. package/dist/ts/stepper-base/stepper-base-model.d.ts +0 -124
  155. package/dist/ts/stepper-base/stepper-base.d.ts +0 -187
  156. package/dist/ts/stepper-base/stepper-base.ts +0 -290
  157. package/dist/ts/tab/index.d.ts +0 -5
  158. package/dist/ts/tab/index.ts +0 -5
  159. package/dist/ts/tab/tab-model.d.ts +0 -408
  160. package/dist/ts/tab/tab.d.ts +0 -715
  161. package/dist/ts/tab/tab.ts +0 -2842
  162. package/dist/ts/toolbar/index.d.ts +0 -5
  163. package/dist/ts/toolbar/index.ts +0 -5
  164. package/dist/ts/toolbar/toolbar-model.d.ts +0 -294
  165. package/dist/ts/toolbar/toolbar.d.ts +0 -541
  166. package/dist/ts/toolbar/toolbar.ts +0 -2646
  167. package/dist/ts/treeview/index.d.ts +0 -5
  168. package/dist/ts/treeview/index.ts +0 -5
  169. package/dist/ts/treeview/treeview-model.d.ts +0 -637
  170. package/dist/ts/treeview/treeview.d.ts +0 -1518
  171. package/dist/ts/treeview/treeview.ts +0 -6780
@@ -1,3 +0,0 @@
1
- /** Carousel export modules */
2
- export * from './carousel';
3
- export * from './carousel-model';
@@ -1,3 +0,0 @@
1
- /** Carousel export modules */
2
- export * from './carousel';
3
- export * from './carousel-model';
@@ -1,16 +0,0 @@
1
- import { Touch, ScrollEventArgs, TouchEventArgs, Component, EventHandler, selectAll, getUniqueID } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, Property, Browser, detach } from '@syncfusion/ej2-base';import { classList, SwipeEventArgs, isNullOrUndefined} from '@syncfusion/ej2-base';
2
- import {ComponentModel} from '@syncfusion/ej2-base';
3
-
4
- /**
5
- * Interface for a class HScroll
6
- */
7
- export interface HScrollModel extends ComponentModel{
8
-
9
- /**
10
- * Specifies the left or right scrolling distance of the horizontal scrollbar moving.
11
- *
12
- * @default null
13
- */
14
- scrollStep?: number;
15
-
16
- }
@@ -1,105 +0,0 @@
1
- import { Component } from '@syncfusion/ej2-base';
2
- import { INotifyPropertyChanged } from '@syncfusion/ej2-base';
3
- import { HScrollModel } from './h-scroll-model';
4
- /**
5
- * HScroll module is introduces horizontal scroller when content exceeds the current viewing area.
6
- * It can be useful for the components like Toolbar, Tab which needs horizontal scrolling alone.
7
- * Hidden content can be view by touch moving or icon click.
8
- * ```html
9
- * <div id="scroll"/>
10
- * <script>
11
- * var scrollObj = new HScroll();
12
- * scrollObj.appendTo("#scroll");
13
- * </script>
14
- * ```
15
- */
16
- export declare class HScroll extends Component<HTMLElement> implements INotifyPropertyChanged {
17
- private isDevice;
18
- private touchModule;
19
- private scrollEle;
20
- private scrollItems;
21
- private uniqueId;
22
- private timeout;
23
- private keyTimeout;
24
- private keyTimer;
25
- private browser;
26
- private browserCheck;
27
- private ieCheck;
28
- private customStep;
29
- /**
30
- * Specifies the left or right scrolling distance of the horizontal scrollbar moving.
31
- *
32
- * @default null
33
- */
34
- scrollStep: number;
35
- /**
36
- * Initialize the event handler
37
- *
38
- * @private
39
- * @returns {void}
40
- */
41
- protected preRender(): void;
42
- /**
43
- * To Initialize the horizontal scroll rendering
44
- *
45
- * @private
46
- * @returns {void}
47
- */
48
- protected render(): void;
49
- private setScrollState;
50
- /**
51
- * Initializes a new instance of the HScroll class.
52
- *
53
- * @param {HScrollModel} options - Specifies HScroll model properties as options.
54
- * @param {string | HTMLElement} element - Specifies the element for which horizontal scrolling applies.
55
- */
56
- constructor(options?: HScrollModel, element?: string | HTMLElement);
57
- private initialize;
58
- protected getPersistData(): string;
59
- /**
60
- * Returns the current module name.
61
- *
62
- * @returns {string} - It returns the current module name.
63
- * @private
64
- */
65
- protected getModuleName(): string;
66
- /**
67
- * Removes the control from the DOM and also removes all its related events.
68
- *
69
- * @returns {void}
70
- */
71
- destroy(): void;
72
- /**
73
- * Specifies the value to disable/enable the HScroll component.
74
- * When set to `true` , the component will be disabled.
75
- *
76
- * @param {boolean} value - Based on this Boolean value, HScroll will be enabled (false) or disabled (true).
77
- * @returns {void}.
78
- */
79
- disable(value: boolean): void;
80
- private createOverlay;
81
- private createNavIcon;
82
- private onKeyPress;
83
- private onKeyUp;
84
- private eventBinding;
85
- private repeatScroll;
86
- private tabHoldHandler;
87
- private contains;
88
- private eleScrolling;
89
- private clickEventHandler;
90
- private swipeHandler;
91
- private scrollUpdating;
92
- private frameScrollRequest;
93
- private touchHandler;
94
- private arrowDisabling;
95
- private scrollHandler;
96
- /**
97
- * Gets called when the model property changes.The data that describes the old and new values of property that changed.
98
- *
99
- * @param {HScrollModel} newProp - It contains the new value of data.
100
- * @param {HScrollModel} oldProp - It contains the old value of data.
101
- * @returns {void}
102
- * @private
103
- */
104
- onPropertyChanged(newProp: HScrollModel, oldProp: HScrollModel): void;
105
- }
@@ -1,481 +0,0 @@
1
- import { Touch, ScrollEventArgs, TouchEventArgs, Component, EventHandler, selectAll, getUniqueID } from '@syncfusion/ej2-base';
2
- import { NotifyPropertyChanges, INotifyPropertyChanged, Property, Browser, detach } from '@syncfusion/ej2-base';
3
- import { classList, SwipeEventArgs, isNullOrUndefined} from '@syncfusion/ej2-base';
4
- import { HScrollModel } from './h-scroll-model';
5
-
6
- type HTEle = HTMLElement;
7
-
8
- const CLS_ROOT: string = 'e-hscroll';
9
- const CLS_RTL: string = 'e-rtl';
10
- const CLS_DISABLE: string = 'e-overlay';
11
- const CLS_HSCROLLBAR: string = 'e-hscroll-bar';
12
- const CLS_HSCROLLCON: string = 'e-hscroll-content';
13
- const CLS_NAVARROW: string = 'e-nav-arrow';
14
- const CLS_NAVRIGHTARROW: string = 'e-nav-right-arrow';
15
- const CLS_NAVLEFTARROW: string = 'e-nav-left-arrow';
16
- const CLS_HSCROLLNAV: string = 'e-scroll-nav';
17
- const CLS_HSCROLLNAVRIGHT: string = 'e-scroll-right-nav';
18
- const CLS_HSCROLLNAVLEFT: string = 'e-scroll-left-nav';
19
- const CLS_DEVICE: string = 'e-scroll-device';
20
- const CLS_OVERLAY: string = 'e-scroll-overlay';
21
- const CLS_RIGHTOVERLAY: string = 'e-scroll-right-overlay';
22
- const CLS_LEFTOVERLAY: string = 'e-scroll-left-overlay';
23
- const OVERLAY_MAXWID: number = 40;
24
-
25
- interface TapEventArgs {
26
- name: string
27
- originalEvent: TouchEventArgs | TouchEvent | KeyboardEvent
28
- }
29
- /**
30
- * HScroll module is introduces horizontal scroller when content exceeds the current viewing area.
31
- * It can be useful for the components like Toolbar, Tab which needs horizontal scrolling alone.
32
- * Hidden content can be view by touch moving or icon click.
33
- * ```html
34
- * <div id="scroll"/>
35
- * <script>
36
- * var scrollObj = new HScroll();
37
- * scrollObj.appendTo("#scroll");
38
- * </script>
39
- * ```
40
- */
41
- @NotifyPropertyChanges
42
- export class HScroll extends Component<HTMLElement> implements INotifyPropertyChanged {
43
- /* eslint-disable */
44
- private isDevice: Boolean;
45
- private touchModule: Touch;
46
- private scrollEle: HTEle;
47
- private scrollItems: HTEle;
48
- private uniqueId: boolean;
49
- private timeout: number;
50
- private keyTimeout: boolean;
51
- private keyTimer: number;
52
- private browser: string;
53
- private browserCheck: boolean;
54
- private ieCheck: boolean;
55
- private customStep: boolean;
56
-
57
- /**
58
- * Specifies the left or right scrolling distance of the horizontal scrollbar moving.
59
- *
60
- * @default null
61
- */
62
- @Property(null)
63
- public scrollStep: number;
64
- /**
65
- * Initialize the event handler
66
- *
67
- * @private
68
- * @returns {void}
69
- */
70
- protected preRender(): void {
71
- this.browser = Browser.info.name;
72
- this.browserCheck = this.browser === 'mozilla';
73
- this.isDevice = Browser.isDevice;
74
- this.customStep = true;
75
- const element: HTEle = this.element;
76
- this.ieCheck = this.browser === 'edge' || this.browser === 'msie';
77
- this.initialize();
78
- if (element.id === '') {
79
- element.id = getUniqueID('hscroll');
80
- this.uniqueId = true;
81
- }
82
- element.style.display = 'block';
83
- if (this.enableRtl) {
84
- element.classList.add(CLS_RTL);
85
- }
86
- }
87
- /**
88
- * To Initialize the horizontal scroll rendering
89
- *
90
- * @private
91
- * @returns {void}
92
- */
93
- protected render(): void {
94
- this.touchModule = new Touch(this.element, { scroll: this.touchHandler.bind(this), swipe: this.swipeHandler.bind(this) });
95
- EventHandler.add(this.scrollEle, 'scroll', this.scrollHandler, this);
96
- if ( !this.isDevice) {
97
- this.createNavIcon(this.element);
98
- } else {
99
- this.element.classList.add(CLS_DEVICE);
100
- this.createOverlay(this.element);
101
- }
102
- this.setScrollState();
103
- }
104
- private setScrollState(): void {
105
- if (isNullOrUndefined(this.scrollStep) || this.scrollStep < 0) {
106
- this.scrollStep = this.scrollEle.offsetWidth;
107
- this.customStep = false;
108
- } else {
109
- this.customStep = true;
110
- }
111
- }
112
- /**
113
- * Initializes a new instance of the HScroll class.
114
- *
115
- * @param {HScrollModel} options - Specifies HScroll model properties as options.
116
- * @param {string | HTMLElement} element - Specifies the element for which horizontal scrolling applies.
117
- */
118
- public constructor(options?: HScrollModel, element?: string | HTMLElement) {
119
- super(options, <HTEle | string>element);
120
- }
121
- private initialize(): void {
122
- const scrollEle: HTEle = this.createElement('div', { className: CLS_HSCROLLCON });
123
- const scrollDiv: HTEle = this.createElement('div', { className: CLS_HSCROLLBAR });
124
- scrollDiv.setAttribute('tabindex', '-1');
125
- const ele: HTEle = this.element;
126
- const innerEle: HTEle[] = [].slice.call(ele.children);
127
- for (const ele of innerEle) {
128
- scrollEle.appendChild(ele);
129
- }
130
- scrollDiv.appendChild(scrollEle);
131
- ele.appendChild(scrollDiv);
132
- scrollDiv.style.overflowX = 'hidden';
133
- this.scrollEle = scrollDiv;
134
- this.scrollItems = scrollEle;
135
- }
136
- protected getPersistData(): string {
137
- const keyEntity: string[] = ['scrollStep'];
138
- return this.addOnPersist(keyEntity);
139
- }
140
- /**
141
- * Returns the current module name.
142
- *
143
- * @returns {string} - It returns the current module name.
144
- * @private
145
- */
146
- protected getModuleName(): string {
147
- return 'hScroll';
148
- }
149
- /**
150
- * Removes the control from the DOM and also removes all its related events.
151
- *
152
- * @returns {void}
153
- */
154
- public destroy(): void {
155
- const ele: HTEle = this.element;
156
- ele.style.display = '';
157
- ele.classList.remove(CLS_ROOT);
158
- ele.classList.remove(CLS_DEVICE);
159
- ele.classList.remove(CLS_RTL);
160
- const nav: HTEle[] = selectAll('.e-' + ele.id + '_nav.' + CLS_HSCROLLNAV, ele);
161
- const overlay: HTEle[] = selectAll('.' + CLS_OVERLAY, ele);
162
- [].slice.call(overlay).forEach((ele: HTEle) => {
163
- detach(ele);
164
- });
165
- for (const elem of [].slice.call(this.scrollItems.children)) {
166
- ele.appendChild(elem);
167
- }
168
- if (this.uniqueId) {
169
- this.element.removeAttribute('id');
170
- }
171
- detach(this.scrollEle);
172
- if (nav.length > 0) {
173
- detach(nav[0]);
174
- if (!isNullOrUndefined(nav[1])) {
175
- detach(nav[1]);
176
- }
177
- }
178
- EventHandler.remove(this.scrollEle, 'scroll', this.scrollHandler);
179
- this.touchModule.destroy();
180
- this.touchModule = null;
181
- super.destroy();
182
- }
183
- /**
184
- * Specifies the value to disable/enable the HScroll component.
185
- * When set to `true` , the component will be disabled.
186
- *
187
- * @param {boolean} value - Based on this Boolean value, HScroll will be enabled (false) or disabled (true).
188
- * @returns {void}.
189
- */
190
- public disable(value: boolean): void {
191
- const navEles: HTMLElement[] = selectAll('.e-scroll-nav:not(.' + CLS_DISABLE + ')', this.element );
192
- if (value) {
193
- this.element.classList.add(CLS_DISABLE);
194
- } else {
195
- this.element.classList.remove(CLS_DISABLE);
196
- }
197
- [].slice.call(navEles).forEach((el: HTMLElement) => {
198
- el.setAttribute('tabindex', !value ? '0' : '-1');
199
- });
200
- }
201
- private createOverlay(element: HTEle): void {
202
- const id: string = element.id.concat('_nav');
203
- const rightOverlayEle: HTEle = this.createElement('div', {className: CLS_OVERLAY + ' ' + CLS_RIGHTOVERLAY});
204
- const clsRight: string = 'e-' + element.id.concat('_nav ' + CLS_HSCROLLNAV + ' ' + CLS_HSCROLLNAVRIGHT);
205
- const rightEle: HTEle = this.createElement('div', { id: id.concat('_right'), className: clsRight });
206
- const navItem: HTEle = this.createElement('div', { className: CLS_NAVRIGHTARROW + ' ' + CLS_NAVARROW + ' e-icons' });
207
- rightEle.appendChild(navItem);
208
- const leftEle: HTEle = this.createElement('div', {className: CLS_OVERLAY + ' ' + CLS_LEFTOVERLAY});
209
- if (this.ieCheck ) {
210
- rightEle.classList.add('e-ie-align');
211
- }
212
- element.appendChild(rightOverlayEle);
213
- element.appendChild(rightEle);
214
- element.insertBefore(leftEle, element.firstChild);
215
- this.eventBinding([rightEle]);
216
- }
217
- private createNavIcon(element: HTEle): void {
218
- const id: string = element.id.concat('_nav');
219
- const clsRight: string = 'e-' + element.id.concat('_nav ' + CLS_HSCROLLNAV + ' ' + CLS_HSCROLLNAVRIGHT);
220
- const rightAttributes: { [key: string]: string; } = { 'role': 'button', 'id': id.concat('_right'), 'aria-label': 'Scroll right' };
221
- const nav: HTEle = this.createElement('div', { className: clsRight, attrs: rightAttributes });
222
- nav.setAttribute('aria-disabled', 'false');
223
- const navItem: HTEle = this.createElement('div', { className: CLS_NAVRIGHTARROW + ' ' + CLS_NAVARROW + ' e-icons' });
224
- const clsLeft: string = 'e-' + element.id.concat('_nav ' + CLS_HSCROLLNAV + ' ' + CLS_HSCROLLNAVLEFT);
225
- const leftAttributes: { [key: string]: string; } = { 'role': 'button', 'id': id.concat('_left'), 'aria-label': 'Scroll left' };
226
- const navEle: HTEle = this.createElement('div', { className: clsLeft + ' ' + CLS_DISABLE, attrs: leftAttributes });
227
- navEle.setAttribute('aria-disabled', 'true');
228
- const navLeftItem: HTEle = this.createElement('div', { className: CLS_NAVLEFTARROW + ' ' + CLS_NAVARROW + ' e-icons' });
229
- navEle.appendChild(navLeftItem);
230
- nav.appendChild(navItem);
231
- element.appendChild(nav);
232
- element.insertBefore(navEle, element.firstChild);
233
- if (this.ieCheck ) {
234
- nav.classList.add('e-ie-align');
235
- navEle.classList.add('e-ie-align');
236
- }
237
- this.eventBinding([nav, navEle]);
238
- }
239
- private onKeyPress(e: KeyboardEvent): void {
240
- if (e.key === 'Enter') {
241
- const timeoutFun: () => void = () => {
242
- this.keyTimeout = true;
243
- this.eleScrolling(10, <HTEle>e.target, true);
244
- };
245
- this.keyTimer = window.setTimeout(
246
- () => {
247
- timeoutFun();
248
- }, 100);
249
- }
250
- }
251
- private onKeyUp(e: KeyboardEvent): void {
252
- if (e.key !== 'Enter') {
253
- return;
254
- }
255
- if (this.keyTimeout) {
256
- this.keyTimeout = false;
257
- } else {
258
- (<HTEle>e.target).click();
259
- }
260
- clearTimeout(this.keyTimer);
261
- }
262
- private eventBinding(ele: HTEle[]): void {
263
- [].slice.call(ele).forEach((el: HTEle) => {
264
- new Touch(el, {tapHold: this.tabHoldHandler.bind(this), tapHoldThreshold: 500 });
265
- el.addEventListener('keydown' , this.onKeyPress.bind(this));
266
- el.addEventListener('keyup', this.onKeyUp.bind(this));
267
- el.addEventListener('mouseup', this.repeatScroll.bind(this));
268
- el.addEventListener('touchend', this.repeatScroll.bind(this));
269
- el.addEventListener('contextmenu', (e: Event) => {
270
- e.preventDefault();
271
- });
272
- EventHandler.add(el, 'click', this.clickEventHandler, this);
273
- });
274
- }
275
- private repeatScroll(): void {
276
- clearInterval (this.timeout);
277
- }
278
- private tabHoldHandler(e: TapEventArgs): void {
279
- let trgt: HTEle = e.originalEvent.target as HTEle;
280
- trgt = this.contains(trgt, CLS_HSCROLLNAV) ? <HTEle>trgt.firstElementChild : trgt;
281
- const scrollDis: number = 10;
282
- const timeoutFun: () => void = () => {
283
- this.eleScrolling(scrollDis, trgt, true);
284
- };
285
- this.timeout = window.setInterval(
286
- () => {
287
- timeoutFun();
288
- }, 50);
289
- }
290
- private contains(ele: HTEle, className: string): boolean {
291
- return ele.classList.contains(className);
292
- }
293
- private eleScrolling(scrollDis: number, trgt: HTEle, isContinuous: boolean ): void {
294
- const rootEle: HTEle = this.element;
295
- let classList: DOMTokenList = trgt.classList;
296
- if (classList.contains(CLS_HSCROLLNAV)) {
297
- classList = trgt.querySelector('.' + CLS_NAVARROW).classList;
298
- }
299
- if (this.contains(rootEle, CLS_RTL) && this.browserCheck) {
300
- scrollDis = - scrollDis;
301
- }
302
- if ((!this.contains(rootEle, CLS_RTL) || this.browserCheck) || this.ieCheck) {
303
- if (classList.contains(CLS_NAVRIGHTARROW)) {
304
- this.frameScrollRequest(scrollDis, 'add', isContinuous);
305
- } else {
306
- this.frameScrollRequest(scrollDis, '', isContinuous);
307
- }
308
- } else {
309
- if (classList.contains(CLS_NAVLEFTARROW)) {
310
- this.frameScrollRequest(scrollDis, 'add', isContinuous);
311
- } else {
312
- this.frameScrollRequest(scrollDis, '', isContinuous);
313
- }
314
- }
315
- }
316
- private clickEventHandler(e: Event): void {
317
- this.eleScrolling(this.scrollStep , <HTEle>e.target, false);
318
- }
319
-
320
- private swipeHandler(e: SwipeEventArgs): void {
321
- const swipeEle: HTEle = this.scrollEle;
322
- let distance: number;
323
- if (e.velocity <= 1) {
324
- distance = e.distanceX / (e.velocity * 10);
325
- } else {
326
- distance = e.distanceX / e.velocity;
327
- }
328
- let start: number = 0.5;
329
- const animate: () => void = () => {
330
- const step: number = Math.sin(start);
331
- if (step <= 0) {
332
- window.cancelAnimationFrame(step);
333
- } else {
334
- if (e.swipeDirection === 'Left') {
335
- swipeEle.scrollLeft += distance * step;
336
- } else if (e.swipeDirection === 'Right') {
337
- swipeEle.scrollLeft -= distance * step;
338
- }
339
- start -= 0.5;
340
- window.requestAnimationFrame(animate as FrameRequestCallback);
341
- }
342
- };
343
- animate();
344
- }
345
-
346
- private scrollUpdating(scrollVal: number, action: string): void {
347
- if (action === 'add') {
348
- this.scrollEle.scrollLeft += scrollVal;
349
- } else {
350
- this.scrollEle.scrollLeft -= scrollVal;
351
- }
352
- if (this.enableRtl && this.scrollEle.scrollLeft > 0) {
353
- this.scrollEle.scrollLeft = 0;
354
- }
355
- }
356
-
357
- private frameScrollRequest(scrollVal: number, action: string, isContinuous: boolean): void {
358
- const step: number = 10;
359
- if (isContinuous) {
360
- this.scrollUpdating(scrollVal, action);
361
- return;
362
- }
363
- if (!this.customStep) {
364
- [].slice.call(selectAll('.' + CLS_OVERLAY, this.element)).forEach((el: HTMLElement) => {
365
- scrollVal -= el.offsetWidth;
366
- });
367
- }
368
- const animate: () => void = () => {
369
- let scrollValue: number;
370
- let scrollStep: number;
371
- if (this.contains(this.element, CLS_RTL) && this.browserCheck) {
372
- scrollValue = - scrollVal;
373
- scrollStep = - step;
374
- } else {
375
- scrollValue = scrollVal;
376
- scrollStep = step;
377
- }
378
- if (scrollValue < step) {
379
- window.cancelAnimationFrame(scrollStep);
380
- } else {
381
- this.scrollUpdating(scrollStep, action);
382
- scrollVal -= scrollStep;
383
- window.requestAnimationFrame(animate as FrameRequestCallback);
384
- }
385
- };
386
- animate();
387
- }
388
-
389
- private touchHandler(e: ScrollEventArgs): void {
390
- const ele: HTEle = this.scrollEle;
391
- let distance: number = e.distanceX;
392
- if ((this.ieCheck) && this.contains(this.element, CLS_RTL)) {
393
- distance = - distance;
394
- }
395
- if (e.scrollDirection === 'Left') {
396
- ele.scrollLeft = ele.scrollLeft + distance;
397
- } else if (e.scrollDirection === 'Right') {
398
- ele.scrollLeft = ele.scrollLeft - distance;
399
- }
400
- }
401
- private arrowDisabling(addDisable: HTEle, removeDisable: HTEle): void {
402
- if (this.isDevice) {
403
- const arrowEle: HTMLElement = isNullOrUndefined(addDisable) ? removeDisable : addDisable;
404
- const arrowIcon: HTMLElement = arrowEle.querySelector('.' + CLS_NAVARROW) as HTMLElement;
405
- if (isNullOrUndefined(addDisable)) {
406
- classList(arrowIcon, [CLS_NAVRIGHTARROW], [CLS_NAVLEFTARROW]);
407
- } else {
408
- classList(arrowIcon, [CLS_NAVLEFTARROW], [CLS_NAVRIGHTARROW]);
409
- }
410
- } else if (addDisable && removeDisable) {
411
- addDisable.classList.add(CLS_DISABLE);
412
- addDisable.setAttribute('aria-disabled' , 'true');
413
- addDisable.removeAttribute('tabindex');
414
- removeDisable.classList.remove(CLS_DISABLE);
415
- removeDisable.setAttribute('aria-disabled' , 'false');
416
- removeDisable.setAttribute('tabindex', '0');
417
- }
418
- this.repeatScroll();
419
- }
420
- private scrollHandler(e: Event): void {
421
- const target: HTEle = <HTEle>e.target;
422
- const width: number = target.offsetWidth;
423
- const rootEle: HTEle = this.element;
424
- const navLeftEle: HTEle = (<HTEle>this.element.querySelector('.' + CLS_HSCROLLNAVLEFT));
425
- const navRightEle: HTEle = (<HTEle>this.element.querySelector('.' + CLS_HSCROLLNAVRIGHT));
426
- let leftOverlay: HTEle = (<HTEle>this.element.querySelector('.' + CLS_LEFTOVERLAY));
427
- let rightOverlay: HTEle = (<HTEle>this.element.querySelector('.' + CLS_RIGHTOVERLAY));
428
- let scrollLeft: number = target.scrollLeft;
429
- if (scrollLeft <= 0) {
430
- scrollLeft = -scrollLeft;
431
- }
432
- if (this.isDevice) {
433
- if (this.enableRtl && !(this.browserCheck || this.ieCheck)) {
434
- leftOverlay = (<HTEle>this.element.querySelector('.' + CLS_RIGHTOVERLAY));
435
- rightOverlay = (<HTEle>this.element.querySelector('.' + CLS_LEFTOVERLAY));
436
- }
437
- if (scrollLeft < OVERLAY_MAXWID) {
438
- leftOverlay.style.width = scrollLeft + 'px';
439
- } else {
440
- leftOverlay.style.width = '40px';
441
- }
442
- if (( target.scrollWidth - Math.ceil(width + scrollLeft)) < OVERLAY_MAXWID ) {
443
- rightOverlay.style.width = ( target.scrollWidth - Math.ceil(width + scrollLeft)) + 'px';
444
- } else {
445
- rightOverlay.style.width = '40px';
446
- }
447
- }
448
- if (scrollLeft === 0) {
449
- this.arrowDisabling(navLeftEle, navRightEle);
450
- } else if (Math.ceil(width + scrollLeft + .1) >= target.scrollWidth) {
451
- this.arrowDisabling(navRightEle, navLeftEle);
452
- } else {
453
- const disEle: HTEle = <HTEle>this.element.querySelector('.' + CLS_HSCROLLNAV + '.' + CLS_DISABLE);
454
- if (disEle) {
455
- disEle.classList.remove(CLS_DISABLE);
456
- disEle.setAttribute('aria-disabled', 'false');
457
- disEle.setAttribute('tabindex', '0');
458
- }
459
- }
460
- }
461
- /**
462
- * Gets called when the model property changes.The data that describes the old and new values of property that changed.
463
- *
464
- * @param {HScrollModel} newProp - It contains the new value of data.
465
- * @param {HScrollModel} oldProp - It contains the old value of data.
466
- * @returns {void}
467
- * @private
468
- */
469
- public onPropertyChanged(newProp: HScrollModel, oldProp: HScrollModel): void {
470
- for (const prop of Object.keys(newProp)) {
471
- switch (prop) {
472
- case 'scrollStep':
473
- this.setScrollState();
474
- break;
475
- case 'enableRtl':
476
- newProp.enableRtl ? this.element.classList.add(CLS_RTL) : this.element.classList.remove(CLS_RTL);
477
- break;
478
- }
479
- }
480
- }
481
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Navigation Common modules
3
- */
4
- export * from './h-scroll';
5
- export * from './v-scroll';
6
- export * from './menu-scroll';
7
- export { MenuEventArgs, OpenCloseMenuEventArgs, BeforeOpenCloseMenuEventArgs, MenuAnimationSettings, MenuEffect } from './menu-base';
8
- export { MenuItem, FieldSettings } from './menu-base';
9
- export { MenuItemModel, FieldSettingsModel, MenuAnimationSettingsModel } from './menu-base-model';
@@ -1,10 +0,0 @@
1
- /**
2
- * Navigation Common modules
3
- */
4
-
5
- export * from './h-scroll';
6
- export * from './v-scroll';
7
- export * from './menu-scroll';
8
- export { MenuEventArgs, OpenCloseMenuEventArgs, BeforeOpenCloseMenuEventArgs, MenuAnimationSettings, MenuEffect } from './menu-base';
9
- export { MenuItem, FieldSettings } from './menu-base';
10
- export { MenuItemModel, FieldSettingsModel, MenuAnimationSettingsModel } from './menu-base-model';