@syncfusion/ej2-navigations 28.1.39 → 28.2.3-1479479
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/.eslintrc.json +243 -260
- package/README.md +301 -301
- package/blazorGlobalSrc/accordion/accordion-model.d.ts +285 -0
- package/blazorGlobalSrc/accordion/accordion.d.ts +458 -0
- package/blazorGlobalSrc/accordion/accordion.js +1411 -0
- package/blazorGlobalSrc/accordion/index.d.ts +5 -0
- package/blazorGlobalSrc/accordion/index.js +4 -0
- package/blazorGlobalSrc/appbar/appbar-model.d.ts +76 -0
- package/blazorGlobalSrc/appbar/appbar.d.ts +115 -0
- package/blazorGlobalSrc/appbar/appbar.js +221 -0
- package/blazorGlobalSrc/appbar/index.d.ts +3 -0
- package/blazorGlobalSrc/appbar/index.js +2 -0
- package/blazorGlobalSrc/breadcrumb/breadcrumb-model.d.ts +170 -0
- package/blazorGlobalSrc/breadcrumb/breadcrumb.d.ts +297 -0
- package/blazorGlobalSrc/breadcrumb/breadcrumb.js +833 -0
- package/blazorGlobalSrc/breadcrumb/index.d.ts +5 -0
- package/blazorGlobalSrc/breadcrumb/index.js +4 -0
- package/blazorGlobalSrc/carousel/carousel-model.d.ts +282 -0
- package/blazorGlobalSrc/carousel/carousel.d.ts +439 -0
- package/blazorGlobalSrc/carousel/carousel.js +1353 -0
- package/blazorGlobalSrc/carousel/index.d.ts +3 -0
- package/blazorGlobalSrc/carousel/index.js +2 -0
- package/blazorGlobalSrc/common/h-scroll-model.d.ts +16 -0
- package/blazorGlobalSrc/common/h-scroll.d.ts +105 -0
- package/blazorGlobalSrc/common/h-scroll.js +499 -0
- package/blazorGlobalSrc/common/index.d.ts +9 -0
- package/blazorGlobalSrc/common/index.js +8 -0
- package/blazorGlobalSrc/common/menu-base-model.d.ts +308 -0
- package/blazorGlobalSrc/common/menu-base.d.ts +553 -0
- package/blazorGlobalSrc/common/menu-base.js +2502 -0
- package/blazorGlobalSrc/common/menu-scroll.d.ts +29 -0
- package/blazorGlobalSrc/common/menu-scroll.js +103 -0
- package/blazorGlobalSrc/common/v-scroll-model.d.ts +16 -0
- package/blazorGlobalSrc/common/v-scroll.d.ts +106 -0
- package/blazorGlobalSrc/common/v-scroll.js +471 -0
- package/blazorGlobalSrc/context-menu/context-menu-model.d.ts +47 -0
- package/blazorGlobalSrc/context-menu/context-menu.d.ts +101 -0
- package/blazorGlobalSrc/context-menu/context-menu.js +143 -0
- package/blazorGlobalSrc/context-menu/index.d.ts +5 -0
- package/blazorGlobalSrc/context-menu/index.js +4 -0
- package/blazorGlobalSrc/global.js +1 -0
- package/blazorGlobalSrc/index.d.ts +16 -0
- package/blazorGlobalSrc/index.js +16 -0
- package/blazorGlobalSrc/menu/index.d.ts +5 -0
- package/blazorGlobalSrc/menu/index.js +4 -0
- package/blazorGlobalSrc/menu/menu-model.d.ts +70 -0
- package/blazorGlobalSrc/menu/menu.d.ts +127 -0
- package/blazorGlobalSrc/menu/menu.js +288 -0
- package/blazorGlobalSrc/sidebar/index.d.ts +5 -0
- package/blazorGlobalSrc/sidebar/index.js +4 -0
- package/blazorGlobalSrc/sidebar/sidebar-model.d.ts +200 -0
- package/blazorGlobalSrc/sidebar/sidebar.d.ts +335 -0
- package/blazorGlobalSrc/sidebar/sidebar.js +729 -0
- package/blazorGlobalSrc/stepper/index.d.ts +3 -0
- package/blazorGlobalSrc/stepper/index.js +2 -0
- package/blazorGlobalSrc/stepper/stepper-model.d.ts +159 -0
- package/blazorGlobalSrc/stepper/stepper.d.ts +381 -0
- package/blazorGlobalSrc/stepper/stepper.js +1305 -0
- package/blazorGlobalSrc/stepper-base/index.d.ts +5 -0
- package/blazorGlobalSrc/stepper-base/index.js +4 -0
- package/blazorGlobalSrc/stepper-base/stepper-base-model.d.ts +121 -0
- package/blazorGlobalSrc/stepper-base/stepper-base.d.ts +184 -0
- package/blazorGlobalSrc/stepper-base/stepper-base.js +230 -0
- package/blazorGlobalSrc/tab/index.d.ts +5 -0
- package/blazorGlobalSrc/tab/index.js +4 -0
- package/blazorGlobalSrc/tab/tab-model.d.ts +408 -0
- package/blazorGlobalSrc/tab/tab.d.ts +715 -0
- package/blazorGlobalSrc/tab/tab.js +2564 -0
- package/blazorGlobalSrc/toolbar/index.d.ts +5 -0
- package/blazorGlobalSrc/toolbar/index.js +4 -0
- package/blazorGlobalSrc/toolbar/toolbar-model.d.ts +287 -0
- package/blazorGlobalSrc/toolbar/toolbar.d.ts +522 -0
- package/blazorGlobalSrc/toolbar/toolbar.js +2408 -0
- package/blazorGlobalSrc/treeview/index.d.ts +5 -0
- package/blazorGlobalSrc/treeview/index.js +4 -0
- package/blazorGlobalSrc/treeview/treeview-model.d.ts +630 -0
- package/blazorGlobalSrc/treeview/treeview.d.ts +1509 -0
- package/blazorGlobalSrc/treeview/treeview.js +5766 -0
- package/dist/ej2-navigations.min.js +1 -10
- package/dist/ej2-navigations.umd.min.js +1 -10
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +116 -97
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +310 -291
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +1 -10
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/undefined +285 -0
- package/license +10 -10
- package/package.json +166 -166
- package/src/accordion/accordion-model.d.ts +199 -199
- package/src/accordion/accordion.js +19 -19
- package/src/appbar/appbar-model.d.ts +51 -51
- package/src/appbar/appbar.js +19 -19
- package/src/breadcrumb/breadcrumb-model.d.ts +114 -114
- package/src/breadcrumb/breadcrumb.js +19 -19
- package/src/carousel/carousel-model.d.ts +204 -204
- package/src/carousel/carousel.js +19 -19
- package/src/common/h-scroll-model.d.ts +6 -6
- package/src/common/h-scroll.js +19 -19
- package/src/common/menu-base-model.d.ts +234 -234
- package/src/common/menu-base.js +35 -20
- package/src/common/v-scroll-model.d.ts +6 -6
- package/src/common/v-scroll.js +19 -19
- package/src/context-menu/context-menu-model.d.ts +29 -29
- package/src/context-menu/context-menu.js +19 -19
- package/src/menu/menu-model.d.ts +45 -45
- package/src/menu/menu.js +19 -19
- package/src/sidebar/sidebar-model.d.ts +189 -189
- package/src/sidebar/sidebar.js +19 -19
- package/src/stepper/stepper.js +19 -19
- package/src/stepper-base/stepper-base.js +19 -19
- package/src/tab/tab-model.d.ts +305 -305
- package/src/tab/tab.js +19 -19
- package/src/toolbar/toolbar-model.d.ts +209 -209
- package/src/toolbar/toolbar.js +19 -19
- package/src/treeview/treeview-model.d.ts +520 -520
- package/src/treeview/treeview.d.ts +2 -1
- package/src/treeview/treeview.js +28 -24
- package/styles/accordion/_all.scss +2 -2
- package/styles/accordion/_bds-definition.scss +167 -167
- package/styles/accordion/_bigger.scss +121 -121
- package/styles/accordion/_bootstrap-dark-definition.scss +169 -167
- package/styles/accordion/_bootstrap-definition.scss +167 -167
- package/styles/accordion/_bootstrap4-definition.scss +177 -175
- package/styles/accordion/_bootstrap5-definition.scss +168 -168
- package/styles/accordion/_bootstrap5.3-definition.scss +168 -168
- package/styles/accordion/_fabric-dark-definition.scss +171 -171
- package/styles/accordion/_fabric-definition.scss +171 -171
- package/styles/accordion/_fluent-definition.scss +168 -168
- package/styles/accordion/_fluent2-definition.scss +167 -167
- package/styles/accordion/_fusionnew-definition.scss +168 -168
- package/styles/accordion/_highcontrast-definition.scss +193 -193
- package/styles/accordion/_highcontrast-light-definition.scss +193 -193
- package/styles/accordion/_layout.scss +236 -236
- package/styles/accordion/_material-dark-definition.scss +171 -171
- package/styles/accordion/_material-definition.scss +165 -165
- package/styles/accordion/_material3-definition.scss +168 -168
- package/styles/accordion/_tailwind-definition.scss +167 -167
- package/styles/accordion/_tailwind3-definition.scss +168 -168
- package/styles/accordion/_theme.scss +418 -418
- package/styles/accordion/bootstrap-dark.css +12 -12
- package/styles/accordion/bootstrap4.css +4 -4
- package/styles/accordion/bootstrap5-dark.css +37 -37
- package/styles/accordion/bootstrap5.css +16 -16
- package/styles/accordion/fabric.css +11 -11
- package/styles/accordion/icons/_bds.scss +15 -15
- package/styles/accordion/icons/_bootstrap-dark.scss +15 -15
- package/styles/accordion/icons/_bootstrap.scss +15 -15
- package/styles/accordion/icons/_bootstrap4.scss +15 -15
- package/styles/accordion/icons/_bootstrap5.3.scss +15 -15
- package/styles/accordion/icons/_bootstrap5.scss +15 -15
- package/styles/accordion/icons/_fabric-dark.scss +15 -15
- package/styles/accordion/icons/_fabric.scss +15 -15
- package/styles/accordion/icons/_fluent.scss +15 -15
- package/styles/accordion/icons/_fluent2.scss +15 -15
- package/styles/accordion/icons/_fusionnew.scss +15 -15
- package/styles/accordion/icons/_highcontrast-light.scss +15 -15
- package/styles/accordion/icons/_highcontrast.scss +15 -15
- package/styles/accordion/icons/_material-dark.scss +15 -15
- package/styles/accordion/icons/_material.scss +15 -15
- package/styles/accordion/icons/_material3.scss +15 -15
- package/styles/accordion/icons/_tailwind.scss +15 -15
- package/styles/accordion/icons/_tailwind3.scss +15 -15
- package/styles/accordion/material3-dark.scss +1 -1
- package/styles/accordion/material3.scss +1 -1
- package/styles/accordion/tailwind-dark.css +2 -2
- package/styles/appbar/_all.scss +2 -2
- package/styles/appbar/_bds-definition.scss +24 -24
- package/styles/appbar/_bigger.scss +15 -15
- package/styles/appbar/_bootstrap-dark-definition.scss +6 -6
- package/styles/appbar/_bootstrap-definition.scss +6 -6
- package/styles/appbar/_bootstrap4-definition.scss +6 -6
- package/styles/appbar/_bootstrap5-definition.scss +6 -6
- package/styles/appbar/_bootstrap5.3-definition.scss +6 -6
- package/styles/appbar/_fabric-dark-definition.scss +6 -6
- package/styles/appbar/_fabric-definition.scss +6 -6
- package/styles/appbar/_fluent-definition.scss +6 -6
- package/styles/appbar/_fluent2-definition.scss +23 -23
- package/styles/appbar/_fusionnew-definition.scss +6 -6
- package/styles/appbar/_highcontrast-definition.scss +6 -6
- package/styles/appbar/_highcontrast-light-definition.scss +6 -6
- package/styles/appbar/_layout.scss +76 -76
- package/styles/appbar/_material-dark-definition.scss +6 -6
- package/styles/appbar/_material-definition.scss +6 -6
- package/styles/appbar/_material3-definition.scss +6 -6
- package/styles/appbar/_tailwind-definition.scss +6 -6
- package/styles/appbar/_tailwind3-definition.scss +6 -6
- package/styles/appbar/_theme.scss +216 -216
- package/styles/appbar/material3-dark.scss +1 -1
- package/styles/appbar/material3.scss +1 -1
- package/styles/bds-lite.css +70 -5
- package/styles/bds.css +72 -7
- package/styles/bootstrap-dark-lite.css +120 -55
- package/styles/bootstrap-dark.css +124 -59
- package/styles/bootstrap-lite.css +72 -7
- package/styles/bootstrap.css +76 -11
- package/styles/bootstrap4-lite.css +153 -88
- package/styles/bootstrap4.css +156 -91
- package/styles/bootstrap5-dark-lite.css +288 -229
- package/styles/bootstrap5-dark.css +291 -232
- package/styles/bootstrap5-lite.css +150 -91
- package/styles/bootstrap5.3-lite.css +88 -27
- package/styles/bootstrap5.3.css +96 -29
- package/styles/bootstrap5.css +153 -94
- package/styles/breadcrumb/_all.scss +2 -2
- package/styles/breadcrumb/_bds-definition.scss +60 -60
- package/styles/breadcrumb/_bigger.scss +168 -166
- package/styles/breadcrumb/_bootstrap-dark-definition.scss +54 -54
- package/styles/breadcrumb/_bootstrap-definition.scss +54 -54
- package/styles/breadcrumb/_bootstrap4-definition.scss +56 -54
- package/styles/breadcrumb/_bootstrap5-definition.scss +65 -63
- package/styles/breadcrumb/_bootstrap5.3-definition.scss +61 -61
- package/styles/breadcrumb/_fabric-dark-definition.scss +59 -59
- package/styles/breadcrumb/_fabric-definition.scss +59 -59
- package/styles/breadcrumb/_fluent-definition.scss +63 -63
- package/styles/breadcrumb/_fluent2-definition.scss +61 -61
- package/styles/breadcrumb/_fusionnew-definition.scss +65 -59
- package/styles/breadcrumb/_highcontrast-definition.scss +61 -61
- package/styles/breadcrumb/_highcontrast-light-definition.scss +61 -61
- package/styles/breadcrumb/_layout.scss +465 -449
- package/styles/breadcrumb/_material-dark-definition.scss +50 -50
- package/styles/breadcrumb/_material-definition.scss +50 -50
- package/styles/breadcrumb/_material3-definition.scss +60 -60
- package/styles/breadcrumb/_tailwind-definition.scss +60 -60
- package/styles/breadcrumb/_tailwind3-definition.scss +61 -61
- package/styles/breadcrumb/_theme.scss +296 -296
- package/styles/breadcrumb/bds.css +15 -0
- package/styles/breadcrumb/bootstrap-dark.css +17 -2
- package/styles/breadcrumb/bootstrap.css +15 -0
- package/styles/breadcrumb/bootstrap4.css +19 -4
- package/styles/breadcrumb/bootstrap5-dark.css +27 -12
- package/styles/breadcrumb/bootstrap5.3.css +15 -0
- package/styles/breadcrumb/bootstrap5.css +18 -3
- package/styles/breadcrumb/fabric-dark.css +18 -3
- package/styles/breadcrumb/fabric.css +15 -0
- package/styles/breadcrumb/fluent-dark.css +15 -0
- package/styles/breadcrumb/fluent.css +15 -0
- package/styles/breadcrumb/fluent2.css +15 -0
- package/styles/breadcrumb/highcontrast-light.css +15 -0
- package/styles/breadcrumb/highcontrast.css +15 -0
- package/styles/breadcrumb/icons/_bds.scss +23 -23
- package/styles/breadcrumb/icons/_bootstrap-dark.scss +12 -12
- package/styles/breadcrumb/icons/_bootstrap.scss +12 -12
- package/styles/breadcrumb/icons/_bootstrap4.scss +12 -12
- package/styles/breadcrumb/icons/_bootstrap5.3.scss +23 -23
- package/styles/breadcrumb/icons/_bootstrap5.scss +23 -23
- package/styles/breadcrumb/icons/_fabric-dark.scss +12 -12
- package/styles/breadcrumb/icons/_fabric.scss +12 -12
- package/styles/breadcrumb/icons/_fluent.scss +23 -23
- package/styles/breadcrumb/icons/_fluent2.scss +23 -23
- package/styles/breadcrumb/icons/_fusionnew.scss +23 -23
- package/styles/breadcrumb/icons/_highcontrast-light.scss +12 -12
- package/styles/breadcrumb/icons/_highcontrast.scss +12 -12
- package/styles/breadcrumb/icons/_material-dark.scss +23 -23
- package/styles/breadcrumb/icons/_material.scss +23 -23
- package/styles/breadcrumb/icons/_material3.scss +12 -12
- package/styles/breadcrumb/icons/_tailwind-dark.scss +23 -23
- package/styles/breadcrumb/icons/_tailwind.scss +23 -23
- package/styles/breadcrumb/icons/_tailwind3.scss +23 -23
- package/styles/breadcrumb/material-dark.css +15 -0
- package/styles/breadcrumb/material.css +15 -0
- package/styles/breadcrumb/material3-dark.css +15 -0
- package/styles/breadcrumb/material3-dark.scss +1 -1
- package/styles/breadcrumb/material3.css +15 -0
- package/styles/breadcrumb/material3.scss +1 -1
- package/styles/breadcrumb/tailwind-dark.css +15 -0
- package/styles/breadcrumb/tailwind.css +15 -0
- package/styles/breadcrumb/tailwind3.css +15 -0
- package/styles/carousel/_all.scss +2 -2
- package/styles/carousel/_bds-definition.scss +20 -20
- package/styles/carousel/_bootstrap-dark-definition.scss +20 -20
- package/styles/carousel/_bootstrap-definition.scss +20 -20
- package/styles/carousel/_bootstrap4-definition.scss +20 -20
- package/styles/carousel/_bootstrap5-definition.scss +20 -20
- package/styles/carousel/_bootstrap5.3-definition.scss +20 -20
- package/styles/carousel/_fabric-dark-definition.scss +20 -20
- package/styles/carousel/_fabric-definition.scss +20 -20
- package/styles/carousel/_fluent-definition.scss +20 -20
- package/styles/carousel/_fluent2-definition.scss +23 -23
- package/styles/carousel/_fusionnew-definition.scss +20 -20
- package/styles/carousel/_highcontrast-definition.scss +20 -20
- package/styles/carousel/_highcontrast-light-definition.scss +20 -20
- package/styles/carousel/_layout.scss +257 -257
- package/styles/carousel/_material-dark-definition.scss +20 -20
- package/styles/carousel/_material-definition.scss +20 -20
- package/styles/carousel/_material3-definition.scss +21 -21
- package/styles/carousel/_tailwind-definition.scss +20 -20
- package/styles/carousel/_tailwind3-definition.scss +24 -24
- package/styles/carousel/_theme.scss +108 -108
- package/styles/carousel/icons/_bds.scss +30 -30
- package/styles/carousel/icons/_bootstrap-dark.scss +30 -30
- package/styles/carousel/icons/_bootstrap.scss +30 -30
- package/styles/carousel/icons/_bootstrap4.scss +30 -30
- package/styles/carousel/icons/_bootstrap5.3.scss +30 -30
- package/styles/carousel/icons/_bootstrap5.scss +30 -30
- package/styles/carousel/icons/_fabric-dark.scss +30 -30
- package/styles/carousel/icons/_fabric.scss +30 -30
- package/styles/carousel/icons/_fluent.scss +30 -30
- package/styles/carousel/icons/_fluent2.scss +30 -30
- package/styles/carousel/icons/_fusionnew.scss +30 -30
- package/styles/carousel/icons/_highcontrast-light.scss +30 -30
- package/styles/carousel/icons/_highcontrast.scss +30 -30
- package/styles/carousel/icons/_material-dark.scss +30 -30
- package/styles/carousel/icons/_material.scss +30 -30
- package/styles/carousel/icons/_material3.scss +30 -30
- package/styles/carousel/icons/_tailwind.scss +30 -30
- package/styles/carousel/icons/_tailwind3.scss +30 -30
- package/styles/carousel/material3-dark.scss +1 -1
- package/styles/carousel/material3.scss +1 -1
- package/styles/context-menu/_all.scss +2 -2
- package/styles/context-menu/_bds-definition.scss +67 -67
- package/styles/context-menu/_bigger.scss +111 -111
- package/styles/context-menu/_bootstrap-dark-definition.scss +50 -50
- package/styles/context-menu/_bootstrap-definition.scss +50 -50
- package/styles/context-menu/_bootstrap4-definition.scss +52 -50
- package/styles/context-menu/_bootstrap5-definition.scss +52 -52
- package/styles/context-menu/_bootstrap5.3-definition.scss +52 -52
- package/styles/context-menu/_fabric-dark-definition.scss +50 -50
- package/styles/context-menu/_fabric-definition.scss +50 -50
- package/styles/context-menu/_fluent-definition.scss +51 -51
- package/styles/context-menu/_fluent2-definition.scss +52 -52
- package/styles/context-menu/_fusionnew-definition.scss +52 -51
- package/styles/context-menu/_highcontrast-definition.scss +50 -50
- package/styles/context-menu/_highcontrast-light-definition.scss +50 -50
- package/styles/context-menu/_layout-mixin.scss +140 -140
- package/styles/context-menu/_layout.scss +179 -174
- package/styles/context-menu/_material-dark-definition.scss +50 -50
- package/styles/context-menu/_material-definition.scss +50 -50
- package/styles/context-menu/_material3-definition.scss +51 -51
- package/styles/context-menu/_tailwind-definition.scss +52 -52
- package/styles/context-menu/_tailwind3-definition.scss +55 -55
- package/styles/context-menu/_theme-mixin.scss +91 -91
- package/styles/context-menu/_theme.scss +77 -69
- package/styles/context-menu/bds.css +7 -1
- package/styles/context-menu/bootstrap-dark.css +7 -1
- package/styles/context-menu/bootstrap.css +7 -1
- package/styles/context-menu/bootstrap4.css +8 -2
- package/styles/context-menu/bootstrap5-dark.css +14 -8
- package/styles/context-menu/bootstrap5.3.css +7 -1
- package/styles/context-menu/bootstrap5.css +7 -1
- package/styles/context-menu/fabric-dark.css +7 -1
- package/styles/context-menu/fabric.css +7 -1
- package/styles/context-menu/fluent-dark.css +7 -1
- package/styles/context-menu/fluent.css +7 -1
- package/styles/context-menu/fluent2.css +7 -1
- package/styles/context-menu/highcontrast-light.css +7 -1
- package/styles/context-menu/highcontrast.css +7 -1
- package/styles/context-menu/icons/_bds.scss +31 -31
- package/styles/context-menu/icons/_bootstrap-dark.scss +31 -31
- package/styles/context-menu/icons/_bootstrap.scss +31 -31
- package/styles/context-menu/icons/_bootstrap4.scss +31 -31
- package/styles/context-menu/icons/_bootstrap5.3.scss +31 -31
- package/styles/context-menu/icons/_bootstrap5.scss +31 -31
- package/styles/context-menu/icons/_fabric-dark.scss +31 -31
- package/styles/context-menu/icons/_fabric.scss +31 -31
- package/styles/context-menu/icons/_fluent.scss +31 -31
- package/styles/context-menu/icons/_fluent2.scss +31 -31
- package/styles/context-menu/icons/_fusionnew.scss +31 -31
- package/styles/context-menu/icons/_highcontrast-light.scss +31 -31
- package/styles/context-menu/icons/_highcontrast.scss +31 -31
- package/styles/context-menu/icons/_material-dark.scss +31 -31
- package/styles/context-menu/icons/_material.scss +31 -31
- package/styles/context-menu/icons/_material3.scss +31 -31
- package/styles/context-menu/icons/_tailwind-dark.scss +31 -31
- package/styles/context-menu/icons/_tailwind.scss +31 -31
- package/styles/context-menu/icons/_tailwind3.scss +31 -31
- package/styles/context-menu/material-dark.css +8 -1
- package/styles/context-menu/material.css +7 -1
- package/styles/context-menu/material3-dark.css +8 -1
- package/styles/context-menu/material3-dark.scss +1 -1
- package/styles/context-menu/material3.css +8 -1
- package/styles/context-menu/material3.scss +1 -1
- package/styles/context-menu/tailwind-dark.css +7 -1
- package/styles/context-menu/tailwind.css +7 -1
- package/styles/context-menu/tailwind3.css +7 -1
- package/styles/fabric-dark-lite.css +76 -11
- package/styles/fabric-dark.css +78 -13
- package/styles/fabric-lite.css +108 -43
- package/styles/fabric.css +110 -45
- package/styles/fluent-dark-lite.css +88 -25
- package/styles/fluent-dark.css +91 -28
- package/styles/fluent-lite.css +88 -25
- package/styles/fluent.css +91 -28
- package/styles/fluent2-lite.css +94 -36
- package/styles/fluent2.css +96 -38
- package/styles/h-scroll/_all.scss +2 -2
- package/styles/h-scroll/_bds-definition.scss +83 -83
- package/styles/h-scroll/_bigger.scss +39 -39
- package/styles/h-scroll/_bootstrap-dark-definition.scss +57 -57
- package/styles/h-scroll/_bootstrap-definition.scss +56 -56
- package/styles/h-scroll/_bootstrap4-definition.scss +58 -56
- package/styles/h-scroll/_bootstrap5-definition.scss +83 -83
- package/styles/h-scroll/_bootstrap5.3-definition.scss +83 -83
- package/styles/h-scroll/_fabric-dark-definition.scss +58 -58
- package/styles/h-scroll/_fabric-definition.scss +55 -55
- package/styles/h-scroll/_fluent-definition.scss +83 -83
- package/styles/h-scroll/_fluent2-definition.scss +83 -83
- package/styles/h-scroll/_fusionnew-definition.scss +83 -83
- package/styles/h-scroll/_highcontrast-definition.scss +56 -56
- package/styles/h-scroll/_highcontrast-light-definition.scss +59 -59
- package/styles/h-scroll/_layout.scss +160 -160
- package/styles/h-scroll/_material-dark-definition.scss +85 -85
- package/styles/h-scroll/_material-definition.scss +82 -82
- package/styles/h-scroll/_material3-definition.scss +83 -83
- package/styles/h-scroll/_tailwind-definition.scss +83 -83
- package/styles/h-scroll/_tailwind3-definition.scss +83 -83
- package/styles/h-scroll/_theme.scss +146 -146
- package/styles/h-scroll/bds.css +1 -1
- package/styles/h-scroll/bootstrap-dark.css +1 -1
- package/styles/h-scroll/bootstrap.css +1 -1
- package/styles/h-scroll/bootstrap4.css +6 -6
- package/styles/h-scroll/bootstrap5-dark.css +7 -7
- package/styles/h-scroll/bootstrap5.3.css +1 -1
- package/styles/h-scroll/bootstrap5.css +1 -1
- package/styles/h-scroll/fabric-dark.css +1 -1
- package/styles/h-scroll/fabric.css +2 -2
- package/styles/h-scroll/fluent-dark.css +1 -1
- package/styles/h-scroll/fluent.css +1 -1
- package/styles/h-scroll/fluent2.css +1 -1
- package/styles/h-scroll/highcontrast-light.css +1 -1
- package/styles/h-scroll/highcontrast.css +1 -1
- package/styles/h-scroll/icons/_bds.scss +49 -49
- package/styles/h-scroll/icons/_bootstrap-dark.scss +49 -49
- package/styles/h-scroll/icons/_bootstrap.scss +49 -49
- package/styles/h-scroll/icons/_bootstrap4.scss +49 -49
- package/styles/h-scroll/icons/_bootstrap5.3.scss +49 -49
- package/styles/h-scroll/icons/_bootstrap5.scss +49 -49
- package/styles/h-scroll/icons/_fabric-dark.scss +49 -49
- package/styles/h-scroll/icons/_fabric.scss +49 -49
- package/styles/h-scroll/icons/_fluent.scss +49 -49
- package/styles/h-scroll/icons/_fluent2.scss +49 -49
- package/styles/h-scroll/icons/_fusionnew.scss +49 -49
- package/styles/h-scroll/icons/_highcontrast-light.scss +49 -49
- package/styles/h-scroll/icons/_highcontrast.scss +49 -49
- package/styles/h-scroll/icons/_material-dark.scss +49 -49
- package/styles/h-scroll/icons/_material.scss +49 -49
- package/styles/h-scroll/icons/_material3.scss +49 -49
- package/styles/h-scroll/icons/_tailwind.scss +49 -49
- package/styles/h-scroll/icons/_tailwind3.scss +49 -49
- package/styles/h-scroll/material-dark.css +1 -1
- package/styles/h-scroll/material.css +1 -1
- package/styles/h-scroll/material3-dark.css +1 -1
- package/styles/h-scroll/material3-dark.scss +1 -1
- package/styles/h-scroll/material3.css +1 -1
- package/styles/h-scroll/material3.scss +1 -1
- package/styles/h-scroll/tailwind-dark.css +1 -1
- package/styles/h-scroll/tailwind.css +1 -1
- package/styles/h-scroll/tailwind3.css +1 -1
- package/styles/highcontrast-light-lite.css +70 -5
- package/styles/highcontrast-light.css +72 -7
- package/styles/highcontrast-lite.css +73 -8
- package/styles/highcontrast.css +75 -10
- package/styles/material-dark-lite.css +75 -9
- package/styles/material-dark.css +77 -11
- package/styles/material-lite.css +81 -16
- package/styles/material.css +83 -18
- package/styles/material3-dark-lite.css +81 -15
- package/styles/material3-dark.css +91 -20
- package/styles/material3-dark.scss +1 -1
- package/styles/material3-lite.css +81 -15
- package/styles/material3.css +91 -20
- package/styles/material3.scss +1 -1
- package/styles/menu/_all.scss +2 -2
- package/styles/menu/_bds-definition.scss +65 -65
- package/styles/menu/_bigger.scss +381 -381
- package/styles/menu/_bootstrap-dark-definition.scss +61 -61
- package/styles/menu/_bootstrap-definition.scss +65 -65
- package/styles/menu/_bootstrap4-definition.scss +66 -64
- package/styles/menu/_bootstrap5-definition.scss +66 -66
- package/styles/menu/_bootstrap5.3-definition.scss +66 -66
- package/styles/menu/_fabric-dark-definition.scss +61 -61
- package/styles/menu/_fabric-definition.scss +64 -64
- package/styles/menu/_fluent-definition.scss +66 -66
- package/styles/menu/_fluent2-definition.scss +67 -67
- package/styles/menu/_fusionnew-definition.scss +66 -66
- package/styles/menu/_highcontrast-definition.scss +65 -65
- package/styles/menu/_highcontrast-light-definition.scss +61 -61
- package/styles/menu/_layout.scss +501 -501
- package/styles/menu/_material-dark-definition.scss +61 -61
- package/styles/menu/_material-definition.scss +64 -64
- package/styles/menu/_material3-definition.scss +66 -66
- package/styles/menu/_tailwind-definition.scss +65 -65
- package/styles/menu/_tailwind3-definition.scss +66 -66
- package/styles/menu/_theme.scss +428 -418
- package/styles/menu/bootstrap4.css +13 -13
- package/styles/menu/bootstrap5-dark.css +14 -14
- package/styles/menu/fluent2.css +12 -3
- package/styles/menu/icons/_bds.scss +104 -104
- package/styles/menu/icons/_bootstrap-dark.scss +105 -105
- package/styles/menu/icons/_bootstrap.scss +104 -104
- package/styles/menu/icons/_bootstrap4.scss +104 -104
- package/styles/menu/icons/_bootstrap5.3.scss +104 -104
- package/styles/menu/icons/_bootstrap5.scss +104 -104
- package/styles/menu/icons/_fabric-dark.scss +104 -104
- package/styles/menu/icons/_fabric.scss +104 -104
- package/styles/menu/icons/_fluent.scss +104 -104
- package/styles/menu/icons/_fluent2.scss +104 -104
- package/styles/menu/icons/_fusionnew.scss +104 -104
- package/styles/menu/icons/_highcontrast-light.scss +104 -104
- package/styles/menu/icons/_highcontrast.scss +104 -104
- package/styles/menu/icons/_material-dark.scss +104 -104
- package/styles/menu/icons/_material.scss +104 -104
- package/styles/menu/icons/_material3.scss +104 -104
- package/styles/menu/icons/_tailwind-dark.scss +104 -104
- package/styles/menu/icons/_tailwind.scss +104 -104
- package/styles/menu/icons/_tailwind3.scss +104 -104
- package/styles/menu/material3-dark.scss +1 -1
- package/styles/menu/material3.scss +1 -1
- package/styles/pager/_all.scss +2 -2
- package/styles/pager/_bds-definition.scss +152 -152
- package/styles/pager/_bigger.scss +364 -363
- package/styles/pager/_bootstrap-dark-definition.scss +152 -151
- package/styles/pager/_bootstrap-definition.scss +151 -151
- package/styles/pager/_bootstrap4-definition.scss +152 -151
- package/styles/pager/_bootstrap5-definition.scss +166 -166
- package/styles/pager/_bootstrap5.3-definition.scss +166 -166
- package/styles/pager/_fabric-dark-definition.scss +149 -149
- package/styles/pager/_fabric-definition.scss +149 -149
- package/styles/pager/_fluent-definition.scss +153 -153
- package/styles/pager/_fluent2-definition.scss +152 -152
- package/styles/pager/_fusionnew-definition.scss +166 -166
- package/styles/pager/_highcontrast-definition.scss +149 -149
- package/styles/pager/_highcontrast-light-definition.scss +149 -149
- package/styles/pager/_layout.scss +776 -762
- package/styles/pager/_material-dark-definition.scss +150 -150
- package/styles/pager/_material-definition.scss +150 -150
- package/styles/pager/_material3-definition.scss +166 -166
- package/styles/pager/_tailwind-definition.scss +152 -152
- package/styles/pager/_tailwind3-definition.scss +166 -166
- package/styles/pager/_theme.scss +189 -189
- package/styles/pager/bds.css +13 -3
- package/styles/pager/bootstrap-dark.css +17 -7
- package/styles/pager/bootstrap.css +13 -3
- package/styles/pager/bootstrap4.css +14 -4
- package/styles/pager/bootstrap5-dark.css +21 -17
- package/styles/pager/bootstrap5.3.css +7 -3
- package/styles/pager/bootstrap5.css +12 -8
- package/styles/pager/fabric-dark.css +13 -3
- package/styles/pager/fabric.css +15 -5
- package/styles/pager/fluent-dark.css +14 -4
- package/styles/pager/fluent.css +14 -4
- package/styles/pager/fluent2.css +16 -3
- package/styles/pager/highcontrast-light.css +13 -3
- package/styles/pager/highcontrast.css +13 -3
- package/styles/pager/icons/_bds.scss +50 -50
- package/styles/pager/icons/_bootstrap-dark.scss +50 -50
- package/styles/pager/icons/_bootstrap.scss +50 -50
- package/styles/pager/icons/_bootstrap4.scss +50 -50
- package/styles/pager/icons/_bootstrap5.3.scss +50 -50
- package/styles/pager/icons/_bootstrap5.scss +50 -50
- package/styles/pager/icons/_fabric-dark.scss +50 -50
- package/styles/pager/icons/_fabric.scss +50 -50
- package/styles/pager/icons/_fluent.scss +50 -50
- package/styles/pager/icons/_fluent2.scss +50 -50
- package/styles/pager/icons/_fusionnew.scss +50 -50
- package/styles/pager/icons/_highcontrast-light.scss +50 -50
- package/styles/pager/icons/_highcontrast.scss +46 -46
- package/styles/pager/icons/_material-dark.scss +50 -50
- package/styles/pager/icons/_material.scss +46 -46
- package/styles/pager/icons/_material3.scss +50 -50
- package/styles/pager/icons/_tailwind.scss +50 -50
- package/styles/pager/icons/_tailwind3.scss +50 -50
- package/styles/pager/material-dark.css +13 -3
- package/styles/pager/material.css +13 -3
- package/styles/pager/material3-dark.css +20 -5
- package/styles/pager/material3-dark.scss +1 -1
- package/styles/pager/material3.css +20 -5
- package/styles/pager/material3.scss +1 -1
- package/styles/pager/tailwind-dark.css +13 -3
- package/styles/pager/tailwind.css +13 -3
- package/styles/pager/tailwind3.css +14 -4
- package/styles/sidebar/_all.scss +3 -3
- package/styles/sidebar/_bds-definition.scss +53 -53
- package/styles/sidebar/_bootstrap-dark-definition.scss +4 -4
- package/styles/sidebar/_bootstrap-definition.scss +4 -4
- package/styles/sidebar/_bootstrap4-definition.scss +4 -4
- package/styles/sidebar/_bootstrap5-definition.scss +6 -6
- package/styles/sidebar/_bootstrap5.3-definition.scss +6 -6
- package/styles/sidebar/_fabric-dark-definition.scss +4 -4
- package/styles/sidebar/_fabric-definition.scss +4 -4
- package/styles/sidebar/_fluent-definition.scss +6 -6
- package/styles/sidebar/_fluent2-definition.scss +8 -8
- package/styles/sidebar/_fusionnew-definition.scss +6 -6
- package/styles/sidebar/_highcontrast-definition.scss +4 -4
- package/styles/sidebar/_highcontrast-light-definition.scss +4 -4
- package/styles/sidebar/_icons.scss +1 -1
- package/styles/sidebar/_layout.scss +1 -1
- package/styles/sidebar/_material-dark-definition.scss +4 -4
- package/styles/sidebar/_material-definition.scss +6 -6
- package/styles/sidebar/_material3-definition.scss +4 -4
- package/styles/sidebar/_tailwind-definition.scss +6 -6
- package/styles/sidebar/_tailwind3-definition.scss +6 -6
- package/styles/sidebar/_theme.scss +251 -251
- package/styles/sidebar/bootstrap5-dark.css +1 -1
- package/styles/sidebar/material3-dark.scss +1 -1
- package/styles/sidebar/material3.scss +1 -1
- package/styles/stepper/_bds-definition.scss +72 -72
- package/styles/stepper/_bigger.scss +53 -53
- package/styles/stepper/_bootstrap4-definition.scss +4 -2
- package/styles/stepper/_bootstrap5.3-definition.scss +72 -72
- package/styles/stepper/_fluent2-definition.scss +72 -72
- package/styles/stepper/_material-dark-definition.scss +4 -2
- package/styles/stepper/_material-definition.scss +7 -5
- package/styles/stepper/_tailwind3-definition.scss +72 -72
- package/styles/stepper/bootstrap-dark.css +2 -2
- package/styles/stepper/bootstrap4.css +2 -2
- package/styles/stepper/bootstrap5-dark.css +20 -20
- package/styles/stepper/bootstrap5.css +2 -2
- package/styles/stepper/fabric-dark.css +2 -2
- package/styles/stepper/fabric.css +2 -2
- package/styles/stepper/fluent-dark.css +1 -1
- package/styles/stepper/fluent.css +1 -1
- package/styles/stepper/icons/_bds.scss +5 -5
- package/styles/stepper/icons/_bootstrap5.3.scss +5 -5
- package/styles/stepper/icons/_fluent2.scss +5 -5
- package/styles/stepper/icons/_tailwind3.scss +5 -5
- package/styles/stepper/material-dark.css +2 -2
- package/styles/stepper/material.css +8 -8
- package/styles/stepper/material3-dark.scss +1 -1
- package/styles/stepper/material3.scss +1 -1
- package/styles/tab/_all.scss +2 -2
- package/styles/tab/_bds-definition.scss +661 -661
- package/styles/tab/_bigger.scss +1276 -1276
- package/styles/tab/_bootstrap-dark-definition.scss +630 -628
- package/styles/tab/_bootstrap-definition.scss +629 -629
- package/styles/tab/_bootstrap4-definition.scss +637 -635
- package/styles/tab/_bootstrap5-definition.scss +635 -633
- package/styles/tab/_bootstrap5.3-definition.scss +636 -634
- package/styles/tab/_fabric-dark-definition.scss +641 -641
- package/styles/tab/_fabric-definition.scss +643 -643
- package/styles/tab/_fluent-definition.scss +637 -635
- package/styles/tab/_fluent2-definition.scss +664 -664
- package/styles/tab/_fusionnew-definition.scss +632 -632
- package/styles/tab/_highcontrast-definition.scss +667 -667
- package/styles/tab/_highcontrast-light-definition.scss +666 -666
- package/styles/tab/_icons.scss +34 -34
- package/styles/tab/_layout.scss +2191 -2187
- package/styles/tab/_material-dark-definition.scss +646 -646
- package/styles/tab/_material-definition.scss +645 -645
- package/styles/tab/_material3-definition.scss +634 -634
- package/styles/tab/_tailwind-definition.scss +648 -648
- package/styles/tab/_tailwind3-definition.scss +634 -634
- package/styles/tab/_theme.scss +1580 -1580
- package/styles/tab/bds.css +5 -0
- package/styles/tab/bootstrap-dark.css +35 -30
- package/styles/tab/bootstrap.css +7 -2
- package/styles/tab/bootstrap4.css +38 -33
- package/styles/tab/bootstrap5-dark.css +60 -55
- package/styles/tab/bootstrap5.3.css +18 -13
- package/styles/tab/bootstrap5.css +40 -35
- package/styles/tab/fabric-dark.css +5 -0
- package/styles/tab/fabric.css +10 -5
- package/styles/tab/fluent-dark.css +19 -14
- package/styles/tab/fluent.css +19 -14
- package/styles/tab/fluent2.css +7 -2
- package/styles/tab/highcontrast-light.css +5 -0
- package/styles/tab/highcontrast.css +6 -1
- package/styles/tab/icons/_bds.scss +90 -90
- package/styles/tab/icons/_bootstrap-dark.scss +98 -98
- package/styles/tab/icons/_bootstrap.scss +98 -98
- package/styles/tab/icons/_bootstrap4.scss +101 -101
- package/styles/tab/icons/_bootstrap5.3.scss +90 -90
- package/styles/tab/icons/_bootstrap5.scss +90 -90
- package/styles/tab/icons/_fabric-dark.scss +98 -98
- package/styles/tab/icons/_fabric.scss +98 -98
- package/styles/tab/icons/_fluent.scss +98 -98
- package/styles/tab/icons/_fluent2.scss +98 -98
- package/styles/tab/icons/_fusionnew.scss +90 -90
- package/styles/tab/icons/_highcontrast-light.scss +90 -90
- package/styles/tab/icons/_highcontrast.scss +101 -101
- package/styles/tab/icons/_material-dark.scss +90 -90
- package/styles/tab/icons/_material.scss +90 -90
- package/styles/tab/icons/_material3.scss +90 -90
- package/styles/tab/icons/_tailwind.scss +90 -90
- package/styles/tab/icons/_tailwind3.scss +90 -90
- package/styles/tab/material-dark.css +5 -0
- package/styles/tab/material.css +6 -1
- package/styles/tab/material3-dark.css +15 -10
- package/styles/tab/material3-dark.scss +1 -1
- package/styles/tab/material3.css +15 -10
- package/styles/tab/material3.scss +1 -1
- package/styles/tab/tailwind-dark.css +13 -8
- package/styles/tab/tailwind.css +13 -8
- package/styles/tab/tailwind3.css +32 -26
- package/styles/tailwind-dark-lite.css +80 -15
- package/styles/tailwind-dark.css +84 -19
- package/styles/tailwind-lite.css +78 -13
- package/styles/tailwind.css +82 -17
- package/styles/tailwind3-lite.css +105 -58
- package/styles/tailwind3.css +109 -61
- package/styles/toolbar/_all.scss +2 -2
- package/styles/toolbar/_bds-definition.scss +197 -197
- package/styles/toolbar/_bigger.scss +323 -323
- package/styles/toolbar/_bootstrap-dark-definition.scss +193 -193
- package/styles/toolbar/_bootstrap-definition.scss +203 -203
- package/styles/toolbar/_bootstrap4-definition.scss +200 -198
- package/styles/toolbar/_bootstrap5-definition.scss +198 -198
- package/styles/toolbar/_bootstrap5.3-definition.scss +198 -198
- package/styles/toolbar/_fabric-dark-definition.scss +207 -207
- package/styles/toolbar/_fabric-definition.scss +195 -195
- package/styles/toolbar/_fluent-definition.scss +197 -197
- package/styles/toolbar/_fluent2-definition.scss +198 -198
- package/styles/toolbar/_fusionnew-definition.scss +198 -198
- package/styles/toolbar/_highcontrast-definition.scss +204 -204
- package/styles/toolbar/_highcontrast-light-definition.scss +218 -218
- package/styles/toolbar/_layout.scss +781 -748
- package/styles/toolbar/_material-dark-definition.scss +233 -231
- package/styles/toolbar/_material-definition.scss +221 -219
- package/styles/toolbar/_material3-definition.scss +199 -199
- package/styles/toolbar/_tailwind-definition.scss +197 -197
- package/styles/toolbar/_tailwind3-definition.scss +199 -199
- package/styles/toolbar/_theme.scss +410 -436
- package/styles/toolbar/bds.css +23 -2
- package/styles/toolbar/bootstrap-dark.css +25 -4
- package/styles/toolbar/bootstrap.css +25 -4
- package/styles/toolbar/bootstrap4.css +35 -14
- package/styles/toolbar/bootstrap5-dark.css +70 -49
- package/styles/toolbar/bootstrap5.3.css +33 -4
- package/styles/toolbar/bootstrap5.css +46 -25
- package/styles/toolbar/fabric-dark.css +23 -2
- package/styles/toolbar/fabric.css +32 -11
- package/styles/toolbar/fluent-dark.css +23 -2
- package/styles/toolbar/fluent.css +23 -2
- package/styles/toolbar/fluent2.css +30 -28
- package/styles/toolbar/highcontrast-light.css +23 -2
- package/styles/toolbar/highcontrast.css +25 -4
- package/styles/toolbar/icons/_bds.scss +14 -14
- package/styles/toolbar/icons/_bootstrap-dark.scss +14 -14
- package/styles/toolbar/icons/_bootstrap.scss +14 -14
- package/styles/toolbar/icons/_bootstrap4.scss +14 -14
- package/styles/toolbar/icons/_bootstrap5.3.scss +14 -14
- package/styles/toolbar/icons/_bootstrap5.scss +14 -14
- package/styles/toolbar/icons/_fabric-dark.scss +14 -14
- package/styles/toolbar/icons/_fabric.scss +14 -14
- package/styles/toolbar/icons/_fluent.scss +14 -14
- package/styles/toolbar/icons/_fluent2.scss +14 -14
- package/styles/toolbar/icons/_fusionnew.scss +14 -14
- package/styles/toolbar/icons/_highcontrast-light.scss +14 -14
- package/styles/toolbar/icons/_highcontrast.scss +14 -14
- package/styles/toolbar/icons/_material-dark.scss +14 -14
- package/styles/toolbar/icons/_material.scss +14 -14
- package/styles/toolbar/icons/_material3.scss +14 -14
- package/styles/toolbar/icons/_tailwind.scss +14 -14
- package/styles/toolbar/icons/_tailwind3.scss +14 -14
- package/styles/toolbar/material-dark.css +25 -4
- package/styles/toolbar/material.css +25 -4
- package/styles/toolbar/material3-dark.css +23 -2
- package/styles/toolbar/material3-dark.scss +1 -1
- package/styles/toolbar/material3.css +23 -2
- package/styles/toolbar/material3.scss +1 -1
- package/styles/toolbar/tailwind-dark.css +23 -2
- package/styles/toolbar/tailwind.css +23 -2
- package/styles/toolbar/tailwind3.css +30 -28
- package/styles/treeview/_all.scss +2 -2
- package/styles/treeview/_bds-definition.scss +131 -131
- package/styles/treeview/_bigger.scss +410 -406
- package/styles/treeview/_bootstrap-dark-definition.scss +118 -118
- package/styles/treeview/_bootstrap-definition.scss +113 -113
- package/styles/treeview/_bootstrap4-definition.scss +143 -141
- package/styles/treeview/_bootstrap5-definition.scss +122 -120
- package/styles/treeview/_bootstrap5.3-definition.scss +119 -119
- package/styles/treeview/_fabric-dark-definition.scss +116 -116
- package/styles/treeview/_fabric-definition.scss +112 -112
- package/styles/treeview/_fluent-definition.scss +122 -120
- package/styles/treeview/_fluent2-definition.scss +128 -128
- package/styles/treeview/_fusionnew-definition.scss +120 -120
- package/styles/treeview/_highcontrast-definition.scss +118 -118
- package/styles/treeview/_highcontrast-light-definition.scss +123 -123
- package/styles/treeview/_layout.scss +769 -761
- package/styles/treeview/_material-dark-definition.scss +114 -114
- package/styles/treeview/_material-definition.scss +112 -112
- package/styles/treeview/_material3-definition.scss +110 -110
- package/styles/treeview/_tailwind-definition.scss +126 -124
- package/styles/treeview/_tailwind3-definition.scss +126 -126
- package/styles/treeview/_theme.scss +352 -350
- package/styles/treeview/bds.css +8 -0
- package/styles/treeview/bootstrap-dark.css +8 -0
- package/styles/treeview/bootstrap.css +8 -0
- package/styles/treeview/bootstrap4.css +17 -9
- package/styles/treeview/bootstrap5-dark.css +20 -12
- package/styles/treeview/bootstrap5.3.css +15 -7
- package/styles/treeview/bootstrap5.css +11 -3
- package/styles/treeview/fabric-dark.css +8 -0
- package/styles/treeview/fabric.css +15 -7
- package/styles/treeview/fluent-dark.css +11 -5
- package/styles/treeview/fluent.css +11 -5
- package/styles/treeview/fluent2.css +8 -0
- package/styles/treeview/highcontrast-light.css +8 -0
- package/styles/treeview/highcontrast.css +8 -0
- package/styles/treeview/icons/_bds.scss +44 -44
- package/styles/treeview/icons/_bootstrap-dark.scss +40 -40
- package/styles/treeview/icons/_bootstrap.scss +40 -40
- package/styles/treeview/icons/_bootstrap4.scss +40 -40
- package/styles/treeview/icons/_bootstrap5.3.scss +44 -44
- package/styles/treeview/icons/_bootstrap5.scss +44 -44
- package/styles/treeview/icons/_fabric-dark.scss +44 -44
- package/styles/treeview/icons/_fabric.scss +44 -44
- package/styles/treeview/icons/_fluent.scss +44 -44
- package/styles/treeview/icons/_fluent2.scss +44 -44
- package/styles/treeview/icons/_fusionnew.scss +44 -44
- package/styles/treeview/icons/_highcontrast-light.scss +44 -44
- package/styles/treeview/icons/_highcontrast.scss +44 -44
- package/styles/treeview/icons/_material-dark.scss +44 -44
- package/styles/treeview/icons/_material.scss +44 -44
- package/styles/treeview/icons/_material3.scss +44 -44
- package/styles/treeview/icons/_tailwind-dark.scss +44 -44
- package/styles/treeview/icons/_tailwind.scss +44 -44
- package/styles/treeview/icons/_tailwind3.scss +44 -44
- package/styles/treeview/material-dark.css +8 -0
- package/styles/treeview/material.css +8 -0
- package/styles/treeview/material3-dark.css +9 -1
- package/styles/treeview/material3-dark.scss +1 -1
- package/styles/treeview/material3.css +9 -1
- package/styles/treeview/material3.scss +1 -1
- package/styles/treeview/tailwind-dark.css +10 -2
- package/styles/treeview/tailwind.css +10 -2
- package/styles/treeview/tailwind3.css +10 -1
- package/styles/v-scroll/_all.scss +2 -2
- package/styles/v-scroll/_bds-definition.scss +49 -49
- package/styles/v-scroll/_bigger.scss +28 -28
- package/styles/v-scroll/_bootstrap-dark-definition.scss +51 -51
- package/styles/v-scroll/_bootstrap-definition.scss +49 -49
- package/styles/v-scroll/_bootstrap4-definition.scss +49 -49
- package/styles/v-scroll/_bootstrap5-definition.scss +49 -49
- package/styles/v-scroll/_bootstrap5.3-definition.scss +49 -49
- package/styles/v-scroll/_fabric-dark-definition.scss +52 -52
- package/styles/v-scroll/_fabric-definition.scss +50 -50
- package/styles/v-scroll/_fluent-definition.scss +49 -49
- package/styles/v-scroll/_fluent2-definition.scss +49 -49
- package/styles/v-scroll/_fusionnew-definition.scss +49 -49
- package/styles/v-scroll/_highcontrast-definition.scss +50 -50
- package/styles/v-scroll/_highcontrast-light-definition.scss +52 -52
- package/styles/v-scroll/_layout.scss +135 -135
- package/styles/v-scroll/_material-dark-definition.scss +79 -79
- package/styles/v-scroll/_material-definition.scss +77 -77
- package/styles/v-scroll/_material3-definition.scss +49 -49
- package/styles/v-scroll/_tailwind-definition.scss +49 -49
- package/styles/v-scroll/_tailwind3-definition.scss +49 -49
- package/styles/v-scroll/_theme.scss +114 -114
- package/styles/v-scroll/fabric-dark.css +1 -1
- package/styles/v-scroll/fabric.css +1 -1
- package/styles/v-scroll/icons/_bds.scss +27 -27
- package/styles/v-scroll/icons/_bootstrap-dark.scss +27 -27
- package/styles/v-scroll/icons/_bootstrap.scss +27 -27
- package/styles/v-scroll/icons/_bootstrap4.scss +27 -27
- package/styles/v-scroll/icons/_bootstrap5.3.scss +27 -27
- package/styles/v-scroll/icons/_bootstrap5.scss +27 -27
- package/styles/v-scroll/icons/_fabric-dark.scss +27 -27
- package/styles/v-scroll/icons/_fabric.scss +27 -27
- package/styles/v-scroll/icons/_fluent.scss +27 -27
- package/styles/v-scroll/icons/_fluent2.scss +27 -27
- package/styles/v-scroll/icons/_fusionnew.scss +27 -27
- package/styles/v-scroll/icons/_highcontrast-light.scss +27 -27
- package/styles/v-scroll/icons/_highcontrast.scss +27 -27
- package/styles/v-scroll/icons/_material-dark.scss +27 -27
- package/styles/v-scroll/icons/_material.scss +27 -27
- package/styles/v-scroll/icons/_material3.scss +27 -27
- package/styles/v-scroll/icons/_tailwind.scss +27 -27
- package/styles/v-scroll/icons/_tailwind3.scss +27 -27
- package/styles/v-scroll/material3-dark.scss +1 -1
- package/styles/v-scroll/material3.scss +1 -1
- package/tslint.json +111 -111
- package/helpers/e2e/accordionHelper.d.ts +0 -56
- package/helpers/e2e/accordionHelper.js +0 -71
- package/helpers/e2e/contextmenuHelper.d.ts +0 -37
- package/helpers/e2e/contextmenuHelper.js +0 -53
- package/helpers/e2e/index.d.ts +0 -7
- package/helpers/e2e/index.js +0 -14
- package/helpers/e2e/menuHelper.d.ts +0 -37
- package/helpers/e2e/menuHelper.js +0 -53
- package/helpers/e2e/sidebarHelper.d.ts +0 -94
- package/helpers/e2e/sidebarHelper.js +0 -110
- package/helpers/e2e/tabHelper.d.ts +0 -60
- package/helpers/e2e/tabHelper.js +0 -74
- package/helpers/e2e/toolbarHelper.d.ts +0 -60
- package/helpers/e2e/toolbarHelper.js +0 -74
- package/helpers/e2e/treeview.d.ts +0 -50
- package/helpers/e2e/treeview.js +0 -80
|
@@ -0,0 +1,2502 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
|
+
import { Component, Property, ChildProperty, NotifyPropertyChanges, isBlazor } from '@syncfusion/ej2-base';
|
|
21
|
+
import { Event, EventHandler, KeyboardEvents, Touch } from '@syncfusion/ej2-base';
|
|
22
|
+
import { Animation } from '@syncfusion/ej2-base';
|
|
23
|
+
import { Browser, Collection, setValue, getValue, getUniqueID, getInstance, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
24
|
+
import { select, selectAll, closest, detach, append, rippleEffect, isVisible, Complex, addClass, removeClass } from '@syncfusion/ej2-base';
|
|
25
|
+
import { ListBase } from '@syncfusion/ej2-lists';
|
|
26
|
+
import { getZindexPartial, calculatePosition, isCollide, fit, Popup } from '@syncfusion/ej2-popups';
|
|
27
|
+
import { SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
|
28
|
+
import { getScrollableParent } from '@syncfusion/ej2-popups';
|
|
29
|
+
import { HScroll } from '../common/h-scroll';
|
|
30
|
+
import { VScroll } from '../common/v-scroll';
|
|
31
|
+
import { addScrolling, destroyScroll } from '../common/menu-scroll';
|
|
32
|
+
var ENTER = 'enter';
|
|
33
|
+
var ESCAPE = 'escape';
|
|
34
|
+
var FOCUSED = 'e-focused';
|
|
35
|
+
var HEADER = 'e-menu-header';
|
|
36
|
+
var SELECTED = 'e-selected';
|
|
37
|
+
var SEPARATOR = 'e-separator';
|
|
38
|
+
var UPARROW = 'uparrow';
|
|
39
|
+
var DOWNARROW = 'downarrow';
|
|
40
|
+
var LEFTARROW = 'leftarrow';
|
|
41
|
+
var RIGHTARROW = 'rightarrow';
|
|
42
|
+
var HOME = 'home';
|
|
43
|
+
var END = 'end';
|
|
44
|
+
var TAB = 'tab';
|
|
45
|
+
var CARET = 'e-caret';
|
|
46
|
+
var ITEM = 'e-menu-item';
|
|
47
|
+
var DISABLED = 'e-disabled';
|
|
48
|
+
var HIDE = 'e-menu-hide';
|
|
49
|
+
var ICONS = 'e-icons';
|
|
50
|
+
var RTL = 'e-rtl';
|
|
51
|
+
var POPUP = 'e-menu-popup';
|
|
52
|
+
var TEMPLATE_PROPERTY = 'Template';
|
|
53
|
+
/**
|
|
54
|
+
* Configures the field options of the Menu.
|
|
55
|
+
*/
|
|
56
|
+
var FieldSettings = /** @class */ (function (_super) {
|
|
57
|
+
__extends(FieldSettings, _super);
|
|
58
|
+
function FieldSettings() {
|
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
+
}
|
|
61
|
+
__decorate([
|
|
62
|
+
Property('id')
|
|
63
|
+
], FieldSettings.prototype, "itemId", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Property('parentId')
|
|
66
|
+
], FieldSettings.prototype, "parentId", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
Property('text')
|
|
69
|
+
], FieldSettings.prototype, "text", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
Property('iconCss')
|
|
72
|
+
], FieldSettings.prototype, "iconCss", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
Property('url')
|
|
75
|
+
], FieldSettings.prototype, "url", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
Property('separator')
|
|
78
|
+
], FieldSettings.prototype, "separator", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Property('items')
|
|
81
|
+
], FieldSettings.prototype, "children", void 0);
|
|
82
|
+
return FieldSettings;
|
|
83
|
+
}(ChildProperty));
|
|
84
|
+
export { FieldSettings };
|
|
85
|
+
/**
|
|
86
|
+
* Specifies menu items.
|
|
87
|
+
*/
|
|
88
|
+
var MenuItem = /** @class */ (function (_super) {
|
|
89
|
+
__extends(MenuItem, _super);
|
|
90
|
+
function MenuItem() {
|
|
91
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
92
|
+
}
|
|
93
|
+
__decorate([
|
|
94
|
+
Property(null)
|
|
95
|
+
], MenuItem.prototype, "iconCss", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
Property('')
|
|
98
|
+
], MenuItem.prototype, "id", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
Property(false)
|
|
101
|
+
], MenuItem.prototype, "separator", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
Collection([], MenuItem)
|
|
104
|
+
], MenuItem.prototype, "items", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
Property('')
|
|
107
|
+
], MenuItem.prototype, "text", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
Property('')
|
|
110
|
+
], MenuItem.prototype, "url", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
Property()
|
|
113
|
+
], MenuItem.prototype, "htmlAttributes", void 0);
|
|
114
|
+
return MenuItem;
|
|
115
|
+
}(ChildProperty));
|
|
116
|
+
export { MenuItem };
|
|
117
|
+
/**
|
|
118
|
+
* Animation configuration settings.
|
|
119
|
+
*/
|
|
120
|
+
var MenuAnimationSettings = /** @class */ (function (_super) {
|
|
121
|
+
__extends(MenuAnimationSettings, _super);
|
|
122
|
+
function MenuAnimationSettings() {
|
|
123
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
124
|
+
}
|
|
125
|
+
__decorate([
|
|
126
|
+
Property('SlideDown')
|
|
127
|
+
], MenuAnimationSettings.prototype, "effect", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
Property(400)
|
|
130
|
+
], MenuAnimationSettings.prototype, "duration", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
Property('ease')
|
|
133
|
+
], MenuAnimationSettings.prototype, "easing", void 0);
|
|
134
|
+
return MenuAnimationSettings;
|
|
135
|
+
}(ChildProperty));
|
|
136
|
+
export { MenuAnimationSettings };
|
|
137
|
+
/**
|
|
138
|
+
* Base class for Menu and ContextMenu components.
|
|
139
|
+
*
|
|
140
|
+
* @private
|
|
141
|
+
*/
|
|
142
|
+
var MenuBase = /** @class */ (function (_super) {
|
|
143
|
+
__extends(MenuBase, _super);
|
|
144
|
+
/**
|
|
145
|
+
* Constructor for creating the widget.
|
|
146
|
+
*
|
|
147
|
+
* @private
|
|
148
|
+
* @param {MenuBaseModel} options - Specifies the menu base model
|
|
149
|
+
* @param {string | HTMLUListElement} element - Specifies the element
|
|
150
|
+
*/
|
|
151
|
+
function MenuBase(options, element) {
|
|
152
|
+
var _this = _super.call(this, options, element) || this;
|
|
153
|
+
_this.navIdx = [];
|
|
154
|
+
_this.animation = new Animation({});
|
|
155
|
+
_this.isTapHold = false;
|
|
156
|
+
_this.tempItem = [];
|
|
157
|
+
_this.showSubMenuOn = 'Auto';
|
|
158
|
+
_this.isAnimationNone = false;
|
|
159
|
+
return _this;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Initialized third party configuration settings.
|
|
163
|
+
*
|
|
164
|
+
* @private
|
|
165
|
+
* @returns {void}
|
|
166
|
+
*/
|
|
167
|
+
MenuBase.prototype.preRender = function () {
|
|
168
|
+
if (!this.isMenu) {
|
|
169
|
+
var ul = void 0;
|
|
170
|
+
if (this.element.tagName === 'EJS-CONTEXTMENU') {
|
|
171
|
+
ul = this.createElement('ul', {
|
|
172
|
+
id: getUniqueID(this.getModuleName()), className: 'e-control e-lib e-' + this.getModuleName()
|
|
173
|
+
});
|
|
174
|
+
var ejInst = getValue('ej2_instances', this.element);
|
|
175
|
+
removeClass([this.element], ['e-control', 'e-lib', 'e-' + this.getModuleName()]);
|
|
176
|
+
this.clonedElement = this.element;
|
|
177
|
+
this.element = ul;
|
|
178
|
+
setValue('ej2_instances', ejInst, this.element);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
ul = this.createElement('ul', { id: getUniqueID(this.getModuleName()) });
|
|
182
|
+
append([].slice.call(this.element.cloneNode(true).children), ul);
|
|
183
|
+
var refEle = this.element.nextElementSibling;
|
|
184
|
+
if (refEle) {
|
|
185
|
+
this.element.parentElement.insertBefore(ul, refEle);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this.element.parentElement.appendChild(ul);
|
|
189
|
+
}
|
|
190
|
+
this.clonedElement = ul;
|
|
191
|
+
}
|
|
192
|
+
this.clonedElement.style.display = 'none';
|
|
193
|
+
}
|
|
194
|
+
if (this.element.tagName === 'EJS-MENU') {
|
|
195
|
+
var ele = this.element;
|
|
196
|
+
var ejInstance = getValue('ej2_instances', ele);
|
|
197
|
+
var ul = this.createElement('ul');
|
|
198
|
+
var wrapper = this.createElement('EJS-MENU', { className: 'e-' + this.getModuleName() + '-wrapper' });
|
|
199
|
+
for (var idx = 0, len = ele.attributes.length; idx < len; idx++) {
|
|
200
|
+
ul.setAttribute(ele.attributes[idx].nodeName, ele.attributes[idx].nodeValue);
|
|
201
|
+
}
|
|
202
|
+
ele.parentNode.insertBefore(wrapper, ele);
|
|
203
|
+
detach(ele);
|
|
204
|
+
ele = ul;
|
|
205
|
+
wrapper.appendChild(ele);
|
|
206
|
+
setValue('ej2_instances', ejInstance, ele);
|
|
207
|
+
this.clonedElement = wrapper;
|
|
208
|
+
this.element = ele;
|
|
209
|
+
if (!this.element.id) {
|
|
210
|
+
this.element.id = getUniqueID(this.getModuleName());
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Initialize the control rendering.
|
|
216
|
+
*
|
|
217
|
+
* @private
|
|
218
|
+
* @returns {void}
|
|
219
|
+
*/
|
|
220
|
+
MenuBase.prototype.render = function () {
|
|
221
|
+
var _this = this;
|
|
222
|
+
this.initialize();
|
|
223
|
+
this.renderItems();
|
|
224
|
+
this.wireEvents();
|
|
225
|
+
this.renderComplete();
|
|
226
|
+
var wrapper = this.getWrapper();
|
|
227
|
+
// eslint-disable-next-line
|
|
228
|
+
if (this.template && this.enableScrolling && (this.isReact || this.isAngular)) {
|
|
229
|
+
requestAnimationFrame(function () {
|
|
230
|
+
addScrolling(_this.createElement, wrapper, _this.element, 'hscroll', _this.enableRtl);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
MenuBase.prototype.initialize = function () {
|
|
235
|
+
var wrapper = this.getWrapper();
|
|
236
|
+
if (!wrapper) {
|
|
237
|
+
wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-wrapper' });
|
|
238
|
+
if (this.isMenu) {
|
|
239
|
+
this.element.parentElement.insertBefore(wrapper, this.element);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
document.body.appendChild(wrapper);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (this.cssClass) {
|
|
246
|
+
addClass([wrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
247
|
+
}
|
|
248
|
+
if (this.enableRtl) {
|
|
249
|
+
wrapper.classList.add(RTL);
|
|
250
|
+
}
|
|
251
|
+
wrapper.appendChild(this.element);
|
|
252
|
+
if (this.isMenu && this.hamburgerMode) {
|
|
253
|
+
if (!this.target) {
|
|
254
|
+
this.createHeaderContainer(wrapper);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
this.defaultOption = this.showItemOnClick;
|
|
258
|
+
};
|
|
259
|
+
MenuBase.prototype.renderItems = function () {
|
|
260
|
+
if (!this.items.length) {
|
|
261
|
+
var items = ListBase.createJsonFromElement(this.element, { fields: { child: 'items' } });
|
|
262
|
+
this.setProperties({ items: items }, true);
|
|
263
|
+
if (isBlazor() && !this.isMenu) {
|
|
264
|
+
this.element = this.removeChildElement(this.element);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
this.element.innerHTML = '';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
var ul = this.createItems(this.items);
|
|
271
|
+
append(Array.prototype.slice.call(ul.children), this.element);
|
|
272
|
+
this.element.classList.add('e-menu-parent');
|
|
273
|
+
if (this.isMenu) {
|
|
274
|
+
if (!this.hamburgerMode && this.element.classList.contains('e-vertical')) {
|
|
275
|
+
this.setBlankIconStyle(this.element);
|
|
276
|
+
}
|
|
277
|
+
if (this.enableScrolling) {
|
|
278
|
+
var wrapper = this.getWrapper();
|
|
279
|
+
if (this.element.classList.contains('e-vertical')) {
|
|
280
|
+
addScrolling(this.createElement, wrapper, this.element, 'vscroll', this.enableRtl);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
addScrolling(this.createElement, wrapper, this.element, 'hscroll', this.enableRtl);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this.element.parentElement.setAttribute('role', 'dialog');
|
|
289
|
+
this.element.parentElement.setAttribute('aria-label', 'context menu');
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
MenuBase.prototype.wireEvents = function () {
|
|
293
|
+
var wrapper = this.getWrapper();
|
|
294
|
+
if (this.target) {
|
|
295
|
+
var target = void 0;
|
|
296
|
+
var targetElems = selectAll(this.target);
|
|
297
|
+
for (var i = 0, len = targetElems.length; i < len; i++) {
|
|
298
|
+
target = targetElems[i];
|
|
299
|
+
if (this.isMenu) {
|
|
300
|
+
EventHandler.add(target, 'click', this.menuHeaderClickHandler, this);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
if (Browser.isIos) {
|
|
304
|
+
new Touch(target, { tapHold: this.touchHandler.bind(this) });
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
EventHandler.add(target, 'contextmenu', this.cmenuHandler, this);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
this.targetElement = target;
|
|
312
|
+
if (!this.isMenu) {
|
|
313
|
+
EventHandler.add(this.targetElement, 'scroll', this.scrollHandler, this);
|
|
314
|
+
for (var _i = 0, _a = getScrollableParent(this.targetElement); _i < _a.length; _i++) {
|
|
315
|
+
var parent_1 = _a[_i];
|
|
316
|
+
EventHandler.add(parent_1, 'scroll', this.scrollHandler, this);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (!Browser.isDevice) {
|
|
321
|
+
this.delegateMoverHandler = this.moverHandler.bind(this);
|
|
322
|
+
this.delegateMouseDownHandler = this.mouseDownHandler.bind(this);
|
|
323
|
+
EventHandler.add(this.isMenu ? document : wrapper, 'mouseover', this.delegateMoverHandler, this);
|
|
324
|
+
EventHandler.add(document, 'mousedown', this.delegateMouseDownHandler, this);
|
|
325
|
+
EventHandler.add(document, 'keydown', this.domKeyHandler, this);
|
|
326
|
+
if (!this.isMenu && !this.target) {
|
|
327
|
+
EventHandler.add(document, 'scroll', this.scrollHandler, this);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
this.delegateClickHandler = this.clickHandler.bind(this);
|
|
331
|
+
EventHandler.add(document, 'click', this.delegateClickHandler, this);
|
|
332
|
+
this.wireKeyboardEvent(wrapper);
|
|
333
|
+
this.rippleFn = rippleEffect(wrapper, { selector: '.' + ITEM });
|
|
334
|
+
};
|
|
335
|
+
MenuBase.prototype.wireKeyboardEvent = function (element) {
|
|
336
|
+
var keyConfigs = {
|
|
337
|
+
downarrow: DOWNARROW,
|
|
338
|
+
uparrow: UPARROW,
|
|
339
|
+
enter: ENTER,
|
|
340
|
+
leftarrow: LEFTARROW,
|
|
341
|
+
rightarrow: RIGHTARROW,
|
|
342
|
+
escape: ESCAPE
|
|
343
|
+
};
|
|
344
|
+
if (this.isMenu) {
|
|
345
|
+
keyConfigs.home = HOME;
|
|
346
|
+
keyConfigs.end = END;
|
|
347
|
+
keyConfigs.tab = TAB;
|
|
348
|
+
}
|
|
349
|
+
new KeyboardEvents(element, {
|
|
350
|
+
keyAction: this.keyBoardHandler.bind(this),
|
|
351
|
+
keyConfigs: keyConfigs
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
MenuBase.prototype.mouseDownHandler = function (e) {
|
|
355
|
+
if (closest(e.target, '.e-' + this.getModuleName() + '-wrapper') !== this.getWrapper()
|
|
356
|
+
&& (!closest(e.target, '.e-' + this.getModuleName() + '-popup'))) {
|
|
357
|
+
this.closeMenu(this.isMenu ? null : this.navIdx.length, e);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
MenuBase.prototype.keyHandler = function (e) {
|
|
361
|
+
if (e.keyCode === 38 || e.keyCode === 40) {
|
|
362
|
+
if (e.target && (e.target.classList.contains('e-contextmenu') || e.target.classList.contains('e-menu-item'))) {
|
|
363
|
+
e.preventDefault();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
MenuBase.prototype.domKeyHandler = function (e) {
|
|
368
|
+
if (e.keyCode === 27) {
|
|
369
|
+
if (this.isMenuVisible()) {
|
|
370
|
+
e.stopImmediatePropagation();
|
|
371
|
+
}
|
|
372
|
+
e.action = ESCAPE;
|
|
373
|
+
this.leftEscKeyHandler(e);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
MenuBase.prototype.keyBoardHandler = function (e) {
|
|
377
|
+
var actionName = '';
|
|
378
|
+
var trgt = e.target;
|
|
379
|
+
var actionNeeded = this.isMenu && !this.hamburgerMode && !this.element.classList.contains('e-vertical')
|
|
380
|
+
&& this.navIdx.length < 1;
|
|
381
|
+
e.preventDefault();
|
|
382
|
+
if (this.enableScrolling && e.keyCode === 13 && trgt.classList.contains('e-scroll-nav')) {
|
|
383
|
+
this.removeLIStateByClass([FOCUSED, SELECTED], [closest(trgt, '.e-' + this.getModuleName() + '-wrapper')]);
|
|
384
|
+
}
|
|
385
|
+
if (actionNeeded) {
|
|
386
|
+
switch (e.action) {
|
|
387
|
+
case RIGHTARROW:
|
|
388
|
+
actionName = RIGHTARROW;
|
|
389
|
+
e.action = DOWNARROW;
|
|
390
|
+
break;
|
|
391
|
+
case LEFTARROW:
|
|
392
|
+
actionName = LEFTARROW;
|
|
393
|
+
e.action = UPARROW;
|
|
394
|
+
break;
|
|
395
|
+
case DOWNARROW:
|
|
396
|
+
actionName = DOWNARROW;
|
|
397
|
+
e.action = RIGHTARROW;
|
|
398
|
+
break;
|
|
399
|
+
case UPARROW:
|
|
400
|
+
actionName = UPARROW;
|
|
401
|
+
e.action = '';
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else if (this.enableRtl) {
|
|
406
|
+
switch (e.action) {
|
|
407
|
+
case LEFTARROW:
|
|
408
|
+
actionNeeded = true;
|
|
409
|
+
actionName = LEFTARROW;
|
|
410
|
+
e.action = RIGHTARROW;
|
|
411
|
+
break;
|
|
412
|
+
case RIGHTARROW:
|
|
413
|
+
actionNeeded = true;
|
|
414
|
+
actionName = RIGHTARROW;
|
|
415
|
+
e.action = LEFTARROW;
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
switch (e.action) {
|
|
420
|
+
case DOWNARROW:
|
|
421
|
+
case UPARROW:
|
|
422
|
+
case END:
|
|
423
|
+
case HOME:
|
|
424
|
+
case TAB:
|
|
425
|
+
this.upDownKeyHandler(e);
|
|
426
|
+
break;
|
|
427
|
+
case RIGHTARROW:
|
|
428
|
+
this.rightEnterKeyHandler(e);
|
|
429
|
+
break;
|
|
430
|
+
case LEFTARROW:
|
|
431
|
+
this.leftEscKeyHandler(e);
|
|
432
|
+
break;
|
|
433
|
+
case ENTER:
|
|
434
|
+
if (this.hamburgerMode && trgt.tagName === 'SPAN' && trgt.classList.contains('e-menu-icon')) {
|
|
435
|
+
this.menuHeaderClickHandler(e);
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
this.rightEnterKeyHandler(e);
|
|
439
|
+
}
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
if (actionNeeded) {
|
|
443
|
+
e.action = actionName;
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
MenuBase.prototype.upDownKeyHandler = function (e) {
|
|
447
|
+
var cul = this.getUlByNavIdx();
|
|
448
|
+
var defaultIdx = (e.action === DOWNARROW || e.action === HOME || e.action === TAB) ? 0 : cul.childElementCount - 1;
|
|
449
|
+
var fliIdx = defaultIdx;
|
|
450
|
+
var fli = this.getLIByClass(cul, FOCUSED);
|
|
451
|
+
if (fli) {
|
|
452
|
+
if (e.action !== END && e.action !== HOME) {
|
|
453
|
+
fliIdx = this.getIdx(cul, fli);
|
|
454
|
+
}
|
|
455
|
+
fli.classList.remove(FOCUSED);
|
|
456
|
+
if (e.action !== END && e.action !== HOME) {
|
|
457
|
+
if (e.action === DOWNARROW) {
|
|
458
|
+
fliIdx++;
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
fliIdx--;
|
|
462
|
+
}
|
|
463
|
+
if (fliIdx === (e.action === DOWNARROW ? cul.childElementCount : -1)) {
|
|
464
|
+
fliIdx = defaultIdx;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
var cli = cul.children[fliIdx];
|
|
469
|
+
fliIdx = this.isValidLI(cli, fliIdx, e.action);
|
|
470
|
+
cul.children[fliIdx].classList.add(FOCUSED);
|
|
471
|
+
cul.children[fliIdx].focus();
|
|
472
|
+
};
|
|
473
|
+
MenuBase.prototype.isValidLI = function (cli, index, action) {
|
|
474
|
+
var cul = this.getUlByNavIdx();
|
|
475
|
+
var defaultIdx = (action === DOWNARROW || action === HOME || action === TAB) ? 0 : cul.childElementCount - 1;
|
|
476
|
+
if (cli.classList.contains(SEPARATOR) || cli.classList.contains(DISABLED) || cli.classList.contains(HIDE)) {
|
|
477
|
+
if (action === DOWNARROW && index === cul.childElementCount - 1) {
|
|
478
|
+
index = defaultIdx;
|
|
479
|
+
}
|
|
480
|
+
else if (action === UPARROW && index === 0) {
|
|
481
|
+
index = defaultIdx;
|
|
482
|
+
}
|
|
483
|
+
else if ((action === DOWNARROW) || (action === RIGHTARROW)) {
|
|
484
|
+
index++;
|
|
485
|
+
}
|
|
486
|
+
else if (action === 'tab' && cli.classList.contains(SEPARATOR)) {
|
|
487
|
+
index++;
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
index--;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
cli = cul.children[index];
|
|
494
|
+
if (cli && (cli.classList.contains(SEPARATOR) || cli.classList.contains(DISABLED) || cli.classList.contains(HIDE))) {
|
|
495
|
+
index = this.isValidLI(cli, index, action);
|
|
496
|
+
}
|
|
497
|
+
return index;
|
|
498
|
+
};
|
|
499
|
+
MenuBase.prototype.getUlByNavIdx = function (navIdxLen) {
|
|
500
|
+
var _this = this;
|
|
501
|
+
if (navIdxLen === void 0) { navIdxLen = this.navIdx.length; }
|
|
502
|
+
if (this.isMenu) {
|
|
503
|
+
var popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
|
|
504
|
+
var popups_1 = [];
|
|
505
|
+
var allPopup = selectAll('.' + POPUP);
|
|
506
|
+
allPopup.forEach(function (elem) {
|
|
507
|
+
if (_this.element.id === elem.id.split('-')[2] || elem.id.split('-')[2] + '-' + elem.id.split('-')[3]) {
|
|
508
|
+
popups_1.push(elem);
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
popup = [this.getWrapper()].concat([].slice.call(popups_1))[navIdxLen];
|
|
512
|
+
return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
if (!document.body.contains(this.element) && navIdxLen === 0) {
|
|
516
|
+
return null;
|
|
517
|
+
}
|
|
518
|
+
return this.getWrapper().children[navIdxLen];
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
MenuBase.prototype.rightEnterKeyHandler = function (e) {
|
|
522
|
+
var eventArgs;
|
|
523
|
+
var cul = this.getUlByNavIdx();
|
|
524
|
+
var fli = this.getLIByClass(cul, FOCUSED);
|
|
525
|
+
if (fli) {
|
|
526
|
+
var fliIdx = this.getIdx(cul, fli);
|
|
527
|
+
var navIdx = this.navIdx.concat(fliIdx);
|
|
528
|
+
var item = this.getItem(navIdx);
|
|
529
|
+
if (item.items.length) {
|
|
530
|
+
this.navIdx.push(fliIdx);
|
|
531
|
+
this.keyType = 'right';
|
|
532
|
+
this.action = e.action;
|
|
533
|
+
this.openMenu(fli, item, -1, -1, e);
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
if (e.action === ENTER) {
|
|
537
|
+
if (this.isMenu && this.navIdx.length === 0) {
|
|
538
|
+
this.removeLIStateByClass([SELECTED], [this.getWrapper()]);
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
fli.classList.remove(FOCUSED);
|
|
542
|
+
}
|
|
543
|
+
fli.classList.add(SELECTED);
|
|
544
|
+
eventArgs = { element: fli, item: item, event: e };
|
|
545
|
+
this.trigger('select', eventArgs);
|
|
546
|
+
var aEle = fli.querySelector('.e-menu-url');
|
|
547
|
+
if (item.url && aEle) {
|
|
548
|
+
switch (aEle.getAttribute('target')) {
|
|
549
|
+
case '_blank':
|
|
550
|
+
window.open(item.url, '_blank');
|
|
551
|
+
break;
|
|
552
|
+
case '_parent':
|
|
553
|
+
window.parent.location.href = item.url;
|
|
554
|
+
break;
|
|
555
|
+
default:
|
|
556
|
+
window.location.href = item.url;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
this.closeMenu(null, e);
|
|
560
|
+
var sli = this.getLIByClass(this.getUlByNavIdx(), SELECTED);
|
|
561
|
+
if (sli) {
|
|
562
|
+
sli.classList.add(FOCUSED);
|
|
563
|
+
sli.focus();
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
MenuBase.prototype.leftEscKeyHandler = function (e) {
|
|
570
|
+
if (this.navIdx.length) {
|
|
571
|
+
this.keyType = 'left';
|
|
572
|
+
this.closeMenu(this.navIdx.length, e);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
if (e.action === ESCAPE) {
|
|
576
|
+
this.closeMenu(null, e);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
MenuBase.prototype.scrollHandler = function (e) {
|
|
581
|
+
this.closeMenu(null, e);
|
|
582
|
+
};
|
|
583
|
+
MenuBase.prototype.touchHandler = function (e) {
|
|
584
|
+
this.isTapHold = true;
|
|
585
|
+
this.cmenuHandler(e.originalEvent);
|
|
586
|
+
};
|
|
587
|
+
MenuBase.prototype.cmenuHandler = function (e) {
|
|
588
|
+
e.preventDefault();
|
|
589
|
+
this.currentTarget = e.target;
|
|
590
|
+
this.isCMenu = true;
|
|
591
|
+
this.pageX = e.changedTouches ? e.changedTouches[0].pageX + 1 : e.pageX + 1;
|
|
592
|
+
this.pageY = e.changedTouches ? e.changedTouches[0].pageY + 1 : e.pageY + 1;
|
|
593
|
+
this.closeMenu(null, e);
|
|
594
|
+
if (this.isCMenu) {
|
|
595
|
+
if (this.canOpen(e.target)) {
|
|
596
|
+
this.openMenu(null, null, this.pageY, this.pageX, e);
|
|
597
|
+
}
|
|
598
|
+
this.isCMenu = false;
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
// eslint:disable-next-line:max-func-body-length
|
|
602
|
+
MenuBase.prototype.closeMenu = function (ulIndex, e, isIterated) {
|
|
603
|
+
var _this = this;
|
|
604
|
+
if (ulIndex === void 0) { ulIndex = 0; }
|
|
605
|
+
if (e === void 0) { e = null; }
|
|
606
|
+
if (this.isMenuVisible()) {
|
|
607
|
+
var sli = void 0;
|
|
608
|
+
var item_1;
|
|
609
|
+
var wrapper_1 = this.getWrapper();
|
|
610
|
+
var beforeCloseArgs = void 0;
|
|
611
|
+
var items_1;
|
|
612
|
+
var popups = this.getPopups();
|
|
613
|
+
var isClose = false;
|
|
614
|
+
var cnt = this.isMenu ? popups.length + 1 : wrapper_1.childElementCount;
|
|
615
|
+
var ul_1 = this.isMenu && cnt !== 1 ? select('.e-ul', popups[cnt - 2])
|
|
616
|
+
: selectAll('.e-menu-parent', wrapper_1)[cnt - 1];
|
|
617
|
+
if (this.isMenu && ul_1.classList.contains('e-menu')) {
|
|
618
|
+
sli = this.getLIByClass(ul_1, SELECTED);
|
|
619
|
+
if (sli) {
|
|
620
|
+
sli.classList.remove(SELECTED);
|
|
621
|
+
}
|
|
622
|
+
isClose = true;
|
|
623
|
+
}
|
|
624
|
+
if (!isClose) {
|
|
625
|
+
var liElem_1 = e && e.target && this.getLI(e.target);
|
|
626
|
+
if (liElem_1) {
|
|
627
|
+
this.cli = liElem_1;
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
this.cli = ul_1.children[0];
|
|
631
|
+
}
|
|
632
|
+
item_1 = this.navIdx.length ? this.getItem(this.navIdx) : null;
|
|
633
|
+
items_1 = item_1 ? item_1.items : this.items;
|
|
634
|
+
beforeCloseArgs = { element: ul_1, parentItem: item_1, items: items_1, event: e, cancel: false, isFocused: true };
|
|
635
|
+
this.trigger('beforeClose', beforeCloseArgs, function (observedCloseArgs) {
|
|
636
|
+
var popupEle;
|
|
637
|
+
var closeArgs;
|
|
638
|
+
var popupId = '';
|
|
639
|
+
var popupObj;
|
|
640
|
+
var isOpen = !observedCloseArgs.cancel;
|
|
641
|
+
if (isOpen || _this.isCMenu) {
|
|
642
|
+
if (_this.isMenu) {
|
|
643
|
+
popupEle = closest(ul_1, '.' + POPUP);
|
|
644
|
+
if (_this.hamburgerMode) {
|
|
645
|
+
popupEle.parentElement.style.minHeight = '';
|
|
646
|
+
closest(ul_1, '.e-menu-item').setAttribute('aria-expanded', 'false');
|
|
647
|
+
}
|
|
648
|
+
_this.unWireKeyboardEvent(popupEle);
|
|
649
|
+
destroyScroll(getInstance(popupEle.children[0], VScroll), popupEle.children[0]);
|
|
650
|
+
popupObj = getInstance(popupEle, Popup);
|
|
651
|
+
popupObj.hide();
|
|
652
|
+
popupId = popupEle.id;
|
|
653
|
+
popupObj.destroy();
|
|
654
|
+
detach(popupEle);
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
_this.isContextMenuClosed = false;
|
|
658
|
+
_this.toggleAnimation(ul_1, false);
|
|
659
|
+
}
|
|
660
|
+
closeArgs = { element: ul_1, parentItem: item_1, items: items_1 };
|
|
661
|
+
_this.trigger('onClose', closeArgs);
|
|
662
|
+
_this.navIdx.pop();
|
|
663
|
+
if (_this.navIdx.length === 0 && e && e.type === 'keyup') {
|
|
664
|
+
_this.showSubMenu = false;
|
|
665
|
+
}
|
|
666
|
+
if (!_this.isMenu) {
|
|
667
|
+
EventHandler.remove(ul_1, 'keydown', _this.keyHandler);
|
|
668
|
+
if (_this.keyType === 'right') {
|
|
669
|
+
_this.keyType = '';
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
_this.updateReactTemplate();
|
|
674
|
+
var trgtliId;
|
|
675
|
+
var closedLi;
|
|
676
|
+
var trgtLi;
|
|
677
|
+
var trgtpopUp = _this.getWrapper() && _this.getUlByNavIdx();
|
|
678
|
+
if (_this.isCMenu) {
|
|
679
|
+
if (_this.canOpen(e.target)) {
|
|
680
|
+
_this.openMenu(null, null, _this.pageY, _this.pageX, e);
|
|
681
|
+
}
|
|
682
|
+
_this.isCMenu = false;
|
|
683
|
+
}
|
|
684
|
+
if (_this.isMenu && trgtpopUp && popupId.length) {
|
|
685
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
686
|
+
var regExp = RegExp;
|
|
687
|
+
trgtliId = new regExp('(.*)-ej2menu-' + _this.element.id + '-popup').exec(popupId)[1];
|
|
688
|
+
closedLi = trgtpopUp.querySelector('[id="' + trgtliId + '"]');
|
|
689
|
+
trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
|
|
690
|
+
}
|
|
691
|
+
else if (trgtpopUp) {
|
|
692
|
+
closedLi = trgtpopUp.querySelector('.e-menu-item.e-selected');
|
|
693
|
+
trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
|
|
694
|
+
}
|
|
695
|
+
var submenus = liElem_1 && liElem_1.querySelectorAll('.e-menu-item');
|
|
696
|
+
if (isOpen && _this.hamburgerMode && ulIndex && !(submenus.length)) {
|
|
697
|
+
_this.afterCloseMenu(e);
|
|
698
|
+
}
|
|
699
|
+
else if (isOpen && !_this.hamburgerMode && closedLi && !trgtLi && _this.keyType !== 'left' && (_this.navIdx.length || !_this.isMenu && _this.navIdx.length === 0)) {
|
|
700
|
+
var ele = (e && e.target.classList && (e.target.classList.contains('e-vscroll') || e.target.classList.contains('e-scroll-nav')))
|
|
701
|
+
? closest(e.target, '.e-menu-wrapper') : null;
|
|
702
|
+
if (ele) {
|
|
703
|
+
ele = ele.querySelector('.e-menu-item');
|
|
704
|
+
if (_this.showItemOnClick || (ele && _this.getIndex(ele.id, true).length <= _this.navIdx.length)) {
|
|
705
|
+
_this.closeMenu(_this.navIdx[_this.navIdx.length - 1], e, true);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
if (!(e && e.target.classList && e.target.classList.contains('e-nav-arrow'))) {
|
|
710
|
+
_this.closeMenu(_this.navIdx[_this.navIdx.length - 1], e);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
else if (isOpen && !isIterated && !ulIndex && ((_this.hamburgerMode && _this.navIdx.length) ||
|
|
715
|
+
_this.navIdx.length === 1 && liElem_1 && trgtpopUp !== liElem_1.parentElement)) {
|
|
716
|
+
_this.closeMenu(null, e);
|
|
717
|
+
}
|
|
718
|
+
else if (isOpen && isNullOrUndefined(ulIndex) && _this.navIdx.length) {
|
|
719
|
+
_this.closeMenu(null, e);
|
|
720
|
+
}
|
|
721
|
+
else if (isOpen && !_this.isMenu && !ulIndex && _this.navIdx.length === 0 &&
|
|
722
|
+
!_this.isMenusClosed && !_this.isCmenuHover) {
|
|
723
|
+
_this.isMenusClosed = true;
|
|
724
|
+
_this.closeMenu(0, e);
|
|
725
|
+
}
|
|
726
|
+
else if (isOpen && _this.isMenu && e && e.target &&
|
|
727
|
+
_this.navIdx.length !== 0 && closest(e.target, '.e-menu-parent.e-control')) {
|
|
728
|
+
_this.closeMenu(0, e);
|
|
729
|
+
}
|
|
730
|
+
else if (isOpen && !_this.isMenu && selectAll('.e-menu-parent', wrapper_1)[ulIndex - 1] && e.which === 3) {
|
|
731
|
+
_this.closeMenu(null, e);
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
if (isOpen && (_this.keyType === 'right' || _this.keyType === 'click')) {
|
|
735
|
+
_this.afterCloseMenu(e);
|
|
736
|
+
}
|
|
737
|
+
else {
|
|
738
|
+
var cul = _this.getUlByNavIdx();
|
|
739
|
+
var sli_1 = _this.getLIByClass(cul, SELECTED);
|
|
740
|
+
if (sli_1) {
|
|
741
|
+
sli_1.setAttribute('aria-expanded', 'false');
|
|
742
|
+
sli_1.classList.remove(SELECTED);
|
|
743
|
+
if (observedCloseArgs.isFocused && liElem_1 || _this.keyType === 'left') {
|
|
744
|
+
sli_1.classList.add(FOCUSED);
|
|
745
|
+
if (!e.target || !e.target.classList.contains('e-edit-template')) {
|
|
746
|
+
sli_1.focus();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
if (!isOpen && _this.hamburgerMode && liElem_1 && liElem_1.getAttribute('aria-expanded') === 'false' &&
|
|
751
|
+
liElem_1.getAttribute('aria-haspopup') === 'true') {
|
|
752
|
+
if (closest(liElem_1, '.e-menu-parent.e-control')) {
|
|
753
|
+
_this.navIdx = [];
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
_this.navIdx.pop();
|
|
757
|
+
}
|
|
758
|
+
_this.navIdx.push(_this.cliIdx);
|
|
759
|
+
var item_2 = _this.getItem(_this.navIdx);
|
|
760
|
+
liElem_1.setAttribute('aria-expanded', 'true');
|
|
761
|
+
_this.openMenu(liElem_1, item_2, -1, -1, e);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
if (_this.navIdx.length < 1) {
|
|
765
|
+
if (_this.showSubMenuOn === 'Hover' || _this.showSubMenuOn === 'Click') {
|
|
766
|
+
_this.showItemOnClick = _this.defaultOption;
|
|
767
|
+
_this.showSubMenuOn = 'Auto';
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
_this.removeStateWrapper();
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
MenuBase.prototype.updateReactTemplate = function () {
|
|
777
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
778
|
+
if (this.isReact && this.template && this.navIdx.length === 0) {
|
|
779
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
780
|
+
var portals = void 0;
|
|
781
|
+
if (this.portals) {
|
|
782
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
783
|
+
portals = this.portals.splice(0, this.items.length);
|
|
784
|
+
}
|
|
785
|
+
this.clearTemplate(['template']);
|
|
786
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
787
|
+
this.portals = portals;
|
|
788
|
+
this.renderReactTemplates();
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
MenuBase.prototype.getMenuItemModel = function (item, level) {
|
|
792
|
+
if (isNullOrUndefined(item)) {
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
795
|
+
if (isNullOrUndefined(level)) {
|
|
796
|
+
level = 0;
|
|
797
|
+
}
|
|
798
|
+
var fields = this.getFields(level);
|
|
799
|
+
return { text: item[fields.text], id: item[fields.id], items: item[fields.child], separator: item[fields.separator],
|
|
800
|
+
iconCss: item[fields.iconCss], url: item[fields.url] };
|
|
801
|
+
};
|
|
802
|
+
MenuBase.prototype.getPopups = function () {
|
|
803
|
+
var _this = this;
|
|
804
|
+
var popups = [];
|
|
805
|
+
[].slice.call(document.querySelectorAll('.' + POPUP)).forEach(function (elem) {
|
|
806
|
+
if (!isNullOrUndefined(elem.querySelector('.' + ITEM)) && _this.getIndex(elem.querySelector('.' + ITEM).id, true).length) {
|
|
807
|
+
popups.push(elem);
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
return popups;
|
|
811
|
+
};
|
|
812
|
+
MenuBase.prototype.isMenuVisible = function () {
|
|
813
|
+
return (this.navIdx.length > 0 || (this.element.classList.contains('e-contextmenu') && isVisible(this.element).valueOf()));
|
|
814
|
+
};
|
|
815
|
+
MenuBase.prototype.canOpen = function (target) {
|
|
816
|
+
var canOpen = true;
|
|
817
|
+
if (this.filter) {
|
|
818
|
+
canOpen = false;
|
|
819
|
+
var filter = this.filter.split(' ');
|
|
820
|
+
for (var i = 0, len = filter.length; i < len; i++) {
|
|
821
|
+
if (closest(target, '.' + filter[i])) {
|
|
822
|
+
canOpen = true;
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
return canOpen;
|
|
828
|
+
};
|
|
829
|
+
MenuBase.prototype.openMenu = function (li, item, top, left, e, target) {
|
|
830
|
+
var _this = this;
|
|
831
|
+
if (top === void 0) { top = 0; }
|
|
832
|
+
if (left === void 0) { left = 0; }
|
|
833
|
+
if (e === void 0) { e = null; }
|
|
834
|
+
if (target === void 0) { target = this.targetElement; }
|
|
835
|
+
var wrapper = this.getWrapper();
|
|
836
|
+
this.lItem = li;
|
|
837
|
+
var elemId = this.element.id !== '' ? this.element.id : 'menu';
|
|
838
|
+
this.isMenusClosed = false;
|
|
839
|
+
if (isNullOrUndefined(top)) {
|
|
840
|
+
top = -1;
|
|
841
|
+
}
|
|
842
|
+
if (isNullOrUndefined(left)) {
|
|
843
|
+
left = -1;
|
|
844
|
+
}
|
|
845
|
+
if (li) {
|
|
846
|
+
this.uList = this.createItems(item[this.getField('children', this.navIdx.length - 1)]);
|
|
847
|
+
if (!this.isMenu && Browser.isDevice) {
|
|
848
|
+
wrapper.lastChild.style.display = 'none';
|
|
849
|
+
var data = {
|
|
850
|
+
text: item[this.getField('text')].toString(), iconCss: ICONS + ' e-previous'
|
|
851
|
+
};
|
|
852
|
+
if (this.template) {
|
|
853
|
+
item.iconCss = (item.iconCss || '') + ICONS + ' e-previous';
|
|
854
|
+
}
|
|
855
|
+
var hdata = new MenuItem(this.items[0], 'items', this.template ? item : data, true);
|
|
856
|
+
var hli = this.createItems([hdata]).children[0];
|
|
857
|
+
hli.classList.add(HEADER);
|
|
858
|
+
this.uList.insertBefore(hli, this.uList.children[0]);
|
|
859
|
+
}
|
|
860
|
+
if (this.isMenu) {
|
|
861
|
+
this.popupWrapper = this.createElement('div', {
|
|
862
|
+
className: 'e-' + this.getModuleName() + '-wrapper ' + POPUP, id: li.id + '-ej2menu-' + elemId + '-popup'
|
|
863
|
+
});
|
|
864
|
+
if (this.hamburgerMode) {
|
|
865
|
+
top = li.offsetHeight;
|
|
866
|
+
li.appendChild(this.popupWrapper);
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
document.body.appendChild(this.popupWrapper);
|
|
870
|
+
}
|
|
871
|
+
this.isNestedOrVertical = this.element.classList.contains('e-vertical') || this.navIdx.length !== 1;
|
|
872
|
+
this.popupObj = this.generatePopup(this.popupWrapper, this.uList, li, this.isNestedOrVertical);
|
|
873
|
+
if (this.template) {
|
|
874
|
+
this.renderReactTemplates();
|
|
875
|
+
}
|
|
876
|
+
if (this.hamburgerMode) {
|
|
877
|
+
this.calculateIndentSize(this.uList, li);
|
|
878
|
+
}
|
|
879
|
+
else {
|
|
880
|
+
if (this.cssClass) {
|
|
881
|
+
addClass([this.popupWrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
882
|
+
}
|
|
883
|
+
this.popupObj.hide();
|
|
884
|
+
}
|
|
885
|
+
if (!this.hamburgerMode && !this.showItemOnClick && this.hoverDelay) {
|
|
886
|
+
window.clearInterval(this.timer);
|
|
887
|
+
this.timer = window.setTimeout(function () { _this.triggerBeforeOpen(li, _this.uList, item, e, 0, 0, 'menu'); }, this.hoverDelay);
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
this.triggerBeforeOpen(li, this.uList, item, e, 0, 0, 'menu');
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
else {
|
|
894
|
+
this.uList.style.zIndex = this.element.style.zIndex;
|
|
895
|
+
wrapper.appendChild(this.uList);
|
|
896
|
+
if (!this.showItemOnClick && this.hoverDelay) {
|
|
897
|
+
window.clearInterval(this.timer);
|
|
898
|
+
this.timer = window.setTimeout(function () { _this.triggerBeforeOpen(li, _this.uList, item, e, top, left, 'none'); }, this.hoverDelay);
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
this.triggerBeforeOpen(li, this.uList, item, e, top, left, 'none');
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
else {
|
|
906
|
+
this.uList = this.element;
|
|
907
|
+
this.uList.style.zIndex = getZindexPartial(target ? target : this.element).toString();
|
|
908
|
+
if (isNullOrUndefined(e)) {
|
|
909
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
910
|
+
var ev = document.createEvent('MouseEvents');
|
|
911
|
+
ev.initEvent('click', true, false);
|
|
912
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
913
|
+
var targetEvent = this.copyObject(ev, {});
|
|
914
|
+
targetEvent.target = targetEvent.srcElement = target;
|
|
915
|
+
targetEvent.currentTarget = target;
|
|
916
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
917
|
+
this.triggerBeforeOpen(li, this.uList, item, targetEvent, top, left, 'none');
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
this.triggerBeforeOpen(li, this.uList, item, e, top, left, 'none');
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
925
|
+
MenuBase.prototype.copyObject = function (source, destination) {
|
|
926
|
+
// eslint-disable-next-line guard-for-in
|
|
927
|
+
for (var prop in source) {
|
|
928
|
+
destination["" + prop] = source["" + prop];
|
|
929
|
+
}
|
|
930
|
+
return destination;
|
|
931
|
+
};
|
|
932
|
+
MenuBase.prototype.calculateIndentSize = function (ul, li) {
|
|
933
|
+
var liStyle = getComputedStyle(li);
|
|
934
|
+
var liIndent = parseInt(liStyle.textIndent, 10);
|
|
935
|
+
if (this.navIdx.length < 2 && !li.classList.contains('e-blankicon')) {
|
|
936
|
+
liIndent *= 2;
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
939
|
+
liIndent += (liIndent / 4);
|
|
940
|
+
}
|
|
941
|
+
ul.style.textIndent = liIndent + 'px';
|
|
942
|
+
var blankIconElem = ul.querySelectorAll('.e-blankicon');
|
|
943
|
+
if (blankIconElem && blankIconElem.length) {
|
|
944
|
+
var menuIconElem = ul.querySelector('.e-menu-icon');
|
|
945
|
+
var menuIconElemStyle = getComputedStyle(menuIconElem);
|
|
946
|
+
var blankIconIndent = (parseInt(menuIconElemStyle.marginRight, 10) + menuIconElem.offsetWidth + liIndent);
|
|
947
|
+
for (var i = 0; i < blankIconElem.length; i++) {
|
|
948
|
+
blankIconElem[i].style.textIndent = blankIconIndent + 'px';
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
MenuBase.prototype.generatePopup = function (popupWrapper, ul, li, isNestedOrVertical) {
|
|
953
|
+
var _this = this;
|
|
954
|
+
var popupObj = new Popup(popupWrapper, {
|
|
955
|
+
actionOnScroll: this.hamburgerMode ? 'none' : 'reposition',
|
|
956
|
+
relateTo: li,
|
|
957
|
+
collision: this.hamburgerMode ? { X: 'none', Y: 'none' } : { X: isNestedOrVertical ||
|
|
958
|
+
this.enableRtl ? 'none' : 'flip', Y: 'fit' },
|
|
959
|
+
position: (isNestedOrVertical && !this.hamburgerMode) ? { X: 'right', Y: 'top' } : { X: 'left', Y: 'bottom' },
|
|
960
|
+
targetType: 'relative',
|
|
961
|
+
enableRtl: this.enableRtl,
|
|
962
|
+
content: ul,
|
|
963
|
+
open: function () {
|
|
964
|
+
var scrollEle = select('.e-menu-vscroll', popupObj.element);
|
|
965
|
+
if (scrollEle) {
|
|
966
|
+
scrollEle.style.height = 'inherit';
|
|
967
|
+
scrollEle.style.maxHeight = '';
|
|
968
|
+
}
|
|
969
|
+
var ul = select('.e-ul', popupObj.element);
|
|
970
|
+
popupObj.element.style.maxHeight = '';
|
|
971
|
+
ul.focus();
|
|
972
|
+
_this.triggerOpen(ul);
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
return popupObj;
|
|
976
|
+
};
|
|
977
|
+
MenuBase.prototype.createHeaderContainer = function (wrapper) {
|
|
978
|
+
wrapper = wrapper || this.getWrapper();
|
|
979
|
+
var spanElem = this.createElement('span', { className: 'e-' + this.getModuleName() + '-header' });
|
|
980
|
+
var tempTitle = (this.enableHtmlSanitizer) ? SanitizeHtmlHelper.sanitize(this.title) : this.title;
|
|
981
|
+
var spanTitle = this.createElement('span', {
|
|
982
|
+
className: 'e-' + this.getModuleName() + '-title', innerHTML: tempTitle
|
|
983
|
+
});
|
|
984
|
+
var spanIcon = this.createElement('span', {
|
|
985
|
+
className: 'e-icons e-' + this.getModuleName() + '-icon', attrs: { 'tabindex': '0' }
|
|
986
|
+
});
|
|
987
|
+
spanElem.appendChild(spanTitle);
|
|
988
|
+
spanElem.appendChild(spanIcon);
|
|
989
|
+
wrapper.insertBefore(spanElem, this.element);
|
|
990
|
+
};
|
|
991
|
+
MenuBase.prototype.openHamburgerMenu = function (e) {
|
|
992
|
+
if (this.hamburgerMode) {
|
|
993
|
+
this.triggerBeforeOpen(null, this.element, null, e, 0, 0, 'hamburger');
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
MenuBase.prototype.closeHamburgerMenu = function (e) {
|
|
997
|
+
var _this = this;
|
|
998
|
+
var beforeCloseArgs = { element: this.element, parentItem: null, event: e,
|
|
999
|
+
items: this.items, cancel: false };
|
|
1000
|
+
this.trigger('beforeClose', beforeCloseArgs, function (observedHamburgerCloseArgs) {
|
|
1001
|
+
if (!observedHamburgerCloseArgs.cancel) {
|
|
1002
|
+
_this.closeMenu(null, e);
|
|
1003
|
+
_this.element.classList.add('e-hide-menu');
|
|
1004
|
+
_this.trigger('onClose', { element: _this.element, parentItem: null, items: _this.items });
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
};
|
|
1008
|
+
MenuBase.prototype.callFit = function (element, x, y, top, left) {
|
|
1009
|
+
return fit(element, null, { X: x, Y: y }, { top: top, left: left });
|
|
1010
|
+
};
|
|
1011
|
+
MenuBase.prototype.triggerBeforeOpen = function (li, ul, item, e, top, left, type) {
|
|
1012
|
+
var _this = this;
|
|
1013
|
+
var items = li ? item[this.getField('children', this.navIdx.length - 1)] : this.items;
|
|
1014
|
+
var eventArgs = {
|
|
1015
|
+
element: ul, items: items, parentItem: item, event: e, cancel: false, top: top, left: left, showSubMenuOn: 'Auto'
|
|
1016
|
+
};
|
|
1017
|
+
var menuType = type;
|
|
1018
|
+
var observedElement;
|
|
1019
|
+
this.trigger('beforeOpen', eventArgs, function (observedOpenArgs) {
|
|
1020
|
+
switch (menuType) {
|
|
1021
|
+
case 'menu':
|
|
1022
|
+
if (!_this.hamburgerMode) {
|
|
1023
|
+
if (observedOpenArgs.showSubMenuOn !== 'Auto') {
|
|
1024
|
+
_this.showItemOnClick = !_this.defaultOption;
|
|
1025
|
+
_this.showSubMenuOn = observedOpenArgs.showSubMenuOn;
|
|
1026
|
+
}
|
|
1027
|
+
_this.top = observedOpenArgs.top;
|
|
1028
|
+
_this.left = observedOpenArgs.left;
|
|
1029
|
+
}
|
|
1030
|
+
_this.popupWrapper.style.display = 'block';
|
|
1031
|
+
if (!_this.hamburgerMode) {
|
|
1032
|
+
_this.popupWrapper.style.maxHeight = _this.popupWrapper.getBoundingClientRect().height + 'px';
|
|
1033
|
+
if (_this.enableScrolling) {
|
|
1034
|
+
addScrolling(_this.createElement, _this.popupWrapper, _this.uList, 'vscroll', _this.enableRtl);
|
|
1035
|
+
}
|
|
1036
|
+
_this.checkScrollOffset(e);
|
|
1037
|
+
}
|
|
1038
|
+
if (!_this.hamburgerMode && !_this.left && !_this.top) {
|
|
1039
|
+
_this.popupObj.refreshPosition(_this.lItem, true);
|
|
1040
|
+
_this.left = parseInt(_this.popupWrapper.style.left, 10);
|
|
1041
|
+
_this.top = parseInt(_this.popupWrapper.style.top, 10);
|
|
1042
|
+
if (_this.enableRtl) {
|
|
1043
|
+
_this.left =
|
|
1044
|
+
_this.isNestedOrVertical ? _this.left - _this.popupWrapper.offsetWidth - _this.lItem.parentElement.offsetWidth + 2
|
|
1045
|
+
: _this.left - _this.popupWrapper.offsetWidth + _this.lItem.offsetWidth;
|
|
1046
|
+
}
|
|
1047
|
+
// eslint-disable-next-line
|
|
1048
|
+
if (_this.template && (_this.isReact || _this.isAngular)) {
|
|
1049
|
+
requestAnimationFrame(function () {
|
|
1050
|
+
_this.collision();
|
|
1051
|
+
_this.popupWrapper.style.display = '';
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
_this.collision();
|
|
1056
|
+
_this.popupWrapper.style.display = '';
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
else {
|
|
1060
|
+
_this.popupObj.collision = { X: 'none', Y: 'none' };
|
|
1061
|
+
_this.popupWrapper.style.display = '';
|
|
1062
|
+
}
|
|
1063
|
+
break;
|
|
1064
|
+
case 'none':
|
|
1065
|
+
_this.top = observedOpenArgs.top;
|
|
1066
|
+
_this.left = observedOpenArgs.left;
|
|
1067
|
+
_this.isContextMenuClosed = true;
|
|
1068
|
+
observedElement = observedOpenArgs.element;
|
|
1069
|
+
if (_this.enableScrolling && _this.isCMenu && observedElement && observedElement.parentElement) {
|
|
1070
|
+
observedElement.style.height = observedElement.parentElement.style.height;
|
|
1071
|
+
}
|
|
1072
|
+
break;
|
|
1073
|
+
case 'hamburger':
|
|
1074
|
+
if (!observedOpenArgs.cancel) {
|
|
1075
|
+
_this.element.classList.remove('e-hide-menu');
|
|
1076
|
+
_this.triggerOpen(_this.element);
|
|
1077
|
+
}
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
if (menuType !== 'hamburger') {
|
|
1081
|
+
if (observedOpenArgs.cancel) {
|
|
1082
|
+
if (_this.isMenu) {
|
|
1083
|
+
_this.popupObj.destroy();
|
|
1084
|
+
detach(_this.popupWrapper);
|
|
1085
|
+
}
|
|
1086
|
+
else if (ul.className.indexOf('e-ul') > -1) {
|
|
1087
|
+
detach(ul);
|
|
1088
|
+
}
|
|
1089
|
+
_this.navIdx.pop();
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
if (_this.isMenu) {
|
|
1093
|
+
if (_this.hamburgerMode) {
|
|
1094
|
+
_this.popupWrapper.style.top = _this.top + 'px';
|
|
1095
|
+
_this.popupWrapper.style.left = 0 + 'px';
|
|
1096
|
+
_this.toggleAnimation(_this.popupWrapper);
|
|
1097
|
+
}
|
|
1098
|
+
else {
|
|
1099
|
+
_this.setBlankIconStyle(_this.popupWrapper);
|
|
1100
|
+
_this.wireKeyboardEvent(_this.popupWrapper);
|
|
1101
|
+
rippleEffect(_this.popupWrapper, { selector: '.' + ITEM });
|
|
1102
|
+
_this.popupWrapper.style.left = _this.left + 'px';
|
|
1103
|
+
_this.popupWrapper.style.top = _this.top + 'px';
|
|
1104
|
+
var animationOptions = _this.animationSettings.effect !== 'None' ? {
|
|
1105
|
+
name: _this.animationSettings.effect, duration: _this.animationSettings.duration,
|
|
1106
|
+
timingFunction: _this.animationSettings.easing
|
|
1107
|
+
} : null;
|
|
1108
|
+
_this.popupObj.show(animationOptions, _this.lItem);
|
|
1109
|
+
if (Browser.isDevice) {
|
|
1110
|
+
_this.popupWrapper.style.left = _this.left + 'px';
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
else {
|
|
1115
|
+
_this.setBlankIconStyle(_this.uList);
|
|
1116
|
+
_this.setPosition(_this.lItem, _this.uList, _this.top, _this.left);
|
|
1117
|
+
_this.toggleAnimation(_this.uList);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
if (_this.keyType === 'right') {
|
|
1122
|
+
var cul = _this.getUlByNavIdx();
|
|
1123
|
+
li.classList.remove(FOCUSED);
|
|
1124
|
+
if (_this.isMenu && _this.navIdx.length === 1) {
|
|
1125
|
+
_this.removeLIStateByClass([SELECTED], [_this.getWrapper()]);
|
|
1126
|
+
}
|
|
1127
|
+
li.classList.add(SELECTED);
|
|
1128
|
+
if (_this.action === ENTER) {
|
|
1129
|
+
var eventArgs_1 = { element: li, item: item, event: e };
|
|
1130
|
+
_this.trigger('select', eventArgs_1);
|
|
1131
|
+
}
|
|
1132
|
+
li.focus();
|
|
1133
|
+
cul = _this.getUlByNavIdx();
|
|
1134
|
+
var index = _this.isValidLI(cul.children[0], 0, _this.action);
|
|
1135
|
+
cul.children[index].classList.add(FOCUSED);
|
|
1136
|
+
cul.children[index].focus();
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
};
|
|
1140
|
+
MenuBase.prototype.collision = function () {
|
|
1141
|
+
var collide;
|
|
1142
|
+
collide = isCollide(this.popupWrapper, null, this.left, this.top);
|
|
1143
|
+
if ((this.isNestedOrVertical || this.enableRtl) && (collide.indexOf('right') > -1
|
|
1144
|
+
|| collide.indexOf('left') > -1)) {
|
|
1145
|
+
this.popupObj.collision.X = 'none';
|
|
1146
|
+
var offWidth = closest(this.lItem, '.e-' + this.getModuleName() + '-wrapper').offsetWidth;
|
|
1147
|
+
this.left =
|
|
1148
|
+
this.enableRtl ? calculatePosition(this.lItem, this.isNestedOrVertical ? 'right' : 'left', 'top').left
|
|
1149
|
+
: this.left - this.popupWrapper.offsetWidth - offWidth + 2;
|
|
1150
|
+
}
|
|
1151
|
+
collide = isCollide(this.popupWrapper, null, this.left, this.top);
|
|
1152
|
+
if (collide.indexOf('left') > -1 || collide.indexOf('right') > -1) {
|
|
1153
|
+
this.left = this.callFit(this.popupWrapper, true, false, this.top, this.left).left;
|
|
1154
|
+
}
|
|
1155
|
+
this.popupWrapper.style.left = this.left + 'px';
|
|
1156
|
+
};
|
|
1157
|
+
MenuBase.prototype.setBlankIconStyle = function (menu) {
|
|
1158
|
+
var blankIconList = [].slice.call(menu.getElementsByClassName('e-blankicon'));
|
|
1159
|
+
if (!blankIconList.length) {
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
var iconLi = menu.querySelector('.e-menu-item:not(.e-blankicon):not(.e-separator)');
|
|
1163
|
+
if (!iconLi) {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
var icon = iconLi.querySelector('.e-menu-icon');
|
|
1167
|
+
if (!icon) {
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
var cssProp = this.enableRtl ? { padding: 'paddingRight', margin: 'marginLeft' } :
|
|
1171
|
+
{ padding: 'paddingLeft', margin: 'marginRight' };
|
|
1172
|
+
var iconCssProps = getComputedStyle(icon);
|
|
1173
|
+
var iconSize = parseInt(iconCssProps.fontSize, 10);
|
|
1174
|
+
if (!!parseInt(iconCssProps.width, 10) && parseInt(iconCssProps.width, 10) > iconSize) {
|
|
1175
|
+
iconSize = parseInt(iconCssProps.width, 10);
|
|
1176
|
+
}
|
|
1177
|
+
// eslint:disable
|
|
1178
|
+
var size = iconSize + parseInt(
|
|
1179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1180
|
+
iconCssProps[cssProp.margin], 10) + parseInt(getComputedStyle(iconLi)[cssProp.padding], 10) + "px";
|
|
1181
|
+
blankIconList.forEach(function (li) {
|
|
1182
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1183
|
+
li.style[cssProp.padding] = size;
|
|
1184
|
+
});
|
|
1185
|
+
// eslint:enable
|
|
1186
|
+
};
|
|
1187
|
+
MenuBase.prototype.checkScrollOffset = function (e) {
|
|
1188
|
+
var wrapper = this.getWrapper();
|
|
1189
|
+
if (wrapper.children[0].classList.contains('e-menu-hscroll') && this.navIdx.length === 1) {
|
|
1190
|
+
var trgt = isNullOrUndefined(e) ? this.element : closest(e.target, '.' + ITEM);
|
|
1191
|
+
var offsetEle = select('.e-hscroll-bar', wrapper);
|
|
1192
|
+
if (offsetEle.scrollLeft > trgt.offsetLeft) {
|
|
1193
|
+
offsetEle.scrollLeft -= (offsetEle.scrollLeft - trgt.offsetLeft);
|
|
1194
|
+
}
|
|
1195
|
+
var offsetLeft = offsetEle.scrollLeft + offsetEle.offsetWidth;
|
|
1196
|
+
var offsetRight = trgt.offsetLeft + trgt.offsetWidth;
|
|
1197
|
+
if (offsetLeft < offsetRight) {
|
|
1198
|
+
offsetEle.scrollLeft += (offsetRight - offsetLeft);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
};
|
|
1202
|
+
MenuBase.prototype.setPosition = function (li, ul, top, left) {
|
|
1203
|
+
var px = 'px';
|
|
1204
|
+
this.toggleVisiblity(ul);
|
|
1205
|
+
if (ul === this.element || (left > -1 && top > -1)) {
|
|
1206
|
+
var collide = isCollide(ul, null, left, top);
|
|
1207
|
+
if (collide.indexOf('right') > -1) {
|
|
1208
|
+
left = left - ul.offsetWidth;
|
|
1209
|
+
}
|
|
1210
|
+
if (collide.indexOf('bottom') > -1) {
|
|
1211
|
+
var offset = this.callFit(ul, false, true, top, left);
|
|
1212
|
+
top = offset.top - 20;
|
|
1213
|
+
if (top < 0) {
|
|
1214
|
+
var newTop = (pageYOffset + document.documentElement.clientHeight) - ul.getBoundingClientRect().height;
|
|
1215
|
+
if (newTop > -1) {
|
|
1216
|
+
top = newTop;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
collide = isCollide(ul, null, left, top);
|
|
1221
|
+
if (collide.indexOf('left') > -1) {
|
|
1222
|
+
var offset = this.callFit(ul, true, false, top, left);
|
|
1223
|
+
left = offset.left;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
else {
|
|
1227
|
+
if (Browser.isDevice) {
|
|
1228
|
+
top = Number(this.element.style.top.replace(px, ''));
|
|
1229
|
+
left = Number(this.element.style.left.replace(px, ''));
|
|
1230
|
+
}
|
|
1231
|
+
else {
|
|
1232
|
+
var x = this.enableRtl ? 'left' : 'right';
|
|
1233
|
+
var offset = calculatePosition(li, x, 'top');
|
|
1234
|
+
top = offset.top;
|
|
1235
|
+
left = offset.left;
|
|
1236
|
+
var collide = isCollide(ul, null, this.enableRtl ? left - ul.offsetWidth : left, top);
|
|
1237
|
+
var xCollision = collide.indexOf('left') > -1 || collide.indexOf('right') > -1;
|
|
1238
|
+
if (xCollision) {
|
|
1239
|
+
offset = calculatePosition(li, this.enableRtl ? 'right' : 'left', 'top');
|
|
1240
|
+
left = offset.left;
|
|
1241
|
+
}
|
|
1242
|
+
if (this.enableRtl || xCollision) {
|
|
1243
|
+
left = (this.enableRtl && xCollision) ? left : left - ul.offsetWidth;
|
|
1244
|
+
}
|
|
1245
|
+
if (collide.indexOf('bottom') > -1) {
|
|
1246
|
+
offset = this.callFit(ul, false, true, top, left);
|
|
1247
|
+
top = offset.top;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
this.toggleVisiblity(ul, false);
|
|
1252
|
+
if (this.isCMenu && this.enableScrolling && ul) {
|
|
1253
|
+
ul.style.height = '';
|
|
1254
|
+
}
|
|
1255
|
+
var wrapper = closest(this.element, '.e-' + this.getModuleName() + '-wrapper');
|
|
1256
|
+
if (!this.isMenu && this.enableScrolling && ul && wrapper && wrapper.offsetHeight > 0) {
|
|
1257
|
+
var menuVScroll = closest(ul, '.e-menu-vscroll');
|
|
1258
|
+
ul.style.display = 'block';
|
|
1259
|
+
if (menuVScroll) {
|
|
1260
|
+
destroyScroll(getInstance(menuVScroll, VScroll), menuVScroll);
|
|
1261
|
+
}
|
|
1262
|
+
var cmenuWidth = Math.ceil(this.getMenuWidth(ul, ul.offsetWidth, this.enableRtl));
|
|
1263
|
+
var cmenu = addScrolling(this.createElement, wrapper, ul, 'vscroll', this.enableRtl, wrapper.offsetHeight);
|
|
1264
|
+
Object.assign(cmenu.style, {
|
|
1265
|
+
top: top + "px",
|
|
1266
|
+
left: left + "px",
|
|
1267
|
+
width: cmenuWidth + "px",
|
|
1268
|
+
position: 'absolute',
|
|
1269
|
+
display: 'none'
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
else {
|
|
1273
|
+
ul.style.top = top + px;
|
|
1274
|
+
ul.style.left = left + px;
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
MenuBase.prototype.getMenuWidth = function (cmenu, width, isRtl) {
|
|
1278
|
+
var caretIcon = cmenu.getElementsByClassName(CARET)[0];
|
|
1279
|
+
if (caretIcon) {
|
|
1280
|
+
width += parseInt(getComputedStyle(caretIcon)[isRtl ? 'marginRight' : 'marginLeft'], 10);
|
|
1281
|
+
}
|
|
1282
|
+
return width < 120 ? 120 : width;
|
|
1283
|
+
};
|
|
1284
|
+
MenuBase.prototype.toggleVisiblity = function (ul, isVisible) {
|
|
1285
|
+
if (isVisible === void 0) { isVisible = true; }
|
|
1286
|
+
ul.style.visibility = isVisible ? 'hidden' : '';
|
|
1287
|
+
ul.style.display = isVisible ? 'block' : 'none';
|
|
1288
|
+
};
|
|
1289
|
+
MenuBase.prototype.createItems = function (items) {
|
|
1290
|
+
var _this = this;
|
|
1291
|
+
var level = this.navIdx ? this.navIdx.length : 0;
|
|
1292
|
+
var fields = this.getFields(level);
|
|
1293
|
+
var showIcon = this.hasField(items, this.getField('iconCss', level));
|
|
1294
|
+
var listBaseOptions = {
|
|
1295
|
+
showIcon: showIcon,
|
|
1296
|
+
moduleName: 'menu',
|
|
1297
|
+
fields: fields,
|
|
1298
|
+
template: this.template,
|
|
1299
|
+
itemNavigable: true,
|
|
1300
|
+
itemCreating: function (args) {
|
|
1301
|
+
if (!args.curData[args.fields[fields.id]]) {
|
|
1302
|
+
args.curData[args.fields[fields.id]] = getUniqueID('menuitem');
|
|
1303
|
+
}
|
|
1304
|
+
if (isNullOrUndefined(args.curData.htmlAttributes)) {
|
|
1305
|
+
Object.defineProperty(args.curData, 'htmlAttributes', {
|
|
1306
|
+
value: {},
|
|
1307
|
+
writable: true,
|
|
1308
|
+
enumerable: true,
|
|
1309
|
+
configurable: true
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
if (Browser.isIE) {
|
|
1313
|
+
if (!args.curData.htmlAttributes.role) {
|
|
1314
|
+
args.curData.htmlAttributes.role = 'menuitem';
|
|
1315
|
+
}
|
|
1316
|
+
if (!args.curData.htmlAttributes.tabindex) {
|
|
1317
|
+
args.curData.htmlAttributes.tabindex = '-1';
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
else {
|
|
1321
|
+
Object.assign(args.curData.htmlAttributes, {
|
|
1322
|
+
role: args.curData.htmlAttributes.role || 'menuitem',
|
|
1323
|
+
tabindex: args.curData.htmlAttributes.tabindex || '-1'
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
if (_this.isMenu && !args.curData[_this.getField('separator', level)]) {
|
|
1327
|
+
if (!args.curData.htmlAttributes['aria-label']) {
|
|
1328
|
+
args.curData.htmlAttributes['aria-label'] = args.curData[args.fields.text] ?
|
|
1329
|
+
args.curData[args.fields.text] : args.curData[args.fields.id];
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
if (args.curData[args.fields[fields.iconCss]] === '') {
|
|
1333
|
+
args.curData[args.fields[fields.iconCss]] = null;
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
itemCreated: function (args) {
|
|
1337
|
+
if (args.curData[_this.getField('separator', level)]) {
|
|
1338
|
+
args.item.classList.add(SEPARATOR);
|
|
1339
|
+
if (!args.curData.htmlAttributes.role) {
|
|
1340
|
+
args.item.setAttribute('role', 'separator');
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
if (showIcon && !args.curData[args.fields.iconCss]
|
|
1344
|
+
&& !args.curData[_this.getField('separator', level)]) {
|
|
1345
|
+
args.item.classList.add('e-blankicon');
|
|
1346
|
+
}
|
|
1347
|
+
if (args.curData[args.fields.child]
|
|
1348
|
+
&& args.curData[args.fields.child].length) {
|
|
1349
|
+
var span = _this.createElement('span', { className: ICONS + ' ' + CARET });
|
|
1350
|
+
args.item.appendChild(span);
|
|
1351
|
+
args.item.setAttribute('aria-haspopup', 'true');
|
|
1352
|
+
args.item.setAttribute('aria-expanded', 'false');
|
|
1353
|
+
args.item.classList.add('e-menu-caret-icon');
|
|
1354
|
+
}
|
|
1355
|
+
if (_this.isMenu && _this.template) {
|
|
1356
|
+
args.item.setAttribute('id', args.curData[args.fields.id].toString());
|
|
1357
|
+
args.item.removeAttribute('data-uid');
|
|
1358
|
+
if (args.item.classList.contains('e-level-1')) {
|
|
1359
|
+
args.item.classList.remove('e-level-1');
|
|
1360
|
+
}
|
|
1361
|
+
if (args.item.classList.contains('e-has-child')) {
|
|
1362
|
+
args.item.classList.remove('e-has-child');
|
|
1363
|
+
}
|
|
1364
|
+
args.item.removeAttribute('aria-level');
|
|
1365
|
+
}
|
|
1366
|
+
var eventArgs = { item: args.curData, element: args.item };
|
|
1367
|
+
_this.trigger('beforeItemRender', eventArgs);
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
this.setProperties({ 'items': this.items }, true);
|
|
1371
|
+
if (this.isMenu) {
|
|
1372
|
+
listBaseOptions.templateID = this.element.id + TEMPLATE_PROPERTY;
|
|
1373
|
+
}
|
|
1374
|
+
var ul = ListBase.createList(this.createElement, items, listBaseOptions, !this.template, this);
|
|
1375
|
+
ul.setAttribute('tabindex', '0');
|
|
1376
|
+
if (this.isMenu) {
|
|
1377
|
+
ul.setAttribute('role', 'menu');
|
|
1378
|
+
}
|
|
1379
|
+
else {
|
|
1380
|
+
ul.setAttribute('role', 'menubar');
|
|
1381
|
+
}
|
|
1382
|
+
return ul;
|
|
1383
|
+
};
|
|
1384
|
+
MenuBase.prototype.moverHandler = function (e) {
|
|
1385
|
+
var trgt = e.target;
|
|
1386
|
+
this.liTrgt = trgt;
|
|
1387
|
+
if (!this.isMenu) {
|
|
1388
|
+
this.isCmenuHover = true;
|
|
1389
|
+
}
|
|
1390
|
+
var cli = this.getLI(trgt);
|
|
1391
|
+
var wrapper = cli ? closest(cli, '.e-' + this.getModuleName() + '-wrapper') : this.getWrapper();
|
|
1392
|
+
var hdrWrapper = this.getWrapper();
|
|
1393
|
+
var regex = new RegExp('-ej2menu-(.*)-popup');
|
|
1394
|
+
var ulId;
|
|
1395
|
+
var isDifferentElem = false;
|
|
1396
|
+
if (!wrapper) {
|
|
1397
|
+
return;
|
|
1398
|
+
}
|
|
1399
|
+
if (wrapper.id !== '') {
|
|
1400
|
+
ulId = regex.exec(wrapper.id)[1];
|
|
1401
|
+
}
|
|
1402
|
+
else {
|
|
1403
|
+
ulId = wrapper.querySelector('ul').id;
|
|
1404
|
+
}
|
|
1405
|
+
if (ulId !== this.element.id) {
|
|
1406
|
+
this.removeLIStateByClass([FOCUSED, SELECTED], [this.getWrapper()]);
|
|
1407
|
+
if (this.navIdx.length) {
|
|
1408
|
+
isDifferentElem = true;
|
|
1409
|
+
}
|
|
1410
|
+
else {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
if (cli && closest(cli, '.e-' + this.getModuleName() + '-wrapper') && !isDifferentElem) {
|
|
1415
|
+
this.removeLIStateByClass([FOCUSED], this.isMenu ? [wrapper].concat(this.getPopups()) : [wrapper]);
|
|
1416
|
+
this.removeLIStateByClass([FOCUSED], this.isMenu ? [hdrWrapper].concat(this.getPopups()) : [hdrWrapper]);
|
|
1417
|
+
cli.classList.add(FOCUSED);
|
|
1418
|
+
if (!this.showItemOnClick) {
|
|
1419
|
+
this.clickHandler(e);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
else if (this.isMenu && this.showItemOnClick && !isDifferentElem) {
|
|
1423
|
+
this.removeLIStateByClass([FOCUSED], [wrapper].concat(this.getPopups()));
|
|
1424
|
+
}
|
|
1425
|
+
if (this.isMenu) {
|
|
1426
|
+
if (!this.showItemOnClick && (trgt.parentElement !== wrapper && !closest(trgt, '.e-' + this.getModuleName() + '-popup'))
|
|
1427
|
+
&& (!cli || (cli && !this.getIndex(cli.id, true).length)) && this.showSubMenuOn !== 'Hover') {
|
|
1428
|
+
this.removeLIStateByClass([FOCUSED], [wrapper]);
|
|
1429
|
+
if (this.navIdx.length) {
|
|
1430
|
+
this.isClosed = true;
|
|
1431
|
+
this.closeMenu(null, e);
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
else if (isDifferentElem && !this.showItemOnClick) {
|
|
1435
|
+
if (this.navIdx.length) {
|
|
1436
|
+
this.isClosed = true;
|
|
1437
|
+
this.closeMenu(null, e);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
if (!this.isClosed) {
|
|
1441
|
+
this.removeStateWrapper();
|
|
1442
|
+
}
|
|
1443
|
+
this.isClosed = false;
|
|
1444
|
+
}
|
|
1445
|
+
if (!this.isMenu) {
|
|
1446
|
+
this.isCmenuHover = false;
|
|
1447
|
+
}
|
|
1448
|
+
};
|
|
1449
|
+
MenuBase.prototype.removeStateWrapper = function () {
|
|
1450
|
+
if (this.liTrgt) {
|
|
1451
|
+
var wrapper = closest(this.liTrgt, '.e-menu-vscroll');
|
|
1452
|
+
if (this.liTrgt.tagName === 'DIV' && wrapper) {
|
|
1453
|
+
this.removeLIStateByClass([FOCUSED, SELECTED], [wrapper]);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
MenuBase.prototype.removeLIStateByClass = function (classList, element) {
|
|
1458
|
+
var li;
|
|
1459
|
+
var _loop_1 = function (i) {
|
|
1460
|
+
classList.forEach(function (className) {
|
|
1461
|
+
li = select('.' + className, element[i]);
|
|
1462
|
+
if (li) {
|
|
1463
|
+
li.classList.remove(className);
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
};
|
|
1467
|
+
for (var i = 0; i < element.length; i++) {
|
|
1468
|
+
_loop_1(i);
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
MenuBase.prototype.getField = function (propName, level) {
|
|
1472
|
+
if (level === void 0) { level = 0; }
|
|
1473
|
+
var fieldName = this.fields["" + propName];
|
|
1474
|
+
return typeof fieldName === 'string' ? fieldName :
|
|
1475
|
+
(!fieldName[level] ? fieldName[fieldName.length - 1].toString()
|
|
1476
|
+
: fieldName[level].toString());
|
|
1477
|
+
};
|
|
1478
|
+
MenuBase.prototype.getFields = function (level) {
|
|
1479
|
+
if (level === void 0) { level = 0; }
|
|
1480
|
+
return {
|
|
1481
|
+
id: this.getField('itemId', level),
|
|
1482
|
+
iconCss: this.getField('iconCss', level),
|
|
1483
|
+
text: this.getField('text', level),
|
|
1484
|
+
url: this.getField('url', level),
|
|
1485
|
+
child: this.getField('children', level),
|
|
1486
|
+
separator: this.getField('separator', level)
|
|
1487
|
+
};
|
|
1488
|
+
};
|
|
1489
|
+
MenuBase.prototype.hasField = function (items, field) {
|
|
1490
|
+
for (var i = 0, len = items.length; i < len; i++) {
|
|
1491
|
+
if (items[i]["" + field]) {
|
|
1492
|
+
return true;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
return false;
|
|
1496
|
+
};
|
|
1497
|
+
MenuBase.prototype.menuHeaderClickHandler = function (e) {
|
|
1498
|
+
var menuWrapper = closest(e.target, '.e-menu-wrapper');
|
|
1499
|
+
if (menuWrapper && menuWrapper.querySelector('ul.e-menu-parent').id !== this.element.id) {
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
if (this.element.className.indexOf('e-hide-menu') > -1) {
|
|
1503
|
+
this.openHamburgerMenu(e);
|
|
1504
|
+
}
|
|
1505
|
+
else {
|
|
1506
|
+
this.closeHamburgerMenu(e);
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1509
|
+
MenuBase.prototype.clickHandler = function (e) {
|
|
1510
|
+
this.isTapHold = this.isTapHold ? false : this.isTapHold;
|
|
1511
|
+
var wrapper = this.getWrapper();
|
|
1512
|
+
var trgt = e.target;
|
|
1513
|
+
var cli = this.cli = this.getLI(trgt);
|
|
1514
|
+
var regex = new RegExp('-ej2menu-(.*)-popup');
|
|
1515
|
+
var cliWrapper = cli ? closest(cli, '.e-' + this.getModuleName() + '-wrapper') : null;
|
|
1516
|
+
var isInstLI = cli && cliWrapper && (this.isMenu ? this.getIndex(cli.id, true).length > 0
|
|
1517
|
+
: wrapper.firstElementChild.id === cliWrapper.firstElementChild.id);
|
|
1518
|
+
if (Browser.isDevice && this.isMenu) {
|
|
1519
|
+
this.removeLIStateByClass([FOCUSED], [wrapper].concat(this.getPopups()));
|
|
1520
|
+
this.mouseDownHandler(e);
|
|
1521
|
+
}
|
|
1522
|
+
if (cli && cliWrapper && this.isMenu) {
|
|
1523
|
+
var cliWrapperId = cliWrapper.id ? regex.exec(cliWrapper.id)[1] : cliWrapper.querySelector('.e-menu-parent').id;
|
|
1524
|
+
if (this.element.id !== cliWrapperId) {
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
if (isInstLI && e.type === 'click' && !cli.classList.contains(HEADER)) {
|
|
1529
|
+
this.setLISelected(cli);
|
|
1530
|
+
var navIdx = this.getIndex(cli.id, true);
|
|
1531
|
+
var item = this.getItem(navIdx);
|
|
1532
|
+
var eventArgs = { element: cli, item: item, event: e };
|
|
1533
|
+
this.trigger('select', eventArgs);
|
|
1534
|
+
}
|
|
1535
|
+
if (isInstLI && (e.type === 'mouseover' || Browser.isDevice || this.showItemOnClick)) {
|
|
1536
|
+
var ul = void 0;
|
|
1537
|
+
if (cli.classList.contains(HEADER)) {
|
|
1538
|
+
ul = wrapper.children[this.navIdx.length - 1];
|
|
1539
|
+
this.toggleAnimation(ul);
|
|
1540
|
+
var sli = this.getLIByClass(ul, SELECTED);
|
|
1541
|
+
if (sli) {
|
|
1542
|
+
sli.classList.remove(SELECTED);
|
|
1543
|
+
}
|
|
1544
|
+
detach(cli.parentNode);
|
|
1545
|
+
this.navIdx.pop();
|
|
1546
|
+
}
|
|
1547
|
+
else {
|
|
1548
|
+
if (!cli.classList.contains(SEPARATOR)) {
|
|
1549
|
+
this.showSubMenu = true;
|
|
1550
|
+
var cul = cli.parentNode;
|
|
1551
|
+
if (isNullOrUndefined(cul)) {
|
|
1552
|
+
return;
|
|
1553
|
+
}
|
|
1554
|
+
this.cliIdx = this.getIdx(cul, cli);
|
|
1555
|
+
if (this.isMenu || !Browser.isDevice) {
|
|
1556
|
+
var culIdx = this.isMenu ? Array.prototype.indexOf.call([wrapper].concat(this.getPopups()), closest(cul, '.' + 'e-' + this.getModuleName() + '-wrapper'))
|
|
1557
|
+
: this.getIdx(wrapper, cul);
|
|
1558
|
+
if (this.navIdx[culIdx] === this.cliIdx) {
|
|
1559
|
+
this.showSubMenu = false;
|
|
1560
|
+
}
|
|
1561
|
+
if (culIdx !== this.navIdx.length && (e.type !== 'mouseover' || this.showSubMenu)) {
|
|
1562
|
+
var sli = this.getLIByClass(cul, SELECTED);
|
|
1563
|
+
if (sli) {
|
|
1564
|
+
sli.classList.remove(SELECTED);
|
|
1565
|
+
}
|
|
1566
|
+
this.isClosed = true;
|
|
1567
|
+
this.keyType = 'click';
|
|
1568
|
+
if (this.showItemOnClick) {
|
|
1569
|
+
this.setLISelected(cli);
|
|
1570
|
+
if (!this.isMenu) {
|
|
1571
|
+
this.isCmenuHover = true;
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
this.closeMenu(culIdx + 1, e);
|
|
1575
|
+
if (this.showItemOnClick) {
|
|
1576
|
+
this.setLISelected(cli);
|
|
1577
|
+
if (!this.isMenu) {
|
|
1578
|
+
this.isCmenuHover = false;
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
if (!this.isClosed) {
|
|
1584
|
+
this.afterCloseMenu(e);
|
|
1585
|
+
}
|
|
1586
|
+
this.isClosed = false;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
if (trgt.tagName === 'DIV' && closest(trgt, '.e-menu-vscroll') && (this.navIdx.length || !this.isMenu && this.enableScrolling && this.navIdx.length === 0)) {
|
|
1592
|
+
var popupEle = this.isMenu ? closest(trgt, '.' + POPUP) : closest(trgt, '.e-menu-vscroll');
|
|
1593
|
+
var cIdx = this.isMenu ? Array.prototype.indexOf.call(this.getPopups(), popupEle) + 1
|
|
1594
|
+
: this.getIdx(wrapper, select('ul.e-menu-parent', popupEle));
|
|
1595
|
+
if (cIdx < this.navIdx.length) {
|
|
1596
|
+
this.closeMenu(cIdx + 1, e);
|
|
1597
|
+
if (popupEle) {
|
|
1598
|
+
this.removeLIStateByClass([FOCUSED, SELECTED], [popupEle]);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
else if (this.isMenu && this.hamburgerMode && trgt.tagName === 'SPAN'
|
|
1603
|
+
&& trgt.classList.contains('e-menu-icon')) {
|
|
1604
|
+
this.menuHeaderClickHandler(e);
|
|
1605
|
+
}
|
|
1606
|
+
else {
|
|
1607
|
+
if (trgt.tagName !== 'UL' || (this.isMenu ? trgt.parentElement.classList.contains('e-menu-wrapper') &&
|
|
1608
|
+
!this.getIndex(trgt.querySelector('.' + ITEM).id, true).length : trgt.parentElement !== wrapper)) {
|
|
1609
|
+
if (!cli) {
|
|
1610
|
+
this.removeLIStateByClass([SELECTED], [wrapper]);
|
|
1611
|
+
}
|
|
1612
|
+
if (!this.isAnimationNone && !cli || (cli && !cli.querySelector('.' + CARET))) {
|
|
1613
|
+
if (navigator.platform.toUpperCase().indexOf('MAC') < 0 || (navigator.platform.toUpperCase().indexOf('MAC') >= 0 && !e.ctrlKey)) {
|
|
1614
|
+
this.closeMenu(null, e);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
MenuBase.prototype.afterCloseMenu = function (e) {
|
|
1622
|
+
if (isNullOrUndefined(e)) {
|
|
1623
|
+
return;
|
|
1624
|
+
}
|
|
1625
|
+
var isHeader;
|
|
1626
|
+
if (this.showSubMenu) {
|
|
1627
|
+
if (this.showItemOnClick && this.navIdx.length === 0) {
|
|
1628
|
+
isHeader = closest(e.target, '.e-menu-parent.e-control');
|
|
1629
|
+
}
|
|
1630
|
+
else {
|
|
1631
|
+
isHeader = closest(this.element, '.e-menu-parent.e-control');
|
|
1632
|
+
}
|
|
1633
|
+
var idx = this.navIdx.concat(this.cliIdx);
|
|
1634
|
+
var item = this.getItem(idx);
|
|
1635
|
+
if (item && item[this.getField('children', idx.length - 1)] &&
|
|
1636
|
+
item[this.getField('children', idx.length - 1)].length) {
|
|
1637
|
+
if (e.type === 'mouseover' || (Browser.isDevice && this.isMenu)) {
|
|
1638
|
+
this.setLISelected(this.cli);
|
|
1639
|
+
}
|
|
1640
|
+
if ((!this.hamburgerMode && isHeader) || (this.hamburgerMode && this.cli.getAttribute('aria-expanded') === 'false')) {
|
|
1641
|
+
this.cli.setAttribute('aria-expanded', 'true');
|
|
1642
|
+
this.navIdx.push(this.cliIdx);
|
|
1643
|
+
this.openMenu(this.cli, item, null, null, e);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
else {
|
|
1647
|
+
if (e.type !== 'mouseover') {
|
|
1648
|
+
this.closeMenu(null, e);
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
if (!isHeader) {
|
|
1652
|
+
var cul = this.getUlByNavIdx();
|
|
1653
|
+
var sli = this.getLIByClass(cul, SELECTED);
|
|
1654
|
+
if (sli) {
|
|
1655
|
+
sli.setAttribute('aria-expanded', 'false');
|
|
1656
|
+
sli.classList.remove(SELECTED);
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
this.keyType = '';
|
|
1661
|
+
};
|
|
1662
|
+
MenuBase.prototype.setLISelected = function (li) {
|
|
1663
|
+
var sli = this.getLIByClass(li.parentElement, SELECTED);
|
|
1664
|
+
if (sli) {
|
|
1665
|
+
sli.classList.remove(SELECTED);
|
|
1666
|
+
}
|
|
1667
|
+
if (!this.isMenu) {
|
|
1668
|
+
li.classList.remove(FOCUSED);
|
|
1669
|
+
}
|
|
1670
|
+
li.classList.add(SELECTED);
|
|
1671
|
+
};
|
|
1672
|
+
MenuBase.prototype.getLIByClass = function (ul, classname) {
|
|
1673
|
+
if (ul && ul.children) {
|
|
1674
|
+
for (var i = 0, len = ul.children.length; i < len; i++) {
|
|
1675
|
+
if (ul.children[i].classList.contains(classname)) {
|
|
1676
|
+
return ul.children[i];
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
return null;
|
|
1681
|
+
};
|
|
1682
|
+
/**
|
|
1683
|
+
* This method is used to get the index of the menu item in the Menu based on the argument.
|
|
1684
|
+
*
|
|
1685
|
+
* @param {MenuItem | string} item - item be passed to get the index | id to be passed to get the item index.
|
|
1686
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
1687
|
+
* @returns {void}
|
|
1688
|
+
*/
|
|
1689
|
+
MenuBase.prototype.getItemIndex = function (item, isUniqueId) {
|
|
1690
|
+
var idx;
|
|
1691
|
+
if (typeof item === 'string') {
|
|
1692
|
+
idx = item;
|
|
1693
|
+
}
|
|
1694
|
+
else {
|
|
1695
|
+
idx = item.id;
|
|
1696
|
+
}
|
|
1697
|
+
var isText = (isUniqueId === false) ? false : true;
|
|
1698
|
+
var navIdx = this.getIndex(idx, isText);
|
|
1699
|
+
return navIdx;
|
|
1700
|
+
};
|
|
1701
|
+
/**
|
|
1702
|
+
* This method is used to set the menu item in the Menu based on the argument.
|
|
1703
|
+
*
|
|
1704
|
+
* @param {MenuItem} item - item need to be updated.
|
|
1705
|
+
* @param {string} id - id / text to be passed to update the item.
|
|
1706
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
1707
|
+
* @returns {void}
|
|
1708
|
+
*/
|
|
1709
|
+
MenuBase.prototype.setItem = function (item, id, isUniqueId) {
|
|
1710
|
+
var idx;
|
|
1711
|
+
if (isUniqueId) {
|
|
1712
|
+
idx = id ? id : item.id;
|
|
1713
|
+
}
|
|
1714
|
+
else {
|
|
1715
|
+
idx = id ? id : item.text;
|
|
1716
|
+
}
|
|
1717
|
+
var navIdx = this.getIndex(idx, isUniqueId);
|
|
1718
|
+
var newItem = this.getItem(navIdx);
|
|
1719
|
+
Object.assign(newItem, item);
|
|
1720
|
+
};
|
|
1721
|
+
MenuBase.prototype.getItem = function (navIdx) {
|
|
1722
|
+
navIdx = navIdx.slice();
|
|
1723
|
+
var idx = navIdx.pop();
|
|
1724
|
+
var items = this.getItems(navIdx);
|
|
1725
|
+
return items[idx];
|
|
1726
|
+
};
|
|
1727
|
+
MenuBase.prototype.getItems = function (navIdx) {
|
|
1728
|
+
var items = this.items;
|
|
1729
|
+
for (var i = 0; i < navIdx.length; i++) {
|
|
1730
|
+
items = items[navIdx[i]][this.getField('children', i)];
|
|
1731
|
+
}
|
|
1732
|
+
return items;
|
|
1733
|
+
};
|
|
1734
|
+
MenuBase.prototype.setItems = function (newItems, navIdx) {
|
|
1735
|
+
var items = this.getItems(navIdx);
|
|
1736
|
+
items.splice(0, items.length);
|
|
1737
|
+
for (var i = 0; i < newItems.length; i++) {
|
|
1738
|
+
items.splice(i, 0, newItems[i]);
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
MenuBase.prototype.getIdx = function (ul, li, skipHdr) {
|
|
1742
|
+
if (skipHdr === void 0) { skipHdr = true; }
|
|
1743
|
+
var ulElem = !this.isMenu && this.enableScrolling && select('.e-menu-vscroll', ul)
|
|
1744
|
+
? selectAll('.e-menu-parent', ul) : Array.from(ul.children);
|
|
1745
|
+
var idx = Array.prototype.indexOf.call(ulElem, li);
|
|
1746
|
+
if (skipHdr && ul.children[0].classList.contains(HEADER)) {
|
|
1747
|
+
idx--;
|
|
1748
|
+
}
|
|
1749
|
+
return idx;
|
|
1750
|
+
};
|
|
1751
|
+
MenuBase.prototype.getLI = function (elem) {
|
|
1752
|
+
if (elem.tagName === 'LI' && elem.classList.contains('e-menu-item')) {
|
|
1753
|
+
return elem;
|
|
1754
|
+
}
|
|
1755
|
+
return closest(elem, 'li.e-menu-item');
|
|
1756
|
+
};
|
|
1757
|
+
MenuBase.prototype.updateItemsByNavIdx = function () {
|
|
1758
|
+
var items = this.items;
|
|
1759
|
+
var count = 0;
|
|
1760
|
+
for (var index = 0; index < this.navIdx.length; index++) {
|
|
1761
|
+
items = items[index].items;
|
|
1762
|
+
if (!items) {
|
|
1763
|
+
break;
|
|
1764
|
+
}
|
|
1765
|
+
count++;
|
|
1766
|
+
var ul = this.getUlByNavIdx(count);
|
|
1767
|
+
if (!ul) {
|
|
1768
|
+
break;
|
|
1769
|
+
}
|
|
1770
|
+
this.updateItem(ul, items);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
MenuBase.prototype.removeChildElement = function (elem) {
|
|
1774
|
+
while (elem.firstElementChild) {
|
|
1775
|
+
elem.removeChild(elem.firstElementChild);
|
|
1776
|
+
}
|
|
1777
|
+
return elem;
|
|
1778
|
+
};
|
|
1779
|
+
/**
|
|
1780
|
+
* Called internally if any of the property value changed.
|
|
1781
|
+
*
|
|
1782
|
+
* @private
|
|
1783
|
+
* @param {MenuBaseModel} newProp - Specifies the new properties
|
|
1784
|
+
* @param {MenuBaseModel} oldProp - Specifies the old properties
|
|
1785
|
+
* @returns {void}
|
|
1786
|
+
*/
|
|
1787
|
+
MenuBase.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
1788
|
+
var _this = this;
|
|
1789
|
+
var wrapper = this.getWrapper();
|
|
1790
|
+
var _loop_2 = function (prop) {
|
|
1791
|
+
switch (prop) {
|
|
1792
|
+
case 'cssClass':
|
|
1793
|
+
if (oldProp.cssClass) {
|
|
1794
|
+
removeClass([wrapper], oldProp.cssClass.split(' '));
|
|
1795
|
+
}
|
|
1796
|
+
if (newProp.cssClass) {
|
|
1797
|
+
addClass([wrapper], newProp.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
1798
|
+
}
|
|
1799
|
+
break;
|
|
1800
|
+
case 'enableRtl':
|
|
1801
|
+
if (this_1.enableRtl) {
|
|
1802
|
+
wrapper.classList.add(RTL);
|
|
1803
|
+
}
|
|
1804
|
+
else {
|
|
1805
|
+
wrapper.classList.remove(RTL);
|
|
1806
|
+
}
|
|
1807
|
+
break;
|
|
1808
|
+
case 'showItemOnClick':
|
|
1809
|
+
this_1.unWireEvents();
|
|
1810
|
+
this_1.showItemOnClick = newProp.showItemOnClick;
|
|
1811
|
+
this_1.wireEvents();
|
|
1812
|
+
break;
|
|
1813
|
+
case 'enableScrolling':
|
|
1814
|
+
if (newProp.enableScrolling) {
|
|
1815
|
+
var ul_2;
|
|
1816
|
+
if (this_1.element.classList.contains('e-vertical')) {
|
|
1817
|
+
addScrolling(this_1.createElement, wrapper, this_1.element, 'vscroll', this_1.enableRtl);
|
|
1818
|
+
}
|
|
1819
|
+
else {
|
|
1820
|
+
addScrolling(this_1.createElement, wrapper, this_1.element, 'hscroll', this_1.enableRtl);
|
|
1821
|
+
}
|
|
1822
|
+
this_1.getPopups().forEach(function (wrapper) {
|
|
1823
|
+
ul_2 = select('.e-ul', wrapper);
|
|
1824
|
+
addScrolling(_this.createElement, wrapper, ul_2, 'vscroll', _this.enableRtl);
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
else {
|
|
1828
|
+
var ul_3 = wrapper.children[0];
|
|
1829
|
+
if (this_1.element.classList.contains('e-vertical') || !this_1.isMenu) {
|
|
1830
|
+
destroyScroll(getInstance(ul_3, VScroll), ul_3);
|
|
1831
|
+
}
|
|
1832
|
+
else {
|
|
1833
|
+
destroyScroll(getInstance(ul_3, HScroll), ul_3);
|
|
1834
|
+
}
|
|
1835
|
+
wrapper.style.overflow = '';
|
|
1836
|
+
wrapper.appendChild(this_1.element);
|
|
1837
|
+
this_1.getPopups().forEach(function (wrapper) {
|
|
1838
|
+
ul_3 = wrapper.children[0];
|
|
1839
|
+
destroyScroll(getInstance(ul_3, VScroll), ul_3);
|
|
1840
|
+
wrapper.style.overflow = '';
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
break;
|
|
1844
|
+
case 'items': {
|
|
1845
|
+
var idx = void 0;
|
|
1846
|
+
var navIdx = void 0;
|
|
1847
|
+
var item = void 0;
|
|
1848
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1849
|
+
if (this_1.isReact && this_1.template) {
|
|
1850
|
+
this_1.clearTemplate(['template']);
|
|
1851
|
+
}
|
|
1852
|
+
if (!Object.keys(oldProp.items).length) {
|
|
1853
|
+
this_1.updateItem(this_1.element, this_1.items);
|
|
1854
|
+
if (this_1.enableScrolling && this_1.element.parentElement.classList.contains('e-custom-scroll')) {
|
|
1855
|
+
if (this_1.element.classList.contains('e-vertical')) {
|
|
1856
|
+
addScrolling(this_1.createElement, wrapper, this_1.element, 'vscroll', this_1.enableRtl);
|
|
1857
|
+
}
|
|
1858
|
+
else {
|
|
1859
|
+
addScrolling(this_1.createElement, wrapper, this_1.element, 'hscroll', this_1.enableRtl);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
if (!this_1.hamburgerMode) {
|
|
1863
|
+
for (var i = 1, count = wrapper.childElementCount; i < count; i++) {
|
|
1864
|
+
detach(wrapper.lastElementChild);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
this_1.navIdx = [];
|
|
1868
|
+
}
|
|
1869
|
+
else {
|
|
1870
|
+
var keys = Object.keys(newProp.items);
|
|
1871
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1872
|
+
navIdx = this_1.getChangedItemIndex(newProp, [], Number(keys[i]));
|
|
1873
|
+
if (navIdx.length <= this_1.getWrapper().children.length) {
|
|
1874
|
+
idx = navIdx.pop();
|
|
1875
|
+
item = this_1.getItems(navIdx);
|
|
1876
|
+
this_1.insertAfter([item[idx]], item[idx].text);
|
|
1877
|
+
this_1.removeItem(item, navIdx, idx);
|
|
1878
|
+
this_1.setItems(item, navIdx);
|
|
1879
|
+
}
|
|
1880
|
+
navIdx.length = 0;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
break;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
var this_1 = this;
|
|
1888
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
1889
|
+
var prop = _a[_i];
|
|
1890
|
+
_loop_2(prop);
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
MenuBase.prototype.updateItem = function (ul, items) {
|
|
1894
|
+
if (isBlazor() && !this.isMenu) {
|
|
1895
|
+
ul = this.removeChildElement(ul);
|
|
1896
|
+
}
|
|
1897
|
+
else {
|
|
1898
|
+
if (this.enableScrolling) {
|
|
1899
|
+
var wrapper1 = this.getWrapper();
|
|
1900
|
+
var ul1 = wrapper1.children[0];
|
|
1901
|
+
if (this.element.classList.contains('e-vertical')) {
|
|
1902
|
+
destroyScroll(getInstance(ul1, VScroll), ul1);
|
|
1903
|
+
}
|
|
1904
|
+
else {
|
|
1905
|
+
destroyScroll(getInstance(ul1, HScroll), ul1);
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
ul.innerHTML = '';
|
|
1909
|
+
}
|
|
1910
|
+
var lis = [].slice.call(this.createItems(items).children);
|
|
1911
|
+
lis.forEach(function (li) {
|
|
1912
|
+
ul.appendChild(li);
|
|
1913
|
+
});
|
|
1914
|
+
};
|
|
1915
|
+
MenuBase.prototype.getChangedItemIndex = function (newProp, index, idx) {
|
|
1916
|
+
index.push(idx);
|
|
1917
|
+
var key = Object.keys(newProp.items[idx]).pop();
|
|
1918
|
+
if (key === 'items') {
|
|
1919
|
+
var item = newProp.items[idx];
|
|
1920
|
+
var popStr = Object.keys(item.items).pop();
|
|
1921
|
+
if (popStr) {
|
|
1922
|
+
this.getChangedItemIndex(item, index, Number(popStr));
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
else {
|
|
1926
|
+
if (key === 'isParentArray' && index.length > 1) {
|
|
1927
|
+
index.pop();
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
return index;
|
|
1931
|
+
};
|
|
1932
|
+
MenuBase.prototype.removeItem = function (item, navIdx, idx) {
|
|
1933
|
+
item.splice(idx, 1);
|
|
1934
|
+
var uls = this.getWrapper().children;
|
|
1935
|
+
if (navIdx.length < uls.length) {
|
|
1936
|
+
detach(uls[navIdx.length].children[idx]);
|
|
1937
|
+
}
|
|
1938
|
+
};
|
|
1939
|
+
/**
|
|
1940
|
+
* Used to unwire the bind events.
|
|
1941
|
+
*
|
|
1942
|
+
* @private
|
|
1943
|
+
* @param {string} targetSelctor - Specifies the target selector
|
|
1944
|
+
* @returns {void}
|
|
1945
|
+
*/
|
|
1946
|
+
MenuBase.prototype.unWireEvents = function (targetSelctor) {
|
|
1947
|
+
if (targetSelctor === void 0) { targetSelctor = this.target; }
|
|
1948
|
+
var wrapper = this.getWrapper();
|
|
1949
|
+
if (targetSelctor) {
|
|
1950
|
+
var target = void 0;
|
|
1951
|
+
var touchModule = void 0;
|
|
1952
|
+
var targetElems = selectAll(targetSelctor);
|
|
1953
|
+
for (var i = 0, len = targetElems.length; i < len; i++) {
|
|
1954
|
+
target = targetElems[i];
|
|
1955
|
+
if (this.isMenu) {
|
|
1956
|
+
EventHandler.remove(target, 'click', this.menuHeaderClickHandler);
|
|
1957
|
+
}
|
|
1958
|
+
else {
|
|
1959
|
+
if (Browser.isIos) {
|
|
1960
|
+
touchModule = getInstance(target, Touch);
|
|
1961
|
+
if (touchModule) {
|
|
1962
|
+
touchModule.destroy();
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
else {
|
|
1966
|
+
EventHandler.remove(target, 'contextmenu', this.cmenuHandler);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
if (!this.isMenu) {
|
|
1971
|
+
EventHandler.remove(this.targetElement, 'scroll', this.scrollHandler);
|
|
1972
|
+
for (var _i = 0, _a = getScrollableParent(this.targetElement); _i < _a.length; _i++) {
|
|
1973
|
+
var parent_2 = _a[_i];
|
|
1974
|
+
EventHandler.remove(parent_2, 'scroll', this.scrollHandler);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
if (!Browser.isDevice) {
|
|
1979
|
+
EventHandler.remove(this.isMenu ? document : wrapper, 'mouseover', this.delegateMoverHandler);
|
|
1980
|
+
EventHandler.remove(document, 'mousedown', this.delegateMouseDownHandler);
|
|
1981
|
+
EventHandler.remove(document, 'keydown', this.domKeyHandler);
|
|
1982
|
+
if (!this.isMenu && !this.target) {
|
|
1983
|
+
EventHandler.remove(document, 'scroll', this.scrollHandler);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
EventHandler.remove(document, 'click', this.delegateClickHandler);
|
|
1987
|
+
this.unWireKeyboardEvent(wrapper);
|
|
1988
|
+
this.rippleFn();
|
|
1989
|
+
};
|
|
1990
|
+
MenuBase.prototype.unWireKeyboardEvent = function (element) {
|
|
1991
|
+
var keyboardModule = getInstance(element, KeyboardEvents);
|
|
1992
|
+
if (keyboardModule) {
|
|
1993
|
+
keyboardModule.destroy();
|
|
1994
|
+
}
|
|
1995
|
+
};
|
|
1996
|
+
MenuBase.prototype.toggleAnimation = function (ul, isMenuOpen) {
|
|
1997
|
+
var _this = this;
|
|
1998
|
+
if (isMenuOpen === void 0) { isMenuOpen = true; }
|
|
1999
|
+
var menuWrapper = this.getWrapper();
|
|
2000
|
+
if (menuWrapper) {
|
|
2001
|
+
var activeMenuElements = menuWrapper.querySelectorAll('.e-menu-parent');
|
|
2002
|
+
activeMenuElements.forEach(function (menuElement) {
|
|
2003
|
+
Animation.stop(menuElement);
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
var pUlHeight;
|
|
2007
|
+
var pElement;
|
|
2008
|
+
var animateElement = (this.enableScrolling && !this.isMenu && closest(ul, '.e-menu-vscroll'))
|
|
2009
|
+
? closest(ul, '.e-menu-vscroll') : ul;
|
|
2010
|
+
if (this.animationSettings.effect === 'None' || !isMenuOpen) {
|
|
2011
|
+
if (this.hamburgerMode && ul) {
|
|
2012
|
+
ul.style.top = '0px';
|
|
2013
|
+
}
|
|
2014
|
+
this.isAnimationNone = this.animationSettings.effect === 'None';
|
|
2015
|
+
this.end(ul, isMenuOpen);
|
|
2016
|
+
}
|
|
2017
|
+
else {
|
|
2018
|
+
this.animation.animate(animateElement, {
|
|
2019
|
+
name: this.animationSettings.effect,
|
|
2020
|
+
duration: this.animationSettings.duration,
|
|
2021
|
+
timingFunction: this.animationSettings.easing,
|
|
2022
|
+
begin: function (options) {
|
|
2023
|
+
if (_this.hamburgerMode) {
|
|
2024
|
+
pElement = options.element.parentElement;
|
|
2025
|
+
options.element.style.position = 'absolute';
|
|
2026
|
+
if (pElement) {
|
|
2027
|
+
pUlHeight = pElement.offsetHeight;
|
|
2028
|
+
}
|
|
2029
|
+
options.element.style.maxHeight = options.element.offsetHeight + 'px';
|
|
2030
|
+
if (pElement) {
|
|
2031
|
+
pElement.style.maxHeight = '';
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
else {
|
|
2035
|
+
options.element.style.display = 'block';
|
|
2036
|
+
options.element.style.maxHeight = _this.isMenu ? options.element.getBoundingClientRect().height + 'px' : options.element.scrollHeight + 'px';
|
|
2037
|
+
}
|
|
2038
|
+
},
|
|
2039
|
+
progress: function (options) {
|
|
2040
|
+
if (_this.hamburgerMode && pElement) {
|
|
2041
|
+
pElement.style.minHeight = (pUlHeight + options.element.offsetHeight) + 'px';
|
|
2042
|
+
}
|
|
2043
|
+
},
|
|
2044
|
+
end: function (options) {
|
|
2045
|
+
if (_this.hamburgerMode) {
|
|
2046
|
+
options.element.style.position = '';
|
|
2047
|
+
options.element.style.maxHeight = '';
|
|
2048
|
+
if (pElement) {
|
|
2049
|
+
pElement.style.minHeight = '';
|
|
2050
|
+
}
|
|
2051
|
+
options.element.style.top = 0 + 'px';
|
|
2052
|
+
options.element.children[0].focus();
|
|
2053
|
+
_this.triggerOpen(options.element.children[0]);
|
|
2054
|
+
}
|
|
2055
|
+
else {
|
|
2056
|
+
_this.end(options.element, isMenuOpen);
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
};
|
|
2062
|
+
MenuBase.prototype.triggerOpen = function (ul) {
|
|
2063
|
+
var item = this.navIdx.length ? this.getItem(this.navIdx) : null;
|
|
2064
|
+
var eventArgs = {
|
|
2065
|
+
element: ul, parentItem: item, items: item ? item.items : this.items
|
|
2066
|
+
};
|
|
2067
|
+
this.trigger('onOpen', eventArgs);
|
|
2068
|
+
if (!this.isMenu) {
|
|
2069
|
+
EventHandler.add(ul, 'keydown', this.keyHandler, this);
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
MenuBase.prototype.end = function (ul, isMenuOpen) {
|
|
2073
|
+
if (isMenuOpen && this.isContextMenuClosed) {
|
|
2074
|
+
if (this.isMenu || !Browser.isDevice || (!this.isMenu && this.isAnimationNone && Browser.isDevice)) {
|
|
2075
|
+
ul.style.display = 'block';
|
|
2076
|
+
}
|
|
2077
|
+
ul.style.maxHeight = '';
|
|
2078
|
+
var scrollMenu = this.enableScrolling && !this.isMenu ? closest(ul, '.e-menu-vscroll') : null;
|
|
2079
|
+
if (scrollMenu) {
|
|
2080
|
+
scrollMenu.style.display = 'block';
|
|
2081
|
+
}
|
|
2082
|
+
this.triggerOpen(ul);
|
|
2083
|
+
if (ul.querySelector('.' + FOCUSED)) {
|
|
2084
|
+
ul.querySelector('.' + FOCUSED).focus();
|
|
2085
|
+
}
|
|
2086
|
+
else {
|
|
2087
|
+
var ele = this.getWrapper().children[this.getIdx(this.getWrapper(), ul) - 1];
|
|
2088
|
+
if (this.currentTarget) {
|
|
2089
|
+
if (!(this.currentTarget.classList.contains('e-numerictextbox') || this.currentTarget.classList.contains('e-textbox') || this.currentTarget.tagName === 'INPUT')) {
|
|
2090
|
+
if (ele) {
|
|
2091
|
+
ele.querySelector('.' + SELECTED).focus();
|
|
2092
|
+
}
|
|
2093
|
+
else {
|
|
2094
|
+
this.element.focus();
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
else {
|
|
2099
|
+
if (ele) {
|
|
2100
|
+
ele.querySelector('.' + SELECTED).focus();
|
|
2101
|
+
}
|
|
2102
|
+
else {
|
|
2103
|
+
this.element.focus();
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
else {
|
|
2109
|
+
var scrollMenu = this.enableScrolling && !this.isMenu ? closest(ul, '.e-menu-vscroll') : null;
|
|
2110
|
+
if (scrollMenu) {
|
|
2111
|
+
destroyScroll(getInstance(scrollMenu, VScroll), scrollMenu);
|
|
2112
|
+
}
|
|
2113
|
+
if (ul === this.element) {
|
|
2114
|
+
var fli = this.getLIByClass(this.element, FOCUSED);
|
|
2115
|
+
if (fli) {
|
|
2116
|
+
fli.classList.remove(FOCUSED);
|
|
2117
|
+
}
|
|
2118
|
+
var sli = this.getLIByClass(this.element, SELECTED);
|
|
2119
|
+
if (sli) {
|
|
2120
|
+
sli.classList.remove(SELECTED);
|
|
2121
|
+
}
|
|
2122
|
+
ul.style.display = 'none';
|
|
2123
|
+
this.isAnimationNone = false;
|
|
2124
|
+
}
|
|
2125
|
+
else {
|
|
2126
|
+
detach(ul);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
};
|
|
2130
|
+
/**
|
|
2131
|
+
* Get the properties to be maintained in the persisted state.
|
|
2132
|
+
*
|
|
2133
|
+
* @returns {string} - Persist data
|
|
2134
|
+
*/
|
|
2135
|
+
MenuBase.prototype.getPersistData = function () {
|
|
2136
|
+
return '';
|
|
2137
|
+
};
|
|
2138
|
+
/**
|
|
2139
|
+
* Get wrapper element.
|
|
2140
|
+
*
|
|
2141
|
+
* @returns {Element} - Wrapper element
|
|
2142
|
+
* @private
|
|
2143
|
+
*/
|
|
2144
|
+
MenuBase.prototype.getWrapper = function () {
|
|
2145
|
+
return closest(this.element, '.e-' + this.getModuleName() + '-wrapper');
|
|
2146
|
+
};
|
|
2147
|
+
MenuBase.prototype.getIndex = function (data, isUniqueId, items, nIndex, isCallBack, level) {
|
|
2148
|
+
if (items === void 0) { items = this.items; }
|
|
2149
|
+
if (nIndex === void 0) { nIndex = []; }
|
|
2150
|
+
if (isCallBack === void 0) { isCallBack = false; }
|
|
2151
|
+
if (level === void 0) { level = 0; }
|
|
2152
|
+
var item;
|
|
2153
|
+
level = isCallBack ? level + 1 : 0;
|
|
2154
|
+
for (var i = 0, len = items.length; i < len; i++) {
|
|
2155
|
+
item = items[i];
|
|
2156
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2157
|
+
var currentField = isUniqueId ? item[this.getField('itemId', level)] : item[this.getField('text', level)];
|
|
2158
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2159
|
+
var itemId = (item.htmlAttributes && 'id' in item.htmlAttributes) ? item.htmlAttributes.id : currentField;
|
|
2160
|
+
if (itemId === data) {
|
|
2161
|
+
nIndex.push(i);
|
|
2162
|
+
break;
|
|
2163
|
+
}
|
|
2164
|
+
else if (item[this.getField('children', level)]
|
|
2165
|
+
&& item[this.getField('children', level)].length) {
|
|
2166
|
+
nIndex = this.getIndex(data, isUniqueId, item[this.getField('children', level)], nIndex, true, level);
|
|
2167
|
+
if (nIndex[nIndex.length - 1] === -1) {
|
|
2168
|
+
if (i !== len - 1) {
|
|
2169
|
+
nIndex.pop();
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
else {
|
|
2173
|
+
nIndex.unshift(i);
|
|
2174
|
+
break;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
else {
|
|
2178
|
+
if (i === len - 1) {
|
|
2179
|
+
nIndex.push(-1);
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
return (!isCallBack && nIndex[0] === -1) ? [] : nIndex;
|
|
2184
|
+
};
|
|
2185
|
+
/**
|
|
2186
|
+
* This method is used to enable or disable the menu items in the Menu based on the items and enable argument.
|
|
2187
|
+
*
|
|
2188
|
+
* @param {string[]} items - Text items that needs to be enabled/disabled.
|
|
2189
|
+
* @param {boolean} enable - Set `true`/`false` to enable/disable the list items.
|
|
2190
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2191
|
+
* @returns {void}
|
|
2192
|
+
*/
|
|
2193
|
+
MenuBase.prototype.enableItems = function (items, enable, isUniqueId) {
|
|
2194
|
+
if (enable === void 0) { enable = true; }
|
|
2195
|
+
var ul;
|
|
2196
|
+
var idx;
|
|
2197
|
+
var navIdx;
|
|
2198
|
+
var disabled = DISABLED;
|
|
2199
|
+
var skipItem;
|
|
2200
|
+
for (var i = 0; i < items.length; i++) {
|
|
2201
|
+
navIdx = this.getIndex(items[i], isUniqueId);
|
|
2202
|
+
if (this.navIdx.length) {
|
|
2203
|
+
if (navIdx.length !== 1) {
|
|
2204
|
+
skipItem = false;
|
|
2205
|
+
for (var i_1 = 0, len = navIdx.length - 1; i_1 < len; i_1++) {
|
|
2206
|
+
if (navIdx[i_1] !== this.navIdx[i_1]) {
|
|
2207
|
+
skipItem = true;
|
|
2208
|
+
break;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
if (skipItem) {
|
|
2212
|
+
continue;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
else {
|
|
2217
|
+
if (navIdx.length !== 1) {
|
|
2218
|
+
continue;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
idx = navIdx.pop();
|
|
2222
|
+
ul = this.getUlByNavIdx(navIdx.length);
|
|
2223
|
+
if (ul && !isNullOrUndefined(idx)) {
|
|
2224
|
+
if (enable) {
|
|
2225
|
+
if (this.isMenu) {
|
|
2226
|
+
ul.children[idx].classList.remove(disabled);
|
|
2227
|
+
ul.children[idx].removeAttribute('aria-disabled');
|
|
2228
|
+
}
|
|
2229
|
+
else {
|
|
2230
|
+
if (Browser.isDevice && !ul.classList.contains('e-contextmenu')) {
|
|
2231
|
+
ul.children[idx + 1].classList.remove(disabled);
|
|
2232
|
+
}
|
|
2233
|
+
else {
|
|
2234
|
+
ul.children[idx].classList.remove(disabled);
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
else {
|
|
2239
|
+
if (this.isMenu) {
|
|
2240
|
+
ul.children[idx].classList.add(disabled);
|
|
2241
|
+
ul.children[idx].setAttribute('aria-disabled', 'true');
|
|
2242
|
+
}
|
|
2243
|
+
else {
|
|
2244
|
+
if (Browser.isDevice && !ul.classList.contains('e-contextmenu')) {
|
|
2245
|
+
ul.children[idx + 1].classList.add(disabled);
|
|
2246
|
+
}
|
|
2247
|
+
else {
|
|
2248
|
+
ul.children[idx].classList.add(disabled);
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
};
|
|
2255
|
+
/**
|
|
2256
|
+
* This method is used to show the menu items in the Menu based on the items text.
|
|
2257
|
+
*
|
|
2258
|
+
* @param {string[]} items - Text items that needs to be shown.
|
|
2259
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2260
|
+
* @returns {void}
|
|
2261
|
+
*/
|
|
2262
|
+
MenuBase.prototype.showItems = function (items, isUniqueId) {
|
|
2263
|
+
this.showHideItems(items, false, isUniqueId);
|
|
2264
|
+
};
|
|
2265
|
+
/**
|
|
2266
|
+
* This method is used to hide the menu items in the Menu based on the items text.
|
|
2267
|
+
*
|
|
2268
|
+
* @param {string[]} items - Text items that needs to be hidden.
|
|
2269
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2270
|
+
* @returns {void}
|
|
2271
|
+
*/
|
|
2272
|
+
MenuBase.prototype.hideItems = function (items, isUniqueId) {
|
|
2273
|
+
this.showHideItems(items, true, isUniqueId);
|
|
2274
|
+
};
|
|
2275
|
+
MenuBase.prototype.showHideItems = function (items, ishide, isUniqueId) {
|
|
2276
|
+
var ul;
|
|
2277
|
+
var index;
|
|
2278
|
+
var navIdx;
|
|
2279
|
+
var item;
|
|
2280
|
+
for (var i = 0; i < items.length; i++) {
|
|
2281
|
+
navIdx = this.getIndex(items[i], isUniqueId);
|
|
2282
|
+
index = navIdx.pop();
|
|
2283
|
+
ul = this.getUlByNavIdx(navIdx.length);
|
|
2284
|
+
item = this.getItems(navIdx);
|
|
2285
|
+
if (ul) {
|
|
2286
|
+
var validUl = isUniqueId ? ul.children[index].id : item[index].text.toString();
|
|
2287
|
+
if (ishide && validUl === items[i]) {
|
|
2288
|
+
ul.children[index].classList.add(HIDE);
|
|
2289
|
+
}
|
|
2290
|
+
else if (!ishide && validUl === items[i]) {
|
|
2291
|
+
ul.children[index].classList.remove(HIDE);
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
};
|
|
2296
|
+
/**
|
|
2297
|
+
* It is used to remove the menu items from the Menu based on the items text.
|
|
2298
|
+
*
|
|
2299
|
+
* @param {string[]} items Text items that needs to be removed.
|
|
2300
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2301
|
+
* @returns {void}
|
|
2302
|
+
*/
|
|
2303
|
+
MenuBase.prototype.removeItems = function (items, isUniqueId) {
|
|
2304
|
+
var idx;
|
|
2305
|
+
var navIdx;
|
|
2306
|
+
var iitems;
|
|
2307
|
+
for (var i = 0; i < items.length; i++) {
|
|
2308
|
+
navIdx = this.getIndex(items[i], isUniqueId);
|
|
2309
|
+
idx = navIdx.pop();
|
|
2310
|
+
iitems = this.getItems(navIdx);
|
|
2311
|
+
if (!isNullOrUndefined(idx)) {
|
|
2312
|
+
this.removeItem(iitems, navIdx, idx);
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
};
|
|
2316
|
+
/**
|
|
2317
|
+
* It is used to insert the menu items after the specified menu item text.
|
|
2318
|
+
*
|
|
2319
|
+
* @param {MenuItemModel[]} items - Items that needs to be inserted.
|
|
2320
|
+
* @param {string} text - Text item after that the element to be inserted.
|
|
2321
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2322
|
+
* @returns {void}
|
|
2323
|
+
*/
|
|
2324
|
+
MenuBase.prototype.insertAfter = function (items, text, isUniqueId) {
|
|
2325
|
+
this.insertItems(items, text, isUniqueId);
|
|
2326
|
+
};
|
|
2327
|
+
/**
|
|
2328
|
+
* It is used to insert the menu items before the specified menu item text.
|
|
2329
|
+
*
|
|
2330
|
+
* @param {MenuItemModel[]} items - Items that needs to be inserted.
|
|
2331
|
+
* @param {string} text - Text item before that the element to be inserted.
|
|
2332
|
+
* @param {boolean} isUniqueId - Set `true` if it is a unique id.
|
|
2333
|
+
* @returns {void}
|
|
2334
|
+
*/
|
|
2335
|
+
MenuBase.prototype.insertBefore = function (items, text, isUniqueId) {
|
|
2336
|
+
this.insertItems(items, text, isUniqueId, false);
|
|
2337
|
+
};
|
|
2338
|
+
MenuBase.prototype.insertItems = function (items, text, isUniqueId, isAfter) {
|
|
2339
|
+
if (isAfter === void 0) { isAfter = true; }
|
|
2340
|
+
var li;
|
|
2341
|
+
var idx;
|
|
2342
|
+
var navIdx;
|
|
2343
|
+
var iitems;
|
|
2344
|
+
var menuitem;
|
|
2345
|
+
for (var i = 0; i < items.length; i++) {
|
|
2346
|
+
navIdx = this.getIndex(text, isUniqueId);
|
|
2347
|
+
idx = navIdx.pop();
|
|
2348
|
+
iitems = this.getItems(navIdx);
|
|
2349
|
+
menuitem = new MenuItem(iitems[0], 'items', items[i], true);
|
|
2350
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2351
|
+
menuitem.parentObj = iitems[0].parentObj;
|
|
2352
|
+
iitems.splice(isAfter ? idx + 1 : idx, 0, menuitem);
|
|
2353
|
+
var uls = this.isMenu ? [this.getWrapper()].concat(this.getPopups()) : [].slice.call(this.getWrapper().children);
|
|
2354
|
+
if (!isNullOrUndefined(idx) && navIdx.length < uls.length) {
|
|
2355
|
+
idx = isAfter ? idx + 1 : idx;
|
|
2356
|
+
li = this.createItems(iitems).children[idx];
|
|
2357
|
+
var ul = this.isMenu ? select('.e-menu-parent', uls[navIdx.length]) : uls[navIdx.length];
|
|
2358
|
+
ul.insertBefore(li, ul.children[idx]);
|
|
2359
|
+
if (i === items.length - 1 && !this.isMenu && ul.style.display === 'block') {
|
|
2360
|
+
this.setPosition(null, ul, parseFloat(ul.style.top), parseFloat(ul.style.left));
|
|
2361
|
+
ul.style.display = 'block';
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
};
|
|
2366
|
+
MenuBase.prototype.removeAttributes = function () {
|
|
2367
|
+
var _this = this;
|
|
2368
|
+
['top', 'left', 'display', 'z-index'].forEach(function (key) {
|
|
2369
|
+
_this.element.style.removeProperty(key);
|
|
2370
|
+
});
|
|
2371
|
+
['role', 'tabindex', 'class', 'style'].forEach(function (key) {
|
|
2372
|
+
if (key === 'class' && _this.element.classList.contains('e-menu-parent')) {
|
|
2373
|
+
_this.element.classList.remove('e-menu-parent');
|
|
2374
|
+
}
|
|
2375
|
+
if (['class', 'style'].indexOf(key) === -1 || !_this.element.getAttribute(key)) {
|
|
2376
|
+
_this.element.removeAttribute(key);
|
|
2377
|
+
}
|
|
2378
|
+
if (_this.isMenu && key === 'class' && _this.element.classList.contains('e-vertical')) {
|
|
2379
|
+
_this.element.classList.remove('e-vertical');
|
|
2380
|
+
}
|
|
2381
|
+
});
|
|
2382
|
+
};
|
|
2383
|
+
/**
|
|
2384
|
+
* Destroys the widget.
|
|
2385
|
+
*
|
|
2386
|
+
* @returns {void}
|
|
2387
|
+
*/
|
|
2388
|
+
MenuBase.prototype.destroy = function () {
|
|
2389
|
+
var wrapper = this.getWrapper();
|
|
2390
|
+
if (wrapper) {
|
|
2391
|
+
this.unWireEvents();
|
|
2392
|
+
if (!this.isMenu) {
|
|
2393
|
+
this.clonedElement.style.display = '';
|
|
2394
|
+
if (this.clonedElement.tagName === 'EJS-CONTEXTMENU') {
|
|
2395
|
+
addClass([this.clonedElement], ['e-control', 'e-lib', 'e-' + this.getModuleName()]);
|
|
2396
|
+
this.element = this.clonedElement;
|
|
2397
|
+
}
|
|
2398
|
+
else {
|
|
2399
|
+
if (this.refreshing && this.clonedElement.childElementCount && this.clonedElement.children[0].tagName === 'LI') {
|
|
2400
|
+
this.setProperties({ 'items': [] }, true);
|
|
2401
|
+
}
|
|
2402
|
+
if (document.getElementById(this.clonedElement.id)) {
|
|
2403
|
+
var refEle = this.clonedElement.nextElementSibling;
|
|
2404
|
+
if (refEle && refEle !== wrapper) {
|
|
2405
|
+
this.clonedElement.parentElement.insertBefore(this.element, refEle);
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
this.clonedElement.parentElement.appendChild(this.element);
|
|
2409
|
+
}
|
|
2410
|
+
if (isBlazor() && !this.isMenu) {
|
|
2411
|
+
this.element = this.removeChildElement(this.element);
|
|
2412
|
+
}
|
|
2413
|
+
else {
|
|
2414
|
+
this.element.innerHTML = '';
|
|
2415
|
+
}
|
|
2416
|
+
append([].slice.call(this.clonedElement.children), this.element);
|
|
2417
|
+
detach(this.clonedElement);
|
|
2418
|
+
this.removeAttributes();
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
this.clonedElement = null;
|
|
2422
|
+
}
|
|
2423
|
+
else {
|
|
2424
|
+
this.closeMenu();
|
|
2425
|
+
if (isBlazor() && !this.isMenu) {
|
|
2426
|
+
this.element = this.removeChildElement(this.element);
|
|
2427
|
+
}
|
|
2428
|
+
else {
|
|
2429
|
+
this.element.innerHTML = '';
|
|
2430
|
+
}
|
|
2431
|
+
this.removeAttributes();
|
|
2432
|
+
wrapper.parentNode.insertBefore(this.element, wrapper);
|
|
2433
|
+
this.clonedElement = null;
|
|
2434
|
+
}
|
|
2435
|
+
detach(wrapper);
|
|
2436
|
+
_super.prototype.destroy.call(this);
|
|
2437
|
+
if (this.template) {
|
|
2438
|
+
this.clearTemplate(['template']);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
this.rippleFn = null;
|
|
2442
|
+
};
|
|
2443
|
+
__decorate([
|
|
2444
|
+
Event()
|
|
2445
|
+
], MenuBase.prototype, "beforeItemRender", void 0);
|
|
2446
|
+
__decorate([
|
|
2447
|
+
Event()
|
|
2448
|
+
], MenuBase.prototype, "beforeOpen", void 0);
|
|
2449
|
+
__decorate([
|
|
2450
|
+
Event()
|
|
2451
|
+
], MenuBase.prototype, "onOpen", void 0);
|
|
2452
|
+
__decorate([
|
|
2453
|
+
Event()
|
|
2454
|
+
], MenuBase.prototype, "beforeClose", void 0);
|
|
2455
|
+
__decorate([
|
|
2456
|
+
Event()
|
|
2457
|
+
], MenuBase.prototype, "onClose", void 0);
|
|
2458
|
+
__decorate([
|
|
2459
|
+
Event()
|
|
2460
|
+
], MenuBase.prototype, "select", void 0);
|
|
2461
|
+
__decorate([
|
|
2462
|
+
Event()
|
|
2463
|
+
], MenuBase.prototype, "created", void 0);
|
|
2464
|
+
__decorate([
|
|
2465
|
+
Property('')
|
|
2466
|
+
], MenuBase.prototype, "cssClass", void 0);
|
|
2467
|
+
__decorate([
|
|
2468
|
+
Property(0)
|
|
2469
|
+
], MenuBase.prototype, "hoverDelay", void 0);
|
|
2470
|
+
__decorate([
|
|
2471
|
+
Property(false)
|
|
2472
|
+
], MenuBase.prototype, "showItemOnClick", void 0);
|
|
2473
|
+
__decorate([
|
|
2474
|
+
Property('')
|
|
2475
|
+
], MenuBase.prototype, "target", void 0);
|
|
2476
|
+
__decorate([
|
|
2477
|
+
Property('')
|
|
2478
|
+
], MenuBase.prototype, "filter", void 0);
|
|
2479
|
+
__decorate([
|
|
2480
|
+
Property(null)
|
|
2481
|
+
], MenuBase.prototype, "template", void 0);
|
|
2482
|
+
__decorate([
|
|
2483
|
+
Property(false)
|
|
2484
|
+
], MenuBase.prototype, "enableScrolling", void 0);
|
|
2485
|
+
__decorate([
|
|
2486
|
+
Property(true)
|
|
2487
|
+
], MenuBase.prototype, "enableHtmlSanitizer", void 0);
|
|
2488
|
+
__decorate([
|
|
2489
|
+
Complex({ itemId: 'id', text: 'text', parentId: 'parentId', iconCss: 'iconCss', url: 'url', separator: 'separator', children: 'items' }, FieldSettings)
|
|
2490
|
+
], MenuBase.prototype, "fields", void 0);
|
|
2491
|
+
__decorate([
|
|
2492
|
+
Collection([], MenuItem)
|
|
2493
|
+
], MenuBase.prototype, "items", void 0);
|
|
2494
|
+
__decorate([
|
|
2495
|
+
Complex({ duration: 400, easing: 'ease', effect: 'SlideDown' }, MenuAnimationSettings)
|
|
2496
|
+
], MenuBase.prototype, "animationSettings", void 0);
|
|
2497
|
+
MenuBase = __decorate([
|
|
2498
|
+
NotifyPropertyChanges
|
|
2499
|
+
], MenuBase);
|
|
2500
|
+
return MenuBase;
|
|
2501
|
+
}(Component));
|
|
2502
|
+
export { MenuBase };
|