@refinitiv-ui/efx-grid 6.0.0-next.0
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/LICENSE +17 -0
- package/README.md +61 -0
- package/lib/column-format-dialog/index.d.ts +1 -0
- package/lib/column-format-dialog/index.js +1 -0
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +64 -0
- package/lib/column-format-dialog/lib/column-format-dialog.js +2713 -0
- package/lib/column-format-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-de.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-en.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-ja.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-zh-hant.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-zh.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/column-format-dialog/lib/locale/translation.js +18 -0
- package/lib/column-format-dialog/lib/preview-table.d.ts +151 -0
- package/lib/column-format-dialog/lib/preview-table.js +995 -0
- package/lib/column-format-dialog/themes/base.less +429 -0
- package/lib/column-format-dialog/themes/elemental/column-format-dialog.less +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/elemental/dark.js +16 -0
- package/lib/column-format-dialog/themes/elemental/defaults.less +1 -0
- package/lib/column-format-dialog/themes/elemental/index.less +5 -0
- package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/elemental/light.js +16 -0
- package/lib/column-format-dialog/themes/halo/column-format-dialog.less +6 -0
- package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/halo/dark.js +16 -0
- package/lib/column-format-dialog/themes/halo/defaults.less +1 -0
- package/lib/column-format-dialog/themes/halo/index.less +5 -0
- package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/halo/light.js +16 -0
- package/lib/column-format-dialog/themes/luna/column-format-dialog.less +1 -0
- package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/luna/default/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/luna/default/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/luna/default/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/luna/default/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/luna/defaults.less +1 -0
- package/lib/column-format-dialog/themes/luna/index.less +5 -0
- package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/solar/charcoal.js +16 -0
- package/lib/column-format-dialog/themes/solar/column-format-dialog.less +6 -0
- package/lib/column-format-dialog/themes/solar/defaults.less +1 -0
- package/lib/column-format-dialog/themes/solar/index.less +5 -0
- package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/solar/pearl.js +16 -0
- package/lib/column-selection-dialog/index.d.ts +1 -0
- package/lib/column-selection-dialog/index.js +1 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +41 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +1410 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/column-selection-dialog/lib/locale/translation.js +18 -0
- package/lib/column-selection-dialog/themes/base.less +189 -0
- package/lib/column-selection-dialog/themes/elemental/column-selection-dialog.less +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/elemental/dark.js +6 -0
- package/lib/column-selection-dialog/themes/elemental/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/elemental/index.less +5 -0
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/elemental/light.js +6 -0
- package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +22 -0
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/halo/dark.js +6 -0
- package/lib/column-selection-dialog/themes/halo/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/halo/index.less +6 -0
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/halo/light.js +6 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/solar/charcoal.js +6 -0
- package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +1 -0
- package/lib/column-selection-dialog/themes/solar/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/solar/index.less +6 -0
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/solar/pearl.js +6 -0
- package/lib/core/dist/core.css +1 -0
- package/lib/core/dist/core.js +28075 -0
- package/lib/core/dist/core.min.js +1 -0
- package/lib/core/es6/data/ColumnStats.d.ts +42 -0
- package/lib/core/es6/data/ColumnStats.js +428 -0
- package/lib/core/es6/data/DataCache.d.ts +81 -0
- package/lib/core/es6/data/DataCache.js +1317 -0
- package/lib/core/es6/data/DataTable.d.ts +125 -0
- package/lib/core/es6/data/DataTable.js +1655 -0
- package/lib/core/es6/data/DataView.d.ts +280 -0
- package/lib/core/es6/data/DataView.js +3654 -0
- package/lib/core/es6/data/Segment.d.ts +38 -0
- package/lib/core/es6/data/Segment.js +193 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +58 -0
- package/lib/core/es6/data/SegmentCollection.js +431 -0
- package/lib/core/es6/grid/Core.d.ts +387 -0
- package/lib/core/es6/grid/Core.js +4939 -0
- package/lib/core/es6/grid/ILayoutGrid.d.ts +204 -0
- package/lib/core/es6/grid/ILayoutGrid.js +658 -0
- package/lib/core/es6/grid/LayoutGrid.d.ts +23 -0
- package/lib/core/es6/grid/LayoutGrid.js +2602 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +18 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +907 -0
- package/lib/core/es6/grid/components/Cell.d.ts +50 -0
- package/lib/core/es6/grid/components/Cell.js +740 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +19 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.js +123 -0
- package/lib/core/es6/grid/components/CellSpan.d.ts +18 -0
- package/lib/core/es6/grid/components/CellSpan.js +99 -0
- package/lib/core/es6/grid/components/CellSpans.d.ts +38 -0
- package/lib/core/es6/grid/components/CellSpans.js +341 -0
- package/lib/core/es6/grid/components/Column.d.ts +22 -0
- package/lib/core/es6/grid/components/Column.js +612 -0
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +125 -0
- package/lib/core/es6/grid/components/ElementWrapper.js +714 -0
- package/lib/core/es6/grid/components/HScrollbar.d.ts +24 -0
- package/lib/core/es6/grid/components/HScrollbar.js +222 -0
- package/lib/core/es6/grid/components/Scrollbar.d.ts +61 -0
- package/lib/core/es6/grid/components/Scrollbar.js +1374 -0
- package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
- package/lib/core/es6/grid/components/StretchedCells.js +328 -0
- package/lib/core/es6/grid/components/VScrollbar.d.ts +18 -0
- package/lib/core/es6/grid/components/VScrollbar.js +139 -0
- package/lib/core/es6/grid/components/VirtualItems.d.ts +12 -0
- package/lib/core/es6/grid/components/VirtualItems.js +51 -0
- package/lib/core/es6/grid/event/EventDispatcher.d.ts +16 -0
- package/lib/core/es6/grid/event/EventDispatcher.js +138 -0
- package/lib/core/es6/grid/event/EventListeners.d.ts +34 -0
- package/lib/core/es6/grid/event/EventListeners.js +163 -0
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +615 -0
- package/lib/core/es6/grid/plugins/Plugin.d.ts +28 -0
- package/lib/core/es6/grid/plugins/Plugin.js +272 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +127 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1707 -0
- package/lib/core/es6/grid/util/Conflator.d.ts +32 -0
- package/lib/core/es6/grid/util/Conflator.js +191 -0
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +18 -0
- package/lib/core/es6/grid/util/ElementFrameWork.js +227 -0
- package/lib/core/es6/grid/util/HttpRequest.d.ts +53 -0
- package/lib/core/es6/grid/util/HttpRequest.js +371 -0
- package/lib/core/es6/grid/util/PercentBar.d.ts +43 -0
- package/lib/core/es6/grid/util/PercentBar.js +390 -0
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +41 -0
- package/lib/core/es6/grid/util/PercentBarRenderer.js +316 -0
- package/lib/core/es6/grid/util/RangeBar.d.ts +25 -0
- package/lib/core/es6/grid/util/RangeBar.js +255 -0
- package/lib/core/es6/grid/util/Reverter.d.ts +14 -0
- package/lib/core/es6/grid/util/Reverter.js +79 -0
- package/lib/core/es6/grid/util/SectionSettings.d.ts +79 -0
- package/lib/core/es6/grid/util/SectionSettings.js +674 -0
- package/lib/core/es6/grid/util/SelectionList.d.ts +50 -0
- package/lib/core/es6/grid/util/SelectionList.js +422 -0
- package/lib/core/es6/grid/util/TrackLayout.d.ts +84 -0
- package/lib/core/es6/grid/util/TrackLayout.js +850 -0
- package/lib/core/es6/grid/util/Virtualizer.d.ts +40 -0
- package/lib/core/es6/grid/util/Virtualizer.js +340 -0
- package/lib/core/es6/grid/util/util.d.ts +18 -0
- package/lib/core/es6/grid/util/util.js +450 -0
- package/lib/core/es6/index.d.ts +84 -0
- package/lib/core/es6/index.js +132 -0
- package/lib/core/es6/tr-grid-theme.d.ts +5 -0
- package/lib/core/es6/tr-grid-theme.js +5 -0
- package/lib/filter-dialog/index.d.ts +1 -0
- package/lib/filter-dialog/index.js +1 -0
- package/lib/filter-dialog/lib/checkbox-list.d.ts +27 -0
- package/lib/filter-dialog/lib/checkbox-list.js +336 -0
- package/lib/filter-dialog/lib/filter-dialog.d.ts +53 -0
- package/lib/filter-dialog/lib/filter-dialog.js +860 -0
- package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-de.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-en.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-ja.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh.js +37 -0
- package/lib/filter-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/filter-dialog/lib/locale/translation.js +18 -0
- package/lib/filter-dialog/themes/base-checkbox.less +37 -0
- package/lib/filter-dialog/themes/base.less +102 -0
- package/lib/filter-dialog/themes/elemental/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/elemental/dark.js +11 -0
- package/lib/filter-dialog/themes/elemental/defaults.less +3 -0
- package/lib/filter-dialog/themes/elemental/filter-dialog.less +1 -0
- package/lib/filter-dialog/themes/elemental/index.less +6 -0
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/elemental/light/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/light/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/elemental/light.js +11 -0
- package/lib/filter-dialog/themes/halo/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/halo/dark/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/dark/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/halo/dark.js +11 -0
- package/lib/filter-dialog/themes/halo/defaults.less +3 -0
- package/lib/filter-dialog/themes/halo/filter-dialog.less +9 -0
- package/lib/filter-dialog/themes/halo/index.less +6 -0
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/halo/light/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/light/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/halo/light.js +11 -0
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/solar/charcoal.js +11 -0
- package/lib/filter-dialog/themes/solar/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/solar/defaults.less +3 -0
- package/lib/filter-dialog/themes/solar/filter-dialog.less +5 -0
- package/lib/filter-dialog/themes/solar/index.less +6 -0
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/solar/pearl.js +11 -0
- package/lib/formatters/es6/CoralButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/CoralButtonFormatter.js +40 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.js +45 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.js +102 -0
- package/lib/formatters/es6/CoralIconFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralIconFormatter.js +45 -0
- package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralInputFormatter.js +40 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.js +80 -0
- package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralSelectFormatter.js +66 -0
- package/lib/formatters/es6/CoralToggleFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralToggleFormatter.js +47 -0
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +119 -0
- package/lib/formatters/es6/EFButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/EFButtonFormatter.js +40 -0
- package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFCheckboxFormatter.js +45 -0
- package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFComboBoxFormatter.js +68 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.js +55 -0
- package/lib/formatters/es6/EFIconFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFIconFormatter.js +45 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.js +40 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.js +80 -0
- package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFSelectFormatter.js +66 -0
- package/lib/formatters/es6/EFTextFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFTextFieldFormatter.js +40 -0
- package/lib/formatters/es6/EFToggleFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFToggleFormatter.js +47 -0
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +55 -0
- package/lib/formatters/es6/FormatterBuilder.d.ts +22 -0
- package/lib/formatters/es6/FormatterBuilder.js +334 -0
- package/lib/formatters/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/formatters/es6/NumericInputFormatter.js +64 -0
- package/lib/formatters/es6/PercentBarFormatter.d.ts +25 -0
- package/lib/formatters/es6/PercentBarFormatter.js +62 -0
- package/lib/formatters/es6/SimpleImageFormatter.d.ts +21 -0
- package/lib/formatters/es6/SimpleImageFormatter.js +64 -0
- package/lib/formatters/es6/SimpleInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/SimpleInputFormatter.js +40 -0
- package/lib/formatters/es6/SimpleLinkFormatter.d.ts +21 -0
- package/lib/formatters/es6/SimpleLinkFormatter.js +48 -0
- package/lib/formatters/es6/SimpleTickerFormatter.d.ts +25 -0
- package/lib/formatters/es6/SimpleTickerFormatter.js +65 -0
- package/lib/formatters/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/formatters/es6/SimpleToggleFormatter.js +132 -0
- package/lib/formatters/es6/TextFormatter.d.ts +12 -0
- package/lib/formatters/es6/TextFormatter.js +30 -0
- package/lib/formatters/es6/index.d.ts +43 -0
- package/lib/formatters/es6/index.js +67 -0
- package/lib/grid/index.d.ts +1 -0
- package/lib/grid/index.js +2 -0
- package/lib/grid/lib/efx-grid.d.ts +32 -0
- package/lib/grid/lib/efx-grid.js +469 -0
- package/lib/grid/themes/base.less +134 -0
- package/lib/grid/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/grid/themes/halo/dark/efx-grid.js +4 -0
- package/lib/grid/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/grid/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/grid/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/grid/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/grid/themes/halo/dark.js +3 -0
- package/lib/grid/themes/halo/efx-grid.less +92 -0
- package/lib/grid/themes/halo/index.less +3 -0
- package/lib/grid/themes/halo/light/css/native-elements.css +0 -0
- package/lib/grid/themes/halo/light/efx-grid.js +4 -0
- package/lib/grid/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/grid/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/grid/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/grid/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/grid/themes/halo/light.js +3 -0
- package/lib/grid/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/grid/themes/solar/charcoal/efx-grid.js +4 -0
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/grid/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/grid/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/grid/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/grid/themes/solar/charcoal.js +3 -0
- package/lib/grid/themes/solar/efx-grid.less +27 -0
- package/lib/grid/themes/solar/index.less +3 -0
- package/lib/grid/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/grid/themes/solar/pearl/efx-grid.js +4 -0
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/grid/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/grid/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/grid/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/grid/themes/solar/pearl.js +3 -0
- package/lib/index.d.ts +102 -0
- package/lib/index.js +102 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +83 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +592 -0
- package/lib/row-segmenting/es6/index.d.ts +1 -0
- package/lib/row-segmenting/es6/index.js +1 -0
- package/lib/rt-grid/dist/rt-grid.js +44672 -0
- package/lib/rt-grid/dist/rt-grid.min.js +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +141 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +1074 -0
- package/lib/rt-grid/es6/DataConnector.d.ts +37 -0
- package/lib/rt-grid/es6/DataConnector.js +266 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +20 -0
- package/lib/rt-grid/es6/FieldDefinition.js +418 -0
- package/lib/rt-grid/es6/Grid.d.ts +261 -0
- package/lib/rt-grid/es6/Grid.js +2893 -0
- package/lib/rt-grid/es6/PredefinedFormula.d.ts +16 -0
- package/lib/rt-grid/es6/PredefinedFormula.js +33 -0
- package/lib/rt-grid/es6/ReferenceCounter.d.ts +38 -0
- package/lib/rt-grid/es6/ReferenceCounter.js +230 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +120 -0
- package/lib/rt-grid/es6/RowDefinition.js +873 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +21 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +252 -0
- package/lib/rt-grid/es6/StyleLoader.d.ts +17 -0
- package/lib/rt-grid/es6/StyleLoader.js +47 -0
- package/lib/rt-grid/es6/index.d.ts +8 -0
- package/lib/rt-grid/es6/index.js +43 -0
- package/lib/statistics-row/es6/StatisticsRow.d.ts +67 -0
- package/lib/statistics-row/es6/StatisticsRow.js +786 -0
- package/lib/statistics-row/es6/index.d.ts +1 -0
- package/lib/statistics-row/es6/index.js +1 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.d.ts +45 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +431 -0
- package/lib/tr-grid-auto-tooltip/es6/index.d.ts +1 -0
- package/lib/tr-grid-auto-tooltip/es6/index.js +1 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +67 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1777 -0
- package/lib/tr-grid-cell-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-cell-selection/es6/index.js +1 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +69 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1476 -0
- package/lib/tr-grid-checkbox/es6/index.d.ts +1 -0
- package/lib/tr-grid-checkbox/es6/index.js +1 -0
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +56 -0
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +1000 -0
- package/lib/tr-grid-column-fitter/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-fitter/es6/index.js +1 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +89 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +615 -0
- package/lib/tr-grid-column-formatting/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-formatting/es6/index.js +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +60 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +913 -0
- package/lib/tr-grid-column-grouping/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/index.js +1 -0
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +68 -0
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1013 -0
- package/lib/tr-grid-column-resizing/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-resizing/es6/index.js +1 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +70 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +928 -0
- package/lib/tr-grid-column-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-selection/es6/index.js +1 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +76 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +1227 -0
- package/lib/tr-grid-column-stack/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-stack/es6/index.js +1 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +70 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +947 -0
- package/lib/tr-grid-conditional-coloring/es6/index.d.ts +1 -0
- package/lib/tr-grid-conditional-coloring/es6/index.js +1 -0
- package/lib/tr-grid-content-wrap/es6/ContentWrap.d.ts +43 -0
- package/lib/tr-grid-content-wrap/es6/ContentWrap.js +478 -0
- package/lib/tr-grid-content-wrap/es6/index.d.ts +1 -0
- package/lib/tr-grid-content-wrap/es6/index.js +1 -0
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +83 -0
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +471 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +133 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +39 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.js +245 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +29 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.js +292 -0
- package/lib/tr-grid-contextmenu/es6/index.d.ts +1 -0
- package/lib/tr-grid-contextmenu/es6/index.js +1 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +57 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.js +928 -0
- package/lib/tr-grid-filter-input/es6/index.d.ts +1 -0
- package/lib/tr-grid-filter-input/es6/index.js +1 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +44 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.js +394 -0
- package/lib/tr-grid-heat-map/es6/index.d.ts +1 -0
- package/lib/tr-grid-heat-map/es6/index.js +1 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +129 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +1977 -0
- package/lib/tr-grid-in-cell-editing/es6/index.d.ts +1 -0
- package/lib/tr-grid-in-cell-editing/es6/index.js +1 -0
- package/lib/tr-grid-pagination/es6/Pagination.d.ts +57 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +427 -0
- package/lib/tr-grid-pagination/es6/index.d.ts +1 -0
- package/lib/tr-grid-pagination/es6/index.js +1 -0
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +60 -0
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +801 -0
- package/lib/tr-grid-percent-bar/es6/index.d.ts +1 -0
- package/lib/tr-grid-percent-bar/es6/index.js +1 -0
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +49 -0
- package/lib/tr-grid-printer/es6/CellWriter.js +226 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +12 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.js +21 -0
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +32 -0
- package/lib/tr-grid-printer/es6/GridPrinter.js +761 -0
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +38 -0
- package/lib/tr-grid-printer/es6/PrintTrait.js +481 -0
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +54 -0
- package/lib/tr-grid-printer/es6/SectionWriter.js +205 -0
- package/lib/tr-grid-printer/es6/index.d.ts +1 -0
- package/lib/tr-grid-printer/es6/index.js +1 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +39 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +353 -0
- package/lib/tr-grid-range-bar/es6/index.d.ts +1 -0
- package/lib/tr-grid-range-bar/es6/index.js +1 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +53 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +794 -0
- package/lib/tr-grid-row-dragging/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-dragging/es6/index.js +1 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +118 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +1884 -0
- package/lib/tr-grid-row-filtering/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-filtering/es6/index.js +1 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +109 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1541 -0
- package/lib/tr-grid-row-grouping/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-grouping/es6/index.js +1 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +74 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.js +1202 -0
- package/lib/tr-grid-row-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-selection/es6/index.js +1 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +60 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +611 -0
- package/lib/tr-grid-rowcoloring/es6/index.d.ts +1 -0
- package/lib/tr-grid-rowcoloring/es6/index.js +1 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +77 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +574 -0
- package/lib/tr-grid-textformatting/es6/index.d.ts +1 -0
- package/lib/tr-grid-textformatting/es6/index.js +1 -0
- package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +29 -0
- package/lib/tr-grid-titlewrap/es6/TitleWrap.js +431 -0
- package/lib/tr-grid-titlewrap/es6/index.d.ts +1 -0
- package/lib/tr-grid-titlewrap/es6/index.js +1 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +136 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1128 -0
- package/lib/tr-grid-util/es6/Conflator.d.ts +34 -0
- package/lib/tr-grid-util/es6/Conflator.js +193 -0
- package/lib/tr-grid-util/es6/CoralItems.d.ts +10 -0
- package/lib/tr-grid-util/es6/CoralItems.js +42 -0
- package/lib/tr-grid-util/es6/DateTime.d.ts +57 -0
- package/lib/tr-grid-util/es6/DateTime.js +508 -0
- package/lib/tr-grid-util/es6/Deferred.d.ts +14 -0
- package/lib/tr-grid-util/es6/Deferred.js +98 -0
- package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
- package/lib/tr-grid-util/es6/Delay.js +85 -0
- package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
- package/lib/tr-grid-util/es6/Dom.js +346 -0
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +10 -0
- package/lib/tr-grid-util/es6/ElementObserver.js +101 -0
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
- package/lib/tr-grid-util/es6/ElementWrapper.js +83 -0
- package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
- package/lib/tr-grid-util/es6/ElfDate.js +163 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +33 -0
- package/lib/tr-grid-util/es6/ElfUtil.js +458 -0
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +26 -0
- package/lib/tr-grid-util/es6/EventDispatcher.js +161 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +27 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.js +169 -0
- package/lib/tr-grid-util/es6/Ext.d.ts +10 -0
- package/lib/tr-grid-util/es6/Ext.js +52 -0
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +55 -0
- package/lib/tr-grid-util/es6/FieldFormatter.js +432 -0
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +48 -0
- package/lib/tr-grid-util/es6/FilterBuilder.js +521 -0
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +41 -0
- package/lib/tr-grid-util/es6/FilterOperators.js +181 -0
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +72 -0
- package/lib/tr-grid-util/es6/GridPlugin.js +747 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
- package/lib/tr-grid-util/es6/Icon.js +61 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.js +237 -0
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +32 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +506 -0
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +83 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +471 -0
- package/lib/tr-grid-util/es6/PercentBar.d.ts +71 -0
- package/lib/tr-grid-util/es6/PercentBar.js +600 -0
- package/lib/tr-grid-util/es6/Perf.d.ts +32 -0
- package/lib/tr-grid-util/es6/Perf.js +162 -0
- package/lib/tr-grid-util/es6/Popup.d.ts +84 -0
- package/lib/tr-grid-util/es6/Popup.js +818 -0
- package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
- package/lib/tr-grid-util/es6/RangeBar.js +259 -0
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
- package/lib/tr-grid-util/es6/RequestQueue.js +239 -0
- package/lib/tr-grid-util/es6/RowPainter.d.ts +23 -0
- package/lib/tr-grid-util/es6/RowPainter.js +188 -0
- package/lib/tr-grid-util/es6/SubTable.d.ts +74 -0
- package/lib/tr-grid-util/es6/SubTable.js +558 -0
- package/lib/tr-grid-util/es6/Table.d.ts +125 -0
- package/lib/tr-grid-util/es6/Table.js +790 -0
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +18 -0
- package/lib/tr-grid-util/es6/TextHighlighter.js +273 -0
- package/lib/tr-grid-util/es6/TickCodes.d.ts +8 -0
- package/lib/tr-grid-util/es6/TickCodes.js +33 -0
- package/lib/tr-grid-util/es6/Timer.d.ts +16 -0
- package/lib/tr-grid-util/es6/Timer.js +49 -0
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +46 -0
- package/lib/tr-grid-util/es6/TouchProxy.js +212 -0
- package/lib/tr-grid-util/es6/Util.d.ts +65 -0
- package/lib/tr-grid-util/es6/Util.js +528 -0
- package/lib/tr-grid-util/es6/formula/ADCService.d.ts +11 -0
- package/lib/tr-grid-util/es6/formula/ADCService.js +72 -0
- package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +17 -0
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +317 -0
- package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +12 -0
- package/lib/tr-grid-util/es6/formula/AdFinService.js +61 -0
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +19 -0
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +310 -0
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +56 -0
- package/lib/tr-grid-util/es6/formula/Engine.js +592 -0
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +68 -0
- package/lib/tr-grid-util/es6/formula/Formula.js +882 -0
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +16 -0
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +165 -0
- package/lib/tr-grid-util/es6/formula/Realtime.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/Realtime.js +279 -0
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +203 -0
- package/lib/tr-grid-util/es6/formula/TSIService.d.ts +11 -0
- package/lib/tr-grid-util/es6/formula/TSIService.js +51 -0
- package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +1015 -0
- package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +30 -0
- package/lib/tr-grid-util/es6/formula/VariableToken.js +314 -0
- package/lib/tr-grid-util/es6/formula/functions/AdFin.d.ts +9 -0
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +1778 -0
- package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +21 -0
- package/lib/tr-grid-util/es6/formula/functions/Info.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Info.js +192 -0
- package/lib/tr-grid-util/es6/formula/functions/Internal.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +90 -0
- package/lib/tr-grid-util/es6/formula/functions/Logic.d.ts +12 -0
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +176 -0
- package/lib/tr-grid-util/es6/formula/functions/Math.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/functions/Math.js +1624 -0
- package/lib/tr-grid-util/es6/formula/functions/Statistics.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +234 -0
- package/lib/tr-grid-util/es6/formula/functions/Text.d.ts +10 -0
- package/lib/tr-grid-util/es6/formula/functions/Text.js +676 -0
- package/lib/tr-grid-util/es6/index.d.ts +63 -0
- package/lib/tr-grid-util/es6/index.js +99 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +141 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +114 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +827 -0
- package/lib/tr-grid-util/es6/jet/DataSet.d.ts +8 -0
- package/lib/tr-grid-util/es6/jet/DataSet.js +392 -0
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +21 -0
- package/lib/tr-grid-util/es6/jet/MockArchive.js +56 -0
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +25 -0
- package/lib/tr-grid-util/es6/jet/MockJET.js +63 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +37 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +199 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +72 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +564 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +8 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.js +43 -0
- package/lib/tr-grid-util/es6/jet/index.d.ts +9 -0
- package/lib/tr-grid-util/es6/jet/index.js +18 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +11 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +131 -0
- package/lib/tr-grid-util/es6/locale/translation-de.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-de.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-en.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-en.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-ja.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-ja.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-zh.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-zh.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation.d.ts +11 -0
- package/lib/tr-grid-util/es6/locale/translation.js +18 -0
- package/lib/types/es6/AutoTooltip.d.ts +45 -0
- package/lib/types/es6/CellSelection.d.ts +67 -0
- package/lib/types/es6/Checkbox.d.ts +69 -0
- package/lib/types/es6/ColumnFitter.d.ts +56 -0
- package/lib/types/es6/ColumnFormatting.d.ts +90 -0
- package/lib/types/es6/ColumnGrouping.d.ts +60 -0
- package/lib/types/es6/ColumnResizing.d.ts +68 -0
- package/lib/types/es6/ColumnSelection.d.ts +70 -0
- package/lib/types/es6/ColumnStack.d.ts +76 -0
- package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +38 -0
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +287 -0
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +22 -0
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +44 -0
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +30 -0
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +42 -0
- package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +24 -0
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +46 -0
- package/lib/types/es6/CompositeGrid/index.d.ts +9 -0
- package/lib/types/es6/ConditionalColoring.d.ts +70 -0
- package/lib/types/es6/ContentWrap.d.ts +43 -0
- package/lib/types/es6/ContextMenu.d.ts +83 -0
- package/lib/types/es6/CoralButtonFormatter.d.ts +22 -0
- package/lib/types/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/types/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/types/es6/CoralIconFormatter.d.ts +23 -0
- package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/types/es6/CoralRadioButtonFormatter.d.ts +22 -0
- package/lib/types/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/types/es6/CoralToggleFormatter.d.ts +12 -0
- package/lib/types/es6/Core/data/ColumnStats.d.ts +42 -0
- package/lib/types/es6/Core/data/DataCache.d.ts +81 -0
- package/lib/types/es6/Core/data/DataTable.d.ts +125 -0
- package/lib/types/es6/Core/data/DataView.d.ts +280 -0
- package/lib/types/es6/Core/data/Segment.d.ts +38 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +58 -0
- package/lib/types/es6/Core/grid/Core.d.ts +387 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +204 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +23 -0
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/Cell.d.ts +50 -0
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +19 -0
- package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +38 -0
- package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +125 -0
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +24 -0
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +61 -0
- package/lib/types/es6/Core/grid/components/StretchedCells.d.ts +17 -0
- package/lib/types/es6/Core/grid/components/VScrollbar.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/VirtualItems.d.ts +12 -0
- package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +16 -0
- package/lib/types/es6/Core/grid/event/EventListeners.d.ts +34 -0
- package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
- package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +28 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +127 -0
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +18 -0
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +53 -0
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +43 -0
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +41 -0
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +25 -0
- package/lib/types/es6/Core/grid/util/Reverter.d.ts +14 -0
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +79 -0
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +50 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +84 -0
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
- package/lib/types/es6/Core/grid/util/util.d.ts +18 -0
- package/lib/types/es6/Core/index.d.ts +84 -0
- package/lib/types/es6/Core/tr-grid-theme.d.ts +5 -0
- package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
- package/lib/types/es6/EFButtonFormatter.d.ts +22 -0
- package/lib/types/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/types/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/types/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/types/es6/EFIconFormatter.d.ts +23 -0
- package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFRadioButtonFormatter.d.ts +22 -0
- package/lib/types/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/types/es6/EFTextFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFToggleFormatter.d.ts +12 -0
- package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
- package/lib/types/es6/ExtensionColumnOptions.d.ts +41 -0
- package/lib/types/es6/ExtensionOptions.d.ts +52 -0
- package/lib/types/es6/Extensions.d.ts +61 -0
- package/lib/types/es6/FilterInput.d.ts +57 -0
- package/lib/types/es6/FormatterBuilder.d.ts +22 -0
- package/lib/types/es6/GridFormatter.d.ts +63 -0
- package/lib/types/es6/HeatMap.d.ts +44 -0
- package/lib/types/es6/InCellEditing.d.ts +129 -0
- package/lib/types/es6/MenuEventAPI.d.ts +22 -0
- package/lib/types/es6/MenuItem.d.ts +39 -0
- package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/types/es6/Pagination.d.ts +57 -0
- package/lib/types/es6/PercentBar.d.ts +60 -0
- package/lib/types/es6/PercentBarFormatter.d.ts +25 -0
- package/lib/types/es6/PopupMenu.d.ts +29 -0
- package/lib/types/es6/RangeBar.d.ts +39 -0
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +143 -0
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +37 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +20 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +263 -0
- package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +38 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +120 -0
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +21 -0
- package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +17 -0
- package/lib/types/es6/RealtimeGrid/index.d.ts +8 -0
- package/lib/types/es6/RowColoring.d.ts +60 -0
- package/lib/types/es6/RowDragging.d.ts +53 -0
- package/lib/types/es6/RowFiltering.d.ts +118 -0
- package/lib/types/es6/RowGrouping.d.ts +109 -0
- package/lib/types/es6/RowSegmenting.d.ts +83 -0
- package/lib/types/es6/RowSelection.d.ts +74 -0
- package/lib/types/es6/SimpleImageFormatter.d.ts +21 -0
- package/lib/types/es6/SimpleInputFormatter.d.ts +12 -0
- package/lib/types/es6/SimpleLinkFormatter.d.ts +21 -0
- package/lib/types/es6/SimpleTickerFormatter.d.ts +25 -0
- package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/types/es6/StatisticsRow.d.ts +67 -0
- package/lib/types/es6/TextFormatter.d.ts +12 -0
- package/lib/types/es6/TextFormatting.d.ts +77 -0
- package/lib/types/es6/TitleWrap.d.ts +29 -0
- package/lib/types/es6/Zoom.d.ts +51 -0
- package/lib/types/es6/index.d.ts +76 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/versions.json +36 -0
- package/lib/window-exporter.js +13 -0
- package/lib/zoom/es6/Zoom.d.ts +51 -0
- package/lib/zoom/es6/Zoom.js +419 -0
- package/lib/zoom/es6/index.d.ts +1 -0
- package/lib/zoom/es6/index.js +1 -0
- package/package.json +42 -0
@@ -0,0 +1,1777 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { MouseDownTrait } from "../../tr-grid-util/es6/MouseDownTrait.js";
|
4
|
+
import { EventDispatcher } from "../../tr-grid-util/es6/EventDispatcher.js";
|
5
|
+
import { isIE, cloneObject, prepareTSVContent } from "../../tr-grid-util/es6/Util.js";
|
6
|
+
/** @typedef {Object} CellSelectionPlugin~Options
|
7
|
+
* @description The options can be specified by `cellSelection` property of the main grid's options
|
8
|
+
* @property {string=} mode="cell" Available options are cell, row, and column
|
9
|
+
* @property {boolean=} multipleSelection=true If disabled, only single cell can be selected at time
|
10
|
+
* @property {boolean=} autoDeselecting=true If disabled, the selection will remain after grid losing focus
|
11
|
+
* @property {boolean=} tabToSelect=false If enabled, the selection can be moved when user press tab key during the time grid is in focus.
|
12
|
+
* @property {Function=} selectionChanged=null Event handler
|
13
|
+
* @property {Function=} copy=null Event handler
|
14
|
+
* @property {Function=} beforeMouseDown=null Event handler
|
15
|
+
* @property {Array=} selectableSections=['content'] Use to set which section can be selected, if not specific then only content section can select
|
16
|
+
*/
|
17
|
+
|
18
|
+
/** @event CellSelectionPlugin#selectionChanged
|
19
|
+
* @description Happens after mouse up event.
|
20
|
+
*/
|
21
|
+
|
22
|
+
/** @event CellSelectionPlugin#copy
|
23
|
+
* @description Happens when Copy is triggered (e.g. Ctrl + C, or selecting copy from context menu).
|
24
|
+
*/
|
25
|
+
|
26
|
+
/** @event CellSelectionPlugin#beforeMouseDown
|
27
|
+
* @description Happens when mouse is down.
|
28
|
+
* @type {Object}
|
29
|
+
* @property {boolean=} cancel Set to true to cancel operation.
|
30
|
+
*/
|
31
|
+
|
32
|
+
/** Active cell selected.
|
33
|
+
* @private
|
34
|
+
* @param {Object} cell
|
35
|
+
*/
|
36
|
+
|
37
|
+
var selectCell = function selectCell(cell) {
|
38
|
+
if (cell) cell.enableClass("selection", true);
|
39
|
+
};
|
40
|
+
/** Deactive cell selected.
|
41
|
+
* @private
|
42
|
+
* @param {Object} cell
|
43
|
+
*/
|
44
|
+
|
45
|
+
|
46
|
+
var deselectCell = function deselectCell(cell) {
|
47
|
+
if (cell) cell.enableClass("selection", false);
|
48
|
+
};
|
49
|
+
/** @constructor
|
50
|
+
* @param {Object=} options
|
51
|
+
* @extends {GridPlugin}
|
52
|
+
*/
|
53
|
+
|
54
|
+
|
55
|
+
var CellSelectionPlugin = function CellSelectionPlugin(options) {
|
56
|
+
this._textRange = document.createRange();
|
57
|
+
this._isIE = isIE();
|
58
|
+
this._unselectables = {
|
59
|
+
title: true,
|
60
|
+
header: true,
|
61
|
+
content: false
|
62
|
+
};
|
63
|
+
this._hosts = [];
|
64
|
+
this._map = [];
|
65
|
+
this._curRect = {};
|
66
|
+
this._curRect.left = 0;
|
67
|
+
this._curRect.right = 0;
|
68
|
+
this._curRect.top = 0;
|
69
|
+
this._curRect.bottom = 0;
|
70
|
+
this._onMouseMove = this._onMouseMove.bind(this);
|
71
|
+
this._onMouseUp = this._onMouseUp.bind(this);
|
72
|
+
this._onMouseDown = this._onMouseDown.bind(this);
|
73
|
+
this._onBlur = this._onBlur.bind(this);
|
74
|
+
this._onCopy = this._onCopy.bind(this);
|
75
|
+
this._onTab = this._onTab.bind(this);
|
76
|
+
this._onPostSectionDataBinding = this._onPostSectionDataBinding.bind(this);
|
77
|
+
this._onColumnMoved = this._onColumnMoved.bind(this);
|
78
|
+
|
79
|
+
if (options) {
|
80
|
+
this.config({
|
81
|
+
"cellSelection": options
|
82
|
+
});
|
83
|
+
}
|
84
|
+
};
|
85
|
+
|
86
|
+
Ext.inherits(CellSelectionPlugin, GridPlugin);
|
87
|
+
/** @type {Range}
|
88
|
+
* @private
|
89
|
+
*/
|
90
|
+
|
91
|
+
CellSelectionPlugin.prototype._textRange = null;
|
92
|
+
/** Current anchor position that mouse down.
|
93
|
+
* @type {Object}
|
94
|
+
* @private
|
95
|
+
*/
|
96
|
+
|
97
|
+
CellSelectionPlugin.prototype._anchor = null;
|
98
|
+
/** Current mouse position.
|
99
|
+
* @type {Object}
|
100
|
+
* @private
|
101
|
+
*/
|
102
|
+
|
103
|
+
CellSelectionPlugin.prototype._curMouse = null;
|
104
|
+
/** Current rectangle of cell selected.
|
105
|
+
* @type {!Object}
|
106
|
+
* @private
|
107
|
+
*/
|
108
|
+
|
109
|
+
CellSelectionPlugin.prototype._curRect;
|
110
|
+
/** @type {!Array.<Object>}
|
111
|
+
* @private
|
112
|
+
*/
|
113
|
+
|
114
|
+
CellSelectionPlugin.prototype._map;
|
115
|
+
/** @type {boolean}
|
116
|
+
* @private
|
117
|
+
*/
|
118
|
+
|
119
|
+
CellSelectionPlugin.prototype._hasCellSpan = false;
|
120
|
+
/** mode of selection, column, cell, row.
|
121
|
+
* @type {string}
|
122
|
+
* @private
|
123
|
+
*/
|
124
|
+
|
125
|
+
CellSelectionPlugin.prototype._mode = "cell";
|
126
|
+
/** Define which section can't select.
|
127
|
+
* @type {!Object}
|
128
|
+
* @private
|
129
|
+
*/
|
130
|
+
|
131
|
+
CellSelectionPlugin.prototype._unselectables;
|
132
|
+
/** @type {Object}
|
133
|
+
* @private
|
134
|
+
*/
|
135
|
+
|
136
|
+
CellSelectionPlugin.prototype._lastSelection = null;
|
137
|
+
/** WORKAROUND FOR IE11 <br>
|
138
|
+
* to prevent onblur event perform action if this blur event come from onmouseup handler <br>
|
139
|
+
* _lastMouseUpTimeStamp will change in onmouseup handler
|
140
|
+
* @type {Object}
|
141
|
+
* @private
|
142
|
+
*/
|
143
|
+
|
144
|
+
CellSelectionPlugin.prototype._lastMouseUpTimeStamp;
|
145
|
+
/** Control auto Deseleting when on blur.
|
146
|
+
* @type {boolean}
|
147
|
+
* @private
|
148
|
+
*/
|
149
|
+
|
150
|
+
CellSelectionPlugin.prototype._autoDeselecting = true;
|
151
|
+
/** Turn on/off cell selection.
|
152
|
+
* @type {boolean}
|
153
|
+
* @private
|
154
|
+
*/
|
155
|
+
|
156
|
+
CellSelectionPlugin.prototype._disabled = false;
|
157
|
+
/** Trait Mouse Down
|
158
|
+
* @type {MouseDownTrait}
|
159
|
+
* @private
|
160
|
+
*/
|
161
|
+
|
162
|
+
CellSelectionPlugin.prototype._mouseTrait = null;
|
163
|
+
/** Allow user to select multiple cell.
|
164
|
+
* @type {boolean}
|
165
|
+
* @private
|
166
|
+
*/
|
167
|
+
|
168
|
+
CellSelectionPlugin.prototype._allowMultipleSelection = true;
|
169
|
+
/** @type {boolean}
|
170
|
+
* @private
|
171
|
+
*/
|
172
|
+
|
173
|
+
CellSelectionPlugin.prototype._dirty = false;
|
174
|
+
/** Allow user tab to select next/previous cell
|
175
|
+
* @type {boolean}
|
176
|
+
* @private
|
177
|
+
*/
|
178
|
+
|
179
|
+
CellSelectionPlugin.prototype._tabToSelect = false;
|
180
|
+
/** Flag to tell that browser is IE or Edge or not
|
181
|
+
* @type {boolean}
|
182
|
+
* @private
|
183
|
+
*/
|
184
|
+
|
185
|
+
CellSelectionPlugin.prototype._isIE;
|
186
|
+
/** Mapping of unclickable element tag
|
187
|
+
* @type {Object}
|
188
|
+
* @private
|
189
|
+
*/
|
190
|
+
|
191
|
+
CellSelectionPlugin.prototype._unclickableMapping = {
|
192
|
+
'A': 1,
|
193
|
+
'INPUT': 1,
|
194
|
+
'BUTTON': 1,
|
195
|
+
'SELECT': 1,
|
196
|
+
'CHECKBOX': 1,
|
197
|
+
'EF-DATETIME-PICKER': 1,
|
198
|
+
'EF-MULTI-SELECT': 1
|
199
|
+
};
|
200
|
+
/** Indicates direction vectors of mouse
|
201
|
+
* @type {Object}
|
202
|
+
* @private
|
203
|
+
*/
|
204
|
+
|
205
|
+
CellSelectionPlugin.prototype._dirVectors = null;
|
206
|
+
/** Flag to tell if mouse out of Grid
|
207
|
+
* @type {Object}
|
208
|
+
* @private
|
209
|
+
*/
|
210
|
+
|
211
|
+
CellSelectionPlugin.prototype._mouseOutOfGrid = false;
|
212
|
+
/** Hold timeout ID of scroll update interval function
|
213
|
+
* @type {number}
|
214
|
+
* @private
|
215
|
+
*/
|
216
|
+
|
217
|
+
CellSelectionPlugin.prototype._timeoutID = null;
|
218
|
+
/** Default scroll speed
|
219
|
+
* @type {number}
|
220
|
+
* @private
|
221
|
+
*/
|
222
|
+
|
223
|
+
CellSelectionPlugin.prototype._scrollSpeed = 500;
|
224
|
+
/** Previous rectangle of cell selected.
|
225
|
+
* @type {!Object}
|
226
|
+
* @private
|
227
|
+
*/
|
228
|
+
|
229
|
+
CellSelectionPlugin.prototype._prevRect = {};
|
230
|
+
/** can mouse draggable
|
231
|
+
* @type {boolean}
|
232
|
+
* @private
|
233
|
+
*/
|
234
|
+
|
235
|
+
CellSelectionPlugin.prototype._draggable = false;
|
236
|
+
/** @override
|
237
|
+
* @return {string}
|
238
|
+
*/
|
239
|
+
|
240
|
+
CellSelectionPlugin.prototype.getName = function () {
|
241
|
+
return "CellSelectionPlugin";
|
242
|
+
};
|
243
|
+
/** Plugin that has multi-table support means that it can have multiple hosts/tables and share its states across those hosts/tables.
|
244
|
+
* @override
|
245
|
+
* @public
|
246
|
+
* @return {boolean}
|
247
|
+
*/
|
248
|
+
|
249
|
+
|
250
|
+
CellSelectionPlugin.prototype.hasMultiTableSupport = function () {
|
251
|
+
return true;
|
252
|
+
};
|
253
|
+
/** Called by Grid plugin's initialization
|
254
|
+
* @override
|
255
|
+
*/
|
256
|
+
|
257
|
+
|
258
|
+
CellSelectionPlugin.prototype.initialize = function (host, options) {
|
259
|
+
if (this._hosts.indexOf(host) >= 0) {
|
260
|
+
return;
|
261
|
+
}
|
262
|
+
|
263
|
+
this._hosts.push(host); // Set dragable event
|
264
|
+
|
265
|
+
|
266
|
+
this._mouseTrait = new MouseDownTrait(host.getElement());
|
267
|
+
|
268
|
+
this._mouseTrait.addEventListener('mouseDown', this._onMouseDown);
|
269
|
+
|
270
|
+
this._mouseTrait.addEventListener('mouseUp', this._onMouseUp);
|
271
|
+
|
272
|
+
this._mouseTrait.addEventListener('mouseMove', this._onMouseMove); // Set Behavior events.
|
273
|
+
// the onblur event does not bubble
|
274
|
+
|
275
|
+
|
276
|
+
host.getParent().addEventListener('blur', this._onBlur, true);
|
277
|
+
host.listen("focusout", this._onBlur);
|
278
|
+
host.listen("copy", this._onCopy); // Listen keydown from other hosts
|
279
|
+
|
280
|
+
if (this._tabToSelect) {
|
281
|
+
host.listen("keydown", this._onTab);
|
282
|
+
}
|
283
|
+
|
284
|
+
host.listen('postSectionDataBinding', this._onPostSectionDataBinding);
|
285
|
+
host.listen('columnMoved', this._onColumnMoved);
|
286
|
+
host.enableClass("no-text-select", true);
|
287
|
+
|
288
|
+
if (this._hosts.length === 1) {
|
289
|
+
this.config(options);
|
290
|
+
}
|
291
|
+
};
|
292
|
+
/** Prevent memory leak, when we leave witout unlisten.
|
293
|
+
* @override
|
294
|
+
*/
|
295
|
+
|
296
|
+
|
297
|
+
CellSelectionPlugin.prototype.unload = function (host) {
|
298
|
+
var at = this._hosts.indexOf(host);
|
299
|
+
|
300
|
+
if (at < 0) {
|
301
|
+
return;
|
302
|
+
}
|
303
|
+
|
304
|
+
this._mouseTrait.removeEventListener('mouseDown', this._onMouseDown);
|
305
|
+
|
306
|
+
this._mouseTrait.removeEventListener('mouseMove', this._onMouseMove);
|
307
|
+
|
308
|
+
this._mouseTrait.removeEventListener('mouseUp', this._onMouseUp);
|
309
|
+
|
310
|
+
host.unlisten("copy", this._onCopy);
|
311
|
+
host.getParent().removeEventListener('blur', this._onBlur);
|
312
|
+
host.unlisten("keydown", this._onTab);
|
313
|
+
host.unlisten('postSectionDataBinding', this._onPostSectionDataBinding);
|
314
|
+
host.unlisten('columnMoved', this._onColumnMoved); // Reset cell-selection behavior.
|
315
|
+
|
316
|
+
this.deselectAll();
|
317
|
+
host.enableClass("no-text-select", false); // remove host from host list
|
318
|
+
|
319
|
+
this._hosts.splice(at, 1);
|
320
|
+
|
321
|
+
if (!this._hosts.length) {
|
322
|
+
this._compositeGrid = null;
|
323
|
+
this._realTimeGrid = null;
|
324
|
+
}
|
325
|
+
};
|
326
|
+
/** Involk when config object is set.
|
327
|
+
* @public
|
328
|
+
* @param {Object=} options
|
329
|
+
*/
|
330
|
+
|
331
|
+
|
332
|
+
CellSelectionPlugin.prototype.config = function (options) {
|
333
|
+
if (!options) {
|
334
|
+
return;
|
335
|
+
}
|
336
|
+
|
337
|
+
var pluginOption = options["cellSelection"];
|
338
|
+
|
339
|
+
if (!pluginOption) {
|
340
|
+
return;
|
341
|
+
} // Mode
|
342
|
+
|
343
|
+
|
344
|
+
var val = pluginOption["mode"];
|
345
|
+
this._mode = val ? val : this._mode; // Is multiple selection
|
346
|
+
|
347
|
+
val = pluginOption["multipleSelection"];
|
348
|
+
this._allowMultipleSelection = val != null ? val : this._allowMultipleSelection;
|
349
|
+
|
350
|
+
if (!this._allowMultipleSelection) {
|
351
|
+
this._mouseTrait.removeEventListener("mouseMove", this._onMouseMove);
|
352
|
+
} // Auto deselecting on blue
|
353
|
+
|
354
|
+
|
355
|
+
val = pluginOption["autoDeselecting"];
|
356
|
+
this._autoDeselecting = val != null ? val : this._autoDeselecting; // selectable sections
|
357
|
+
|
358
|
+
val = pluginOption["selectableSections"];
|
359
|
+
|
360
|
+
if (val) {
|
361
|
+
this.setSelectableSections(val);
|
362
|
+
} // Listen keydown from the first host
|
363
|
+
|
364
|
+
|
365
|
+
val = pluginOption["tabToSelect"];
|
366
|
+
|
367
|
+
if (val) {
|
368
|
+
this._tabToSelect = true;
|
369
|
+
|
370
|
+
if (this._hosts[0]) {
|
371
|
+
this._hosts[0].listen("keydown", this._onTab);
|
372
|
+
}
|
373
|
+
} // event callback
|
374
|
+
|
375
|
+
|
376
|
+
this.addListener(pluginOption, "selectionChanged");
|
377
|
+
this.addListener(pluginOption, "copy");
|
378
|
+
this.addListener(pluginOption, "beforeMouseDown");
|
379
|
+
};
|
380
|
+
/** @public
|
381
|
+
* @param {Object=} gridOptions
|
382
|
+
* @return {!Object}
|
383
|
+
*/
|
384
|
+
|
385
|
+
|
386
|
+
CellSelectionPlugin.prototype.getConfigObject = function (gridOptions) {
|
387
|
+
var obj = gridOptions || {};
|
388
|
+
var extOptions = obj.cellSelection;
|
389
|
+
|
390
|
+
if (!extOptions) {
|
391
|
+
extOptions = obj.cellSelection = {};
|
392
|
+
}
|
393
|
+
|
394
|
+
extOptions.mode = this._mode;
|
395
|
+
|
396
|
+
if (!this._allowMultipleSelection) {
|
397
|
+
extOptions.multipleSelection = false;
|
398
|
+
}
|
399
|
+
|
400
|
+
if (!this._autoDeselecting) {
|
401
|
+
extOptions.autoDeselecting = false;
|
402
|
+
}
|
403
|
+
|
404
|
+
if (this._tabToSelect) {
|
405
|
+
extOptions.tabToSelect = true;
|
406
|
+
}
|
407
|
+
|
408
|
+
var unSelectables = this._unselectables;
|
409
|
+
var sections = [];
|
410
|
+
|
411
|
+
for (var sectionName in unSelectables) {
|
412
|
+
if (!unSelectables[sectionName]) {
|
413
|
+
sections.push(sectionName);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
417
|
+
if (sections.length > 0 && sections.length < 3) {
|
418
|
+
extOptions.selectableSections = sections;
|
419
|
+
}
|
420
|
+
|
421
|
+
return obj;
|
422
|
+
};
|
423
|
+
/** Fire when mouse down.
|
424
|
+
* @private
|
425
|
+
* @param {MouseEvent} e
|
426
|
+
*/
|
427
|
+
|
428
|
+
|
429
|
+
CellSelectionPlugin.prototype._onMouseDown = function (e) {
|
430
|
+
this._draggable = false;
|
431
|
+
|
432
|
+
if (this._disabled || !this._isClickable(e.target)) {
|
433
|
+
return;
|
434
|
+
}
|
435
|
+
|
436
|
+
var activeGrid = this.getRelativeGrid(e);
|
437
|
+
var newAnchor = activeGrid.getRelativePosition(e);
|
438
|
+
|
439
|
+
if (this._unselectables[newAnchor.sectionType]) {
|
440
|
+
return;
|
441
|
+
}
|
442
|
+
|
443
|
+
this._dispatch('beforeMouseDown', newAnchor);
|
444
|
+
|
445
|
+
if (newAnchor.cancel) {
|
446
|
+
return;
|
447
|
+
}
|
448
|
+
|
449
|
+
this._dirty = true;
|
450
|
+
this.selectSingleCell(newAnchor);
|
451
|
+
activeGrid.setAttribute("draggable", "true");
|
452
|
+
this._draggable = true;
|
453
|
+
};
|
454
|
+
/** Fire when mouse is draging.
|
455
|
+
* @private
|
456
|
+
* @param {Event} e
|
457
|
+
*/
|
458
|
+
|
459
|
+
|
460
|
+
CellSelectionPlugin.prototype._onMouseMove = function (e) {
|
461
|
+
if (this._disabled || !this._anchor || !this._draggable) {
|
462
|
+
return;
|
463
|
+
}
|
464
|
+
|
465
|
+
var activeGrid = this._getActiveGrid();
|
466
|
+
|
467
|
+
var newMouse = activeGrid.getRelativePosition(e);
|
468
|
+
|
469
|
+
if (newMouse.sectionIndex === 0) {
|
470
|
+
// prevent first row (header) selection
|
471
|
+
return;
|
472
|
+
}
|
473
|
+
|
474
|
+
if (!newMouse['hit']) {
|
475
|
+
var gridHeight = activeGrid.getHeight();
|
476
|
+
var gridWidth = activeGrid.getWidth();
|
477
|
+
|
478
|
+
if (activeGrid.getScrollWidth() === 0 && activeGrid.getScrollHeight() === 0) {
|
479
|
+
// prevent Auto Scrolling, if Grid does not have scroll
|
480
|
+
return;
|
481
|
+
}
|
482
|
+
|
483
|
+
if (gridHeight >= newMouse.y && !(newMouse.y < 0) && gridWidth >= newMouse.x && !(newMouse.x < 0)) {
|
484
|
+
// return Auto Scrolling, if mouse out of Grid
|
485
|
+
return;
|
486
|
+
}
|
487
|
+
|
488
|
+
var x = 0;
|
489
|
+
var y = 0;
|
490
|
+
|
491
|
+
if (newMouse.x > gridWidth) {
|
492
|
+
x = newMouse.x - gridWidth;
|
493
|
+
} else if (newMouse.x < 0) {
|
494
|
+
x = newMouse.x;
|
495
|
+
}
|
496
|
+
|
497
|
+
if (newMouse.y > gridHeight) {
|
498
|
+
y = newMouse.y - gridHeight;
|
499
|
+
} else if (newMouse.y < 0) {
|
500
|
+
y = newMouse.y;
|
501
|
+
}
|
502
|
+
|
503
|
+
var dirVectors = {
|
504
|
+
"x": x,
|
505
|
+
"y": y
|
506
|
+
}; // set up scrollSpeed
|
507
|
+
|
508
|
+
this._setScrollSpeed(dirVectors);
|
509
|
+
|
510
|
+
var isSameProps = this._checkIsSameProps(dirVectors);
|
511
|
+
|
512
|
+
if (this._mouseOutOfGrid && isSameProps) {
|
513
|
+
return;
|
514
|
+
}
|
515
|
+
|
516
|
+
this._dirVectors = dirVectors;
|
517
|
+
|
518
|
+
this._setScrollInterval(dirVectors);
|
519
|
+
|
520
|
+
return;
|
521
|
+
}
|
522
|
+
|
523
|
+
if (this._timeoutID) {
|
524
|
+
clearTimeout(this._timeoutID);
|
525
|
+
this._mouseOutOfGrid = false;
|
526
|
+
}
|
527
|
+
|
528
|
+
if (this._isTheSamePosition(this._curMouse, newMouse)) {
|
529
|
+
// No selection has been changed
|
530
|
+
return;
|
531
|
+
}
|
532
|
+
|
533
|
+
this._curMouse = newMouse;
|
534
|
+
this._dirty = true;
|
535
|
+
|
536
|
+
var tgtRect = this._newSelectionRect();
|
537
|
+
|
538
|
+
this._updateSelection(tgtRect);
|
539
|
+
};
|
540
|
+
/** Get active grid
|
541
|
+
* @private
|
542
|
+
* @return {Object} core grid
|
543
|
+
*/
|
544
|
+
|
545
|
+
|
546
|
+
CellSelectionPlugin.prototype._getActiveGrid = function () {
|
547
|
+
var anchor = this._anchor;
|
548
|
+
|
549
|
+
if (anchor && anchor["grid"]) {
|
550
|
+
return anchor["grid"];
|
551
|
+
} else {
|
552
|
+
return this._hosts[0];
|
553
|
+
}
|
554
|
+
};
|
555
|
+
/** Set scroll speed
|
556
|
+
* @private
|
557
|
+
* @param {Object} dirVectors Indicates direction vectors of mouse
|
558
|
+
*/
|
559
|
+
|
560
|
+
|
561
|
+
CellSelectionPlugin.prototype._setScrollSpeed = function (dirVectors) {
|
562
|
+
var basedSped = 300;
|
563
|
+
var scrollSpeed = Math.floor(basedSped - Math.abs((dirVectors.x + dirVectors.y) / 2));
|
564
|
+
|
565
|
+
if (scrollSpeed % 10 === 0) {
|
566
|
+
this._scrollSpeed = scrollSpeed > 0 || scrollSpeed <= 500 ? scrollSpeed : 50;
|
567
|
+
}
|
568
|
+
};
|
569
|
+
/** Detect direction vector
|
570
|
+
* @private
|
571
|
+
* @param {number} vector
|
572
|
+
* @return {string|null}
|
573
|
+
*/
|
574
|
+
|
575
|
+
|
576
|
+
CellSelectionPlugin.prototype._detectDir = function (vector) {
|
577
|
+
var part = null;
|
578
|
+
|
579
|
+
if (vector < 0) {
|
580
|
+
part = 'minus'; // minus vector
|
581
|
+
} else if (vector === 0) {
|
582
|
+
part = 'zero'; // zero vector
|
583
|
+
} else if (vector > 0) {
|
584
|
+
part = 'positive'; // positive vector
|
585
|
+
}
|
586
|
+
|
587
|
+
return part;
|
588
|
+
};
|
589
|
+
/** Check Is Same Props
|
590
|
+
* @private
|
591
|
+
* @param {Object} newDirVectors - indicates direction vectors of mouse
|
592
|
+
* @return {boolean}
|
593
|
+
*/
|
594
|
+
|
595
|
+
|
596
|
+
CellSelectionPlugin.prototype._checkIsSameProps = function (newDirVectors) {
|
597
|
+
if (!this._dirVectors || !newDirVectors) {
|
598
|
+
return false;
|
599
|
+
}
|
600
|
+
|
601
|
+
var isX = this._detectDir(this._dirVectors.x) === this._detectDir(newDirVectors.x);
|
602
|
+
|
603
|
+
var isY = this._detectDir(this._dirVectors.y) === this._detectDir(newDirVectors.y);
|
604
|
+
|
605
|
+
return isX && isY;
|
606
|
+
};
|
607
|
+
/** @private
|
608
|
+
* @param {Object} dirVectors
|
609
|
+
*/
|
610
|
+
|
611
|
+
|
612
|
+
CellSelectionPlugin.prototype._setScrollInterval = function (dirVectors) {
|
613
|
+
if (this._timeoutID) {
|
614
|
+
clearTimeout(this._timeoutID);
|
615
|
+
}
|
616
|
+
|
617
|
+
if (!this._mouseOutOfGrid) {
|
618
|
+
this._mouseOutOfGrid = true;
|
619
|
+
}
|
620
|
+
|
621
|
+
var tgtRect = this._newSelectionRect();
|
622
|
+
|
623
|
+
var initialScrollSpeed = this._scrollSpeed || 500;
|
624
|
+
this._timeoutID = setInterval(function () {
|
625
|
+
if (initialScrollSpeed !== this._scrollSpeed) {
|
626
|
+
this._setScrollInterval(dirVectors);
|
627
|
+
|
628
|
+
return;
|
629
|
+
}
|
630
|
+
|
631
|
+
var currentScrollTop = this._hosts[0].getScrollTop();
|
632
|
+
|
633
|
+
var currentScrollLeft = this._hosts[0].getScrollLeft();
|
634
|
+
|
635
|
+
var isYPositive = dirVectors.y > 0;
|
636
|
+
var isXPositive = dirVectors.x > 0;
|
637
|
+
|
638
|
+
var cellWidth = this._map[0].section.getCellWidth();
|
639
|
+
|
640
|
+
var cellHeight = this._map[0].section.getCellHeight();
|
641
|
+
|
642
|
+
var scrollToTop = isYPositive ? currentScrollTop + cellWidth : currentScrollTop - cellWidth;
|
643
|
+
var scrollToLeft = isXPositive ? currentScrollLeft + cellHeight : currentScrollLeft - cellHeight;
|
644
|
+
var addCount = 1;
|
645
|
+
|
646
|
+
if (dirVectors.y !== 0) {
|
647
|
+
// updates scroll position
|
648
|
+
this._hosts[0].setScrollTop(scrollToTop);
|
649
|
+
|
650
|
+
var vScrollView = this._hosts[0].getVScrollView();
|
651
|
+
|
652
|
+
var isEndOfVerticalScroll = this._isEndOfVerticalScroll();
|
653
|
+
|
654
|
+
if (isYPositive) {
|
655
|
+
var nextBottomVal = vScrollView.lastFullRow;
|
656
|
+
|
657
|
+
if (!!(this._prevRect && this._prevRect.bottom > nextBottomVal) && !isEndOfVerticalScroll) {
|
658
|
+
tgtRect.top = nextBottomVal;
|
659
|
+
} else {
|
660
|
+
if (isEndOfVerticalScroll) {
|
661
|
+
tgtRect.bottom = this._hosts[0].getRowCount();
|
662
|
+
} else {
|
663
|
+
tgtRect.bottom = nextBottomVal;
|
664
|
+
}
|
665
|
+
}
|
666
|
+
} else {
|
667
|
+
var nextTopVal = vScrollView.firstFullRow + 2;
|
668
|
+
|
669
|
+
if (!!(this._prevRect && this._prevRect.top < nextTopVal) && !isEndOfVerticalScroll) {
|
670
|
+
tgtRect.bottom = nextTopVal + addCount;
|
671
|
+
} else {
|
672
|
+
if (isEndOfVerticalScroll) {
|
673
|
+
tgtRect.top = 1;
|
674
|
+
} else {
|
675
|
+
tgtRect.top = nextTopVal;
|
676
|
+
}
|
677
|
+
}
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
if (dirVectors.x !== 0) {
|
682
|
+
// updates scroll position
|
683
|
+
this._hosts[0].setScrollLeft(Math.floor(scrollToLeft));
|
684
|
+
|
685
|
+
var isEndOfHorizontalScroll = this._isEndOfHorizontalScroll();
|
686
|
+
|
687
|
+
var gridWidth = this._hosts[0].getWidth();
|
688
|
+
|
689
|
+
var curColumnWidth = this._hosts[0].getColumnWidth(tgtRect.right + addCount);
|
690
|
+
|
691
|
+
if (isXPositive) {
|
692
|
+
var leftColumnPosition = this._hosts[0].getColumnLeft(tgtRect.right + addCount);
|
693
|
+
|
694
|
+
var rightColPos = this._hosts[0].getColumnLeft(tgtRect.right);
|
695
|
+
|
696
|
+
var rightSps = this._hosts[0].getColumnRight(tgtRect.left + 2);
|
697
|
+
|
698
|
+
var rightPosition = gridWidth - curColumnWidth;
|
699
|
+
|
700
|
+
if (leftColumnPosition < rightPosition) {
|
701
|
+
do {
|
702
|
+
tgtRect.right += addCount;
|
703
|
+
} while (this._hosts[0].getColumnLeft(tgtRect.right + addCount) < rightPosition);
|
704
|
+
} else {
|
705
|
+
if (rightColPos - cellWidth - gridWidth > 0 && leftColumnPosition > rightColPos && rightSps < gridWidth) {
|
706
|
+
do {
|
707
|
+
tgtRect.left += addCount;
|
708
|
+
} while (this._hosts[0].getColumnLeft(tgtRect.right + addCount) > rightColPos);
|
709
|
+
} else if (isEndOfHorizontalScroll) {
|
710
|
+
tgtRect.right = this._hosts[0].getColumnCount();
|
711
|
+
}
|
712
|
+
}
|
713
|
+
} else {
|
714
|
+
var rightColumnPosition = this._hosts[0].getColumnRight(tgtRect.left - addCount);
|
715
|
+
|
716
|
+
var leftColPos = this._hosts[0].getColumnRight(tgtRect.left);
|
717
|
+
|
718
|
+
var colPos = this._hosts[0].getColumnRight(tgtRect.right - 2);
|
719
|
+
|
720
|
+
if (rightColumnPosition - curColumnWidth > 0) {
|
721
|
+
tgtRect.left -= addCount;
|
722
|
+
} else {
|
723
|
+
if (leftColPos - cellWidth < 0 && rightColumnPosition < leftColPos && colPos > curColumnWidth * 2) {
|
724
|
+
tgtRect.right -= addCount;
|
725
|
+
} else if (isEndOfHorizontalScroll) {
|
726
|
+
tgtRect.left = 0;
|
727
|
+
}
|
728
|
+
}
|
729
|
+
}
|
730
|
+
}
|
731
|
+
|
732
|
+
this._updateSelection(tgtRect);
|
733
|
+
|
734
|
+
this._prevRect = cloneObject(tgtRect);
|
735
|
+
}.bind(this), initialScrollSpeed);
|
736
|
+
};
|
737
|
+
/** @private
|
738
|
+
* @return {boolean}
|
739
|
+
*/
|
740
|
+
|
741
|
+
|
742
|
+
CellSelectionPlugin.prototype._isEndOfVerticalScroll = function () {
|
743
|
+
var getScrollTop = this._hosts[0].getScrollTop();
|
744
|
+
|
745
|
+
return getScrollTop === 0 || getScrollTop + this._hosts[0].getHeight() > this._hosts[0].getScrollHeight();
|
746
|
+
};
|
747
|
+
/** @private
|
748
|
+
* @return {boolean}
|
749
|
+
*/
|
750
|
+
|
751
|
+
|
752
|
+
CellSelectionPlugin.prototype._isEndOfHorizontalScroll = function () {
|
753
|
+
var getScrollTop = this._hosts[0].getScrollLeft();
|
754
|
+
|
755
|
+
return getScrollTop === 0 || getScrollTop + this._hosts[0].getWidth() > this._hosts[0].getScrollWidth();
|
756
|
+
};
|
757
|
+
/** Fire when draging was end.
|
758
|
+
* @private
|
759
|
+
* @param {Object} e
|
760
|
+
*/
|
761
|
+
|
762
|
+
|
763
|
+
CellSelectionPlugin.prototype._onMouseUp = function (e) {
|
764
|
+
if (this._timeoutID) {
|
765
|
+
clearTimeout(this._timeoutID);
|
766
|
+
this._mouseOutOfGrid = false;
|
767
|
+
}
|
768
|
+
|
769
|
+
if (this._disabled || !this._dirty) {
|
770
|
+
return;
|
771
|
+
}
|
772
|
+
|
773
|
+
this._hosts[0].removeAttribute("draggable");
|
774
|
+
|
775
|
+
this._draggable = false; // WORKAROUND: FOR IE11
|
776
|
+
|
777
|
+
if (this._isIE) {
|
778
|
+
// timestamp to use in onblur event
|
779
|
+
this._lastMouseUpTimeStamp = e.timeStamp;
|
780
|
+
}
|
781
|
+
|
782
|
+
this._updateSelectionText();
|
783
|
+
|
784
|
+
this._dispatch("selectionChanged", {});
|
785
|
+
|
786
|
+
this._dirty = false;
|
787
|
+
};
|
788
|
+
/** to update selection text
|
789
|
+
* @private
|
790
|
+
*/
|
791
|
+
|
792
|
+
|
793
|
+
CellSelectionPlugin.prototype._updateSelectionText = function () {
|
794
|
+
// Native copy event will not be triggered, if there's no text selection.
|
795
|
+
// So we will select text in hiddenInput
|
796
|
+
// we can only use selection.addRange because it not hijack focus of other element
|
797
|
+
// EXCEPT IE11 there is no way to select text without changing focus element
|
798
|
+
var hiddenInput = this._getGridHiddenInput();
|
799
|
+
|
800
|
+
if (hiddenInput) {
|
801
|
+
// we cannot set start with hidden input
|
802
|
+
// it will cause error in IE11
|
803
|
+
// So we use hiddenInput parent instead
|
804
|
+
this._textRange.setStart(hiddenInput.parentNode, 0);
|
805
|
+
|
806
|
+
this._textRange.setEnd(hiddenInput, 0);
|
807
|
+
|
808
|
+
var selection = window.getSelection();
|
809
|
+
selection.removeAllRanges(); // THIS WILL CAUSE IE11 FIRE BLUR EVENT AND CHANG FOCUS
|
810
|
+
|
811
|
+
selection.addRange(this._textRange);
|
812
|
+
} // Cause in IE11, active element will change when perform text select
|
813
|
+
// so we will make current grid focus again
|
814
|
+
|
815
|
+
|
816
|
+
if (this._isIE) {
|
817
|
+
this._getActiveGrid().getParent().focus();
|
818
|
+
}
|
819
|
+
};
|
820
|
+
/** Fire when out of focus.
|
821
|
+
* @private
|
822
|
+
* @param {Object} e
|
823
|
+
*/
|
824
|
+
|
825
|
+
|
826
|
+
CellSelectionPlugin.prototype._onBlur = function (e) {
|
827
|
+
if (this._dirty) {
|
828
|
+
// Prevent onBlur while dragging
|
829
|
+
return;
|
830
|
+
} else if (!this._autoDeselecting) {
|
831
|
+
return;
|
832
|
+
} else if (this._lastMouseUpTimeStamp && e.timeStamp - this._lastMouseUpTimeStamp < 100) {
|
833
|
+
// should use more than 100 millisec
|
834
|
+
// WORKAROUND: FOR IE11
|
835
|
+
// if onblur fire immediately after mouseup event
|
836
|
+
// we will ignore this blur event
|
837
|
+
return;
|
838
|
+
} else if (this.deselectAll()) {
|
839
|
+
this._dispatch("selectionChanged", {});
|
840
|
+
}
|
841
|
+
};
|
842
|
+
/** to remove selection UI when column moved, then postSectionData will rerender selection UI again
|
843
|
+
* @private
|
844
|
+
* @param {Object} e
|
845
|
+
*/
|
846
|
+
|
847
|
+
|
848
|
+
CellSelectionPlugin.prototype._onColumnMoved = function (e) {
|
849
|
+
var rect = this._curRect;
|
850
|
+
var from = e.fromColIndex;
|
851
|
+
var to = e.toColIndex; // ignore column that moved outside selection range
|
852
|
+
|
853
|
+
if (from < rect.left && to < rect.left) {
|
854
|
+
return;
|
855
|
+
} else if (from >= rect.right && to >= rect.right) {
|
856
|
+
return;
|
857
|
+
}
|
858
|
+
|
859
|
+
var clearColIndex; // move from outside left to right
|
860
|
+
// the selection column will shift to left
|
861
|
+
|
862
|
+
if (from < rect.left) {
|
863
|
+
clearColIndex = rect.left - 1;
|
864
|
+
} // move from outside right to left
|
865
|
+
// the selection column will shift to right
|
866
|
+
else if (from >= rect.right) {
|
867
|
+
clearColIndex = rect.right;
|
868
|
+
} // move from inside to outside
|
869
|
+
// the selection column will move to specific column
|
870
|
+
else if (to < rect.left || to >= rect.right) {
|
871
|
+
clearColIndex = to;
|
872
|
+
} // move from inside to inside
|
873
|
+
else {
|
874
|
+
return; // just do nothing
|
875
|
+
}
|
876
|
+
|
877
|
+
for (var rowIndex = rect.top; rowIndex < rect.bottom; rowIndex++) {
|
878
|
+
var rowObj = this._map[rowIndex];
|
879
|
+
var cell = rowObj.section.getCell(clearColIndex, rowObj.rowIndex);
|
880
|
+
deselectCell(cell);
|
881
|
+
} // NOTED: No need to reselect after clear selection UI.
|
882
|
+
// postSectionDataBinding will do this job
|
883
|
+
|
884
|
+
|
885
|
+
this._updateSelectionText();
|
886
|
+
};
|
887
|
+
/** Check if the element clickable.
|
888
|
+
* @private
|
889
|
+
* @param {Element} elem
|
890
|
+
* @param {Object} activeGrid
|
891
|
+
* @return {boolean}
|
892
|
+
*/
|
893
|
+
|
894
|
+
|
895
|
+
CellSelectionPlugin.prototype._isClickable = function (elem, activeGrid) {
|
896
|
+
if (!this._hosts[0] || !elem // case tagName = EF-<whatever> but except EF-ICON and EF-HEADER
|
897
|
+
|| 'EF-ICON' !== elem.tagName && 'EF-HEADER' !== elem.tagName && 0 === elem.tagName.indexOf('EF-')) {
|
898
|
+
return false;
|
899
|
+
} // case elem.tagName is in inclickable list
|
900
|
+
|
901
|
+
|
902
|
+
if (this._unclickableMapping[elem.tagName] && !elem.classList.contains("valigner")) {
|
903
|
+
// button.valigner is clickable
|
904
|
+
return false;
|
905
|
+
}
|
906
|
+
|
907
|
+
return true;
|
908
|
+
};
|
909
|
+
/** Copy text in selected cell to clipboard. If no selection, clipboard will NOT be replaced by empty string
|
910
|
+
* @private
|
911
|
+
* @param {MouseEvent} e
|
912
|
+
*/
|
913
|
+
|
914
|
+
|
915
|
+
CellSelectionPlugin.prototype._onCopy = function (e) {
|
916
|
+
var obj = {
|
917
|
+
"grid": this._hosts[0],
|
918
|
+
"sender": this,
|
919
|
+
"data": "",
|
920
|
+
"format": "",
|
921
|
+
"clipboards": []
|
922
|
+
};
|
923
|
+
|
924
|
+
this._dispatch("copy", obj);
|
925
|
+
|
926
|
+
var clipboardData, format;
|
927
|
+
|
928
|
+
if (e.clipboardData) {
|
929
|
+
clipboardData = e.clipboardData;
|
930
|
+
format = "text/plain";
|
931
|
+
} else {
|
932
|
+
clipboardData = window.clipboardData;
|
933
|
+
format = "Text";
|
934
|
+
} // Set clipboards data to copy api.
|
935
|
+
|
936
|
+
|
937
|
+
if (obj.data) {
|
938
|
+
clipboardData.setData(obj.format || format, obj.data);
|
939
|
+
} else {
|
940
|
+
var txt = this.getSelectedText();
|
941
|
+
|
942
|
+
if (txt) {
|
943
|
+
// Use Native browser event object intead of Google's BrowserEvent
|
944
|
+
clipboardData.setData(format, txt);
|
945
|
+
}
|
946
|
+
}
|
947
|
+
|
948
|
+
var len = obj.clipboards ? obj.clipboards.length : 0;
|
949
|
+
|
950
|
+
for (var i = 0; i < len; ++i) {
|
951
|
+
var clipboard = obj.clipboards[i];
|
952
|
+
|
953
|
+
if (clipboard.format) {
|
954
|
+
clipboardData.setData(clipboard.format, clipboard.data || "");
|
955
|
+
}
|
956
|
+
}
|
957
|
+
|
958
|
+
EventDispatcher.preventDefault(e);
|
959
|
+
};
|
960
|
+
/** @private
|
961
|
+
* @param {KeyboardEvent} e
|
962
|
+
*/
|
963
|
+
|
964
|
+
|
965
|
+
CellSelectionPlugin.prototype._onTab = function (e) {
|
966
|
+
if (e.keyCode === 9) {
|
967
|
+
// Tab key
|
968
|
+
if (e.altKey || e.ctrlKey) {
|
969
|
+
return;
|
970
|
+
}
|
971
|
+
|
972
|
+
var ret = e.shiftKey ? this.selectPrevCell() : this.selectNextCell();
|
973
|
+
|
974
|
+
if (ret) {
|
975
|
+
EventDispatcher.preventDefault(e);
|
976
|
+
}
|
977
|
+
}
|
978
|
+
};
|
979
|
+
/** @private
|
980
|
+
* @param {Object} e for cell style binding
|
981
|
+
*/
|
982
|
+
|
983
|
+
|
984
|
+
CellSelectionPlugin.prototype._onPostSectionDataBinding = function (e) {
|
985
|
+
var activeGrid = this._getActiveGrid();
|
986
|
+
|
987
|
+
if (this.getSelectionCount() > 0 && activeGrid === e.sender) {
|
988
|
+
// var colCount = this._hosts[0].getColumnCount();
|
989
|
+
var rowOffset = e.section.getRowOffset();
|
990
|
+
var selectionRowStart = this._curRect.top - rowOffset;
|
991
|
+
var selectionRowEnd = this._curRect.bottom - rowOffset;
|
992
|
+
var selectionColStart = this._curRect.left;
|
993
|
+
var selectionColEnd = this._curRect.right;
|
994
|
+
var cell, rowIndex, colIndex;
|
995
|
+
|
996
|
+
for (rowIndex = e.fromRowIndex; rowIndex < e.toRowIndex; rowIndex++) {
|
997
|
+
if (rowIndex >= selectionRowStart && rowIndex < selectionRowEnd) {
|
998
|
+
// if row inside selection range
|
999
|
+
for (colIndex = selectionColStart; colIndex < selectionColEnd; colIndex++) {
|
1000
|
+
cell = e.section.getCell(colIndex, rowIndex);
|
1001
|
+
selectCell(cell);
|
1002
|
+
}
|
1003
|
+
} else {
|
1004
|
+
for (colIndex = selectionColStart; colIndex < selectionColEnd; colIndex++) {
|
1005
|
+
cell = e.section.getCell(colIndex, rowIndex);
|
1006
|
+
deselectCell(cell);
|
1007
|
+
}
|
1008
|
+
}
|
1009
|
+
}
|
1010
|
+
}
|
1011
|
+
};
|
1012
|
+
/** Get content string in the cell.
|
1013
|
+
* @private
|
1014
|
+
* @param {string} elem
|
1015
|
+
* @return {boolean}
|
1016
|
+
*/
|
1017
|
+
|
1018
|
+
|
1019
|
+
CellSelectionPlugin.prototype._isString = function (elem) {
|
1020
|
+
return Object.prototype.toString.call(elem) === "[object String]";
|
1021
|
+
};
|
1022
|
+
/** @private */
|
1023
|
+
|
1024
|
+
|
1025
|
+
CellSelectionPlugin.prototype._cacheSectionMap = function () {
|
1026
|
+
var sectionCount = this._hosts[0].getSectionCount();
|
1027
|
+
|
1028
|
+
var totalRow = 0,
|
1029
|
+
rowCount = 0;
|
1030
|
+
this._hasCellSpan = false;
|
1031
|
+
|
1032
|
+
var activeGrid = this._getActiveGrid();
|
1033
|
+
|
1034
|
+
for (var i = 0; i < sectionCount; ++i) {
|
1035
|
+
var sectionSettings = activeGrid.getSectionSettings(i);
|
1036
|
+
var section = sectionSettings.getSection();
|
1037
|
+
var hasCellSpan = section.hasCellSpan();
|
1038
|
+
rowCount = section.getRowCount();
|
1039
|
+
|
1040
|
+
for (var j = 0; j < rowCount; ++j) {
|
1041
|
+
var obj = {};
|
1042
|
+
obj.section = section;
|
1043
|
+
obj.hasCellSpan = hasCellSpan;
|
1044
|
+
obj.sectionIndex = i;
|
1045
|
+
obj.rowIndex = j;
|
1046
|
+
obj.type = sectionSettings.getType();
|
1047
|
+
this._map[totalRow] = obj;
|
1048
|
+
totalRow++;
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
this._hasCellSpan |= hasCellSpan;
|
1052
|
+
}
|
1053
|
+
|
1054
|
+
this._map.length = totalRow;
|
1055
|
+
};
|
1056
|
+
/** @private
|
1057
|
+
* @param {Object} obj
|
1058
|
+
* @return {number}
|
1059
|
+
*/
|
1060
|
+
|
1061
|
+
|
1062
|
+
CellSelectionPlugin.prototype._getCumulativeIndex = function (obj) {
|
1063
|
+
var section = obj["section"];
|
1064
|
+
|
1065
|
+
if (!section) {
|
1066
|
+
section = this._hosts[0].getSection("content");
|
1067
|
+
} else if (typeof section === "string" || typeof section === "number") {
|
1068
|
+
section = this._hosts[0].getSection(section);
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
return section.getRowOffset() + obj["rowIndex"];
|
1072
|
+
};
|
1073
|
+
/** Add new selection rectangle area.
|
1074
|
+
* @private
|
1075
|
+
* @return {!Object} Rectangle
|
1076
|
+
*/
|
1077
|
+
|
1078
|
+
|
1079
|
+
CellSelectionPlugin.prototype._newSelectionRect = function () {
|
1080
|
+
if (!this._anchor || !this._curMouse) {
|
1081
|
+
return this._curRect;
|
1082
|
+
}
|
1083
|
+
|
1084
|
+
var rect = {};
|
1085
|
+
|
1086
|
+
if (this._mode !== "row") {
|
1087
|
+
if (this._anchor["colIndex"] <= this._curMouse["colIndex"]) {
|
1088
|
+
rect.left = this._anchor["colIndex"];
|
1089
|
+
rect.right = this._curMouse["colIndex"] + 1;
|
1090
|
+
} else {
|
1091
|
+
rect.left = this._curMouse["colIndex"];
|
1092
|
+
rect.right = this._anchor["colIndex"] + 1;
|
1093
|
+
}
|
1094
|
+
} else {
|
1095
|
+
rect.left = 0;
|
1096
|
+
rect.right = this._hosts[0].getColumnCount();
|
1097
|
+
} // Required
|
1098
|
+
|
1099
|
+
|
1100
|
+
var cIndex = this._getCumulativeIndex(this._curMouse);
|
1101
|
+
|
1102
|
+
var aIndex = this._getCumulativeIndex(this._anchor);
|
1103
|
+
|
1104
|
+
if (this._mode !== "column") {
|
1105
|
+
if (aIndex <= cIndex) {
|
1106
|
+
rect.top = aIndex;
|
1107
|
+
rect.bottom = cIndex + 1;
|
1108
|
+
} else {
|
1109
|
+
rect.top = cIndex;
|
1110
|
+
rect.bottom = aIndex + 1;
|
1111
|
+
}
|
1112
|
+
} else {
|
1113
|
+
rect.top = 0;
|
1114
|
+
rect.bottom = this._hosts[0].getRowCount();
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
this._scanCellSpans(rect);
|
1118
|
+
|
1119
|
+
return rect;
|
1120
|
+
};
|
1121
|
+
/** we will expand rect by cell span (cell merged)
|
1122
|
+
* @private
|
1123
|
+
* @param {Object} rect
|
1124
|
+
*/
|
1125
|
+
|
1126
|
+
|
1127
|
+
CellSelectionPlugin.prototype._scanCellSpans = function (rect) {
|
1128
|
+
if (!this._hasCellSpan) {
|
1129
|
+
return;
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
var c = 0,
|
1133
|
+
r = 0;
|
1134
|
+
var tgtChanged = false;
|
1135
|
+
|
1136
|
+
do {
|
1137
|
+
tgtChanged = false;
|
1138
|
+
|
1139
|
+
for (c = rect.left; c < rect.right; ++c) {
|
1140
|
+
// Left to right
|
1141
|
+
tgtChanged |= this._expandRect(c, rect.top, rect);
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
c = rect.right - 1;
|
1145
|
+
|
1146
|
+
for (r = rect.top + 1; r < rect.bottom; ++r) {
|
1147
|
+
// Top to bottom
|
1148
|
+
tgtChanged |= this._expandRect(c, r, rect);
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
r = rect.bottom - 1;
|
1152
|
+
|
1153
|
+
for (c = rect.right - 1; --c >= rect.left;) {
|
1154
|
+
// Bottom right to bottom left
|
1155
|
+
tgtChanged |= this._expandRect(c, r, rect);
|
1156
|
+
}
|
1157
|
+
|
1158
|
+
for (r = rect.bottom - 1; --r >= rect.top;) {
|
1159
|
+
// Bottom left to top
|
1160
|
+
tgtChanged |= this._expandRect(rect.left, r, rect);
|
1161
|
+
}
|
1162
|
+
} while (tgtChanged);
|
1163
|
+
};
|
1164
|
+
/** @private
|
1165
|
+
* @param {number} colIndex
|
1166
|
+
* @param {number} rowIndex
|
1167
|
+
* @param {Object} rect
|
1168
|
+
* @return {boolean}
|
1169
|
+
*/
|
1170
|
+
|
1171
|
+
|
1172
|
+
CellSelectionPlugin.prototype._expandRect = function (colIndex, rowIndex, rect) {
|
1173
|
+
var obj = this._map[rowIndex];
|
1174
|
+
|
1175
|
+
if (!obj.hasCellSpan) {
|
1176
|
+
return false;
|
1177
|
+
}
|
1178
|
+
|
1179
|
+
if (this._unselectables[obj.type] === true) {
|
1180
|
+
return false;
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
var changed = false;
|
1184
|
+
var newIndex = 0;
|
1185
|
+
var colSpan = obj.section.getCellColSpan(colIndex, obj.rowIndex);
|
1186
|
+
|
1187
|
+
if (colSpan > 1) {
|
1188
|
+
newIndex = colIndex + colSpan;
|
1189
|
+
|
1190
|
+
if (newIndex > rect.right) {
|
1191
|
+
rect.right = newIndex; // Exclusive
|
1192
|
+
|
1193
|
+
changed = true;
|
1194
|
+
}
|
1195
|
+
} else if (colSpan < 0) {
|
1196
|
+
newIndex = colIndex + colSpan;
|
1197
|
+
|
1198
|
+
if (newIndex < rect.left) {
|
1199
|
+
rect.left = newIndex;
|
1200
|
+
changed = true;
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
colSpan = obj.section.getCellColSpan(newIndex, obj.rowIndex);
|
1204
|
+
newIndex = newIndex + colSpan;
|
1205
|
+
|
1206
|
+
if (newIndex > rect.right) {
|
1207
|
+
rect.right = newIndex; // Exclusive
|
1208
|
+
|
1209
|
+
changed = true;
|
1210
|
+
}
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
var rowSpan = obj.section.getCellRowSpan(colIndex, obj.rowIndex);
|
1214
|
+
|
1215
|
+
if (rowSpan > 1) {
|
1216
|
+
newIndex = obj.section.getRowOffset() + obj.rowIndex + rowSpan;
|
1217
|
+
|
1218
|
+
if (newIndex > rect.bottom) {
|
1219
|
+
rect.bottom = newIndex; // Exclusive
|
1220
|
+
|
1221
|
+
changed = true;
|
1222
|
+
}
|
1223
|
+
} else if (rowSpan < 0) {
|
1224
|
+
newIndex = obj.section.getRowOffset() + obj.rowIndex + rowSpan;
|
1225
|
+
|
1226
|
+
if (newIndex < rect.top) {
|
1227
|
+
rect.top = newIndex;
|
1228
|
+
changed = true;
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
rowSpan = obj.section.getCellRowSpan(colIndex, newIndex);
|
1232
|
+
newIndex = newIndex + rowSpan;
|
1233
|
+
|
1234
|
+
if (newIndex > rect.bottom) {
|
1235
|
+
rect.bottom = newIndex; // Exclusive
|
1236
|
+
|
1237
|
+
changed = true;
|
1238
|
+
}
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
return changed;
|
1242
|
+
};
|
1243
|
+
/** Update all row & column that mouse draged over.
|
1244
|
+
* @private
|
1245
|
+
* @param {Object} tgtRect
|
1246
|
+
*/
|
1247
|
+
|
1248
|
+
|
1249
|
+
CellSelectionPlugin.prototype._updateSelection = function (tgtRect) {
|
1250
|
+
// Expand/Shrink Left
|
1251
|
+
this._updateColumnSelection(tgtRect.left, this._curRect.left);
|
1252
|
+
|
1253
|
+
this._curRect.left = tgtRect.left; // Expand/Shrink Right
|
1254
|
+
|
1255
|
+
this._updateColumnSelection(this._curRect.right, tgtRect.right);
|
1256
|
+
|
1257
|
+
this._curRect.right = tgtRect.right; // Expand/Shrink Top
|
1258
|
+
|
1259
|
+
this._updateRowSelection(tgtRect.top, this._curRect.top);
|
1260
|
+
|
1261
|
+
this._curRect.top = tgtRect.top; // Expand/Shrink Bottom
|
1262
|
+
|
1263
|
+
this._updateRowSelection(this._curRect.bottom, tgtRect.bottom);
|
1264
|
+
|
1265
|
+
this._curRect.bottom = tgtRect.bottom;
|
1266
|
+
};
|
1267
|
+
/** Update all column that mouse draged over.
|
1268
|
+
* @private
|
1269
|
+
* @param {number} from Inclustive starting index
|
1270
|
+
* @param {number} to Exclusive destination index
|
1271
|
+
*/
|
1272
|
+
|
1273
|
+
|
1274
|
+
CellSelectionPlugin.prototype._updateColumnSelection = function (from, to) {
|
1275
|
+
if (from === to) {
|
1276
|
+
return;
|
1277
|
+
}
|
1278
|
+
|
1279
|
+
var c, r;
|
1280
|
+
|
1281
|
+
if (from < to) {
|
1282
|
+
for (r = this._curRect.top; r < this._curRect.bottom; ++r) {
|
1283
|
+
for (c = from; c < to; ++c) {
|
1284
|
+
this._selectAsPosition(r, c, true);
|
1285
|
+
}
|
1286
|
+
}
|
1287
|
+
} else {
|
1288
|
+
// from > to
|
1289
|
+
for (r = this._curRect.top; r < this._curRect.bottom; ++r) {
|
1290
|
+
for (c = from; --c >= to;) {
|
1291
|
+
this._selectAsPosition(r, c, false);
|
1292
|
+
}
|
1293
|
+
}
|
1294
|
+
}
|
1295
|
+
};
|
1296
|
+
/** Update all row that mouse draged over.
|
1297
|
+
* @private
|
1298
|
+
* @param {number} from Inclustive starting index
|
1299
|
+
* @param {number} to Exclusive destination index
|
1300
|
+
*/
|
1301
|
+
|
1302
|
+
|
1303
|
+
CellSelectionPlugin.prototype._updateRowSelection = function (from, to) {
|
1304
|
+
if (from === to) {
|
1305
|
+
return;
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
var c, r;
|
1309
|
+
|
1310
|
+
if (from < to) {
|
1311
|
+
for (r = from; r < to; ++r) {
|
1312
|
+
for (c = this._curRect.left; c < this._curRect.right; ++c) {
|
1313
|
+
this._selectAsPosition(r, c, true);
|
1314
|
+
}
|
1315
|
+
}
|
1316
|
+
} else {
|
1317
|
+
// from > to
|
1318
|
+
for (r = from; --r >= to;) {
|
1319
|
+
for (c = this._curRect.left; c < this._curRect.right; ++c) {
|
1320
|
+
this._selectAsPosition(r, c, false);
|
1321
|
+
}
|
1322
|
+
}
|
1323
|
+
}
|
1324
|
+
};
|
1325
|
+
/** @private
|
1326
|
+
* @param {number} rowIndex
|
1327
|
+
* @param {number} colIndex
|
1328
|
+
* @param {boolean} isSelect
|
1329
|
+
*/
|
1330
|
+
|
1331
|
+
|
1332
|
+
CellSelectionPlugin.prototype._selectAsPosition = function (rowIndex, colIndex, isSelect) {
|
1333
|
+
var mapInfo = this._map[rowIndex];
|
1334
|
+
if (!mapInfo || this._unselectables[mapInfo.type] === true) return;
|
1335
|
+
var cell = mapInfo.section.getCell(colIndex, mapInfo.rowIndex);
|
1336
|
+
|
1337
|
+
if (isSelect) {
|
1338
|
+
selectCell(cell);
|
1339
|
+
} else {
|
1340
|
+
deselectCell(cell);
|
1341
|
+
}
|
1342
|
+
};
|
1343
|
+
/** Check mouse is draging over cell that already selected.
|
1344
|
+
* @private
|
1345
|
+
* @param {Object} cellA
|
1346
|
+
* @param {Object} cellB
|
1347
|
+
* @return {boolean}
|
1348
|
+
*/
|
1349
|
+
|
1350
|
+
|
1351
|
+
CellSelectionPlugin.prototype._isTheSamePosition = function (cellA, cellB) {
|
1352
|
+
if (cellA === null && cellB === null) {
|
1353
|
+
return true;
|
1354
|
+
}
|
1355
|
+
|
1356
|
+
if (cellA !== null && cellB !== null) {
|
1357
|
+
return cellA["rowIndex"] === cellB["rowIndex"] && cellA["colIndex"] === cellB["colIndex"] && cellA["sectionIndex"] === cellB["sectionIndex"];
|
1358
|
+
}
|
1359
|
+
|
1360
|
+
return false;
|
1361
|
+
};
|
1362
|
+
/** Grid has hidden input it's a dummy element <br>
|
1363
|
+
* We can use this input to perform copy or etc.
|
1364
|
+
* @private
|
1365
|
+
* @return {Element}
|
1366
|
+
*/
|
1367
|
+
|
1368
|
+
|
1369
|
+
CellSelectionPlugin.prototype._getGridHiddenInput = function () {
|
1370
|
+
if (this._hosts[0]) {
|
1371
|
+
return this._hosts[0].getHiddenInput();
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
return null;
|
1375
|
+
};
|
1376
|
+
/** Get text from selected cells. If no selection, return empty string. <br>
|
1377
|
+
* Text will be converted to Tab-separated values format, representing tabular structure. <br>
|
1378
|
+
* Newlines (\n, \r), Tab (\t) and <br> <br>
|
1379
|
+
* will be converted to single space. Connecting spaces will remain intact.
|
1380
|
+
* @public
|
1381
|
+
* @return {string}
|
1382
|
+
*/
|
1383
|
+
|
1384
|
+
|
1385
|
+
CellSelectionPlugin.prototype.getSelectedText = function () {
|
1386
|
+
var activeGrid = this._getActiveGrid();
|
1387
|
+
|
1388
|
+
if (!activeGrid || !this.getGridApi() || this.getSelectionCount() <= 0) return "";
|
1389
|
+
var ret_txt = "";
|
1390
|
+
var dv = activeGrid.getDataSource();
|
1391
|
+
|
1392
|
+
for (var r = this._curRect.top; r < this._curRect.bottom; ++r) {
|
1393
|
+
var rowMapping = this._map[r];
|
1394
|
+
|
1395
|
+
if (r !== this._curRect.top) {
|
1396
|
+
ret_txt += "\n";
|
1397
|
+
}
|
1398
|
+
|
1399
|
+
var rowData = null;
|
1400
|
+
|
1401
|
+
if (this._unselectables[rowMapping.type] === true) {
|
1402
|
+
continue;
|
1403
|
+
} else if (rowMapping.type === 'content') {
|
1404
|
+
rowData = this._getRow(dv, rowMapping.rowIndex);
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
for (var c = this._curRect.left; c < this._curRect.right; ++c) {
|
1408
|
+
if (c !== this._curRect.left) {
|
1409
|
+
ret_txt += "\t";
|
1410
|
+
}
|
1411
|
+
|
1412
|
+
if (rowMapping.type === 'content') {
|
1413
|
+
// for content section we will get text from dataSource to support row virtualization
|
1414
|
+
if (rowData) {
|
1415
|
+
var cField = this._getField(c);
|
1416
|
+
|
1417
|
+
ret_txt += prepareTSVContent(rowData[cField]);
|
1418
|
+
}
|
1419
|
+
} else {
|
1420
|
+
// other section not has row virtualization
|
1421
|
+
// so we can get text from cell directly
|
1422
|
+
var txt = rowMapping.section.getCell(c, rowMapping.rowIndex).getTextContent();
|
1423
|
+
ret_txt += prepareTSVContent(txt);
|
1424
|
+
}
|
1425
|
+
}
|
1426
|
+
}
|
1427
|
+
|
1428
|
+
return ret_txt;
|
1429
|
+
};
|
1430
|
+
/** Select all cell.
|
1431
|
+
* @public
|
1432
|
+
*/
|
1433
|
+
|
1434
|
+
|
1435
|
+
CellSelectionPlugin.prototype.selectAll = function () {
|
1436
|
+
var activeGrid = this._getActiveGrid();
|
1437
|
+
|
1438
|
+
var selectAllRectangle = {
|
1439
|
+
left: 0,
|
1440
|
+
right: activeGrid.getColumnCount(),
|
1441
|
+
top: 0,
|
1442
|
+
bottom: activeGrid.getRowCount()
|
1443
|
+
}; // Un-select all selected
|
1444
|
+
|
1445
|
+
this.deselectAll(); // Need to keep the active-grid
|
1446
|
+
|
1447
|
+
this._anchor = {
|
1448
|
+
grid: activeGrid
|
1449
|
+
}; // Need to be done first for getting cumulative row index
|
1450
|
+
|
1451
|
+
this._cacheSectionMap(); // Make new rectangle selection & fire event
|
1452
|
+
|
1453
|
+
|
1454
|
+
this._scanCellSpans(selectAllRectangle);
|
1455
|
+
|
1456
|
+
this._updateSelection(selectAllRectangle);
|
1457
|
+
|
1458
|
+
this._dispatch("selectionChanged", {});
|
1459
|
+
};
|
1460
|
+
/** Deselect all selected cell.
|
1461
|
+
* @public
|
1462
|
+
* @return {boolean} true if there is any change
|
1463
|
+
*/
|
1464
|
+
|
1465
|
+
|
1466
|
+
CellSelectionPlugin.prototype.deselectAll = function () {
|
1467
|
+
if (this.getSelectionCount() <= 0) {
|
1468
|
+
return false;
|
1469
|
+
} // clear selection from ui
|
1470
|
+
|
1471
|
+
|
1472
|
+
var activeGrid = this._getActiveGrid();
|
1473
|
+
|
1474
|
+
var selectedCells = activeGrid.getElement().querySelectorAll("div.cell.selection");
|
1475
|
+
var c = selectedCells.length;
|
1476
|
+
|
1477
|
+
for (var i = 0; i < c; i++) {
|
1478
|
+
selectedCells[i].classList.remove('selection');
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
this._lastSelection = this.getSelectionBounds();
|
1482
|
+
this._anchor = null;
|
1483
|
+
this._curRect.right = this._curRect.left;
|
1484
|
+
this._curRect.bottom = this._curRect.top;
|
1485
|
+
return true;
|
1486
|
+
};
|
1487
|
+
/** Return total number of selected cells
|
1488
|
+
* @public
|
1489
|
+
* @return {number}
|
1490
|
+
*/
|
1491
|
+
|
1492
|
+
|
1493
|
+
CellSelectionPlugin.prototype.getSelectionCount = function () {
|
1494
|
+
var width = this._curRect.right - this._curRect.left;
|
1495
|
+
var height = this._curRect.bottom - this._curRect.top;
|
1496
|
+
return width * height;
|
1497
|
+
};
|
1498
|
+
/** Add left, top, right, bottom properties to the given object
|
1499
|
+
* @public
|
1500
|
+
* @param {Object=} opt_ret
|
1501
|
+
* @return {Object}
|
1502
|
+
*/
|
1503
|
+
|
1504
|
+
|
1505
|
+
CellSelectionPlugin.prototype.getSelectionBounds = function (opt_ret) {
|
1506
|
+
if (this.getSelectionCount() <= 0) {
|
1507
|
+
return null;
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
var obj = opt_ret != null ? opt_ret : {};
|
1511
|
+
obj["left"] = this._curRect.left;
|
1512
|
+
obj["right"] = this._curRect.right - 1; // Inclusive
|
1513
|
+
|
1514
|
+
obj["top"] = this._curRect.top;
|
1515
|
+
obj["bottom"] = this._curRect.bottom - 1; // Inclusive
|
1516
|
+
|
1517
|
+
if (this._map.length > 0 && obj["bottom"] < this._map.length) {
|
1518
|
+
var mapper = this._map[obj["top"]];
|
1519
|
+
obj["startSection"] = mapper.sectionIndex;
|
1520
|
+
obj["startSectionRow"] = mapper.rowIndex;
|
1521
|
+
mapper = this._map[obj["bottom"]];
|
1522
|
+
obj["endSection"] = mapper.sectionIndex; // Inclusive
|
1523
|
+
|
1524
|
+
obj["endSectionRow"] = mapper.rowIndex; // Inclusive
|
1525
|
+
}
|
1526
|
+
|
1527
|
+
return obj;
|
1528
|
+
};
|
1529
|
+
/** Add left, top, right, bottom properties to the given object
|
1530
|
+
* @public
|
1531
|
+
* @param {Object=} opt_ret
|
1532
|
+
* @return {Object}
|
1533
|
+
*/
|
1534
|
+
|
1535
|
+
|
1536
|
+
CellSelectionPlugin.prototype.getLastSelectionBounds = function (opt_ret) {
|
1537
|
+
if (this._lastSelection === null) {
|
1538
|
+
return null;
|
1539
|
+
}
|
1540
|
+
|
1541
|
+
var obj = opt_ret != null ? opt_ret : {};
|
1542
|
+
|
1543
|
+
for (var key in this._lastSelection) {
|
1544
|
+
obj[key] = this._lastSelection[key];
|
1545
|
+
}
|
1546
|
+
|
1547
|
+
return obj;
|
1548
|
+
};
|
1549
|
+
/** Use to set which section can be selected,[ header, title, content ]
|
1550
|
+
* @public
|
1551
|
+
* @param {(string|Array.<string>|null)=} types Use null to allow all sections to be select
|
1552
|
+
*/
|
1553
|
+
|
1554
|
+
|
1555
|
+
CellSelectionPlugin.prototype.setSelectableSections = function (types) {
|
1556
|
+
this._unselectables["content"] = true;
|
1557
|
+
this._unselectables["header"] = true;
|
1558
|
+
this._unselectables["title"] = true; // Set null or empty to allow all sections
|
1559
|
+
|
1560
|
+
if (!types) {
|
1561
|
+
this._unselectables["content"] = false;
|
1562
|
+
this._unselectables["header"] = false;
|
1563
|
+
this._unselectables["title"] = false;
|
1564
|
+
return;
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
var list = typeof types === "string" ? [types] : types;
|
1568
|
+
|
1569
|
+
for (var i = list.length; --i >= 0;) {
|
1570
|
+
this._unselectables[list[i]] = false;
|
1571
|
+
}
|
1572
|
+
};
|
1573
|
+
/** Use to select single cell and deselect previous selected cells.
|
1574
|
+
* @public
|
1575
|
+
* @param {Object} anchor
|
1576
|
+
* @example
|
1577
|
+
* extension.selectSingleCell({colIndex: 1, rowIndex: 0});
|
1578
|
+
*/
|
1579
|
+
|
1580
|
+
|
1581
|
+
CellSelectionPlugin.prototype.selectSingleCell = function (anchor) {
|
1582
|
+
this.deselectAll();
|
1583
|
+
|
1584
|
+
if (!anchor) {
|
1585
|
+
return;
|
1586
|
+
}
|
1587
|
+
|
1588
|
+
this._anchor = anchor;
|
1589
|
+
this._curMouse = anchor; // Need to be done first for getting cumulative row index
|
1590
|
+
|
1591
|
+
this._cacheSectionMap();
|
1592
|
+
|
1593
|
+
this._curRect.left = this._anchor["colIndex"];
|
1594
|
+
this._curRect.top = this._getCumulativeIndex(this._anchor);
|
1595
|
+
this._curRect.right = this._curRect.left;
|
1596
|
+
this._curRect.bottom = this._curRect.top;
|
1597
|
+
|
1598
|
+
var tgtRect = this._newSelectionRect();
|
1599
|
+
|
1600
|
+
this._updateSelection(tgtRect);
|
1601
|
+
};
|
1602
|
+
/** Use to select multiple cells, can be selected by rectangle area.
|
1603
|
+
* @public
|
1604
|
+
* @param {Object} rect
|
1605
|
+
*/
|
1606
|
+
|
1607
|
+
|
1608
|
+
CellSelectionPlugin.prototype.selectCells = function (rect) {
|
1609
|
+
this.deselectAll();
|
1610
|
+
|
1611
|
+
if (!rect) {
|
1612
|
+
return;
|
1613
|
+
}
|
1614
|
+
|
1615
|
+
this._anchor = rect;
|
1616
|
+
this._curMouse = {
|
1617
|
+
"rowIndex": rect["rowIndex"] + (rect["height"] - 1),
|
1618
|
+
"colIndex": rect["colIndex"] + (rect["width"] - 1)
|
1619
|
+
}; // Need to be done first for getting cumulative row index
|
1620
|
+
|
1621
|
+
this._cacheSectionMap();
|
1622
|
+
|
1623
|
+
this._curRect.left = this._anchor["colIndex"];
|
1624
|
+
this._curRect.top = this._getCumulativeIndex(this._anchor);
|
1625
|
+
this._curRect.right = this._curRect.left;
|
1626
|
+
this._curRect.bottom = this._curRect.top;
|
1627
|
+
|
1628
|
+
var tgtRect = this._newSelectionRect();
|
1629
|
+
|
1630
|
+
this._updateSelection(tgtRect);
|
1631
|
+
};
|
1632
|
+
/** Select next cell from the current selection anchor.
|
1633
|
+
* @public
|
1634
|
+
* @return {boolean} Return true if the next cell is selected, otherwise false
|
1635
|
+
*/
|
1636
|
+
|
1637
|
+
|
1638
|
+
CellSelectionPlugin.prototype.selectNextCell = function () {
|
1639
|
+
var newAnchor;
|
1640
|
+
|
1641
|
+
if (this._anchor) {
|
1642
|
+
// TODO: Handle looping
|
1643
|
+
var activeGrid = this._getActiveGrid();
|
1644
|
+
|
1645
|
+
if (this._mode == "row") {
|
1646
|
+
newAnchor = activeGrid.getCellInfo({
|
1647
|
+
"colIndex": 0,
|
1648
|
+
"rowIndex": this._anchor["rowIndex"] + 1
|
1649
|
+
});
|
1650
|
+
} else if (this._mode == "column") {
|
1651
|
+
newAnchor = activeGrid.getCellInfo({
|
1652
|
+
"colIndex": this._anchor["colIndex"] + 1,
|
1653
|
+
"rowIndex": 0
|
1654
|
+
});
|
1655
|
+
} else {
|
1656
|
+
newAnchor = activeGrid.getNextCell(this._anchor);
|
1657
|
+
|
1658
|
+
if (newAnchor && !newAnchor.cell) {
|
1659
|
+
newAnchor = null; // Last cell in the last row has been reached
|
1660
|
+
}
|
1661
|
+
} // Need to store active-grid
|
1662
|
+
|
1663
|
+
|
1664
|
+
if (newAnchor) {
|
1665
|
+
newAnchor.grid = activeGrid;
|
1666
|
+
}
|
1667
|
+
|
1668
|
+
this.selectSingleCell(newAnchor);
|
1669
|
+
}
|
1670
|
+
|
1671
|
+
return newAnchor ? true : false;
|
1672
|
+
};
|
1673
|
+
/** Select previous cell from the current selection anchor.
|
1674
|
+
* @public
|
1675
|
+
* @return {boolean} Return true if the next cell is selected, otherwise false
|
1676
|
+
*/
|
1677
|
+
|
1678
|
+
|
1679
|
+
CellSelectionPlugin.prototype.selectPrevCell = function () {
|
1680
|
+
var newAnchor;
|
1681
|
+
|
1682
|
+
if (this._anchor) {
|
1683
|
+
// TODO: Handle looping
|
1684
|
+
var activeGrid = this._getActiveGrid();
|
1685
|
+
|
1686
|
+
if (this._mode == "row") {
|
1687
|
+
newAnchor = activeGrid.getCellInfo({
|
1688
|
+
"colIndex": 0,
|
1689
|
+
"rowIndex": this._anchor["rowIndex"] - 1
|
1690
|
+
});
|
1691
|
+
} else if (this._mode == "column") {
|
1692
|
+
newAnchor = activeGrid.getCellInfo({
|
1693
|
+
"colIndex": this._anchor["colIndex"] - 1,
|
1694
|
+
"rowIndex": 0
|
1695
|
+
});
|
1696
|
+
} else {
|
1697
|
+
newAnchor = activeGrid.getPrevCell(this._anchor);
|
1698
|
+
|
1699
|
+
if (newAnchor && !newAnchor.cell) {
|
1700
|
+
newAnchor = null; // The first cell in the first row has been reached
|
1701
|
+
}
|
1702
|
+
} // Need to store active-grid
|
1703
|
+
|
1704
|
+
|
1705
|
+
if (newAnchor) {
|
1706
|
+
newAnchor.grid = activeGrid;
|
1707
|
+
}
|
1708
|
+
|
1709
|
+
this.selectSingleCell(newAnchor);
|
1710
|
+
}
|
1711
|
+
|
1712
|
+
return newAnchor ? true : false;
|
1713
|
+
};
|
1714
|
+
/** Get information about current selection anchor
|
1715
|
+
* @public
|
1716
|
+
* @return {Object} MouseInfo
|
1717
|
+
*/
|
1718
|
+
|
1719
|
+
|
1720
|
+
CellSelectionPlugin.prototype.getAnchorInfo = function () {
|
1721
|
+
var activeGrid = this._getActiveGrid();
|
1722
|
+
|
1723
|
+
return activeGrid.getCellInfo(this._anchor);
|
1724
|
+
};
|
1725
|
+
/** Use to get selected cells.
|
1726
|
+
* @public
|
1727
|
+
* @return {Array.<Object>} array of cell
|
1728
|
+
*/
|
1729
|
+
|
1730
|
+
|
1731
|
+
CellSelectionPlugin.prototype.getSelectedCells = function () {
|
1732
|
+
var selectedCells = [];
|
1733
|
+
|
1734
|
+
for (var r = this._curRect.top; r < this._curRect.bottom; ++r) {
|
1735
|
+
var obj = this._map[r];
|
1736
|
+
var cells = [];
|
1737
|
+
|
1738
|
+
for (var c = this._curRect.left; c < this._curRect.right; ++c) {
|
1739
|
+
var cell = obj.section.getCell(c, obj.rowIndex);
|
1740
|
+
cells.push(cell);
|
1741
|
+
}
|
1742
|
+
|
1743
|
+
selectedCells.push(cells);
|
1744
|
+
}
|
1745
|
+
|
1746
|
+
return selectedCells;
|
1747
|
+
};
|
1748
|
+
/** Disable selection
|
1749
|
+
* @public
|
1750
|
+
* @param {boolean=} opt_disable
|
1751
|
+
*/
|
1752
|
+
|
1753
|
+
|
1754
|
+
CellSelectionPlugin.prototype.disableSelection = function (opt_disable) {
|
1755
|
+
this._disabled = opt_disable !== false;
|
1756
|
+
};
|
1757
|
+
/** Use to set Auto Deselecting when blur.
|
1758
|
+
* @public
|
1759
|
+
* @param {boolean} bool
|
1760
|
+
*/
|
1761
|
+
|
1762
|
+
|
1763
|
+
CellSelectionPlugin.prototype.setAutoDeselectingOnBlur = function (bool) {
|
1764
|
+
this._autoDeselecting = bool;
|
1765
|
+
};
|
1766
|
+
/** Use to get state Auto Deselecting.
|
1767
|
+
* @public
|
1768
|
+
* @return {boolean}
|
1769
|
+
*/
|
1770
|
+
|
1771
|
+
|
1772
|
+
CellSelectionPlugin.prototype.getAutoDeselectingOnBlur = function () {
|
1773
|
+
return this._autoDeselecting;
|
1774
|
+
};
|
1775
|
+
|
1776
|
+
export default CellSelectionPlugin;
|
1777
|
+
export { CellSelectionPlugin, CellSelectionPlugin as CellSelection, CellSelectionPlugin as CellSelectionExtension };
|