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