@syncfusion/ej2-navigations 27.2.5 → 28.1.35
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.
- package/README.md +2 -2
- package/dist/ej2-navigations.min.js +3 -3
- package/dist/ej2-navigations.umd.min.js +3 -3
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +535 -341
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +555 -355
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +3 -3
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +12 -12
- package/src/accordion/accordion.d.ts +7 -0
- package/src/accordion/accordion.js +52 -45
- package/src/carousel/carousel-model.d.ts +12 -0
- package/src/carousel/carousel.d.ts +11 -0
- package/src/carousel/carousel.js +25 -4
- package/src/common/menu-base-model.d.ts +7 -0
- package/src/common/menu-base.d.ts +7 -0
- package/src/common/menu-base.js +80 -19
- package/src/context-menu/context-menu-model.d.ts +15 -0
- package/src/context-menu/context-menu.d.ts +13 -0
- package/src/context-menu/context-menu.js +10 -0
- package/src/menu/menu.js +4 -0
- package/src/stepper/stepper.d.ts +9 -0
- package/src/stepper/stepper.js +262 -237
- package/src/stepper-base/stepper-base.js +15 -11
- package/src/tab/tab-model.d.ts +15 -2
- package/src/tab/tab.d.ts +26 -2
- package/src/tab/tab.js +81 -14
- package/src/toolbar/toolbar-model.d.ts +0 -6
- package/src/toolbar/toolbar.d.ts +0 -6
- package/src/treeview/treeview.d.ts +1 -9
- package/src/treeview/treeview.js +17 -16
- package/styles/accordion/_tailwind3-definition.scss +168 -0
- package/styles/accordion/_theme.scss +2 -2
- package/styles/accordion/bds.css +544 -0
- package/styles/accordion/bds.scss +5 -0
- package/styles/accordion/icons/_tailwind3.scss +15 -0
- package/styles/accordion/tailwind3.css +552 -0
- package/styles/accordion/tailwind3.scss +5 -0
- package/styles/appbar/_layout.scss +1 -1
- package/styles/appbar/_tailwind3-definition.scss +6 -0
- package/styles/appbar/bds.css +302 -0
- package/styles/appbar/bds.scss +4 -0
- package/styles/appbar/tailwind3.css +285 -0
- package/styles/appbar/tailwind3.scss +4 -0
- package/styles/bds-lite.css +9233 -0
- package/styles/bds-lite.scss +47 -0
- package/styles/bds.css +11954 -0
- package/styles/bds.scss +59 -0
- package/styles/bootstrap-dark-lite.css +21 -13
- package/styles/bootstrap-dark.css +35 -14
- package/styles/bootstrap-lite.css +21 -13
- package/styles/bootstrap.css +35 -14
- package/styles/bootstrap4-lite.css +21 -13
- package/styles/bootstrap4.css +35 -14
- package/styles/bootstrap5-dark-lite.css +29 -21
- package/styles/bootstrap5-dark.css +43 -22
- package/styles/bootstrap5-lite.css +29 -21
- package/styles/bootstrap5.3-lite.css +21 -13
- package/styles/bootstrap5.3.css +35 -14
- package/styles/bootstrap5.css +43 -22
- package/styles/breadcrumb/_bigger.scss +6 -0
- package/styles/breadcrumb/_layout.scss +19 -1
- package/styles/breadcrumb/_tailwind3-definition.scss +61 -0
- package/styles/breadcrumb/_theme.scss +60 -0
- package/styles/breadcrumb/bds.css +418 -0
- package/styles/breadcrumb/bds.scss +5 -0
- package/styles/breadcrumb/icons/_tailwind3.scss +23 -0
- package/styles/breadcrumb/tailwind3.css +441 -0
- package/styles/breadcrumb/tailwind3.scss +5 -0
- package/styles/carousel/_tailwind3-definition.scss +24 -0
- package/styles/carousel/_theme.scss +9 -3
- package/styles/carousel/bds.css +426 -0
- package/styles/carousel/bds.scss +5 -0
- package/styles/carousel/fluent2.css +5 -0
- package/styles/carousel/icons/_tailwind3.scss +30 -0
- package/styles/carousel/tailwind3.css +396 -0
- package/styles/carousel/tailwind3.scss +5 -0
- package/styles/context-menu/_bigger.scss +15 -0
- package/styles/context-menu/_layout.scss +24 -0
- package/styles/context-menu/_tailwind3-definition.scss +55 -0
- package/styles/context-menu/bds.css +421 -0
- package/styles/context-menu/bds.scss +8 -0
- package/styles/context-menu/fluent2.css +1 -1
- package/styles/context-menu/icons/_tailwind3.scss +31 -0
- package/styles/context-menu/tailwind3.css +449 -0
- package/styles/context-menu/tailwind3.scss +8 -0
- package/styles/fabric-dark-lite.css +21 -13
- package/styles/fabric-dark.css +35 -14
- package/styles/fabric-lite.css +21 -13
- package/styles/fabric.css +35 -14
- package/styles/fluent-dark-lite.css +22 -14
- package/styles/fluent-dark.css +36 -15
- package/styles/fluent-lite.css +22 -14
- package/styles/fluent.css +36 -15
- package/styles/fluent2-lite.css +37 -21
- package/styles/fluent2.css +51 -22
- package/styles/h-scroll/_tailwind3-definition.scss +83 -0
- package/styles/h-scroll/bds.css +311 -0
- package/styles/h-scroll/bds.scss +5 -0
- package/styles/h-scroll/icons/_tailwind3.scss +49 -0
- package/styles/h-scroll/tailwind3.css +311 -0
- package/styles/h-scroll/tailwind3.scss +5 -0
- package/styles/highcontrast-light-lite.css +21 -13
- package/styles/highcontrast-light.css +35 -14
- package/styles/highcontrast-lite.css +24 -16
- package/styles/highcontrast.css +38 -17
- package/styles/material-dark-lite.css +21 -13
- package/styles/material-dark.css +35 -14
- package/styles/material-lite.css +21 -13
- package/styles/material.css +35 -14
- package/styles/material3-dark-lite.css +21 -13
- package/styles/material3-dark.css +38 -14
- package/styles/material3-lite.css +21 -13
- package/styles/material3.css +38 -14
- package/styles/menu/_bigger.scss +26 -0
- package/styles/menu/_layout.scss +35 -0
- package/styles/menu/_tailwind3-definition.scss +66 -0
- package/styles/menu/_theme.scss +33 -1
- package/styles/menu/bds.css +1155 -0
- package/styles/menu/bds.scss +9 -0
- package/styles/menu/fluent2.css +1 -1
- package/styles/menu/icons/_tailwind3.scss +104 -0
- package/styles/menu/tailwind3.css +1238 -0
- package/styles/menu/tailwind3.scss +9 -0
- package/styles/pager/_bigger.scss +65 -6
- package/styles/pager/_layout.scss +22 -2
- package/styles/pager/_tailwind-definition.scss +1 -1
- package/styles/pager/_tailwind3-definition.scss +166 -0
- package/styles/pager/bds.css +915 -0
- package/styles/pager/bds.scss +5 -0
- package/styles/pager/bootstrap-dark.css +7 -0
- package/styles/pager/bootstrap.css +7 -0
- package/styles/pager/bootstrap4.css +7 -0
- package/styles/pager/bootstrap5-dark.css +7 -0
- package/styles/pager/bootstrap5.3.css +7 -0
- package/styles/pager/bootstrap5.css +7 -0
- package/styles/pager/fabric-dark.css +7 -0
- package/styles/pager/fabric.css +7 -0
- package/styles/pager/fluent-dark.css +7 -0
- package/styles/pager/fluent.css +7 -0
- package/styles/pager/fluent2.css +7 -0
- package/styles/pager/highcontrast-light.css +7 -0
- package/styles/pager/highcontrast.css +7 -0
- package/styles/pager/icons/_tailwind3.scss +50 -0
- package/styles/pager/material-dark.css +7 -0
- package/styles/pager/material.css +7 -0
- package/styles/pager/material3-dark.css +8 -0
- package/styles/pager/material3.css +8 -0
- package/styles/pager/tailwind-dark.css +16 -9
- package/styles/pager/tailwind.css +16 -9
- package/styles/pager/tailwind3.css +875 -0
- package/styles/pager/tailwind3.scss +5 -0
- package/styles/sidebar/_tailwind3-definition.scss +6 -0
- package/styles/sidebar/_theme.scss +1 -1
- package/styles/sidebar/bds.css +263 -0
- package/styles/sidebar/bds.scss +3 -0
- package/styles/sidebar/tailwind3.css +227 -0
- package/styles/sidebar/tailwind3.scss +3 -0
- package/styles/stepper/_layout.scss +2 -0
- package/styles/stepper/_tailwind3-definition.scss +72 -0
- package/styles/stepper/_theme.scss +2 -1
- package/styles/stepper/bds.css +724 -0
- package/styles/stepper/bds.scss +6 -0
- package/styles/stepper/bootstrap-dark.css +4 -1
- package/styles/stepper/bootstrap.css +4 -1
- package/styles/stepper/bootstrap4.css +4 -1
- package/styles/stepper/bootstrap5-dark.css +4 -1
- package/styles/stepper/bootstrap5.3.css +4 -1
- package/styles/stepper/bootstrap5.css +4 -1
- package/styles/stepper/fabric-dark.css +4 -1
- package/styles/stepper/fabric.css +4 -1
- package/styles/stepper/fluent-dark.css +4 -1
- package/styles/stepper/fluent.css +4 -1
- package/styles/stepper/fluent2.css +4 -1
- package/styles/stepper/highcontrast-light.css +4 -1
- package/styles/stepper/highcontrast.css +4 -1
- package/styles/stepper/icons/_tailwind3.scss +5 -0
- package/styles/stepper/material-dark.css +4 -1
- package/styles/stepper/material.css +4 -1
- package/styles/stepper/material3-dark.css +4 -1
- package/styles/stepper/material3.css +4 -1
- package/styles/stepper/tailwind-dark.css +4 -1
- package/styles/stepper/tailwind.css +4 -1
- package/styles/stepper/tailwind3.css +724 -0
- package/styles/stepper/tailwind3.scss +6 -0
- package/styles/tab/_bigger.scss +16 -0
- package/styles/tab/_bootstrap-dark-definition.scss +0 -2
- package/styles/tab/_bootstrap-definition.scss +0 -2
- package/styles/tab/_bootstrap4-definition.scss +0 -2
- package/styles/tab/_bootstrap5-definition.scss +0 -2
- package/styles/tab/_bootstrap5.3-definition.scss +0 -2
- package/styles/tab/_fabric-dark-definition.scss +0 -2
- package/styles/tab/_fabric-definition.scss +0 -2
- package/styles/tab/_fluent-definition.scss +0 -2
- package/styles/tab/_fluent2-definition.scss +0 -2
- package/styles/tab/_fusionnew-definition.scss +0 -2
- package/styles/tab/_highcontrast-definition.scss +0 -2
- package/styles/tab/_highcontrast-light-definition.scss +0 -2
- package/styles/tab/_material-dark-definition.scss +0 -2
- package/styles/tab/_material-definition.scss +0 -2
- package/styles/tab/_material3-definition.scss +0 -2
- package/styles/tab/_tailwind-definition.scss +0 -2
- package/styles/tab/_tailwind3-definition.scss +634 -0
- package/styles/tab/_theme.scss +0 -12
- package/styles/tab/bds.css +4190 -0
- package/styles/tab/bds.scss +6 -0
- package/styles/tab/bootstrap-dark.css +7 -11
- package/styles/tab/bootstrap.css +7 -11
- package/styles/tab/bootstrap4.css +7 -11
- package/styles/tab/bootstrap5-dark.css +7 -11
- package/styles/tab/bootstrap5.3.css +7 -11
- package/styles/tab/bootstrap5.css +7 -11
- package/styles/tab/fabric-dark.css +7 -11
- package/styles/tab/fabric.css +7 -11
- package/styles/tab/fluent-dark.css +7 -11
- package/styles/tab/fluent.css +7 -11
- package/styles/tab/fluent2.css +10 -14
- package/styles/tab/highcontrast-light.css +7 -11
- package/styles/tab/highcontrast.css +7 -11
- package/styles/tab/icons/_tailwind3.scss +90 -0
- package/styles/tab/material-dark.css +7 -11
- package/styles/tab/material.css +7 -11
- package/styles/tab/material3-dark.css +9 -11
- package/styles/tab/material3.css +9 -11
- package/styles/tab/tailwind-dark.css +7 -11
- package/styles/tab/tailwind.css +7 -11
- package/styles/tab/tailwind3.css +4125 -0
- package/styles/tab/tailwind3.scss +6 -0
- package/styles/tailwind-dark-lite.css +26 -18
- package/styles/tailwind-dark.css +45 -24
- package/styles/tailwind-lite.css +26 -18
- package/styles/tailwind.css +45 -24
- package/styles/tailwind3-lite.css +9055 -0
- package/styles/tailwind3-lite.scss +47 -0
- package/styles/tailwind3.css +11743 -0
- package/styles/tailwind3.scss +59 -0
- package/styles/toolbar/_bigger.scss +14 -0
- package/styles/toolbar/_bootstrap5-definition.scss +6 -6
- package/styles/toolbar/_layout.scss +7 -1
- package/styles/toolbar/_tailwind3-definition.scss +199 -0
- package/styles/toolbar/_theme.scss +6 -6
- package/styles/toolbar/bds.css +1219 -0
- package/styles/toolbar/bds.scss +9 -0
- package/styles/toolbar/bootstrap-dark.css +1 -1
- package/styles/toolbar/bootstrap.css +1 -1
- package/styles/toolbar/bootstrap4.css +1 -1
- package/styles/toolbar/bootstrap5-dark.css +9 -9
- package/styles/toolbar/bootstrap5.3.css +1 -1
- package/styles/toolbar/bootstrap5.css +9 -9
- package/styles/toolbar/fabric-dark.css +1 -1
- package/styles/toolbar/fabric.css +1 -1
- package/styles/toolbar/fluent-dark.css +1 -1
- package/styles/toolbar/fluent.css +1 -1
- package/styles/toolbar/fluent2.css +1 -1
- package/styles/toolbar/highcontrast-light.css +1 -1
- package/styles/toolbar/highcontrast.css +1 -1
- package/styles/toolbar/icons/_tailwind3.scss +14 -0
- package/styles/toolbar/material-dark.css +1 -1
- package/styles/toolbar/material.css +1 -1
- package/styles/toolbar/material3-dark.css +1 -1
- package/styles/toolbar/material3.css +1 -1
- package/styles/toolbar/tailwind-dark.css +1 -1
- package/styles/toolbar/tailwind.css +1 -1
- package/styles/toolbar/tailwind3.css +1211 -0
- package/styles/toolbar/tailwind3.scss +9 -0
- package/styles/treeview/_bigger.scss +16 -3
- package/styles/treeview/_fluent-definition.scss +1 -1
- package/styles/treeview/_fluent2-definition.scss +2 -2
- package/styles/treeview/_highcontrast-definition.scss +3 -3
- package/styles/treeview/_layout.scss +42 -5
- package/styles/treeview/_tailwind-definition.scss +1 -1
- package/styles/treeview/_tailwind3-definition.scss +126 -0
- package/styles/treeview/_theme.scss +1 -1
- package/styles/treeview/bds.css +1031 -0
- package/styles/treeview/bds.scss +7 -0
- package/styles/treeview/bootstrap-dark.css +16 -1
- package/styles/treeview/bootstrap.css +16 -1
- package/styles/treeview/bootstrap4.css +16 -1
- package/styles/treeview/bootstrap5-dark.css +16 -1
- package/styles/treeview/bootstrap5.3.css +16 -1
- package/styles/treeview/bootstrap5.css +16 -1
- package/styles/treeview/fabric-dark.css +16 -1
- package/styles/treeview/fabric.css +16 -1
- package/styles/treeview/fluent-dark.css +17 -2
- package/styles/treeview/fluent.css +17 -2
- package/styles/treeview/fluent2.css +22 -4
- package/styles/treeview/highcontrast-light.css +16 -1
- package/styles/treeview/highcontrast.css +19 -4
- package/styles/treeview/icons/_tailwind3.scss +44 -0
- package/styles/treeview/material-dark.css +16 -1
- package/styles/treeview/material.css +16 -1
- package/styles/treeview/material3-dark.css +16 -1
- package/styles/treeview/material3.css +16 -1
- package/styles/treeview/tailwind-dark.css +17 -2
- package/styles/treeview/tailwind.css +17 -2
- package/styles/treeview/tailwind3.css +806 -0
- package/styles/treeview/tailwind3.scss +7 -0
- package/styles/v-scroll/_tailwind3-definition.scss +49 -0
- package/styles/v-scroll/bds.css +218 -0
- package/styles/v-scroll/bds.scss +5 -0
- package/styles/v-scroll/icons/_tailwind3.scss +27 -0
- package/styles/v-scroll/tailwind3.css +218 -0
- package/styles/v-scroll/tailwind3.scss +5 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 -
|
|
3
|
+
* version : 28.1.35
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-navigations@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-navigations@
|
|
3
|
+
"_id": "@syncfusion/ej2-navigations@28.1.33",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-0OLo+b+tpp6pVC1e+OE3OcYMqxPCCG1JxTo35UipJ2I2/Fve/COtxBBPpyBLFsAmMHeHldqnsLcSo3X7Fo3mWg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-navigations",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"/@syncfusion/ej2-spreadsheet",
|
|
41
41
|
"/@syncfusion/ej2-vue-navigations"
|
|
42
42
|
],
|
|
43
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-
|
|
44
|
-
"_shasum": "
|
|
43
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-28.1.33.tgz",
|
|
44
|
+
"_shasum": "12d9c190b00e66a4da177fff767f1d7e117474e9",
|
|
45
45
|
"_spec": "@syncfusion/ej2-navigations@*",
|
|
46
|
-
"_where": "/jenkins/workspace/elease-
|
|
46
|
+
"_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
|
|
47
47
|
"author": {
|
|
48
48
|
"name": "Syncfusion Inc."
|
|
49
49
|
},
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
},
|
|
53
53
|
"bundleDependencies": false,
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@syncfusion/ej2-base": "~
|
|
56
|
-
"@syncfusion/ej2-buttons": "~
|
|
57
|
-
"@syncfusion/ej2-data": "~
|
|
58
|
-
"@syncfusion/ej2-inputs": "~
|
|
59
|
-
"@syncfusion/ej2-lists": "~
|
|
60
|
-
"@syncfusion/ej2-popups": "~
|
|
55
|
+
"@syncfusion/ej2-base": "~28.1.33",
|
|
56
|
+
"@syncfusion/ej2-buttons": "~28.1.33",
|
|
57
|
+
"@syncfusion/ej2-data": "~28.1.33",
|
|
58
|
+
"@syncfusion/ej2-inputs": "~28.1.33",
|
|
59
|
+
"@syncfusion/ej2-lists": "~28.1.33",
|
|
60
|
+
"@syncfusion/ej2-popups": "~28.1.33"
|
|
61
61
|
},
|
|
62
62
|
"deprecated": false,
|
|
63
63
|
"description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
|
|
@@ -162,6 +162,6 @@
|
|
|
162
162
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
163
163
|
},
|
|
164
164
|
"typings": "index.d.ts",
|
|
165
|
-
"version": "
|
|
165
|
+
"version": "28.1.35",
|
|
166
166
|
"sideEffects": false
|
|
167
167
|
}
|
|
@@ -18,6 +18,13 @@ export interface AccordionClickArgs extends BaseEventArgs {
|
|
|
18
18
|
* Defines the current Event arguments.
|
|
19
19
|
*/
|
|
20
20
|
originalEvent?: Event;
|
|
21
|
+
/**
|
|
22
|
+
* Defines whether to cancel the Accordion click action.
|
|
23
|
+
* When set to `true`, the default click behavior will be prevented,
|
|
24
|
+
* preventing any action associated with the Accordion item click (such as expanding or collapsing the item).
|
|
25
|
+
* When set to `false` or omitted, the default click behavior will proceed as normal.
|
|
26
|
+
*/
|
|
27
|
+
cancel?: boolean;
|
|
21
28
|
}
|
|
22
29
|
/** An interface that holds options to control the expanding item action. */
|
|
23
30
|
export interface ExpandEventArgs extends BaseEventArgs {
|
|
@@ -438,56 +438,60 @@ var Accordion = /** @class */ (function (_super) {
|
|
|
438
438
|
Accordion.prototype.afterContentRender = function (trgt, eventArgs, acrdnItem, acrdnHdr, acrdnCtn, acrdnCtnItem) {
|
|
439
439
|
var _this = this;
|
|
440
440
|
var acrdActive = [];
|
|
441
|
-
this.trigger('clicked', eventArgs)
|
|
442
|
-
|
|
443
|
-
var inlineAcrdnSel = '.' + CLS_CONTENT + ' .' + CLS_ROOT;
|
|
444
|
-
var inlineEleAcrdn = acrdnCtn && !isNOU(select('.' + CLS_ROOT, acrdnCtn)) && isNOU(closest(trgt, inlineAcrdnSel));
|
|
445
|
-
var nestContCheck = acrdnCtn && isNOU(select('.' + CLS_ROOT, acrdnCtn)) || !(closest(trgt, '.' + CLS_ROOT) === this.element);
|
|
446
|
-
cntclkCheck = cntclkCheck && (inlineEleAcrdn || nestContCheck);
|
|
447
|
-
trgt.classList.remove('e-target');
|
|
448
|
-
if (trgt.classList.contains(CLS_CONTENT) || trgt.classList.contains(CLS_CTENT) || cntclkCheck) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
var acrdcontainer = this.element.querySelector('.' + CLS_CONTAINER);
|
|
452
|
-
var acrdnchild = (acrdcontainer) ? acrdcontainer.children : this.element.children;
|
|
453
|
-
[].slice.call(acrdnchild).forEach(function (el) {
|
|
454
|
-
if (el.classList.contains(CLS_ACTIVE)) {
|
|
455
|
-
acrdActive.push(el);
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
var acrdAniEle = [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM + ' [' + CLS_ANIMATE + ']'));
|
|
459
|
-
if (acrdAniEle.length > 0) {
|
|
460
|
-
for (var _i = 0, acrdAniEle_1 = acrdAniEle; _i < acrdAniEle_1.length; _i++) {
|
|
461
|
-
var el = acrdAniEle_1[_i];
|
|
462
|
-
acrdActive.push(el.parentElement);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
var sameContentCheck = acrdActive.indexOf(acrdnCtnItem) !== -1 && acrdnCtn.getAttribute('e-animate') === 'true';
|
|
466
|
-
var sameHeader = false;
|
|
467
|
-
if (!isNOU(acrdnItem) && !isNOU(acrdnHdr)) {
|
|
468
|
-
var acrdnCtn_1 = select('.' + CLS_CONTENT, acrdnItem);
|
|
469
|
-
var acrdnRoot = closest(acrdnItem, '.' + CLS_ACRDN_ROOT);
|
|
470
|
-
var expandState = acrdnRoot.querySelector('.' + CLS_EXPANDSTATE);
|
|
471
|
-
if (isNOU(acrdnCtn_1)) {
|
|
441
|
+
this.trigger('clicked', eventArgs, function (eventArgs) {
|
|
442
|
+
if (eventArgs.cancel) {
|
|
472
443
|
return;
|
|
473
444
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
445
|
+
var cntclkCheck = (acrdnCtn && !isNOU(select('.e-target', acrdnCtn)));
|
|
446
|
+
var inlineAcrdnSel = '.' + CLS_CONTENT + ' .' + CLS_ROOT;
|
|
447
|
+
var inlineEleAcrdn = acrdnCtn && !isNOU(select('.' + CLS_ROOT, acrdnCtn)) && isNOU(closest(trgt, inlineAcrdnSel));
|
|
448
|
+
var nestContCheck = acrdnCtn && isNOU(select('.' + CLS_ROOT, acrdnCtn)) || !(closest(trgt, '.' + CLS_ROOT) === _this.element);
|
|
449
|
+
cntclkCheck = cntclkCheck && (inlineEleAcrdn || nestContCheck);
|
|
450
|
+
trgt.classList.remove('e-target');
|
|
451
|
+
if (trgt.classList.contains(CLS_CONTENT) || trgt.classList.contains(CLS_CTENT) || cntclkCheck) {
|
|
452
|
+
return;
|
|
477
453
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
454
|
+
var acrdcontainer = _this.element.querySelector('.' + CLS_CONTAINER);
|
|
455
|
+
var acrdnchild = (acrdcontainer) ? acrdcontainer.children : _this.element.children;
|
|
456
|
+
[].slice.call(acrdnchild).forEach(function (el) {
|
|
457
|
+
if (el.classList.contains(CLS_ACTIVE)) {
|
|
458
|
+
acrdActive.push(el);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
var acrdAniEle = [].slice.call(_this.element.querySelectorAll('.' + CLS_ITEM + ' [' + CLS_ANIMATE + ']'));
|
|
462
|
+
if (acrdAniEle.length > 0) {
|
|
463
|
+
for (var _i = 0, acrdAniEle_1 = acrdAniEle; _i < acrdAniEle_1.length; _i++) {
|
|
464
|
+
var el = acrdAniEle_1[_i];
|
|
465
|
+
acrdActive.push(el.parentElement);
|
|
484
466
|
}
|
|
485
|
-
this.expand(acrdnCtn_1);
|
|
486
467
|
}
|
|
487
|
-
|
|
488
|
-
|
|
468
|
+
var sameContentCheck = acrdActive.indexOf(acrdnCtnItem) !== -1 && acrdnCtn.getAttribute('e-animate') === 'true';
|
|
469
|
+
var sameHeader = false;
|
|
470
|
+
if (!isNOU(acrdnItem) && !isNOU(acrdnHdr)) {
|
|
471
|
+
var acrdnCtn_1 = select('.' + CLS_CONTENT, acrdnItem);
|
|
472
|
+
var acrdnRoot = closest(acrdnItem, '.' + CLS_ACRDN_ROOT);
|
|
473
|
+
var expandState = acrdnRoot.querySelector('.' + CLS_EXPANDSTATE);
|
|
474
|
+
if (isNOU(acrdnCtn_1)) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
sameHeader = (expandState === acrdnItem);
|
|
478
|
+
if (isVisible(acrdnCtn_1) && (!sameContentCheck || acrdnCtnItem.classList.contains(CLS_SLCTED))) {
|
|
479
|
+
_this.collapse(acrdnCtn_1);
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
if ((acrdActive.length > 0) && _this.expandMode === 'Single' && !sameContentCheck) {
|
|
483
|
+
acrdActive.forEach(function (el) {
|
|
484
|
+
_this.collapse(select('.' + CLS_CONTENT, el));
|
|
485
|
+
el.classList.remove(CLS_EXPANDSTATE);
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
_this.expand(acrdnCtn_1);
|
|
489
|
+
}
|
|
490
|
+
if (!isNOU(expandState) && !sameHeader) {
|
|
491
|
+
expandState.classList.remove(CLS_EXPANDSTATE);
|
|
492
|
+
}
|
|
489
493
|
}
|
|
490
|
-
}
|
|
494
|
+
});
|
|
491
495
|
};
|
|
492
496
|
Accordion.prototype.eleMoveFocus = function (action, root, trgt) {
|
|
493
497
|
var clst;
|
|
@@ -841,9 +845,12 @@ var Accordion = /** @class */ (function (_super) {
|
|
|
841
845
|
};
|
|
842
846
|
Accordion.prototype.collapse = function (trgt) {
|
|
843
847
|
var _this = this;
|
|
848
|
+
if (isNOU(trgt)) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
844
851
|
var items = this.getItems();
|
|
845
852
|
var trgtItemEle = closest(trgt, '.' + CLS_ITEM);
|
|
846
|
-
if (
|
|
853
|
+
if (!isVisible(trgt) || trgtItemEle.classList.contains(CLS_DISABLE)) {
|
|
847
854
|
return;
|
|
848
855
|
}
|
|
849
856
|
var animation = {
|
|
@@ -197,6 +197,18 @@ export interface CarouselModel extends ComponentModel{
|
|
|
197
197
|
*/
|
|
198
198
|
enableTouchSwipe?: boolean;
|
|
199
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Defines whether to enable keyboard actions or not.
|
|
202
|
+
*
|
|
203
|
+
* * @remarks
|
|
204
|
+
* If any form input component is placed on the carousel slide, interacting with it may cause
|
|
205
|
+
* the left/right arrow keys to navigate to other slides. Disabling keyboard interaction helps
|
|
206
|
+
* prevent this unintended navigation, leading to a smoother user experience.
|
|
207
|
+
*
|
|
208
|
+
* @default true
|
|
209
|
+
*/
|
|
210
|
+
allowKeyboardInteraction?: boolean;
|
|
211
|
+
|
|
200
212
|
/**
|
|
201
213
|
* Defines whether to show the indicator positions or not. The indicator positions allow to know the current slide position of the carousel component.
|
|
202
214
|
*
|
|
@@ -261,6 +261,17 @@ export declare class Carousel extends Component<HTMLElement> implements INotifyP
|
|
|
261
261
|
* @default true
|
|
262
262
|
*/
|
|
263
263
|
enableTouchSwipe: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Defines whether to enable keyboard actions or not.
|
|
266
|
+
*
|
|
267
|
+
* * @remarks
|
|
268
|
+
* If any form input component is placed on the carousel slide, interacting with it may cause
|
|
269
|
+
* the left/right arrow keys to navigate to other slides. Disabling keyboard interaction helps
|
|
270
|
+
* prevent this unintended navigation, leading to a smoother user experience.
|
|
271
|
+
*
|
|
272
|
+
* @default true
|
|
273
|
+
*/
|
|
274
|
+
allowKeyboardInteraction: boolean;
|
|
264
275
|
/**
|
|
265
276
|
* Defines whether to show the indicator positions or not. The indicator positions allow to know the current slide position of the carousel component.
|
|
266
277
|
*
|
package/src/carousel/carousel.js
CHANGED
|
@@ -183,6 +183,15 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
183
183
|
this.reRenderSlides();
|
|
184
184
|
}
|
|
185
185
|
break;
|
|
186
|
+
case 'allowKeyboardInteraction':
|
|
187
|
+
if (this.keyModule) {
|
|
188
|
+
this.keyModule.destroy();
|
|
189
|
+
this.keyModule = null;
|
|
190
|
+
}
|
|
191
|
+
if (newProp.allowKeyboardInteraction) {
|
|
192
|
+
this.renderKeyboardActions();
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
186
195
|
case 'enableRtl':
|
|
187
196
|
rtlElement = [].slice.call(this.element.querySelectorAll("." + CLS_PREV_BUTTON + ",\n ." + CLS_NEXT_BUTTON + ", ." + CLS_PLAY_BUTTON));
|
|
188
197
|
rtlElement.push(this.element);
|
|
@@ -554,6 +563,9 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
554
563
|
append(template, indicatorBar);
|
|
555
564
|
};
|
|
556
565
|
Carousel.prototype.renderKeyboardActions = function () {
|
|
566
|
+
if (!this.allowKeyboardInteraction) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
557
569
|
this.keyModule = new KeyboardEvents(this.element, { keyAction: this.keyHandler.bind(this), keyConfigs: this.keyConfigs });
|
|
558
570
|
};
|
|
559
571
|
Carousel.prototype.renderTouchActions = function () {
|
|
@@ -877,6 +889,9 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
877
889
|
}
|
|
878
890
|
};
|
|
879
891
|
Carousel.prototype.keyHandler = function (e) {
|
|
892
|
+
if (!this.allowKeyboardInteraction) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
880
895
|
var direction;
|
|
881
896
|
var slideIndex;
|
|
882
897
|
var isSlideTransition = false;
|
|
@@ -1025,6 +1040,7 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
1025
1040
|
if (!this.timeStampStart) {
|
|
1026
1041
|
this.timeStampStart = Date.now();
|
|
1027
1042
|
}
|
|
1043
|
+
e.preventDefault();
|
|
1028
1044
|
this.isSwipe = false;
|
|
1029
1045
|
this.itemsContainer.classList.add('e-swipe-start');
|
|
1030
1046
|
this.prevPageX = e.touches ? e.touches[0].pageX : e.pageX;
|
|
@@ -1034,6 +1050,7 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
1034
1050
|
if (!this.itemsContainer.classList.contains('e-swipe-start')) {
|
|
1035
1051
|
return;
|
|
1036
1052
|
}
|
|
1053
|
+
this.isSwipe = true;
|
|
1037
1054
|
e.preventDefault();
|
|
1038
1055
|
var pageX = e.touches ? e.touches[0].pageX : e.pageX;
|
|
1039
1056
|
var positionDiff = this.prevPageX - (pageX);
|
|
@@ -1046,7 +1063,6 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
1046
1063
|
this.itemsContainer.style.transform = "translateX(" + (this.initialTranslate + (this.enableRtl ? positionDiff : -positionDiff)) + "px)";
|
|
1047
1064
|
};
|
|
1048
1065
|
Carousel.prototype.swipStop = function () {
|
|
1049
|
-
this.isSwipe = true;
|
|
1050
1066
|
var time = Date.now() - this.timeStampStart;
|
|
1051
1067
|
var distanceX = this.getTranslateValue(this.itemsContainer) - this.initialTranslate;
|
|
1052
1068
|
distanceX = distanceX < 0 ? distanceX * -1 : distanceX;
|
|
@@ -1110,7 +1126,7 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
1110
1126
|
}
|
|
1111
1127
|
};
|
|
1112
1128
|
Carousel.prototype.wireEvents = function () {
|
|
1113
|
-
if (
|
|
1129
|
+
if (this.animationEffect !== 'Custom' && this.enableTouchSwipe) {
|
|
1114
1130
|
this.swipeModehandlers();
|
|
1115
1131
|
}
|
|
1116
1132
|
EventHandler.add(this.element, 'focusin focusout', this.onFocusActions, this);
|
|
@@ -1232,8 +1248,10 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
1232
1248
|
this.touchModule.destroy();
|
|
1233
1249
|
this.touchModule = null;
|
|
1234
1250
|
}
|
|
1235
|
-
this.keyModule
|
|
1236
|
-
|
|
1251
|
+
if (this.keyModule) {
|
|
1252
|
+
this.keyModule.destroy();
|
|
1253
|
+
this.keyModule = null;
|
|
1254
|
+
}
|
|
1237
1255
|
this.resetSlideInterval();
|
|
1238
1256
|
this.destroyButtons();
|
|
1239
1257
|
this.unWireEvents();
|
|
@@ -1297,6 +1315,9 @@ var Carousel = /** @class */ (function (_super) {
|
|
|
1297
1315
|
__decorate([
|
|
1298
1316
|
Property(true)
|
|
1299
1317
|
], Carousel.prototype, "enableTouchSwipe", void 0);
|
|
1318
|
+
__decorate([
|
|
1319
|
+
Property(true)
|
|
1320
|
+
], Carousel.prototype, "allowKeyboardInteraction", void 0);
|
|
1300
1321
|
__decorate([
|
|
1301
1322
|
Property(true)
|
|
1302
1323
|
], Carousel.prototype, "showIndicators", void 0);
|
|
@@ -106,6 +106,13 @@ export interface MenuItemModel {
|
|
|
106
106
|
*/
|
|
107
107
|
url?: string;
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Specifies the htmlAttributes property to support adding custom attributes to the menu items in the menu component.
|
|
111
|
+
*
|
|
112
|
+
* @default null
|
|
113
|
+
*/
|
|
114
|
+
htmlAttributes?: Record<string, string>;
|
|
115
|
+
|
|
109
116
|
}
|
|
110
117
|
|
|
111
118
|
/**
|
|
@@ -108,6 +108,12 @@ export declare class MenuItem extends ChildProperty<MenuItem> {
|
|
|
108
108
|
* @default ''
|
|
109
109
|
*/
|
|
110
110
|
url: string;
|
|
111
|
+
/**
|
|
112
|
+
* Specifies the htmlAttributes property to support adding custom attributes to the menu items in the menu component.
|
|
113
|
+
*
|
|
114
|
+
* @default null
|
|
115
|
+
*/
|
|
116
|
+
htmlAttributes: Record<string, string>;
|
|
111
117
|
}
|
|
112
118
|
/**
|
|
113
119
|
* Animation configuration settings.
|
|
@@ -373,6 +379,7 @@ export declare abstract class MenuBase extends Component<HTMLUListElement> imple
|
|
|
373
379
|
protected setBlankIconStyle(menu: HTMLElement): void;
|
|
374
380
|
private checkScrollOffset;
|
|
375
381
|
private setPosition;
|
|
382
|
+
getMenuWidth(cmenu: Element, width: number, isRtl: boolean): number;
|
|
376
383
|
private toggleVisiblity;
|
|
377
384
|
private createItems;
|
|
378
385
|
private moverHandler;
|
package/src/common/menu-base.js
CHANGED
|
@@ -108,6 +108,9 @@ var MenuItem = /** @class */ (function (_super) {
|
|
|
108
108
|
__decorate([
|
|
109
109
|
Property('')
|
|
110
110
|
], MenuItem.prototype, "url", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
Property()
|
|
113
|
+
], MenuItem.prototype, "htmlAttributes", void 0);
|
|
111
114
|
return MenuItem;
|
|
112
115
|
}(ChildProperty));
|
|
113
116
|
export { MenuItem };
|
|
@@ -839,7 +842,10 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
839
842
|
var data = {
|
|
840
843
|
text: item[this.getField('text')].toString(), iconCss: ICONS + ' e-previous'
|
|
841
844
|
};
|
|
842
|
-
|
|
845
|
+
if (this.template) {
|
|
846
|
+
item.iconCss = (item.iconCss || '') + ICONS + ' e-previous';
|
|
847
|
+
}
|
|
848
|
+
var hdata = new MenuItem(this.items[0], 'items', this.template ? item : data, true);
|
|
843
849
|
var hli = this.createItems([hdata]).children[0];
|
|
844
850
|
hli.classList.add(HEADER);
|
|
845
851
|
this.uList.insertBefore(hli, this.uList.children[0]);
|
|
@@ -1088,6 +1094,9 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1088
1094
|
timingFunction: _this.animationSettings.easing
|
|
1089
1095
|
} : null;
|
|
1090
1096
|
_this.popupObj.show(animationOptions, _this.lItem);
|
|
1097
|
+
if (Browser.isDevice) {
|
|
1098
|
+
_this.popupWrapper.style.left = _this.left + 'px';
|
|
1099
|
+
}
|
|
1091
1100
|
}
|
|
1092
1101
|
}
|
|
1093
1102
|
else {
|
|
@@ -1228,8 +1237,34 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1228
1237
|
}
|
|
1229
1238
|
}
|
|
1230
1239
|
this.toggleVisiblity(ul, false);
|
|
1231
|
-
|
|
1232
|
-
|
|
1240
|
+
var wrapper = closest(this.element, '.e-' + this.getModuleName() + '-wrapper');
|
|
1241
|
+
if (!this.isMenu && this.enableScrolling && ul && wrapper && wrapper.offsetHeight > 0) {
|
|
1242
|
+
var menuVScroll = closest(ul, '.e-menu-vscroll');
|
|
1243
|
+
ul.style.display = 'block';
|
|
1244
|
+
if (menuVScroll) {
|
|
1245
|
+
destroyScroll(getInstance(menuVScroll, VScroll), menuVScroll);
|
|
1246
|
+
}
|
|
1247
|
+
var cmenuWidth = Math.ceil(this.getMenuWidth(ul, ul.offsetWidth, this.enableRtl));
|
|
1248
|
+
var cmenu = addScrolling(this.createElement, wrapper, ul, 'vscroll', this.enableRtl, wrapper.offsetHeight);
|
|
1249
|
+
Object.assign(cmenu.style, {
|
|
1250
|
+
top: top + "px",
|
|
1251
|
+
left: left + "px",
|
|
1252
|
+
width: cmenuWidth + "px",
|
|
1253
|
+
position: 'absolute',
|
|
1254
|
+
display: 'none'
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
else {
|
|
1258
|
+
ul.style.top = top + px;
|
|
1259
|
+
ul.style.left = left + px;
|
|
1260
|
+
}
|
|
1261
|
+
};
|
|
1262
|
+
MenuBase.prototype.getMenuWidth = function (cmenu, width, isRtl) {
|
|
1263
|
+
var caretIcon = cmenu.getElementsByClassName(CARET)[0];
|
|
1264
|
+
if (caretIcon) {
|
|
1265
|
+
width += parseInt(getComputedStyle(caretIcon)[isRtl ? 'marginRight' : 'marginLeft'], 10);
|
|
1266
|
+
}
|
|
1267
|
+
return width < 120 ? 120 : width;
|
|
1233
1268
|
};
|
|
1234
1269
|
MenuBase.prototype.toggleVisiblity = function (ul, isVisible) {
|
|
1235
1270
|
if (isVisible === void 0) { isVisible = true; }
|
|
@@ -1255,15 +1290,24 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1255
1290
|
args.curData.htmlAttributes = {};
|
|
1256
1291
|
}
|
|
1257
1292
|
if (Browser.isIE) {
|
|
1258
|
-
args.curData.htmlAttributes.role
|
|
1259
|
-
|
|
1293
|
+
if (!args.curData.htmlAttributes.role) {
|
|
1294
|
+
args.curData.htmlAttributes.role = 'menuitem';
|
|
1295
|
+
}
|
|
1296
|
+
if (!args.curData.htmlAttributes.tabindex) {
|
|
1297
|
+
args.curData.htmlAttributes.tabindex = '-1';
|
|
1298
|
+
}
|
|
1260
1299
|
}
|
|
1261
1300
|
else {
|
|
1262
|
-
Object.assign(args.curData.htmlAttributes, {
|
|
1301
|
+
Object.assign(args.curData.htmlAttributes, {
|
|
1302
|
+
role: args.curData.htmlAttributes.role || 'menuitem',
|
|
1303
|
+
tabindex: args.curData.htmlAttributes.tabindex || '-1'
|
|
1304
|
+
});
|
|
1263
1305
|
}
|
|
1264
1306
|
if (_this.isMenu && !args.curData[_this.getField('separator', level)]) {
|
|
1265
|
-
args.curData.htmlAttributes['aria-label']
|
|
1266
|
-
args.curData[
|
|
1307
|
+
if (!args.curData.htmlAttributes['aria-label']) {
|
|
1308
|
+
args.curData.htmlAttributes['aria-label'] = args.curData[args.fields.text] ?
|
|
1309
|
+
args.curData[args.fields.text] : args.curData[args.fields.id];
|
|
1310
|
+
}
|
|
1267
1311
|
}
|
|
1268
1312
|
if (args.curData[args.fields[fields.iconCss]] === '') {
|
|
1269
1313
|
args.curData[args.fields[fields.iconCss]] = null;
|
|
@@ -1272,7 +1316,9 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1272
1316
|
itemCreated: function (args) {
|
|
1273
1317
|
if (args.curData[_this.getField('separator', level)]) {
|
|
1274
1318
|
args.item.classList.add(SEPARATOR);
|
|
1275
|
-
args.
|
|
1319
|
+
if (!args.curData.htmlAttributes.role) {
|
|
1320
|
+
args.item.setAttribute('role', 'separator');
|
|
1321
|
+
}
|
|
1276
1322
|
}
|
|
1277
1323
|
if (showIcon && !args.curData[args.fields.iconCss]
|
|
1278
1324
|
&& !args.curData[_this.getField('separator', level)]) {
|
|
@@ -1522,9 +1568,10 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1522
1568
|
}
|
|
1523
1569
|
}
|
|
1524
1570
|
else {
|
|
1525
|
-
if (
|
|
1526
|
-
var popupEle = closest(trgt, '.' + POPUP);
|
|
1527
|
-
var cIdx = Array.prototype.indexOf.call(this.getPopups(), popupEle) + 1
|
|
1571
|
+
if (trgt.tagName === 'DIV' && closest(trgt, '.e-menu-vscroll') && (this.navIdx.length || !this.isMenu && this.enableScrolling && this.navIdx.length === 0)) {
|
|
1572
|
+
var popupEle = this.isMenu ? closest(trgt, '.' + POPUP) : closest(trgt, '.e-menu-vscroll');
|
|
1573
|
+
var cIdx = this.isMenu ? Array.prototype.indexOf.call(this.getPopups(), popupEle) + 1
|
|
1574
|
+
: this.getIdx(wrapper, select('ul.e-menu-parent', popupEle));
|
|
1528
1575
|
if (cIdx < this.navIdx.length) {
|
|
1529
1576
|
this.closeMenu(cIdx + 1, e);
|
|
1530
1577
|
if (popupEle) {
|
|
@@ -1673,7 +1720,9 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1673
1720
|
};
|
|
1674
1721
|
MenuBase.prototype.getIdx = function (ul, li, skipHdr) {
|
|
1675
1722
|
if (skipHdr === void 0) { skipHdr = true; }
|
|
1676
|
-
var
|
|
1723
|
+
var ulElem = !this.isMenu && this.enableScrolling && select('.e-menu-vscroll', ul)
|
|
1724
|
+
? selectAll('.e-menu-parent', ul) : Array.from(ul.children);
|
|
1725
|
+
var idx = Array.prototype.indexOf.call(ulElem, li);
|
|
1677
1726
|
if (skipHdr && ul.children[0].classList.contains(HEADER)) {
|
|
1678
1727
|
idx--;
|
|
1679
1728
|
}
|
|
@@ -1757,7 +1806,7 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1757
1806
|
}
|
|
1758
1807
|
else {
|
|
1759
1808
|
var ul_3 = wrapper.children[0];
|
|
1760
|
-
if (this_1.element.classList.contains('e-vertical')) {
|
|
1809
|
+
if (this_1.element.classList.contains('e-vertical') || !this_1.isMenu) {
|
|
1761
1810
|
destroyScroll(getInstance(ul_3, VScroll), ul_3);
|
|
1762
1811
|
}
|
|
1763
1812
|
else {
|
|
@@ -1928,6 +1977,8 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1928
1977
|
if (isMenuOpen === void 0) { isMenuOpen = true; }
|
|
1929
1978
|
var pUlHeight;
|
|
1930
1979
|
var pElement;
|
|
1980
|
+
var animateElement = (this.enableScrolling && !this.isMenu && closest(ul, '.e-menu-vscroll'))
|
|
1981
|
+
? closest(ul, '.e-menu-vscroll') : ul;
|
|
1931
1982
|
if (this.animationSettings.effect === 'None' || !isMenuOpen) {
|
|
1932
1983
|
if (this.hamburgerMode && ul) {
|
|
1933
1984
|
ul.style.top = '0px';
|
|
@@ -1936,7 +1987,7 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1936
1987
|
this.end(ul, isMenuOpen);
|
|
1937
1988
|
}
|
|
1938
1989
|
else {
|
|
1939
|
-
this.animation.animate(
|
|
1990
|
+
this.animation.animate(animateElement, {
|
|
1940
1991
|
name: this.animationSettings.effect,
|
|
1941
1992
|
duration: this.animationSettings.duration,
|
|
1942
1993
|
timingFunction: this.animationSettings.easing,
|
|
@@ -1954,7 +2005,7 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1954
2005
|
}
|
|
1955
2006
|
else {
|
|
1956
2007
|
options.element.style.display = 'block';
|
|
1957
|
-
options.element.style.maxHeight = options.element.getBoundingClientRect().height + 'px';
|
|
2008
|
+
options.element.style.maxHeight = _this.isMenu ? options.element.getBoundingClientRect().height + 'px' : options.element.scrollHeight + 'px';
|
|
1958
2009
|
}
|
|
1959
2010
|
},
|
|
1960
2011
|
progress: function (options) {
|
|
@@ -1991,11 +2042,15 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
1991
2042
|
}
|
|
1992
2043
|
};
|
|
1993
2044
|
MenuBase.prototype.end = function (ul, isMenuOpen) {
|
|
1994
|
-
if (isMenuOpen &&
|
|
1995
|
-
if (this.isMenu || !Browser.isDevice) {
|
|
2045
|
+
if (isMenuOpen && this.isContextMenuClosed) {
|
|
2046
|
+
if (this.isMenu || !Browser.isDevice || (!this.isMenu && this.isAnimationNone && Browser.isDevice)) {
|
|
1996
2047
|
ul.style.display = 'block';
|
|
1997
2048
|
}
|
|
1998
2049
|
ul.style.maxHeight = '';
|
|
2050
|
+
var scrollMenu = this.enableScrolling && !this.isMenu ? closest(ul, '.e-menu-vscroll') : null;
|
|
2051
|
+
if (scrollMenu) {
|
|
2052
|
+
scrollMenu.style.display = 'block';
|
|
2053
|
+
}
|
|
1999
2054
|
this.triggerOpen(ul);
|
|
2000
2055
|
if (ul.querySelector('.' + FOCUSED)) {
|
|
2001
2056
|
ul.querySelector('.' + FOCUSED).focus();
|
|
@@ -2023,6 +2078,10 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
2023
2078
|
}
|
|
2024
2079
|
}
|
|
2025
2080
|
else {
|
|
2081
|
+
var scrollMenu = this.enableScrolling && !this.isMenu ? closest(ul, '.e-menu-vscroll') : null;
|
|
2082
|
+
if (scrollMenu) {
|
|
2083
|
+
destroyScroll(getInstance(scrollMenu, VScroll), scrollMenu);
|
|
2084
|
+
}
|
|
2026
2085
|
if (ul === this.element) {
|
|
2027
2086
|
var fli = this.getLIByClass(this.element, FOCUSED);
|
|
2028
2087
|
if (fli) {
|
|
@@ -2066,7 +2125,9 @@ var MenuBase = /** @class */ (function (_super) {
|
|
|
2066
2125
|
level = isCallBack ? level + 1 : 0;
|
|
2067
2126
|
for (var i = 0, len = items.length; i < len; i++) {
|
|
2068
2127
|
item = items[i];
|
|
2069
|
-
|
|
2128
|
+
var currentField = isUniqueId ? item[this.getField('itemId', level)] : item[this.getField('text', level)];
|
|
2129
|
+
var itemId = (item.htmlAttributes && 'id' in item.htmlAttributes) ? item.htmlAttributes.id : currentField;
|
|
2130
|
+
if (itemId === data) {
|
|
2070
2131
|
nIndex.push(i);
|
|
2071
2132
|
break;
|
|
2072
2133
|
}
|
|
@@ -29,4 +29,19 @@ export interface ContextMenuModel extends MenuBaseModel{
|
|
|
29
29
|
*/
|
|
30
30
|
items?: MenuItemModel[];
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* This property allows you to define custom templates for items in the ContextMenu.
|
|
34
|
+
*
|
|
35
|
+
* @default null
|
|
36
|
+
* @aspType string
|
|
37
|
+
*/
|
|
38
|
+
itemTemplate?: string | Function;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Specifies whether to enable / disable the scrollable option in ContextMenu.
|
|
42
|
+
*
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
enableScrolling?: boolean;
|
|
46
|
+
|
|
32
47
|
}
|
|
@@ -44,6 +44,19 @@ export declare class ContextMenu extends MenuBase implements INotifyPropertyChan
|
|
|
44
44
|
* @blazorType object
|
|
45
45
|
*/
|
|
46
46
|
items: MenuItemModel[];
|
|
47
|
+
/**
|
|
48
|
+
* This property allows you to define custom templates for items in the ContextMenu.
|
|
49
|
+
*
|
|
50
|
+
* @default null
|
|
51
|
+
* @aspType string
|
|
52
|
+
*/
|
|
53
|
+
itemTemplate: string | Function;
|
|
54
|
+
/**
|
|
55
|
+
* Specifies whether to enable / disable the scrollable option in ContextMenu.
|
|
56
|
+
*
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
enableScrolling: boolean;
|
|
47
60
|
/**
|
|
48
61
|
* For internal use only - prerender processing.
|
|
49
62
|
*
|
|
@@ -58,6 +58,7 @@ var ContextMenu = /** @class */ (function (_super) {
|
|
|
58
58
|
_super.prototype.preRender.call(this);
|
|
59
59
|
};
|
|
60
60
|
ContextMenu.prototype.initialize = function () {
|
|
61
|
+
this.template = this.itemTemplate ? this.itemTemplate : null;
|
|
61
62
|
_super.prototype.initialize.call(this);
|
|
62
63
|
attributes(this.element, { 'role': 'menubar', 'tabindex': '0' });
|
|
63
64
|
this.element.style.zIndex = getZindexPartial(this.element).toString();
|
|
@@ -104,6 +105,9 @@ var ContextMenu = /** @class */ (function (_super) {
|
|
|
104
105
|
this.unWireEvents(oldProp.target);
|
|
105
106
|
this.wireEvents();
|
|
106
107
|
break;
|
|
108
|
+
case 'itemTemplate':
|
|
109
|
+
this.itemTemplate = newProp.itemTemplate;
|
|
110
|
+
this.refresh();
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
};
|
|
@@ -125,6 +129,12 @@ var ContextMenu = /** @class */ (function (_super) {
|
|
|
125
129
|
__decorate([
|
|
126
130
|
Collection([], MenuItem)
|
|
127
131
|
], ContextMenu.prototype, "items", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
Property(null)
|
|
134
|
+
], ContextMenu.prototype, "itemTemplate", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
Property(false)
|
|
137
|
+
], ContextMenu.prototype, "enableScrolling", void 0);
|
|
128
138
|
ContextMenu = __decorate([
|
|
129
139
|
NotifyPropertyChanges
|
|
130
140
|
], ContextMenu);
|
package/src/menu/menu.js
CHANGED