@refinitiv-ui/efx-grid 0.0.0-dev.12023565035.1
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-dragging/es6/ColumnDragging.d.ts +51 -0
- package/lib/column-dragging/es6/ColumnDragging.js +968 -0
- package/lib/column-dragging/es6/index.d.ts +1 -0
- package/lib/column-dragging/es6/index.js +1 -0
- package/lib/column-format-dialog/index.d.ts +2 -0
- package/lib/column-format-dialog/index.js +2 -0
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +77 -0
- package/lib/column-format-dialog/lib/column-format-dialog.js +2688 -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 +982 -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 +2 -0
- package/lib/column-selection-dialog/index.js +2 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +66 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +2034 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.js +20 -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 +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.js +20 -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 +258 -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 +8 -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 +8 -0
- package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +25 -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 +8 -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 +8 -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 +8 -0
- package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +5 -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 +8 -0
- package/lib/core/dist/core.css +1 -0
- package/lib/core/dist/core.js +33910 -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 +43 -0
- package/lib/core/es6/data/DataCache.js +597 -0
- package/lib/core/es6/data/DataTable.d.ts +156 -0
- package/lib/core/es6/data/DataTable.js +2206 -0
- package/lib/core/es6/data/DataView.d.ts +332 -0
- package/lib/core/es6/data/DataView.js +4144 -0
- package/lib/core/es6/data/Segment.d.ts +91 -0
- package/lib/core/es6/data/Segment.js +1001 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +84 -0
- package/lib/core/es6/data/SegmentCollection.js +713 -0
- package/lib/core/es6/data/WrappedView.d.ts +290 -0
- package/lib/core/es6/data/WrappedView.js +1320 -0
- package/lib/core/es6/grid/Core.d.ts +455 -0
- package/lib/core/es6/grid/Core.js +6196 -0
- package/lib/core/es6/grid/ILayoutGrid.d.ts +212 -0
- package/lib/core/es6/grid/ILayoutGrid.js +706 -0
- package/lib/core/es6/grid/LayoutGrid.d.ts +37 -0
- package/lib/core/es6/grid/LayoutGrid.js +2975 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +28 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +1241 -0
- package/lib/core/es6/grid/components/Cell.d.ts +52 -0
- package/lib/core/es6/grid/components/Cell.js +826 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +21 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.js +130 -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 +40 -0
- package/lib/core/es6/grid/components/CellSpans.js +368 -0
- package/lib/core/es6/grid/components/Column.d.ts +22 -0
- package/lib/core/es6/grid/components/Column.js +618 -0
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +127 -0
- package/lib/core/es6/grid/components/ElementWrapper.js +718 -0
- package/lib/core/es6/grid/components/HScrollbar.d.ts +28 -0
- package/lib/core/es6/grid/components/HScrollbar.js +241 -0
- package/lib/core/es6/grid/components/Scrollbar.d.ts +63 -0
- package/lib/core/es6/grid/components/Scrollbar.js +1413 -0
- package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
- package/lib/core/es6/grid/components/StretchedCells.js +342 -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 +166 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +155 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1977 -0
- package/lib/core/es6/grid/util/CellBoundPainter.d.ts +16 -0
- package/lib/core/es6/grid/util/CellBoundPainter.js +171 -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/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 +679 -0
- package/lib/core/es6/grid/util/SelectionList.d.ts +54 -0
- package/lib/core/es6/grid/util/SelectionList.js +491 -0
- package/lib/core/es6/grid/util/TrackLayout.d.ts +92 -0
- package/lib/core/es6/grid/util/TrackLayout.js +902 -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 +20 -0
- package/lib/core/es6/grid/util/util.js +391 -0
- package/lib/core/es6/index.d.ts +79 -0
- package/lib/core/es6/index.js +125 -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 +2 -0
- package/lib/filter-dialog/index.js +2 -0
- package/lib/filter-dialog/lib/checkbox-list.d.ts +52 -0
- package/lib/filter-dialog/lib/checkbox-list.js +444 -0
- package/lib/filter-dialog/lib/filter-dialog.d.ts +75 -0
- package/lib/filter-dialog/lib/filter-dialog.js +1160 -0
- package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-de.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-en.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-ja.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh.js +40 -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 +42 -0
- package/lib/filter-dialog/themes/base.less +191 -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 +15 -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 +20 -0
- package/lib/formatters/es6/CoralButtonFormatter.js +45 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.js +50 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.js +103 -0
- package/lib/formatters/es6/CoralIconFormatter.d.ts +21 -0
- package/lib/formatters/es6/CoralIconFormatter.js +50 -0
- package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralInputFormatter.js +45 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +20 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.js +85 -0
- package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralSelectFormatter.js +71 -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 +20 -0
- package/lib/formatters/es6/EFButtonFormatter.js +45 -0
- package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFCheckboxFormatter.js +50 -0
- package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFComboBoxFormatter.js +78 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.js +60 -0
- package/lib/formatters/es6/EFIconFormatter.d.ts +21 -0
- package/lib/formatters/es6/EFIconFormatter.js +50 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.js +45 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +20 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.js +132 -0
- package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFSelectFormatter.js +76 -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 +26 -0
- package/lib/formatters/es6/FormatterBuilder.js +493 -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 +23 -0
- package/lib/formatters/es6/SimpleTickerFormatter.js +66 -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 +35 -0
- package/lib/formatters/es6/index.d.ts +64 -0
- package/lib/formatters/es6/index.js +88 -0
- package/lib/grid/index.d.ts +2 -0
- package/lib/grid/index.js +3 -0
- package/lib/grid/lib/efx-grid.d.ts +53 -0
- package/lib/grid/lib/efx-grid.js +444 -0
- package/lib/grid/themes/base.less +137 -0
- package/lib/grid/themes/ds/dark/css/native-elements.css +0 -0
- package/lib/grid/themes/ds/dark/efx-grid.js +4 -0
- package/lib/grid/themes/ds/dark/es5/all-elements.js +2 -0
- package/lib/grid/themes/ds/dark/imports/all-elements.js +1 -0
- package/lib/grid/themes/ds/dark/imports/custom-elements.js +1 -0
- package/lib/grid/themes/ds/dark/imports/native-elements.js +0 -0
- package/lib/grid/themes/ds/dark.js +3 -0
- package/lib/grid/themes/ds/efx-grid.less +207 -0
- package/lib/grid/themes/ds/index.less +3 -0
- package/lib/grid/themes/ds/light/css/native-elements.css +0 -0
- package/lib/grid/themes/ds/light/efx-grid.js +4 -0
- package/lib/grid/themes/ds/light/es5/all-elements.js +2 -0
- package/lib/grid/themes/ds/light/imports/all-elements.js +1 -0
- package/lib/grid/themes/ds/light/imports/custom-elements.js +1 -0
- package/lib/grid/themes/ds/light/imports/native-elements.js +0 -0
- package/lib/grid/themes/ds/light.js +3 -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 +127 -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 +100 -0
- package/lib/index.js +100 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +115 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +1182 -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 +54547 -0
- package/lib/rt-grid/dist/rt-grid.min.js +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +174 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +1203 -0
- package/lib/rt-grid/es6/DataConnector.d.ts +43 -0
- package/lib/rt-grid/es6/DataConnector.js +290 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +40 -0
- package/lib/rt-grid/es6/FieldDefinition.js +560 -0
- package/lib/rt-grid/es6/Grid.d.ts +376 -0
- package/lib/rt-grid/es6/Grid.js +4653 -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 +40 -0
- package/lib/rt-grid/es6/ReferenceCounter.js +251 -0
- package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
- package/lib/rt-grid/es6/RowDefSorter.js +231 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +156 -0
- package/lib/rt-grid/es6/RowDefinition.js +1478 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +36 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +537 -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 +68 -0
- package/lib/statistics-row/es6/StatisticsRow.js +807 -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 +46 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +617 -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 +70 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1695 -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 +82 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1704 -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 +817 -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 +91 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +617 -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 +110 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +2028 -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 +1010 -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 +77 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +1405 -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 +160 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +2155 -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 +100 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1513 -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 +519 -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 +453 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +138 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +41 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.js +285 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +33 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.js +303 -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 +64 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.js +1027 -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 +45 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.js +401 -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 +148 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +2671 -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 +58 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +433 -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 +804 -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 +50 -0
- package/lib/tr-grid-printer/es6/CellWriter.js +234 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +13 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.js +23 -0
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +33 -0
- package/lib/tr-grid-printer/es6/GridPrinter.js +794 -0
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +39 -0
- package/lib/tr-grid-printer/es6/PrintTrait.js +494 -0
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +57 -0
- package/lib/tr-grid-printer/es6/SectionWriter.js +238 -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/LEDGuage.d.ts +39 -0
- package/lib/tr-grid-range-bar/es6/LEDGuage.js +261 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +56 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +514 -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 +81 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +1479 -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 +159 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +2568 -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 +123 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1728 -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 +75 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.js +1447 -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 +64 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +615 -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 +72 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +543 -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 +27 -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 +142 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1183 -0
- package/lib/tr-grid-util/es6/Color.d.ts +40 -0
- package/lib/tr-grid-util/es6/Color.js +210 -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 +16 -0
- package/lib/tr-grid-util/es6/Deferred.js +108 -0
- package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
- package/lib/tr-grid-util/es6/Delay.js +96 -0
- package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
- package/lib/tr-grid-util/es6/Dom.js +350 -0
- package/lib/tr-grid-util/es6/DragUI.d.ts +20 -0
- package/lib/tr-grid-util/es6/DragUI.js +263 -0
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +12 -0
- package/lib/tr-grid-util/es6/ElementObserver.js +134 -0
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
- package/lib/tr-grid-util/es6/ElementWrapper.js +84 -0
- package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
- package/lib/tr-grid-util/es6/ElfDate.js +164 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +46 -0
- package/lib/tr-grid-util/es6/ElfUtil.js +637 -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 +24 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.js +120 -0
- package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
- package/lib/tr-grid-util/es6/ExpressionParser.js +408 -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 +440 -0
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +54 -0
- package/lib/tr-grid-util/es6/FilterBuilder.js +580 -0
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +56 -0
- package/lib/tr-grid-util/es6/FilterOperators.js +255 -0
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +86 -0
- package/lib/tr-grid-util/es6/GridPlugin.js +1055 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +74 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.js +642 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
- package/lib/tr-grid-util/es6/Icon.js +62 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.js +250 -0
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +40 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +611 -0
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +85 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +528 -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 +163 -0
- package/lib/tr-grid-util/es6/Popup.d.ts +98 -0
- package/lib/tr-grid-util/es6/Popup.js +991 -0
- package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
- package/lib/tr-grid-util/es6/RangeBar.js +260 -0
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
- package/lib/tr-grid-util/es6/RequestQueue.js +228 -0
- package/lib/tr-grid-util/es6/RowPainter.d.ts +60 -0
- package/lib/tr-grid-util/es6/RowPainter.js +448 -0
- package/lib/tr-grid-util/es6/SubTable.d.ts +78 -0
- package/lib/tr-grid-util/es6/SubTable.js +642 -0
- package/lib/tr-grid-util/es6/Table.d.ts +146 -0
- package/lib/tr-grid-util/es6/Table.js +832 -0
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +16 -0
- package/lib/tr-grid-util/es6/TextHighlighter.js +268 -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 +66 -0
- package/lib/tr-grid-util/es6/Util.js +508 -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 +890 -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 +65 -0
- package/lib/tr-grid-util/es6/index.js +102 -0
- package/lib/tr-grid-util/es6/jet/Adc.d.ts +9 -0
- package/lib/tr-grid-util/es6/jet/Adc.js +268 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +151 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +136 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +860 -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 +71 -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 +82 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +890 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +48 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.js +82 -0
- package/lib/tr-grid-util/es6/jet/MockUtil.d.ts +7 -0
- package/lib/tr-grid-util/es6/jet/MockUtil.js +25 -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 +111 -0
- package/lib/tr-grid-util/es6/jsx.d.ts +223 -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 +46 -0
- package/lib/types/es6/CellSelection.d.ts +70 -0
- package/lib/types/es6/Checkbox.d.ts +82 -0
- package/lib/types/es6/ColumnDragging.d.ts +51 -0
- package/lib/types/es6/ColumnFitter.d.ts +56 -0
- package/lib/types/es6/ColumnFormatting.d.ts +92 -0
- package/lib/types/es6/ColumnGrouping.d.ts +107 -0
- package/lib/types/es6/ColumnResizing.d.ts +68 -0
- package/lib/types/es6/ColumnSelection.d.ts +77 -0
- package/lib/types/es6/ColumnStack.d.ts +160 -0
- package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +41 -0
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +289 -0
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +23 -0
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +41 -0
- package/lib/types/es6/CompositeGrid/Plugin.d.ts +30 -0
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +32 -0
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +44 -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 +100 -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 +20 -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 +21 -0
- package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/types/es6/CoralRadioButtonFormatter.d.ts +20 -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 +43 -0
- package/lib/types/es6/Core/data/DataTable.d.ts +156 -0
- package/lib/types/es6/Core/data/DataView.d.ts +332 -0
- package/lib/types/es6/Core/data/Segment.d.ts +91 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +84 -0
- package/lib/types/es6/Core/data/WrappedView.d.ts +290 -0
- package/lib/types/es6/Core/grid/Core.d.ts +455 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +212 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +37 -0
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +28 -0
- package/lib/types/es6/Core/grid/components/Cell.d.ts +52 -0
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +21 -0
- package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +40 -0
- package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +127 -0
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +28 -0
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +63 -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/SortableTitlePlugin.d.ts +155 -0
- package/lib/types/es6/Core/grid/util/CellBoundPainter.d.ts +16 -0
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -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 +54 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +92 -0
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
- package/lib/types/es6/Core/grid/util/util.d.ts +20 -0
- package/lib/types/es6/Core/index.d.ts +79 -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 +20 -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 +21 -0
- package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFRadioButtonFormatter.d.ts +20 -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 +58 -0
- package/lib/types/es6/Extensions.d.ts +63 -0
- package/lib/types/es6/FilterInput.d.ts +64 -0
- package/lib/types/es6/FormatterBuilder.d.ts +26 -0
- package/lib/types/es6/GridFormatter.d.ts +63 -0
- package/lib/types/es6/HeatMap.d.ts +45 -0
- package/lib/types/es6/InCellEditing.d.ts +148 -0
- package/lib/types/es6/MenuEventAPI.d.ts +22 -0
- package/lib/types/es6/MenuItem.d.ts +41 -0
- package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/types/es6/Pagination.d.ts +58 -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 +33 -0
- package/lib/types/es6/RangeBar.d.ts +39 -0
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +176 -0
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +43 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +40 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +413 -0
- package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +40 -0
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +156 -0
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +36 -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 +64 -0
- package/lib/types/es6/RowDragging.d.ts +81 -0
- package/lib/types/es6/RowFiltering.d.ts +159 -0
- package/lib/types/es6/RowGrouping.d.ts +123 -0
- package/lib/types/es6/RowSegmenting.d.ts +109 -0
- package/lib/types/es6/RowSelection.d.ts +75 -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 +23 -0
- package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/types/es6/StatisticsRow.d.ts +68 -0
- package/lib/types/es6/TextFormatter.d.ts +12 -0
- package/lib/types/es6/TextFormatting.d.ts +72 -0
- package/lib/types/es6/TitleWrap.d.ts +27 -0
- package/lib/types/es6/Zoom.d.ts +52 -0
- package/lib/types/es6/index.d.ts +80 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +7 -0
- package/lib/versions.json +37 -0
- package/lib/window-exporter.js +18 -0
- package/lib/zoom/es6/Zoom.d.ts +52 -0
- package/lib/zoom/es6/Zoom.js +438 -0
- package/lib/zoom/es6/index.d.ts +1 -0
- package/lib/zoom/es6/index.js +1 -0
- package/package.json +69 -0
@@ -0,0 +1,2028 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { GroupDefinitions } from "../../tr-grid-util/es6/GroupDefinitions.js";
|
4
|
+
import { cloneObject, injectCss, prettifyCss, deepEqual, isEmptyObject } from "../../tr-grid-util/es6/Util.js";
|
5
|
+
|
6
|
+
/** @typedef {Object} ColumnGroupingPlugin~Options
|
7
|
+
* @description This options can be specified by `columnGrouping` property of the main grid's options or extension options.
|
8
|
+
* @property {ColumnGroupingPlugin~GroupDefinitions} groupDefinitions A collection of group definition objects
|
9
|
+
* @property {number=} minChildCount=2 The minimum number of child columns required for group to be visible
|
10
|
+
*/
|
11
|
+
|
12
|
+
/** @typedef {Array<ColumnGroupingPlugin~GroupDefinition>} ColumnGroupingPlugin~GroupDefinitions
|
13
|
+
* @description A collection of group definition objects
|
14
|
+
*/
|
15
|
+
|
16
|
+
/** @typedef {Object} ColumnGroupingPlugin~GroupDefinition
|
17
|
+
* @description Definition object that defined relationship of its children and how to render its content
|
18
|
+
* @property {string} id Group id
|
19
|
+
* @property {string} name Display group name
|
20
|
+
* @property {(boolean|string)=} tooltip=true Show tooltip in column's header
|
21
|
+
* @property {Array.<string>} children Child member in this group
|
22
|
+
* @property {string=} alignment eg. left, center, right
|
23
|
+
* @property {Function=} render render function handler
|
24
|
+
* @property {string=} backgroundColor Background color of group header
|
25
|
+
*/
|
26
|
+
|
27
|
+
/** @constructor
|
28
|
+
* @extends {GridPlugin}
|
29
|
+
* @param {ColumnGroupingPlugin~Options=} options
|
30
|
+
*/
|
31
|
+
let ColumnGroupingPlugin = function (options) {
|
32
|
+
let t = this;
|
33
|
+
t._hosts = [];
|
34
|
+
|
35
|
+
t._onColumnChanged = t._onColumnChanged.bind(t);
|
36
|
+
t._onColumnAdded = t._onColumnAdded.bind(t);
|
37
|
+
t._onColumnMoved = t._onColumnMoved.bind(t);
|
38
|
+
t._onColumnRemoved = t._onColumnRemoved.bind(t);
|
39
|
+
t._requestApplyAddChildGroup = t._requestApplyAddChildGroup.bind(this);
|
40
|
+
t._onPostSectionRender = t._onPostSectionRender.bind(t);
|
41
|
+
t._onBeforeColumnBoundUpdate = t._onBeforeColumnBoundUpdate.bind(t);
|
42
|
+
|
43
|
+
t._groupDefs = new GroupDefinitions();
|
44
|
+
|
45
|
+
if(options) {
|
46
|
+
t.config({ "columnGrouping": options });
|
47
|
+
}
|
48
|
+
};
|
49
|
+
Ext.inherits(ColumnGroupingPlugin, GridPlugin);
|
50
|
+
|
51
|
+
/** @type {!GroupDefinitions}
|
52
|
+
* @description A map of group id to group defintion
|
53
|
+
* @private
|
54
|
+
*/
|
55
|
+
ColumnGroupingPlugin.prototype._groupDefs;
|
56
|
+
/** @type {!Object.<string, ColumnGroupingPlugin~GroupDefinition>}
|
57
|
+
* @description A map of visible group id to group defintion
|
58
|
+
* @private
|
59
|
+
*/
|
60
|
+
ColumnGroupingPlugin.prototype._visibleGroupMap;
|
61
|
+
/** @type {number}
|
62
|
+
* @private
|
63
|
+
*/
|
64
|
+
ColumnGroupingPlugin.prototype._maxDepth = 0;
|
65
|
+
/** @type {boolean}
|
66
|
+
* @private
|
67
|
+
*/
|
68
|
+
ColumnGroupingPlugin.prototype._restructuring = false;
|
69
|
+
/** @type {number}
|
70
|
+
* @private
|
71
|
+
*/
|
72
|
+
ColumnGroupingPlugin.prototype._rerenderTimerId = 0;
|
73
|
+
/** @type {number}
|
74
|
+
* @private
|
75
|
+
*/
|
76
|
+
ColumnGroupingPlugin.prototype._groupHeaderTimerId = 0;
|
77
|
+
/** @type {number}
|
78
|
+
* @private
|
79
|
+
*/
|
80
|
+
ColumnGroupingPlugin.prototype._addingTimerId = 0;
|
81
|
+
/** @type {Array}
|
82
|
+
* @private
|
83
|
+
*/
|
84
|
+
ColumnGroupingPlugin.prototype._addingEvents = null;
|
85
|
+
/** @type {Object}
|
86
|
+
* @private
|
87
|
+
*/
|
88
|
+
ColumnGroupingPlugin.prototype._legacyColumnGroups = null;
|
89
|
+
/** @type {!Object.<string, boolean>}
|
90
|
+
* @description A map of selected groups
|
91
|
+
* @private
|
92
|
+
*/
|
93
|
+
ColumnGroupingPlugin.prototype._selectedColMap;
|
94
|
+
/** @type {number}
|
95
|
+
* @private
|
96
|
+
*/
|
97
|
+
ColumnGroupingPlugin.prototype._minChildCount = 2;
|
98
|
+
|
99
|
+
/** @private
|
100
|
+
* @param {number} a
|
101
|
+
* @param {number} b
|
102
|
+
* @return {number}
|
103
|
+
*/
|
104
|
+
ColumnGroupingPlugin._ascSortLogic = function(a, b) {
|
105
|
+
return a - b;
|
106
|
+
};
|
107
|
+
/** @private
|
108
|
+
* @param {ColumnGroupingPlugin~GroupDefinition} groupingOptions
|
109
|
+
* @return {string}
|
110
|
+
*/
|
111
|
+
ColumnGroupingPlugin._getTooltip = function(groupingOptions) {
|
112
|
+
let tooltip = groupingOptions["tooltip"];
|
113
|
+
let title = groupingOptions["title"] || groupingOptions["name"];
|
114
|
+
if(tooltip != null) {
|
115
|
+
if(typeof tooltip === "string") {
|
116
|
+
return tooltip; // There is a custom tooltip
|
117
|
+
} else if(tooltip === true) {
|
118
|
+
return title;
|
119
|
+
} else if(tooltip === false) {
|
120
|
+
return "";
|
121
|
+
}
|
122
|
+
}
|
123
|
+
return title;
|
124
|
+
};
|
125
|
+
/** @private
|
126
|
+
* @function
|
127
|
+
* @param {Object} groupDef
|
128
|
+
* @return {boolean}
|
129
|
+
*/
|
130
|
+
ColumnGroupingPlugin._hasGroupId = function(groupDef) {
|
131
|
+
if(groupDef) {
|
132
|
+
if(groupDef.id) {
|
133
|
+
return true;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
return false;
|
137
|
+
};
|
138
|
+
|
139
|
+
/** @private
|
140
|
+
* @function
|
141
|
+
* @param {Array|Object} obj
|
142
|
+
* @param {string=} groupId
|
143
|
+
* @return {ColumnGroupingPlugin~GroupDefinition}
|
144
|
+
*/
|
145
|
+
ColumnGroupingPlugin._toGroupDefinition = function(obj, groupId) {
|
146
|
+
let groupDef = null;
|
147
|
+
if(obj) {
|
148
|
+
if(Array.isArray(obj)) {
|
149
|
+
groupDef = {
|
150
|
+
children: obj
|
151
|
+
};
|
152
|
+
} else {
|
153
|
+
groupDef = ColumnGroupingPlugin._cloneObject(obj);
|
154
|
+
}
|
155
|
+
if(groupId) {
|
156
|
+
if(!groupDef.id) {
|
157
|
+
groupDef.name = groupId;
|
158
|
+
}
|
159
|
+
groupDef.id = groupId;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
return groupDef;
|
163
|
+
};
|
164
|
+
/** @private
|
165
|
+
* @function
|
166
|
+
* @param {Object} obj
|
167
|
+
* @return {Object}
|
168
|
+
*/
|
169
|
+
ColumnGroupingPlugin._cloneObject = function(obj) {
|
170
|
+
let newObj = cloneObject(obj);
|
171
|
+
if(!Array.isArray(newObj.children)) {
|
172
|
+
newObj.children = [];
|
173
|
+
}
|
174
|
+
return newObj;
|
175
|
+
};
|
176
|
+
/** Flatten tree structure to simple dictionary
|
177
|
+
* @private
|
178
|
+
* @function
|
179
|
+
* @param {ColumnGroupingPlugin~GroupDefinitions} groupDefs
|
180
|
+
*/
|
181
|
+
ColumnGroupingPlugin._flattenGroupDefs = function(groupDefs) {
|
182
|
+
let grpCount = groupDefs ? groupDefs.length : 0;
|
183
|
+
for(let i = 0; i < grpCount; i++) {
|
184
|
+
ColumnGroupingPlugin._recursivelyFlatten(groupDefs[i], groupDefs);
|
185
|
+
}
|
186
|
+
};
|
187
|
+
/** Flatten group definition structure by using group ID instead of nested group definitions.
|
188
|
+
* @private
|
189
|
+
* @function
|
190
|
+
* @param {Object} groupDef
|
191
|
+
* @param {Array} groupDefs
|
192
|
+
*/
|
193
|
+
ColumnGroupingPlugin._recursivelyFlatten = function (groupDef, groupDefs) {
|
194
|
+
if(groupDef && groupDef.children) {
|
195
|
+
let children = groupDef.children;
|
196
|
+
let member, groupId;
|
197
|
+
for(let i = 0; i < children.length; i++) {
|
198
|
+
member = children[i];
|
199
|
+
if(typeof member !== "string") { // member is nested group definition
|
200
|
+
groupId = member.id;
|
201
|
+
if(groupId) {
|
202
|
+
children[i] = groupId; // Use group ID instead of nested group definition
|
203
|
+
if(groupDefs.indexOf(member) < 0) {
|
204
|
+
groupDefs.push(member);
|
205
|
+
}
|
206
|
+
ColumnGroupingPlugin._recursivelyFlatten(member, groupDefs);
|
207
|
+
}
|
208
|
+
} // TODO: Invalid group is not flatten
|
209
|
+
}
|
210
|
+
}
|
211
|
+
};
|
212
|
+
|
213
|
+
/** Filter time series group out
|
214
|
+
* @private
|
215
|
+
* @param {Object} groupDef
|
216
|
+
* @return {boolean}
|
217
|
+
*/
|
218
|
+
ColumnGroupingPlugin._isNotTimeSeriesGroup = function (groupDef) {
|
219
|
+
return groupDef.timeSeriesGroup ? false : true;
|
220
|
+
};
|
221
|
+
|
222
|
+
/** @public
|
223
|
+
* @return {string}
|
224
|
+
*/
|
225
|
+
ColumnGroupingPlugin.prototype.getName = function () {
|
226
|
+
return "ColumnGroupingPlugin"; // Read Only
|
227
|
+
};
|
228
|
+
/**
|
229
|
+
* @override
|
230
|
+
* @return {boolean}
|
231
|
+
*/
|
232
|
+
ColumnGroupingPlugin.prototype.hasMultiTableSupport = function() {
|
233
|
+
return true;
|
234
|
+
};
|
235
|
+
|
236
|
+
/** @public
|
237
|
+
* @param {Object} host core grid object
|
238
|
+
* @param {Object=} options
|
239
|
+
*/
|
240
|
+
ColumnGroupingPlugin.prototype.initialize = function (host, options) {
|
241
|
+
if(this._hosts.indexOf(host) >= 0) { return; }
|
242
|
+
this._hosts.push(host);
|
243
|
+
if(typeof host.setColumnGrouping === "function") {
|
244
|
+
host.setColumnGrouping(this._groupDefs);
|
245
|
+
}
|
246
|
+
|
247
|
+
if(!this._addingEvents) {
|
248
|
+
this._addingEvents = [];
|
249
|
+
}
|
250
|
+
|
251
|
+
if(this._hosts.length === 1) {
|
252
|
+
host.listen("columnAdded", this._onColumnAdded);
|
253
|
+
host.listen("columnMoved", this._onColumnMoved);
|
254
|
+
host.listen("columnRemoved", this._onColumnRemoved);
|
255
|
+
host.listen("columnVisibilityChanged", this._onColumnChanged);
|
256
|
+
host.listen("postSectionRender", this._onPostSectionRender);
|
257
|
+
host.listen("beforeColumnBoundUpdate", this._onBeforeColumnBoundUpdate);
|
258
|
+
}
|
259
|
+
this.config(options);
|
260
|
+
this._legacyColumnGroups = null;
|
261
|
+
|
262
|
+
if(this._initializedGrid && host.getSection("title")) { // For run-time loading
|
263
|
+
this._applyGrouping();
|
264
|
+
}
|
265
|
+
|
266
|
+
if(!ColumnGroupingPlugin._styles) {
|
267
|
+
ColumnGroupingPlugin._styles = prettifyCss([
|
268
|
+
".tr-grid .title .column .cell:not(:last-child)", [
|
269
|
+
"box-shadow: none;"
|
270
|
+
]
|
271
|
+
]);
|
272
|
+
}
|
273
|
+
|
274
|
+
if(!host._columnGroupingStyles){
|
275
|
+
host._columnGroupingStyles = true;
|
276
|
+
injectCss(ColumnGroupingPlugin._styles, host.getElement());
|
277
|
+
}
|
278
|
+
};
|
279
|
+
/** Prevent built-in config
|
280
|
+
* @public
|
281
|
+
* @param {string} optionName
|
282
|
+
* @param {Object} optionValue
|
283
|
+
* @return {*}
|
284
|
+
*/
|
285
|
+
ColumnGroupingPlugin.prototype.beforeProcessOption = function (optionName, optionValue) {
|
286
|
+
if(optionName === "columnGroups") {
|
287
|
+
this._legacyColumnGroups = optionValue;
|
288
|
+
return false; // eslint-disable-line
|
289
|
+
}
|
290
|
+
return; // eslint-disable-line
|
291
|
+
};
|
292
|
+
/**
|
293
|
+
* @protected
|
294
|
+
* @ignore
|
295
|
+
*/
|
296
|
+
ColumnGroupingPlugin.prototype._afterInit = function() {
|
297
|
+
this._applyGrouping();
|
298
|
+
};
|
299
|
+
/** @public
|
300
|
+
* @param {Object} host core grid object
|
301
|
+
*/
|
302
|
+
ColumnGroupingPlugin.prototype.unload = function (host) {
|
303
|
+
let at = this._hosts.indexOf(host);
|
304
|
+
if(at < 0) { return; }
|
305
|
+
this._hosts.splice(at, 1);
|
306
|
+
if(typeof host.setColumnGrouping === "function") {
|
307
|
+
host.setColumnGrouping(null);
|
308
|
+
}
|
309
|
+
|
310
|
+
host.unlisten("columnAdded", this._onColumnChanged);
|
311
|
+
host.unlisten("columnMoved", this._onColumnMoved);
|
312
|
+
host.unlisten("columnRemoved", this._onColumnRemoved);
|
313
|
+
host.unlisten("postSectionRender", this._onPostSectionRender);
|
314
|
+
host.unlisten("beforeColumnBoundUpdate", this._onBeforeColumnBoundUpdate);
|
315
|
+
|
316
|
+
if(!this._hosts.length) {
|
317
|
+
if(this._rerenderTimerId){
|
318
|
+
clearTimeout(this._rerenderTimerId);
|
319
|
+
this._rerenderTimerId = 0;
|
320
|
+
}
|
321
|
+
if(this._groupHeaderTimerId){
|
322
|
+
clearTimeout(this._groupHeaderTimerId);
|
323
|
+
this._groupHeaderTimerId = 0;
|
324
|
+
}
|
325
|
+
if(this._addingTimerId) {
|
326
|
+
clearTimeout(this._addingTimerId);
|
327
|
+
this._addingTimerId = 0;
|
328
|
+
this._addingEvents.length = 0;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
this._dispose();
|
333
|
+
};
|
334
|
+
/** @public
|
335
|
+
* @param {Object} options
|
336
|
+
*/
|
337
|
+
ColumnGroupingPlugin.prototype.config = function (options) {
|
338
|
+
if(!options) { return; }
|
339
|
+
|
340
|
+
let extOptions = options["columnGrouping"];
|
341
|
+
let groupDefs = null;
|
342
|
+
if(Array.isArray(extOptions)) {
|
343
|
+
groupDefs = extOptions;
|
344
|
+
} else if(typeof extOptions === "object") {
|
345
|
+
groupDefs = extOptions["groupDefinitions"];
|
346
|
+
let minChildCount = extOptions["minChildCount"];
|
347
|
+
if(typeof minChildCount === "number" && minChildCount > 0) {
|
348
|
+
this._minChildCount = minChildCount;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
|
352
|
+
if(groupDefs) {
|
353
|
+
groupDefs = groupDefs.filter(ColumnGroupingPlugin._hasGroupId);
|
354
|
+
groupDefs = groupDefs.map(ColumnGroupingPlugin._cloneObject);
|
355
|
+
}
|
356
|
+
|
357
|
+
let columns = options["columns"];
|
358
|
+
if(columns) {
|
359
|
+
groupDefs = this._migrateLegacyStructure(groupDefs, columns);
|
360
|
+
}
|
361
|
+
|
362
|
+
if(groupDefs) {
|
363
|
+
ColumnGroupingPlugin._flattenGroupDefs(groupDefs);
|
364
|
+
this._groupDefs.setGroups(groupDefs);
|
365
|
+
}
|
366
|
+
};
|
367
|
+
/** @public
|
368
|
+
* @param {Object=} gridOptions
|
369
|
+
* @return {!Object}
|
370
|
+
*/
|
371
|
+
ColumnGroupingPlugin.prototype.getConfigObject = function (gridOptions) {
|
372
|
+
let obj = gridOptions || {};
|
373
|
+
|
374
|
+
let extOptions = {};
|
375
|
+
|
376
|
+
// TODO: Handle legacyRender method that has been migrated
|
377
|
+
let groupDefs = this.getGroupDefinitions();
|
378
|
+
groupDefs = groupDefs.filter(ColumnGroupingPlugin._isNotTimeSeriesGroup);
|
379
|
+
if(groupDefs.length) {
|
380
|
+
extOptions.groupDefinitions = groupDefs;
|
381
|
+
}
|
382
|
+
|
383
|
+
if(this._minChildCount !== 2) {
|
384
|
+
extOptions.minChildCount = this._minChildCount;
|
385
|
+
}
|
386
|
+
|
387
|
+
if(!isEmptyObject(extOptions)) {
|
388
|
+
let extUserOptions = obj.columnGrouping;
|
389
|
+
if(extUserOptions != null && typeof extUserOptions === "object") {
|
390
|
+
Object.assign(extUserOptions, extOptions);
|
391
|
+
} else {
|
392
|
+
obj.columnGrouping = extOptions;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
|
396
|
+
return obj;
|
397
|
+
};
|
398
|
+
|
399
|
+
/** @private
|
400
|
+
* @param {Object.<string, Array>} objMap
|
401
|
+
* @param {string} parentId
|
402
|
+
* @param {string} childId
|
403
|
+
* @return {boolean} Returns true if there is any change
|
404
|
+
*/
|
405
|
+
ColumnGroupingPlugin._mapParentToChildren = function (objMap, parentId, childId) {
|
406
|
+
if(parentId && childId) {
|
407
|
+
let ary = objMap[parentId];
|
408
|
+
if(!ary) {
|
409
|
+
ary = objMap[parentId] = [];
|
410
|
+
}
|
411
|
+
ary.push(childId);
|
412
|
+
return true;
|
413
|
+
}
|
414
|
+
return false;
|
415
|
+
};
|
416
|
+
/** Legacy group structure from composite grid will be converted to the new structure
|
417
|
+
* @private
|
418
|
+
* @param {ColumnGroupingPlugin~GroupDefinitions} groupDefs
|
419
|
+
* @param {Array} colModels
|
420
|
+
* @return {ColumnGroupingPlugin~GroupDefinitions}
|
421
|
+
*/
|
422
|
+
ColumnGroupingPlugin.prototype._migrateLegacyStructure = function (groupDefs, colModels) {
|
423
|
+
let legacyColumnGroups = this._legacyColumnGroups;
|
424
|
+
if(!legacyColumnGroups || !this._compositeGrid) {
|
425
|
+
return groupDefs;
|
426
|
+
}
|
427
|
+
if(!groupDefs) {
|
428
|
+
groupDefs = [];
|
429
|
+
}
|
430
|
+
|
431
|
+
// Collecting parent groups from col models (leaf node)
|
432
|
+
let colCount = colModels.length;
|
433
|
+
let groupMap = {}; // Parent-children pair map
|
434
|
+
for(let c = 0; c < colCount; ++c) {
|
435
|
+
let colModel = colModels[c];
|
436
|
+
if(colModel) {
|
437
|
+
ColumnGroupingPlugin._mapParentToChildren(
|
438
|
+
groupMap, colModel.columnGroup, colModel.id
|
439
|
+
);
|
440
|
+
}
|
441
|
+
}
|
442
|
+
// Collecting parent groups from the group list (groups can have parent as well)
|
443
|
+
let groupCount = legacyColumnGroups.length;
|
444
|
+
let i, groupDef;
|
445
|
+
for(i = 0; i < groupCount; ++i) {
|
446
|
+
groupDef = legacyColumnGroups[i];
|
447
|
+
if(groupDef) {
|
448
|
+
ColumnGroupingPlugin._mapParentToChildren(
|
449
|
+
groupMap, groupDef.parent, groupDef.id
|
450
|
+
);
|
451
|
+
}
|
452
|
+
}
|
453
|
+
// TODO: Merge child relationship to existing group structure
|
454
|
+
|
455
|
+
// Add new definitions and structure to the given legacy objects
|
456
|
+
for(i = 0; i < groupCount; ++i) {
|
457
|
+
groupDef = ColumnGroupingPlugin._cloneObject(legacyColumnGroups[i]);
|
458
|
+
if(groupDef && groupDef.id) {
|
459
|
+
// WARNING: Modify user's object
|
460
|
+
let childAry = groupMap[groupDef.id];
|
461
|
+
groupDef.children = childAry ? childAry : [];
|
462
|
+
|
463
|
+
if(groupDef["formatter"] && groupDef["formatter"]["render"]) {
|
464
|
+
groupDef["legacyRender"] = groupDef["formatter"]["render"];
|
465
|
+
delete groupDef["formatter"];
|
466
|
+
}
|
467
|
+
|
468
|
+
groupDefs.push(groupDef);
|
469
|
+
}
|
470
|
+
}
|
471
|
+
|
472
|
+
return groupDefs.filter(ColumnGroupingPlugin._hasGroupId);
|
473
|
+
};
|
474
|
+
/** @private
|
475
|
+
* @param {number} frozenColIndex
|
476
|
+
* @param {number=} numRightColumn
|
477
|
+
*/
|
478
|
+
ColumnGroupingPlugin.prototype._freezeColumn = function(frozenColIndex, numRightColumn) {
|
479
|
+
let hosts = this._hosts;
|
480
|
+
for(let i = 0; i < hosts.length; i++) {
|
481
|
+
hosts[i].freezeColumn(frozenColIndex, numRightColumn);
|
482
|
+
}
|
483
|
+
};
|
484
|
+
/** @private
|
485
|
+
*/
|
486
|
+
ColumnGroupingPlugin.prototype._applyPinning = function() {
|
487
|
+
let colCount = this.getColumnCount();
|
488
|
+
let columnIds = this.getColumnIds();
|
489
|
+
let leftPinnedIndex = this._hosts[0].getFrozenColumnCount() - 1;
|
490
|
+
let rightPinnedIndex = this._hosts[0].getFirstPinnedRightIndex();
|
491
|
+
let i, groupId, groupDef;
|
492
|
+
let dirty = false;
|
493
|
+
for(i = colCount; i > leftPinnedIndex; i--) {
|
494
|
+
groupId = this._groupDefs.getParentId(columnIds[i]);
|
495
|
+
groupDef = this._visibleGroupMap[groupId];
|
496
|
+
if(groupDef && groupDef.leftPinned) {
|
497
|
+
leftPinnedIndex = i;
|
498
|
+
dirty = true;
|
499
|
+
break;
|
500
|
+
}
|
501
|
+
}
|
502
|
+
|
503
|
+
for(i = leftPinnedIndex; i < rightPinnedIndex; i++) {
|
504
|
+
groupId = this._groupDefs.getParentId(columnIds[i]);
|
505
|
+
groupDef = this._visibleGroupMap[groupId];
|
506
|
+
if(groupDef && groupDef.rightPinned) {
|
507
|
+
rightPinnedIndex = i;
|
508
|
+
dirty = true;
|
509
|
+
break;
|
510
|
+
}
|
511
|
+
}
|
512
|
+
if(dirty) {
|
513
|
+
let rightPinnedCount = colCount - rightPinnedIndex;
|
514
|
+
this._freezeColumn(leftPinnedIndex, rightPinnedCount);
|
515
|
+
}
|
516
|
+
};
|
517
|
+
/** Consolidate and process configuration. Force rerendering on column adding, removing, moving, initializaing, and run-time API execution.
|
518
|
+
* @private
|
519
|
+
*/
|
520
|
+
ColumnGroupingPlugin.prototype._applyGrouping = function () {
|
521
|
+
this._rerenderTimerId = 0;
|
522
|
+
if(this._restructuring) {
|
523
|
+
return;
|
524
|
+
}
|
525
|
+
this._restructuring = true;
|
526
|
+
|
527
|
+
this._evaluateGroupStructure();
|
528
|
+
|
529
|
+
// Apply column pinning
|
530
|
+
this._applyPinning();
|
531
|
+
|
532
|
+
let i, c, r, cell, section, colCount;
|
533
|
+
let rowCount = this._maxDepth + 1;
|
534
|
+
let hostCount = this._hosts.length;
|
535
|
+
for(i = hostCount; --i >= 0;) {
|
536
|
+
let host = this._hosts[i];
|
537
|
+
section = host.getSection("title");
|
538
|
+
if(section) {
|
539
|
+
section.setRowCount(rowCount); // This will cause postSectionRender event to be fired
|
540
|
+
section.clearCellSpans();
|
541
|
+
|
542
|
+
// Remove additional cell settings from _renderGroups() method
|
543
|
+
colCount = section.getColumnCount();
|
544
|
+
for(c = 0; c < colCount; c++) {
|
545
|
+
for(r = 0; r < rowCount; r++) {
|
546
|
+
cell = section.getCell(c, r, false);
|
547
|
+
if(cell) {
|
548
|
+
// TODO: The style and class from the user will not be reset, for example, the color or background
|
549
|
+
cell.removeClass("no-sort");
|
550
|
+
cell.removeClass("selected-group");
|
551
|
+
cell.removeAttribute("group-id");
|
552
|
+
cell.setTooltipInfo("groupHeaderDefault", false);
|
553
|
+
cell.setTooltipInfo("groupHeaderTooltip", null);
|
554
|
+
cell.updateTooltip();
|
555
|
+
}
|
556
|
+
}
|
557
|
+
}
|
558
|
+
if(host.applyColumnsBackgroundColor) {
|
559
|
+
host.applyColumnsBackgroundColor(section);
|
560
|
+
}
|
561
|
+
|
562
|
+
this._spanGroupVertically(section);
|
563
|
+
// TODO: Some calculation in here should not be done in this loop
|
564
|
+
this._spanGroupHorizontally(section);
|
565
|
+
}
|
566
|
+
}
|
567
|
+
|
568
|
+
this._restructuring = false;
|
569
|
+
|
570
|
+
// Request re-rendering
|
571
|
+
for(i = hostCount; --i >= 0;) {
|
572
|
+
let settings = this._hosts[i].getSectionSettings("title");
|
573
|
+
if(settings) {
|
574
|
+
settings.rerender();
|
575
|
+
}
|
576
|
+
}
|
577
|
+
};
|
578
|
+
|
579
|
+
/** @private
|
580
|
+
*/
|
581
|
+
ColumnGroupingPlugin.prototype._evaluateGroupStructure = function () {
|
582
|
+
// Clone group definitions for rendering
|
583
|
+
let visibleGroupMap = this._visibleGroupMap = this._groupDefs.cloneGroupMap();
|
584
|
+
|
585
|
+
this._verifySingleChild(visibleGroupMap);
|
586
|
+
this._verifyColumnPinning(visibleGroupMap);
|
587
|
+
|
588
|
+
// Update depth (onRow) and parentId
|
589
|
+
let maxDepth = this._maxDepth = -1;
|
590
|
+
for(let groupId in visibleGroupMap) {
|
591
|
+
let groupDef = visibleGroupMap[groupId];
|
592
|
+
|
593
|
+
let parentId = groupDef.parentId;
|
594
|
+
if(parentId) {
|
595
|
+
if(!visibleGroupMap[parentId]) {
|
596
|
+
groupDef.parentId = ""; // Parent has been removed from visible view
|
597
|
+
}
|
598
|
+
}
|
599
|
+
|
600
|
+
let depth = GroupDefinitions.calcTreeDepth(visibleGroupMap, groupDef);
|
601
|
+
groupDef["onRow"] = depth;
|
602
|
+
if(depth > maxDepth) {
|
603
|
+
maxDepth = depth;
|
604
|
+
}
|
605
|
+
}
|
606
|
+
|
607
|
+
this._maxDepth = maxDepth + 1; // Column header depth = maximum group depth + 1
|
608
|
+
};
|
609
|
+
|
610
|
+
/** Add pinning state to group definition for further verification.
|
611
|
+
* @private
|
612
|
+
* @param {Object} groupDef
|
613
|
+
* @param {string} side
|
614
|
+
*/
|
615
|
+
ColumnGroupingPlugin.prototype._setGroupPinning = function(groupDef, side) {
|
616
|
+
if(!groupDef || groupDef.leftPinned || groupDef.rightPinned) {
|
617
|
+
return;
|
618
|
+
}
|
619
|
+
|
620
|
+
if(side === "left") {
|
621
|
+
groupDef.leftPinned = true;
|
622
|
+
} else {
|
623
|
+
groupDef.rightPinned = true;
|
624
|
+
}
|
625
|
+
|
626
|
+
let children = groupDef["children"];
|
627
|
+
for(let i = 0; i < children.length; i++){
|
628
|
+
let child = children[i];
|
629
|
+
let group = this._visibleGroupMap[child];
|
630
|
+
if(group) {
|
631
|
+
this._setGroupPinning(group, side);
|
632
|
+
}
|
633
|
+
}
|
634
|
+
};
|
635
|
+
|
636
|
+
/** @private
|
637
|
+
* @param {Object} groupMap
|
638
|
+
*/
|
639
|
+
ColumnGroupingPlugin.prototype._verifyColumnPinning = function(groupMap) {
|
640
|
+
let host = this._hosts[0];
|
641
|
+
let leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
642
|
+
let rightPinnedIndex = host.getFirstPinnedRightIndex();
|
643
|
+
let colCount = this.getColumnCount();
|
644
|
+
|
645
|
+
let i, groupId, rootGroup, colId;
|
646
|
+
let groupDefs = this._groupDefs;
|
647
|
+
let visibleGroupMap = this._visibleGroupMap;
|
648
|
+
if(leftPinnedIndex >= 0) {
|
649
|
+
for(i = leftPinnedIndex; i >= 0; i--) {
|
650
|
+
colId = this.getColumnId(i);
|
651
|
+
groupId = groupDefs.getParentId(colId);
|
652
|
+
if(groupId && visibleGroupMap[groupId]) {
|
653
|
+
rootGroup = groupDefs.getRootGroup(groupId);
|
654
|
+
if(rootGroup) {
|
655
|
+
this._setGroupPinning(visibleGroupMap[rootGroup["id"]], "left");
|
656
|
+
}
|
657
|
+
}
|
658
|
+
}
|
659
|
+
}
|
660
|
+
|
661
|
+
if(rightPinnedIndex < colCount) {
|
662
|
+
for(i = rightPinnedIndex; i < colCount; i++) {
|
663
|
+
colId = this.getColumnId(i);
|
664
|
+
groupId = groupDefs.getParentId(colId);
|
665
|
+
if(groupId && visibleGroupMap[groupId]) {
|
666
|
+
rootGroup = groupDefs.getRootGroup(groupId);
|
667
|
+
if(rootGroup) {
|
668
|
+
this._setGroupPinning(visibleGroupMap[rootGroup["id"]], "right");
|
669
|
+
}
|
670
|
+
}
|
671
|
+
}
|
672
|
+
}
|
673
|
+
};
|
674
|
+
/** @private
|
675
|
+
* @param {Object} groupMap
|
676
|
+
*/
|
677
|
+
ColumnGroupingPlugin.prototype._verifySingleChild = function(groupMap) {
|
678
|
+
let api = this.getGridApi();
|
679
|
+
if(!api) {
|
680
|
+
return;
|
681
|
+
}
|
682
|
+
let core = this._hosts[0];
|
683
|
+
let colCount = this.getColumnCount();
|
684
|
+
let validIds = {};
|
685
|
+
|
686
|
+
let i, j;
|
687
|
+
// initialize a map for all valid and hidden ids of groups and columns
|
688
|
+
for(i = 0; i < colCount; i++){
|
689
|
+
let colId = this.getColumnId(i);
|
690
|
+
if(colId){
|
691
|
+
if(core.isColumnVisible(i)){
|
692
|
+
validIds[colId] = 1;
|
693
|
+
}
|
694
|
+
}
|
695
|
+
}
|
696
|
+
|
697
|
+
let groupIds = Object.keys(groupMap);
|
698
|
+
let groupCount = groupIds.length;
|
699
|
+
for(i = 0; i < groupCount; i++){
|
700
|
+
validIds[groupIds[i]] = 1;
|
701
|
+
}
|
702
|
+
|
703
|
+
let minChildCount = this._minChildCount;
|
704
|
+
let removable = true;
|
705
|
+
while(removable){
|
706
|
+
removable = false;
|
707
|
+
for(i = 0; i < groupCount; i++){
|
708
|
+
let groupId = groupIds[i];
|
709
|
+
let group = groupMap[groupId];
|
710
|
+
if(!group){
|
711
|
+
continue;
|
712
|
+
}
|
713
|
+
|
714
|
+
let children = group["children"];
|
715
|
+
let childCount = children.length;
|
716
|
+
let validChildren = [];
|
717
|
+
for(j = 0; j < childCount; j++){
|
718
|
+
let child = children[j];
|
719
|
+
if(validIds[child]){
|
720
|
+
validChildren.push(child);
|
721
|
+
}
|
722
|
+
}
|
723
|
+
|
724
|
+
if(validChildren.length < minChildCount) {
|
725
|
+
delete groupMap[groupId];
|
726
|
+
validIds[groupId] = 0;
|
727
|
+
removable = true;
|
728
|
+
} else {
|
729
|
+
group.children = validChildren;
|
730
|
+
}
|
731
|
+
}
|
732
|
+
}
|
733
|
+
};
|
734
|
+
|
735
|
+
/** Set a timer to call applyGrouping only once to avoid performance issue
|
736
|
+
* @private
|
737
|
+
*/
|
738
|
+
ColumnGroupingPlugin.prototype._requestApplyGrouping = function() {
|
739
|
+
if(!this._rerenderTimerId) {
|
740
|
+
this._rerenderTimerId = setTimeout(this._applyGrouping.bind(this), 10);
|
741
|
+
}
|
742
|
+
};
|
743
|
+
/** Set a timer to call renderGroups only once to avoid performance issue
|
744
|
+
* @private
|
745
|
+
*/
|
746
|
+
ColumnGroupingPlugin.prototype._requestGroupRendering = function() {
|
747
|
+
if(!this._groupHeaderTimerId) {
|
748
|
+
this._groupHeaderTimerId = setTimeout(this.renderGroups.bind(this), 10);
|
749
|
+
}
|
750
|
+
};
|
751
|
+
/** Apply nearest grouping to column.
|
752
|
+
* @private
|
753
|
+
* @param {number} colIndex
|
754
|
+
*/
|
755
|
+
ColumnGroupingPlugin.prototype._applyNearestGrouping = function (colIndex) {
|
756
|
+
if(colIndex == null || colIndex < 0 ){
|
757
|
+
return;
|
758
|
+
}
|
759
|
+
|
760
|
+
let colId = this.getColumnId(colIndex);
|
761
|
+
let colIndexLeft = colIndex - 1;
|
762
|
+
let colIndexRight = colIndex + 1;
|
763
|
+
|
764
|
+
let groupLeftIds = this.getGroupIds(colIndexLeft);
|
765
|
+
let groupRightIds = this.getGroupIds(colIndexRight);
|
766
|
+
let groupLeftCount = groupLeftIds ? groupLeftIds.length : 0;
|
767
|
+
let groupRightCount = groupRightIds ? groupRightIds.length : 0;
|
768
|
+
|
769
|
+
let parentId = this._groupDefs.getParentId(colId);
|
770
|
+
if(parentId) {
|
771
|
+
let chdr = this._groupDefs.getGroupChildren(parentId);
|
772
|
+
let childCount = chdr ? chdr.length : 0;
|
773
|
+
if(childCount <= 1) { // If current column is only child in the group
|
774
|
+
return; // there is no need to put column into another group because its parent group will be moved along
|
775
|
+
}
|
776
|
+
|
777
|
+
// If current column has a group and stays close to its siblings, it stay in the same group
|
778
|
+
if(groupLeftCount) {
|
779
|
+
if(groupLeftIds[0] === parentId) {
|
780
|
+
return;
|
781
|
+
}
|
782
|
+
}
|
783
|
+
if(groupRightCount) {
|
784
|
+
if(groupRightIds[0] === parentId) {
|
785
|
+
return;
|
786
|
+
}
|
787
|
+
}
|
788
|
+
// The current column is no longer close to its parent
|
789
|
+
if(this._groupDefs.unsetParent(colId)) {
|
790
|
+
chdr = this._groupDefs.getGroupChildren(parentId);
|
791
|
+
childCount = chdr ? chdr.length : 0;
|
792
|
+
if(childCount === 1) { // If there is only one child left, move the remaning child to its parent
|
793
|
+
let grandParentId = this._groupDefs.getParentId(parentId);
|
794
|
+
if(grandParentId) {
|
795
|
+
this._groupDefs.addGroupChild(grandParentId, chdr[0]);
|
796
|
+
}
|
797
|
+
}
|
798
|
+
}
|
799
|
+
}
|
800
|
+
|
801
|
+
if(groupLeftCount && groupRightCount) {
|
802
|
+
for(let i = 0; i < groupLeftCount; i++) {
|
803
|
+
let groupLeftId = groupLeftIds[i];
|
804
|
+
let sharedParentIdx = groupRightIds.indexOf(groupLeftId);
|
805
|
+
if(sharedParentIdx >= 0) {
|
806
|
+
this._groupDefs.addGroupChild(groupRightIds[sharedParentIdx], colId);
|
807
|
+
break;
|
808
|
+
}
|
809
|
+
}
|
810
|
+
}
|
811
|
+
};
|
812
|
+
/** @private
|
813
|
+
* @param {Object=} titleSection
|
814
|
+
*/
|
815
|
+
ColumnGroupingPlugin.prototype._spanGroupVertically = function (titleSection) {
|
816
|
+
let api = this.getGridApi();
|
817
|
+
if(!api) {
|
818
|
+
return;
|
819
|
+
}
|
820
|
+
let core = this._hosts[0];
|
821
|
+
|
822
|
+
let maxDepth = this._maxDepth;
|
823
|
+
let rowCount = maxDepth + 1;
|
824
|
+
let colCount = api.getColumnCount();
|
825
|
+
|
826
|
+
for(let col = 0; col < colCount; col++) {
|
827
|
+
let toSpan = rowCount;
|
828
|
+
let parentNode = this._getVisibleParentGroup(this.getColumnId(col));
|
829
|
+
|
830
|
+
if(parentNode) {
|
831
|
+
let depth = parentNode["onRow"] + 1;
|
832
|
+
toSpan = rowCount - depth;
|
833
|
+
}
|
834
|
+
|
835
|
+
// Note that invisible column cannot have row span
|
836
|
+
if(core.isColumnVisible(col) && toSpan > 1) {
|
837
|
+
titleSection.setCellRowSpan(col, rowCount - toSpan, toSpan);
|
838
|
+
}
|
839
|
+
}
|
840
|
+
};
|
841
|
+
/** @private
|
842
|
+
* @param {Object} titleSection
|
843
|
+
*/
|
844
|
+
ColumnGroupingPlugin.prototype._spanGroupHorizontally = function (titleSection) {
|
845
|
+
let section = titleSection;
|
846
|
+
let visibleGroupMap = this._visibleGroupMap;
|
847
|
+
|
848
|
+
// Span column of column group
|
849
|
+
let groupDef, spanIndices, len, colIds, index, i;
|
850
|
+
for(let id in visibleGroupMap) {
|
851
|
+
spanIndices = [];
|
852
|
+
groupDef = visibleGroupMap[id];
|
853
|
+
colIds = GroupDefinitions.getLeafDescendants(visibleGroupMap, id);
|
854
|
+
let isAllSelected = this._selectedColMap ? true : false;
|
855
|
+
for(i = 0; i < colIds.length; i++) {
|
856
|
+
let colId = colIds[i];
|
857
|
+
index = this._getColumnIndexById(colId);
|
858
|
+
if(index > -1) {
|
859
|
+
spanIndices.push(index);
|
860
|
+
}
|
861
|
+
if(isAllSelected && this._selectedColMap){
|
862
|
+
isAllSelected &= this._selectedColMap[colId];
|
863
|
+
}
|
864
|
+
}
|
865
|
+
spanIndices.sort(ColumnGroupingPlugin._ascSortLogic);
|
866
|
+
len = spanIndices.length;
|
867
|
+
if(len > 0) { // This could be unnecessary
|
868
|
+
let start = spanIndices[0];
|
869
|
+
let end = spanIndices[len - 1];
|
870
|
+
section.setCellColSpan(start, groupDef["onRow"], end - start + 1);
|
871
|
+
groupDef["colIndex"] = start;
|
872
|
+
|
873
|
+
let cell = section.getCell(start, groupDef["onRow"]);
|
874
|
+
cell.setStyle("backgroundColor", groupDef["backgroundColor"] || "");
|
875
|
+
if(isAllSelected){
|
876
|
+
cell.addClass("selected-group");
|
877
|
+
}
|
878
|
+
}
|
879
|
+
}
|
880
|
+
};
|
881
|
+
/** Render all column group headers without affecting cell spans.
|
882
|
+
* @public
|
883
|
+
*/
|
884
|
+
ColumnGroupingPlugin.prototype.renderGroups = function () {
|
885
|
+
this._groupHeaderTimerId = 0;
|
886
|
+
let hostCount = this._hosts.length;
|
887
|
+
let groupMap = this._visibleGroupMap;
|
888
|
+
for(let i = 0; i < hostCount; ++i) {
|
889
|
+
let section = this._hosts[i].getSection("title");
|
890
|
+
if(!section) {
|
891
|
+
continue;
|
892
|
+
}
|
893
|
+
|
894
|
+
for(let id in groupMap) {
|
895
|
+
this._renderGroup(groupMap[id], section);
|
896
|
+
}
|
897
|
+
}
|
898
|
+
};
|
899
|
+
|
900
|
+
/** @public
|
901
|
+
* @param {Array<string|number>} colRefs
|
902
|
+
* @return {string} groupId if all the given columns are children of that groupId, otherwise empty string
|
903
|
+
*/
|
904
|
+
ColumnGroupingPlugin.prototype.getMutualGroupId = function(colRefs) {
|
905
|
+
let colCount = colRefs.length;
|
906
|
+
for(let i = 0; i < colCount; i++) {
|
907
|
+
if(typeof colRefs[i] === "string") {
|
908
|
+
colRefs[i] = this.getColumnIndex(colRefs[i]);
|
909
|
+
}
|
910
|
+
let colIndex = colRefs[i];
|
911
|
+
let groupIds = this.getGroupIds(colIndex);
|
912
|
+
if(!groupIds) { // If at least 1 column is not part of a group, there is no need to find the groupId.
|
913
|
+
return "";
|
914
|
+
}
|
915
|
+
let groupCount = groupIds.length;
|
916
|
+
for(let j = 0; j < groupCount; j++) {
|
917
|
+
let groupId = groupIds[j];
|
918
|
+
let childrenIndices = this.getChildColumnIndices(groupId);
|
919
|
+
if(deepEqual(childrenIndices, colRefs)) {
|
920
|
+
return groupId;
|
921
|
+
}
|
922
|
+
}
|
923
|
+
}
|
924
|
+
return "";
|
925
|
+
};
|
926
|
+
/** Render single column group header without affecting cell span.
|
927
|
+
* @private
|
928
|
+
* @param {Object} groupDef
|
929
|
+
* @param {Object} section
|
930
|
+
*/
|
931
|
+
ColumnGroupingPlugin.prototype._renderGroup = function(groupDef, section) {
|
932
|
+
let colIndex = groupDef["colIndex"];
|
933
|
+
if(colIndex == null) {
|
934
|
+
return;
|
935
|
+
}
|
936
|
+
let rowIndex = groupDef["onRow"];
|
937
|
+
let cell = section.getCell(colIndex, rowIndex);
|
938
|
+
let colIds = GroupDefinitions.getLeafDescendants(this._visibleGroupMap, groupDef["id"]);
|
939
|
+
let isAllSelected = false;
|
940
|
+
if(this._selectedColMap){
|
941
|
+
isAllSelected = true;
|
942
|
+
for(let i = 0; i < colIds.length; i++) {
|
943
|
+
if(!this._selectedColMap[colIds[i]]){
|
944
|
+
isAllSelected = false;
|
945
|
+
break;
|
946
|
+
}
|
947
|
+
}
|
948
|
+
}
|
949
|
+
|
950
|
+
if(cell) {
|
951
|
+
// Overide the defaults
|
952
|
+
cell.setStyle("text-align", groupDef["alignment"] || "");
|
953
|
+
cell.setTooltipInfo("groupHeaderDefault", groupDef["tooltip"]);
|
954
|
+
cell.setTooltipInfo("groupHeaderTooltip", ColumnGroupingPlugin._getTooltip(groupDef));
|
955
|
+
cell.updateTooltip();
|
956
|
+
cell.setContent(groupDef["name"] || groupDef["title"]);
|
957
|
+
|
958
|
+
// Additional cell settings must be removed in the _applyGrouping() method
|
959
|
+
cell.addClass("no-sort");
|
960
|
+
cell.setAttribute("group-id", groupDef["id"]);
|
961
|
+
|
962
|
+
if(isAllSelected){
|
963
|
+
cell.addClass("selected-group");
|
964
|
+
} else {
|
965
|
+
cell.removeClass("selected-group");
|
966
|
+
}
|
967
|
+
|
968
|
+
if(groupDef["legacyRender"]) {
|
969
|
+
// Built-in version if render receive colIndex, cell, groupDefinition as arguments
|
970
|
+
groupDef["legacyRender"](colIndex, cell, groupDef);
|
971
|
+
}
|
972
|
+
|
973
|
+
if(groupDef["render"]) {
|
974
|
+
let arg = {};
|
975
|
+
arg["cell"] = cell;
|
976
|
+
arg["colIndex"] = colIndex;
|
977
|
+
arg["groupNode"] = groupDef;
|
978
|
+
groupDef["render"](arg);
|
979
|
+
}
|
980
|
+
}
|
981
|
+
};
|
982
|
+
|
983
|
+
/** @private
|
984
|
+
* @param {Object} e
|
985
|
+
*/
|
986
|
+
ColumnGroupingPlugin.prototype._onPostSectionRender = function (e) {
|
987
|
+
if(e.sectionType === "title" && !this._restructuring) {
|
988
|
+
this.renderGroups();
|
989
|
+
}
|
990
|
+
};
|
991
|
+
|
992
|
+
/** @private
|
993
|
+
* @param {Object} e dispatching of columnAdded event object
|
994
|
+
*/
|
995
|
+
ColumnGroupingPlugin.prototype._requestApplyAddChildGroup = function (e) {
|
996
|
+
let ctx = e.context;
|
997
|
+
let tsParentDef = ctx ? ctx.parent : null;
|
998
|
+
|
999
|
+
if(tsParentDef) {
|
1000
|
+
this._addingEvents.push(e);
|
1001
|
+
if(!this._addingTimerId) {
|
1002
|
+
this._addingTimerId = setTimeout(this._applyTimeSeries.bind(this, e), 10);
|
1003
|
+
}
|
1004
|
+
}
|
1005
|
+
};
|
1006
|
+
|
1007
|
+
|
1008
|
+
/** @private
|
1009
|
+
* @param {Object} e dispatching of columnAdded event object
|
1010
|
+
*/
|
1011
|
+
ColumnGroupingPlugin.prototype._applyTimeSeries = function (e) {
|
1012
|
+
this._addingTimerId = 0; // clear timer
|
1013
|
+
let addingEvents = this._addingEvents;
|
1014
|
+
this._addingEvents = [];
|
1015
|
+
if(addingEvents.length > 0) {
|
1016
|
+
let children = [];
|
1017
|
+
let timeSeriesId, timeSeriesName;
|
1018
|
+
let tsgChild = {};
|
1019
|
+
for(let i = 0; i < addingEvents.length; i++) { // WARNING: addingEvents column can be difference group
|
1020
|
+
let addingEvent = addingEvents[i];
|
1021
|
+
timeSeriesName = addingEvent.context.timeSeriesName;
|
1022
|
+
timeSeriesId = addingEvent.context.timeSeriesId;
|
1023
|
+
let childIndex, childId;
|
1024
|
+
if(!tsgChild[timeSeriesId]) {
|
1025
|
+
tsgChild[timeSeriesId] = {
|
1026
|
+
name: timeSeriesName,
|
1027
|
+
children: []
|
1028
|
+
};
|
1029
|
+
childIndex = addingEvent.colIndex;
|
1030
|
+
childId = this.getColumnId(childIndex);
|
1031
|
+
tsgChild[timeSeriesId].children.push(childId);
|
1032
|
+
} else {
|
1033
|
+
childIndex = addingEvent.colIndex;
|
1034
|
+
childId = this.getColumnId(childIndex);
|
1035
|
+
tsgChild[timeSeriesId].children.push(childId);
|
1036
|
+
}
|
1037
|
+
}
|
1038
|
+
for(timeSeriesId in tsgChild) {
|
1039
|
+
let groupId = "timeSerieGroup_" + timeSeriesId;
|
1040
|
+
let groupDef = this._groupDefs.getGroup(groupId);
|
1041
|
+
if(groupDef) {
|
1042
|
+
// add children time series field to parent
|
1043
|
+
for(i = 0; i < children.length; i++) {
|
1044
|
+
this._groupDefs.addGroupChild(groupId, children[i]);
|
1045
|
+
}
|
1046
|
+
} else {
|
1047
|
+
// create new group
|
1048
|
+
this.addGroup({
|
1049
|
+
id: groupId,
|
1050
|
+
title: tsgChild[timeSeriesId].name,
|
1051
|
+
children: tsgChild[timeSeriesId].children,
|
1052
|
+
timeSeriesGroup: true // For remove it when getConfigObject
|
1053
|
+
});
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
}
|
1057
|
+
this._requestApplyGrouping();
|
1058
|
+
};
|
1059
|
+
|
1060
|
+
/** @private
|
1061
|
+
* @param {Object} e dispatching of columnAdded event object
|
1062
|
+
*/
|
1063
|
+
ColumnGroupingPlugin.prototype._onColumnAdded = function (e) {
|
1064
|
+
let batches = e["batches"];
|
1065
|
+
if(!(batches && batches["reset"])) {
|
1066
|
+
this._requestApplyAddChildGroup(e);
|
1067
|
+
this._applyNearestGrouping(e.colIndex);
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
this._requestApplyGrouping();
|
1071
|
+
};
|
1072
|
+
/** @private
|
1073
|
+
*/
|
1074
|
+
ColumnGroupingPlugin.prototype._onColumnChanged = function () {
|
1075
|
+
this._requestApplyGrouping();
|
1076
|
+
};
|
1077
|
+
/** @private
|
1078
|
+
* @param {Object} e dispatching of columnMoved event object
|
1079
|
+
*/
|
1080
|
+
ColumnGroupingPlugin.prototype._onColumnMoved = function (e) {
|
1081
|
+
let batches = e["batches"];
|
1082
|
+
if(!(batches && batches["move"])) {
|
1083
|
+
this._applyNearestGrouping(e.toColIndex);
|
1084
|
+
}
|
1085
|
+
this._requestApplyGrouping();
|
1086
|
+
};
|
1087
|
+
/** @private
|
1088
|
+
* @param {Object} e
|
1089
|
+
*/
|
1090
|
+
ColumnGroupingPlugin.prototype._onColumnRemoved = function(e) {
|
1091
|
+
let batches = e["batches"];
|
1092
|
+
if(!(batches && batches["reset"])) {
|
1093
|
+
let colId = e.colId;
|
1094
|
+
if(colId) {
|
1095
|
+
if(this._groupDefs.unsetParent(colId)) {
|
1096
|
+
this._requestApplyGrouping();
|
1097
|
+
}
|
1098
|
+
}
|
1099
|
+
} else {
|
1100
|
+
this._requestApplyGrouping();
|
1101
|
+
}
|
1102
|
+
};
|
1103
|
+
/** @private
|
1104
|
+
* @param {Object} e
|
1105
|
+
*/
|
1106
|
+
ColumnGroupingPlugin.prototype._onBeforeColumnBoundUpdate = function(e) {
|
1107
|
+
let selectedColumns = e.selectedColumns; // Hidden columns are included
|
1108
|
+
|
1109
|
+
// Find non-grouped column
|
1110
|
+
let i, colId, nonGroupedColId, groupId;
|
1111
|
+
let colIds = [];
|
1112
|
+
let groupMap = {};
|
1113
|
+
for(i = 0; i < selectedColumns.length; i++) {
|
1114
|
+
colId = this.getColumnId(selectedColumns[i]);
|
1115
|
+
if(colId) {
|
1116
|
+
groupId = this._groupDefs.getParentId(colId);
|
1117
|
+
if(!groupId) {
|
1118
|
+
nonGroupedColId = colId;
|
1119
|
+
break;
|
1120
|
+
} else {
|
1121
|
+
groupMap[groupId] = this._groupDefs.getGroup(groupId); // Cache group node for further calculation
|
1122
|
+
}
|
1123
|
+
colIds.push(colId); // Cache column id for further calculation
|
1124
|
+
}
|
1125
|
+
}
|
1126
|
+
if(nonGroupedColId) {
|
1127
|
+
e.topBoundRowIndex = 0;
|
1128
|
+
return;
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
let topBoundRowIndex = this._maxDepth; // Column title row
|
1132
|
+
|
1133
|
+
// Find minimum row index of group
|
1134
|
+
let rootGroupMap = {};
|
1135
|
+
let headerRowIndex, group;
|
1136
|
+
for(groupId in groupMap) {
|
1137
|
+
group = this._groupDefs.getRootGroup(groupId);
|
1138
|
+
rootGroupMap[group.id] = group;
|
1139
|
+
headerRowIndex = groupMap[groupId].onRow + 1;
|
1140
|
+
if(headerRowIndex < topBoundRowIndex) {
|
1141
|
+
topBoundRowIndex = headerRowIndex;
|
1142
|
+
}
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
// Traverse down from the root group to find group that its all members are selected
|
1146
|
+
let n, members, allSelected, findingGroup, children;
|
1147
|
+
let nextLevelGroups = rootGroupMap;
|
1148
|
+
for(i = 0; i < topBoundRowIndex; i++) {
|
1149
|
+
findingGroup = nextLevelGroups;
|
1150
|
+
nextLevelGroups = {};
|
1151
|
+
for(groupId in findingGroup) {
|
1152
|
+
group = findingGroup[groupId];
|
1153
|
+
allSelected = true;
|
1154
|
+
members = this._groupDefs.getLeafDescendants(groupId);
|
1155
|
+
if(members.length <= colIds.length) {
|
1156
|
+
for(n = 0; n < members.length; n++) {
|
1157
|
+
if(colIds.indexOf(members[n]) < 0) {
|
1158
|
+
allSelected = false;
|
1159
|
+
break;
|
1160
|
+
}
|
1161
|
+
}
|
1162
|
+
if(allSelected) {
|
1163
|
+
e.topBoundRowIndex = i;
|
1164
|
+
return;
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
// Cache the next level group
|
1169
|
+
children = group.children;
|
1170
|
+
for(n = 0; n < children.length; n++) {
|
1171
|
+
let id = children[n];
|
1172
|
+
group = this._groupDefs.getGroup(id);
|
1173
|
+
if(group) {
|
1174
|
+
nextLevelGroups[id] = group;
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
}
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
// Find maximum spanned row count
|
1181
|
+
let section = this._hosts[0].getSection("title");
|
1182
|
+
let minRowSpanCount = 0;
|
1183
|
+
let bottomRowIndex = this._maxDepth;
|
1184
|
+
for (i = 0; i < selectedColumns.length; i++) {
|
1185
|
+
let rowSpanCount = section.getCellRowSpan(selectedColumns[i], bottomRowIndex);
|
1186
|
+
if(rowSpanCount < minRowSpanCount) {
|
1187
|
+
minRowSpanCount = rowSpanCount;
|
1188
|
+
}
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
e.topBoundRowIndex = bottomRowIndex + minRowSpanCount;
|
1192
|
+
};
|
1193
|
+
/** @private
|
1194
|
+
* @param {String} groupId
|
1195
|
+
* @return {boolean}
|
1196
|
+
*/
|
1197
|
+
ColumnGroupingPlugin.prototype._isChildSelected = function(groupId) {
|
1198
|
+
let childIndices = this.getChildColumnIndices(groupId);
|
1199
|
+
if(childIndices && childIndices.length) {
|
1200
|
+
let host = this._hosts[0];
|
1201
|
+
for(let i = 0; i < childIndices.length; i++) {
|
1202
|
+
if(host.isSelectedColumn(childIndices[i])) {
|
1203
|
+
return true;
|
1204
|
+
}
|
1205
|
+
}
|
1206
|
+
}
|
1207
|
+
return false;
|
1208
|
+
};
|
1209
|
+
/** @private
|
1210
|
+
*/
|
1211
|
+
ColumnGroupingPlugin.prototype._updateColumnBounds = function() {
|
1212
|
+
let hosts = this._hosts;
|
1213
|
+
for(let i = 0; i < hosts.length; i++) {
|
1214
|
+
let host = hosts[i];
|
1215
|
+
if(host.updateColumnBounds) { // Keep backward compatibility
|
1216
|
+
host.updateColumnBounds();
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
};
|
1220
|
+
/** Deprecated. Column should be directly added through grid APIs.
|
1221
|
+
* @deprecated
|
1222
|
+
* @public
|
1223
|
+
* @param {Object} column Grid's Column definition object
|
1224
|
+
* @param {string} groupId
|
1225
|
+
* @param {number} colIndex Column index
|
1226
|
+
*/
|
1227
|
+
ColumnGroupingPlugin.prototype.addColumnToGroup = function (column, groupId, colIndex) {
|
1228
|
+
if(!column) return;
|
1229
|
+
|
1230
|
+
let destIndex = this.getColumnCount();
|
1231
|
+
if(colIndex != null) {
|
1232
|
+
let groupDef = this._groupDefs.getGroup(groupId);
|
1233
|
+
if(groupDef) {
|
1234
|
+
this._groupDefs.addGroupChild(groupId, column.id);
|
1235
|
+
}
|
1236
|
+
destIndex = colIndex;
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
if(this._realTimeGrid) { // TODO: Support multi-table feature
|
1240
|
+
this._realTimeGrid.insertColumn(column, destIndex);
|
1241
|
+
} else if(this._compositeGrid) {
|
1242
|
+
this._compositeGrid.insertColumn(destIndex, column);
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
if(colIndex == null) {
|
1246
|
+
this.setColumnParent(column.id || destColIndex, groupId);
|
1247
|
+
}
|
1248
|
+
};
|
1249
|
+
|
1250
|
+
/** Add new group definition to existing group structure. Existing group with the same id will be replaced.
|
1251
|
+
* @public
|
1252
|
+
* @param {ColumnGroupingPlugin~GroupDefinition} groupDef Group definition object
|
1253
|
+
* @return {string} Return group ID
|
1254
|
+
*/
|
1255
|
+
ColumnGroupingPlugin.prototype.addGroup = function (groupDef) {
|
1256
|
+
if(ColumnGroupingPlugin._hasGroupId(groupDef)) {
|
1257
|
+
return this.setGroupDefinition(groupDef.id, groupDef);
|
1258
|
+
}
|
1259
|
+
return "";
|
1260
|
+
};
|
1261
|
+
/** Deprecated. Use addGroup() method instead
|
1262
|
+
* @deprecated
|
1263
|
+
* @public
|
1264
|
+
* @function
|
1265
|
+
* @param {ColumnGroupingPlugin~GroupDefinition} groupDef Group definition object
|
1266
|
+
* @see {@link ColumnGroupingPlugin#addGroup}
|
1267
|
+
*/
|
1268
|
+
ColumnGroupingPlugin.prototype.addColumnGrouping = ColumnGroupingPlugin.prototype.addGroup;
|
1269
|
+
/** @public
|
1270
|
+
* @param {string} groupId
|
1271
|
+
* @return {boolean}
|
1272
|
+
*/
|
1273
|
+
ColumnGroupingPlugin.prototype.removeGroup = function (groupId) {
|
1274
|
+
let isChildSelected = this._isChildSelected(groupId);
|
1275
|
+
if(this._groupDefs.removeGroup(groupId)) {
|
1276
|
+
this._applyGrouping();
|
1277
|
+
if(isChildSelected) {
|
1278
|
+
this._updateColumnBounds();
|
1279
|
+
}
|
1280
|
+
return true;
|
1281
|
+
}
|
1282
|
+
return false;
|
1283
|
+
};
|
1284
|
+
|
1285
|
+
/** @public
|
1286
|
+
* @param {string} groupId
|
1287
|
+
* @return {ColumnGroupingPlugin~GroupDefinition}
|
1288
|
+
*/
|
1289
|
+
ColumnGroupingPlugin.prototype.getGroupDefinition = function (groupId) {
|
1290
|
+
let chdr = this._getAvaliableChildren(groupId);
|
1291
|
+
if(chdr.length > 1) {
|
1292
|
+
let groupDef = this._groupDefs.getGroup(groupId);
|
1293
|
+
groupDef = ColumnGroupingPlugin._cloneObject(groupDef); // TODO: this is slow
|
1294
|
+
groupDef.children = chdr;
|
1295
|
+
return groupDef;
|
1296
|
+
}
|
1297
|
+
return null;
|
1298
|
+
};
|
1299
|
+
/** Get a shallow copy of all existing group definitions
|
1300
|
+
* @public
|
1301
|
+
* @return {!ColumnGroupingPlugin~GroupDefinitions}
|
1302
|
+
*/
|
1303
|
+
ColumnGroupingPlugin.prototype.getGroupDefinitions = function () {
|
1304
|
+
let validGroupDefs = [];
|
1305
|
+
let groupMap = this._groupDefs.getGroupMap();
|
1306
|
+
for(let grpId in groupMap) {
|
1307
|
+
let groupDef = this.getGroupDefinition(grpId); // Clone
|
1308
|
+
if(groupDef) {
|
1309
|
+
delete groupDef.parentId;
|
1310
|
+
validGroupDefs.push(groupDef);
|
1311
|
+
}
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
return validGroupDefs;
|
1315
|
+
};
|
1316
|
+
/** Replace and update existing group definition. New group is added if the given id has no match. Existing group will be removed of no new definition is given.
|
1317
|
+
* @public
|
1318
|
+
* @param {string} groupId
|
1319
|
+
* @param {ColumnGroupingPlugin~GroupDefinition=} groupDef
|
1320
|
+
* @return {string} Return group Id. Return empty string if nothing has been changed.
|
1321
|
+
*/
|
1322
|
+
ColumnGroupingPlugin.prototype.setGroupDefinition = function (groupId, groupDef) {
|
1323
|
+
if(this._groupDefs.setGroup(groupId, groupDef)) {
|
1324
|
+
let newDef = this._groupDefs.getGroup(groupId);
|
1325
|
+
if(newDef) {
|
1326
|
+
let host = this._hosts[0];
|
1327
|
+
let chdr = host.getValidColumnList(newDef.children).map(ColumnGroupingPlugin.getObjectId); //this return only valid columns without group
|
1328
|
+
let len = chdr.length;
|
1329
|
+
if(len > 1) {
|
1330
|
+
this.reorderColumns(chdr, chdr[0]);
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
this._applyGrouping();
|
1334
|
+
if(this._isChildSelected(groupId)) {
|
1335
|
+
this._updateColumnBounds();
|
1336
|
+
}
|
1337
|
+
return groupId;
|
1338
|
+
}
|
1339
|
+
return "";
|
1340
|
+
};
|
1341
|
+
/** Remove all existing group definitions and replace with the given definitions.
|
1342
|
+
* @public
|
1343
|
+
* @param {ColumnGroupingPlugin~GroupDefinitions} groupDefs Use null or empty array to remove all existing groups
|
1344
|
+
*/
|
1345
|
+
ColumnGroupingPlugin.prototype.setGroupDefinitions = function (groupDefs) {
|
1346
|
+
if(Array.isArray(groupDefs)) {
|
1347
|
+
groupDefs = groupDefs.filter(ColumnGroupingPlugin._hasGroupId);
|
1348
|
+
groupDefs = groupDefs.map(ColumnGroupingPlugin._cloneObject);
|
1349
|
+
} else {
|
1350
|
+
groupDefs = null;
|
1351
|
+
}
|
1352
|
+
ColumnGroupingPlugin._flattenGroupDefs(groupDefs);
|
1353
|
+
this._groupDefs.setGroups(groupDefs);
|
1354
|
+
this._applyGrouping();
|
1355
|
+
|
1356
|
+
let groupIds = this._groupDefs.getGroupIds();
|
1357
|
+
for(let i = 0; i < groupIds.length; i++) {
|
1358
|
+
if(this._isChildSelected(groupIds[i])) {
|
1359
|
+
this._updateColumnBounds();
|
1360
|
+
break;
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
this._updateColumnBounds();
|
1364
|
+
};
|
1365
|
+
/** Replace and update existing group definition.
|
1366
|
+
* @public
|
1367
|
+
* @param {string} groupId
|
1368
|
+
* @param {Array.<string>} newChildList If null is given, all existing children in the group will be removed
|
1369
|
+
* @return {boolean}
|
1370
|
+
*/
|
1371
|
+
ColumnGroupingPlugin.prototype.setGroupChildren = function (groupId, newChildList) {
|
1372
|
+
if(this._groupDefs.setGroupChildren(groupId, newChildList)) {
|
1373
|
+
this._applyGrouping();
|
1374
|
+
if(this._isChildSelected(groupId)) {
|
1375
|
+
this._updateColumnBounds();
|
1376
|
+
}
|
1377
|
+
return true;
|
1378
|
+
}
|
1379
|
+
return false;
|
1380
|
+
};
|
1381
|
+
/** @public
|
1382
|
+
* @param {string} groupId
|
1383
|
+
* @param {string} groupName
|
1384
|
+
*/
|
1385
|
+
ColumnGroupingPlugin.prototype.setGroupName = function (groupId, groupName) {
|
1386
|
+
if(this._groupDefs.setGroupName(groupId, groupName)) {
|
1387
|
+
let groupDef = this._visibleGroupMap[groupId];
|
1388
|
+
if(groupDef) {
|
1389
|
+
groupDef.name = groupName;
|
1390
|
+
|
1391
|
+
let hostCount = this._hosts.length;
|
1392
|
+
for(let i = 0; i < hostCount; ++i) {
|
1393
|
+
let section = this._hosts[i].getSection("title");
|
1394
|
+
if(!section) {
|
1395
|
+
continue;
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
this._renderGroup(groupDef, section);
|
1399
|
+
}
|
1400
|
+
}
|
1401
|
+
}
|
1402
|
+
};
|
1403
|
+
/** @private
|
1404
|
+
* @param {string} groupId
|
1405
|
+
* @return {!Array.<string>} The list of immediate valid child, including invisible child groups
|
1406
|
+
*/
|
1407
|
+
ColumnGroupingPlugin.prototype._getAvaliableChildren = function (groupId) {
|
1408
|
+
let chdr = this._groupDefs.getGroupChildren(groupId);
|
1409
|
+
let childCount = chdr ? chdr.length : 0;
|
1410
|
+
let validChildren = [];
|
1411
|
+
if(childCount) {
|
1412
|
+
let host = this._hosts[0];
|
1413
|
+
let validCols = host.getValidColumnList(chdr);
|
1414
|
+
validChildren = validCols.map(ColumnGroupingPlugin.getObjectId);
|
1415
|
+
let groupMap = this._groupDefs.getGroupMap();
|
1416
|
+
for(let i = 0; i < childCount; i++) {
|
1417
|
+
let childId = chdr[i];
|
1418
|
+
if(groupMap[childId]) {
|
1419
|
+
validChildren.push(childId);
|
1420
|
+
}
|
1421
|
+
}
|
1422
|
+
}
|
1423
|
+
return validChildren;
|
1424
|
+
};
|
1425
|
+
|
1426
|
+
/** @public
|
1427
|
+
* @param {string} groupId
|
1428
|
+
* @return {Array.<string>}
|
1429
|
+
*/
|
1430
|
+
ColumnGroupingPlugin.prototype.getGroupChildren = function (groupId) {
|
1431
|
+
let children = this._getAvaliableChildren(groupId);
|
1432
|
+
if(children.length > 1) {
|
1433
|
+
return children;
|
1434
|
+
}
|
1435
|
+
return null;
|
1436
|
+
};
|
1437
|
+
|
1438
|
+
/** Return all column indices under the given group id
|
1439
|
+
* @public
|
1440
|
+
* @param {string} groupId
|
1441
|
+
* @return {Array.<number>}
|
1442
|
+
*/
|
1443
|
+
ColumnGroupingPlugin.prototype.getChildColumnIndices = function(groupId) {
|
1444
|
+
let colIndices = [];
|
1445
|
+
let host = this._hosts[0];
|
1446
|
+
let colIds = this._groupDefs.getLeafDescendants(groupId);
|
1447
|
+
if(colIds) {
|
1448
|
+
let validColList = host.getValidColumnList(colIds);
|
1449
|
+
colIndices = validColList.map(ColumnGroupingPlugin.getObjectIndex);
|
1450
|
+
return colIndices;
|
1451
|
+
}
|
1452
|
+
return null;
|
1453
|
+
};
|
1454
|
+
|
1455
|
+
/** @public
|
1456
|
+
* @param {string|number} colRef
|
1457
|
+
* @return {Array.<string>}
|
1458
|
+
*/
|
1459
|
+
ColumnGroupingPlugin.prototype.getGroupIds = function(colRef) {
|
1460
|
+
if(colRef == null) {
|
1461
|
+
return null;
|
1462
|
+
}
|
1463
|
+
let colId = (typeof colRef === "number") ? this.getColumnId(colRef) : colRef;
|
1464
|
+
return this._groupDefs.getParentIds(colId);
|
1465
|
+
};
|
1466
|
+
|
1467
|
+
/** Return deepest row index of column headers
|
1468
|
+
* @public
|
1469
|
+
* @return {number}
|
1470
|
+
*/
|
1471
|
+
ColumnGroupingPlugin.prototype.getMaxGroupLevel = function() {
|
1472
|
+
return this._maxDepth;
|
1473
|
+
};
|
1474
|
+
|
1475
|
+
/** Return row index of the given group id
|
1476
|
+
* @public
|
1477
|
+
* @param {string} groupId
|
1478
|
+
* @return {number}
|
1479
|
+
*/
|
1480
|
+
ColumnGroupingPlugin.prototype.getGroupLevel = function(groupId) {
|
1481
|
+
let group = this._visibleGroupMap[groupId];
|
1482
|
+
if(group) {
|
1483
|
+
return group.onRow;
|
1484
|
+
}
|
1485
|
+
return -1;
|
1486
|
+
};
|
1487
|
+
|
1488
|
+
/** This version exclude invisible column unlike the one in GridPlugin
|
1489
|
+
* @private
|
1490
|
+
* @param {string} id
|
1491
|
+
* @return {number} index of the column
|
1492
|
+
*/
|
1493
|
+
ColumnGroupingPlugin.prototype._getColumnIndexById = function (id) {
|
1494
|
+
let api = this.getGridApi();
|
1495
|
+
if(api && id) {
|
1496
|
+
let core = this._hosts[0];
|
1497
|
+
let colCount = core.getColumnCount();
|
1498
|
+
for(let c = 0; c < colCount; c++) {
|
1499
|
+
if(this.getColumnId(c) === id && core.isColumnVisible(c)) {
|
1500
|
+
return c;
|
1501
|
+
}
|
1502
|
+
}
|
1503
|
+
}
|
1504
|
+
return -1;
|
1505
|
+
};
|
1506
|
+
/** @private
|
1507
|
+
* @param {string} childId
|
1508
|
+
* @return {ColumnGroupingPlugin~GroupDefinition}
|
1509
|
+
*/
|
1510
|
+
ColumnGroupingPlugin.prototype._getVisibleParentGroup = function (childId) {
|
1511
|
+
return this._visibleGroupMap[this._groupDefs.getParentId(childId)] || null;
|
1512
|
+
};
|
1513
|
+
/** @public
|
1514
|
+
* @param {Element|Event|MouseEvent} e
|
1515
|
+
* @return {Object}
|
1516
|
+
*/
|
1517
|
+
ColumnGroupingPlugin.prototype.getCellInfo = function(e) {
|
1518
|
+
let api = this.getGridApi();
|
1519
|
+
let grid = e["grid"] || this.getRelativeGrid(e);
|
1520
|
+
if(!api || !grid) {
|
1521
|
+
return null;
|
1522
|
+
}
|
1523
|
+
|
1524
|
+
let cellInfo = grid.getCellInfo(e);
|
1525
|
+
if(!cellInfo){
|
1526
|
+
return e;
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
if(!cellInfo["cell"]){
|
1530
|
+
let cell = cellInfo.section.getCell(cellInfo.colIndex, cellInfo.rowIndex);
|
1531
|
+
cellInfo["cell"] = cell;
|
1532
|
+
}
|
1533
|
+
|
1534
|
+
let colId = this.getColumnId(cellInfo.colIndex);
|
1535
|
+
let groupId = this._groupDefs.getParentId(colId, cellInfo.sectionType == "title" ? cellInfo.rowIndex : null);
|
1536
|
+
if(!groupId){
|
1537
|
+
cellInfo["columnId"] = colId;
|
1538
|
+
return cellInfo;
|
1539
|
+
}
|
1540
|
+
|
1541
|
+
let groupInfo = this._groupDefs.getGroup(groupId); // TODO: Check if we need visible group
|
1542
|
+
if(groupInfo) {
|
1543
|
+
let isGroupHeader = cellInfo.sectionType == "title" && cellInfo.rowIndex == this.getGroupLevel(groupId);
|
1544
|
+
if(isGroupHeader){
|
1545
|
+
cellInfo["groupId"] = groupInfo.id;
|
1546
|
+
cellInfo["groupName"] = groupInfo.name || "";
|
1547
|
+
cellInfo["children"] = groupInfo.children;
|
1548
|
+
} else {
|
1549
|
+
cellInfo["columnId"] = colId;
|
1550
|
+
}
|
1551
|
+
cellInfo["parent"] = isGroupHeader ? groupInfo.parentId || null : groupInfo.id;
|
1552
|
+
}
|
1553
|
+
|
1554
|
+
return cellInfo;
|
1555
|
+
};
|
1556
|
+
/** @public
|
1557
|
+
* @param {number|string} colRef Column index or id that should be moved
|
1558
|
+
* @param {number} to
|
1559
|
+
* @param {string} groupId
|
1560
|
+
*/
|
1561
|
+
ColumnGroupingPlugin.prototype.moveColumnIntoGroup = function(colRef, to, groupId) {
|
1562
|
+
let fromIndex = this.getColumnIndex(colRef);
|
1563
|
+
if(fromIndex == -1){
|
1564
|
+
return;
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
let groupDef = this._groupDefs.getGroup(groupId);
|
1568
|
+
if(!groupDef){
|
1569
|
+
for(let j = this._hosts.length; --j >= 0;) {
|
1570
|
+
let grid = this._hosts[j];
|
1571
|
+
grid.moveColumn(fromIndex, to);
|
1572
|
+
}
|
1573
|
+
return;
|
1574
|
+
}
|
1575
|
+
|
1576
|
+
let childIndices = this.getChildColumnIndices(groupId);
|
1577
|
+
let startIndex = -1;
|
1578
|
+
let endIndex = -1;
|
1579
|
+
|
1580
|
+
if(childIndices && childIndices.length){
|
1581
|
+
startIndex = childIndices[0];
|
1582
|
+
endIndex = childIndices[childIndices.length - 1];
|
1583
|
+
} else {
|
1584
|
+
startIndex = 0;
|
1585
|
+
endIndex = this.getColumnCount();
|
1586
|
+
}
|
1587
|
+
|
1588
|
+
if(to < startIndex){
|
1589
|
+
to = startIndex;
|
1590
|
+
// handle move column to right
|
1591
|
+
if(to > fromIndex){
|
1592
|
+
to -= 1;
|
1593
|
+
}
|
1594
|
+
} else
|
1595
|
+
if(to > endIndex) {
|
1596
|
+
to = endIndex;
|
1597
|
+
// handle move column to left
|
1598
|
+
if(to < fromIndex){
|
1599
|
+
to += 1;
|
1600
|
+
}
|
1601
|
+
}
|
1602
|
+
|
1603
|
+
// Calculate left and right bound of the group, which column can be moved to.
|
1604
|
+
// destination should be between the bound, and it should not be placed between columns in child group
|
1605
|
+
for(let i = 0; i < groupDef.children.length; i++){
|
1606
|
+
let notAllowIndices = this.getChildColumnIndices(groupDef.children[i]);
|
1607
|
+
if(notAllowIndices && notAllowIndices.length){
|
1608
|
+
let leftLimit = notAllowIndices[0];
|
1609
|
+
let rightLimit = notAllowIndices[notAllowIndices.length - 1];
|
1610
|
+
|
1611
|
+
if(to > fromIndex){
|
1612
|
+
leftLimit -= 1;
|
1613
|
+
}
|
1614
|
+
|
1615
|
+
if(to < fromIndex){
|
1616
|
+
rightLimit += 1;
|
1617
|
+
}
|
1618
|
+
|
1619
|
+
if(to > leftLimit && to < rightLimit){
|
1620
|
+
to = rightLimit;
|
1621
|
+
}
|
1622
|
+
}
|
1623
|
+
}
|
1624
|
+
|
1625
|
+
// Get column id before start moving
|
1626
|
+
let colId = this.getColumnId(fromIndex);
|
1627
|
+
|
1628
|
+
for(let gridIndex = this._hosts.length; --gridIndex >= 0;) {
|
1629
|
+
let host = this._hosts[gridIndex];
|
1630
|
+
host.moveColumn(fromIndex, to);
|
1631
|
+
}
|
1632
|
+
|
1633
|
+
if(colId) {
|
1634
|
+
if(this._groupDefs.addGroupChild(groupId, colId)) {
|
1635
|
+
this._applyGrouping();
|
1636
|
+
}
|
1637
|
+
}
|
1638
|
+
};
|
1639
|
+
/**
|
1640
|
+
* @public
|
1641
|
+
* @param {number|string} colRef Column index or id that should be moved
|
1642
|
+
* @param {string} groupId
|
1643
|
+
* @return {boolean}
|
1644
|
+
*/
|
1645
|
+
ColumnGroupingPlugin.prototype.setColumnParent = function(colRef, groupId) {
|
1646
|
+
if(groupId) {
|
1647
|
+
return this.addGroupChild(groupId, colRef);
|
1648
|
+
}
|
1649
|
+
return this.unsetParent(colRef);
|
1650
|
+
};
|
1651
|
+
/** If a column is added as a new child in a group, the column will be moved to the last position in the group. If the column is already a child of the group, nothing happens.
|
1652
|
+
* @public
|
1653
|
+
* @param {string} parentId
|
1654
|
+
* @param {number|string} childRef Column index, column id, group id to be added
|
1655
|
+
* @return {boolean}
|
1656
|
+
*/
|
1657
|
+
ColumnGroupingPlugin.prototype.addGroupChild = function(parentId, childRef) {
|
1658
|
+
let parentDef = this._groupDefs.getGroup(parentId);
|
1659
|
+
if(!parentDef) {
|
1660
|
+
return false;
|
1661
|
+
}
|
1662
|
+
let colId = "";
|
1663
|
+
if(typeof childRef === "string") {
|
1664
|
+
let groupDef = this._groupDefs.getGroup(childRef);
|
1665
|
+
if(groupDef) {
|
1666
|
+
if(this._groupDefs.addGroupChild(parentId, childRef)) {
|
1667
|
+
this._applyGrouping();
|
1668
|
+
if(this._isChildSelected(parentId)) {
|
1669
|
+
this._updateColumnBounds();
|
1670
|
+
}
|
1671
|
+
return true;
|
1672
|
+
}
|
1673
|
+
} else {
|
1674
|
+
colId = childRef;
|
1675
|
+
}
|
1676
|
+
} else {
|
1677
|
+
colId = this.getColumnId(childRef);
|
1678
|
+
}
|
1679
|
+
if(!colId) {
|
1680
|
+
return false;
|
1681
|
+
}
|
1682
|
+
|
1683
|
+
let leafIndices = this.getChildColumnIndices(parentId);
|
1684
|
+
if(this._groupDefs.addGroupChild(parentId, colId)) {
|
1685
|
+
if(leafIndices && leafIndices.length) {
|
1686
|
+
if(this.moveColumnById(colId, leafIndices[leafIndices.length - 1] + 1)) {
|
1687
|
+
return true;
|
1688
|
+
}
|
1689
|
+
}
|
1690
|
+
|
1691
|
+
this._applyGrouping();
|
1692
|
+
if(this._isChildSelected(parentId)) {
|
1693
|
+
this._updateColumnBounds();
|
1694
|
+
}
|
1695
|
+
return true;
|
1696
|
+
}
|
1697
|
+
|
1698
|
+
return false;
|
1699
|
+
};
|
1700
|
+
/**
|
1701
|
+
* @public
|
1702
|
+
* @param {string} parentId
|
1703
|
+
* @param {number|string} childRef Column index, column id, group id to be removed
|
1704
|
+
* @return {boolean}
|
1705
|
+
*/
|
1706
|
+
ColumnGroupingPlugin.prototype.removeGroupChild = function(parentId, childRef) {
|
1707
|
+
let parentDef = this._groupDefs.getGroup(parentId);
|
1708
|
+
if(!parentDef) {
|
1709
|
+
return false;
|
1710
|
+
}
|
1711
|
+
let colId = "";
|
1712
|
+
if(typeof childRef === "string") {
|
1713
|
+
let groupDef = this._groupDefs.getGroup(childRef);
|
1714
|
+
if(groupDef) {
|
1715
|
+
if(this._groupDefs.unsetParent(childRef)) {
|
1716
|
+
this._applyGrouping();
|
1717
|
+
if(this._isChildSelected(parentId)) {
|
1718
|
+
this._updateColumnBounds();
|
1719
|
+
}
|
1720
|
+
return true;
|
1721
|
+
}
|
1722
|
+
} else {
|
1723
|
+
colId = childRef;
|
1724
|
+
}
|
1725
|
+
} else {
|
1726
|
+
colId = this.getColumnId(childRef);
|
1727
|
+
}
|
1728
|
+
if(!colId) {
|
1729
|
+
return false;
|
1730
|
+
}
|
1731
|
+
|
1732
|
+
let rootId = parentId;
|
1733
|
+
let group = this._visibleGroupMap[parentId];
|
1734
|
+
if(group.onRow !== 0) {
|
1735
|
+
rootId = this._groupDefs.getParentId(parentId, 0);
|
1736
|
+
}
|
1737
|
+
|
1738
|
+
let leafIndices = this.getChildColumnIndices(rootId);
|
1739
|
+
if(this._groupDefs.removeGroupChild(parentId, colId)) {
|
1740
|
+
if(leafIndices && leafIndices.length > 1) {
|
1741
|
+
if(this.moveColumnById(colId, leafIndices[leafIndices.length - 1] + 1)) {
|
1742
|
+
return true;
|
1743
|
+
}
|
1744
|
+
}
|
1745
|
+
|
1746
|
+
this._applyGrouping();
|
1747
|
+
if(this._isChildSelected(parentId)) {
|
1748
|
+
this._updateColumnBounds();
|
1749
|
+
}
|
1750
|
+
return true;
|
1751
|
+
}
|
1752
|
+
|
1753
|
+
return false;
|
1754
|
+
};
|
1755
|
+
/**
|
1756
|
+
* @public
|
1757
|
+
* @param {number|string} childRef Column index, column id, group id to be removed from its own parent
|
1758
|
+
* @return {boolean}
|
1759
|
+
*/
|
1760
|
+
ColumnGroupingPlugin.prototype.unsetParent = function(childRef) {
|
1761
|
+
let refId = (typeof childRef === "string") ? childRef : this.getColumnId(childRef);
|
1762
|
+
let parentId = this._groupDefs.getParentId(refId);
|
1763
|
+
if(parentId) {
|
1764
|
+
return this.removeGroupChild(parentId, refId);
|
1765
|
+
}
|
1766
|
+
return false;
|
1767
|
+
};
|
1768
|
+
|
1769
|
+
/** @public
|
1770
|
+
* @description Get a valid index for moving group/column to specific index.
|
1771
|
+
* @param {string} id group id or column id
|
1772
|
+
* @param {number|string} destCol destination column index / id
|
1773
|
+
* @returns {number} destination index
|
1774
|
+
*/
|
1775
|
+
ColumnGroupingPlugin.prototype.getValidDestinationIndex = function(id, destCol) {
|
1776
|
+
let parentGroupDef = null;
|
1777
|
+
if(this._groupDefs.getGroup(id)){
|
1778
|
+
parentGroupDef = this._getVisibleParentGroup(id);
|
1779
|
+
} else if(this.getColumnIndex(id) > -1) {
|
1780
|
+
parentGroupDef = this._getVisibleParentGroup(id);
|
1781
|
+
}
|
1782
|
+
|
1783
|
+
let startIndex = -1;
|
1784
|
+
let endIndex = -1;
|
1785
|
+
let destColIndex = typeof destCol === "string" ? this.getColumnIndex(destCol) : destCol;
|
1786
|
+
|
1787
|
+
if(parentGroupDef){
|
1788
|
+
|
1789
|
+
// If group/column is a child of a group, it should be move within the parent group
|
1790
|
+
let childIndices = this.getChildColumnIndices(parentGroupDef["id"]);
|
1791
|
+
if(childIndices && childIndices.length){
|
1792
|
+
startIndex = childIndices[0];
|
1793
|
+
endIndex = childIndices[childIndices.length - 1];
|
1794
|
+
}
|
1795
|
+
if(destColIndex < startIndex && destColIndex != -1){
|
1796
|
+
destColIndex = this.getColumnId(startIndex);
|
1797
|
+
} else
|
1798
|
+
if(destColIndex > endIndex || destColIndex == -1) {
|
1799
|
+
destColIndex = this.getColumnId(endIndex + 1);
|
1800
|
+
}
|
1801
|
+
|
1802
|
+
// handle group/column should not insert between group
|
1803
|
+
let groupChildren = this.getGroupChildren(parentGroupDef["id"]);
|
1804
|
+
for(let i = 0; i < groupChildren.length; i++){
|
1805
|
+
let childId = groupChildren[i];
|
1806
|
+
let childGroupIndices = this.getChildColumnIndices(childId);
|
1807
|
+
if(childGroupIndices && childGroupIndices.length){
|
1808
|
+
startIndex = childGroupIndices[0];
|
1809
|
+
endIndex = childGroupIndices[childGroupIndices.length - 1];
|
1810
|
+
if(destColIndex > startIndex && destColIndex <= endIndex){
|
1811
|
+
destColIndex = endIndex + 1;
|
1812
|
+
break;
|
1813
|
+
}
|
1814
|
+
}
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
} else {
|
1818
|
+
// handle group/column should not insert between group when group/column is not a child of any group
|
1819
|
+
let destMemberIndices = [];
|
1820
|
+
let destColId = this.getColumnId(destColIndex);
|
1821
|
+
let destParent = this._getVisibleParentGroup(destColId);
|
1822
|
+
if(destParent){
|
1823
|
+
if(destParent.parentId){
|
1824
|
+
destParent = this._groupDefs.getRootGroup(destParent["id"]);
|
1825
|
+
}
|
1826
|
+
destMemberIndices = this.getChildColumnIndices(destParent["id"]);
|
1827
|
+
}
|
1828
|
+
|
1829
|
+
if(destMemberIndices && destMemberIndices.length){
|
1830
|
+
startIndex = destMemberIndices[0];
|
1831
|
+
endIndex = destMemberIndices[destMemberIndices.length - 1];
|
1832
|
+
if(destColIndex > startIndex && destColIndex <= endIndex){
|
1833
|
+
destColIndex = endIndex + 1;
|
1834
|
+
}
|
1835
|
+
}
|
1836
|
+
}
|
1837
|
+
|
1838
|
+
return destColIndex;
|
1839
|
+
};
|
1840
|
+
|
1841
|
+
/** @public
|
1842
|
+
* @description Move group or column to left side of the destination column.
|
1843
|
+
* Group or column can only be moved within the parent group.
|
1844
|
+
* If the destination is between other column group, the destination will change to the end of that group instead.
|
1845
|
+
* @param {string} id group id or column id
|
1846
|
+
* @param {(number|string)=} destCol destination column index / id
|
1847
|
+
*/
|
1848
|
+
ColumnGroupingPlugin.prototype.moveGroup = function(id, destCol) {
|
1849
|
+
let groupDef;
|
1850
|
+
let members = [];
|
1851
|
+
|
1852
|
+
groupDef = this._groupDefs.getGroup(id);
|
1853
|
+
if(groupDef){
|
1854
|
+
let indices = this.getChildColumnIndices(groupDef["id"]);
|
1855
|
+
for(let i = 0; i < indices.length; i++){
|
1856
|
+
let index = indices[i];
|
1857
|
+
let colId = this.getColumnId(index);
|
1858
|
+
members.push(colId);
|
1859
|
+
}
|
1860
|
+
} else if(this.getColumnIndex(id) > -1) {
|
1861
|
+
members.push(id);
|
1862
|
+
} else {
|
1863
|
+
return;
|
1864
|
+
}
|
1865
|
+
|
1866
|
+
let destColIndex = this.getValidDestinationIndex(id, destCol);
|
1867
|
+
let destColId = this.getColumnId(destColIndex); // TODO: This may not necessary
|
1868
|
+
|
1869
|
+
this.reorderColumns(members, destColId);
|
1870
|
+
};
|
1871
|
+
/** Move and reorder the specified columns to position before the destination
|
1872
|
+
* @public
|
1873
|
+
* @param {Array.<number|string>} colList Column list to be reordered
|
1874
|
+
* @param {(number|string)=} destCol Destination column id or index
|
1875
|
+
* @return {boolean}
|
1876
|
+
*/
|
1877
|
+
ColumnGroupingPlugin.prototype.reorderColumns = function(colList, destCol) {
|
1878
|
+
return this._reorderColumns(colList, destCol);
|
1879
|
+
};
|
1880
|
+
/** Move the specified column to position before the destination
|
1881
|
+
* @public
|
1882
|
+
* @param {number|string} srcCol Source column id or index
|
1883
|
+
* @param {(number|string)=} destCol Destination column id or index
|
1884
|
+
* @return {boolean}
|
1885
|
+
*/
|
1886
|
+
ColumnGroupingPlugin.prototype.moveColumnById = function(srcCol, destCol) {
|
1887
|
+
return this._moveColumnById(srcCol, destCol);
|
1888
|
+
};
|
1889
|
+
/** @public
|
1890
|
+
* @param {string} groupId
|
1891
|
+
* @param {string=} side Available values are: left|right. If no value is supplied, all columns will be pinned to the left.
|
1892
|
+
*/
|
1893
|
+
ColumnGroupingPlugin.prototype.pinGroup = function(groupId, side) {
|
1894
|
+
if(!groupId) {
|
1895
|
+
return;
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
let groupDef = this._visibleGroupMap[groupId];
|
1899
|
+
if(!groupDef) {
|
1900
|
+
return;
|
1901
|
+
}
|
1902
|
+
|
1903
|
+
let host = this._hosts[0];
|
1904
|
+
let leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
1905
|
+
let rightPinnedCount = host.getPinnedRightColumnCount();
|
1906
|
+
let colCount = this.getColumnCount();
|
1907
|
+
let colList = this.getChildColumnIndices(groupId);
|
1908
|
+
let len = colList.length;
|
1909
|
+
|
1910
|
+
let dest;
|
1911
|
+
if(side === "right") {
|
1912
|
+
if(groupDef.rightPinned) {
|
1913
|
+
return;
|
1914
|
+
}
|
1915
|
+
if(groupDef.leftPinned) {
|
1916
|
+
this.unpinGroup(groupId);
|
1917
|
+
leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
1918
|
+
}
|
1919
|
+
groupDef.rightPinned = true;
|
1920
|
+
dest = colCount - rightPinnedCount;
|
1921
|
+
rightPinnedCount = rightPinnedCount + len;
|
1922
|
+
} else {
|
1923
|
+
if(groupDef.leftPinned) {
|
1924
|
+
return;
|
1925
|
+
}
|
1926
|
+
if(groupDef.rightPinned) {
|
1927
|
+
this.unpinGroup(groupId);
|
1928
|
+
rightPinnedCount = host.getPinnedRightColumnCount();
|
1929
|
+
}
|
1930
|
+
groupDef.leftPinned = true;
|
1931
|
+
dest = leftPinnedIndex === -1 ? 0 : leftPinnedIndex + 1;
|
1932
|
+
leftPinnedIndex = leftPinnedIndex + len;
|
1933
|
+
}
|
1934
|
+
|
1935
|
+
this.moveGroup(groupId, dest);
|
1936
|
+
this._freezeColumn(leftPinnedIndex, rightPinnedCount);
|
1937
|
+
};
|
1938
|
+
/** @public
|
1939
|
+
* @param {string} groupId
|
1940
|
+
* @param {(number|string)=} dest The unpinned group will be placed before the destination position after the operation
|
1941
|
+
*/
|
1942
|
+
ColumnGroupingPlugin.prototype.unpinGroup = function(groupId, dest) {
|
1943
|
+
if(!groupId) {
|
1944
|
+
return;
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
let groupDef = this._visibleGroupMap[groupId];
|
1948
|
+
if(!groupDef) {
|
1949
|
+
return;
|
1950
|
+
}
|
1951
|
+
|
1952
|
+
if(!groupDef.leftPinned && !groupDef.rightPinned) {
|
1953
|
+
return;
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
let host = this._hosts[0];
|
1957
|
+
let leftPinnedCount = host.getFrozenColumnCount();
|
1958
|
+
let rightPinnedCount = host.getPinnedRightColumnCount();
|
1959
|
+
let colCount = this.getColumnCount();
|
1960
|
+
let firstRightPinnedIndex = colCount - rightPinnedCount;
|
1961
|
+
let colList = this.getChildColumnIndices(groupId);
|
1962
|
+
let len = colList.length;
|
1963
|
+
|
1964
|
+
let destId = null;
|
1965
|
+
if(dest != null) {
|
1966
|
+
let destIdx = this.getColumnIndex(dest);
|
1967
|
+
destId = this.getColumnId(destIdx);
|
1968
|
+
}
|
1969
|
+
|
1970
|
+
if(groupDef.leftPinned) {
|
1971
|
+
groupDef.leftPinned = false;
|
1972
|
+
this.moveGroup(groupId, leftPinnedCount);
|
1973
|
+
this._freezeColumn(leftPinnedCount - (1 + len));
|
1974
|
+
} else if(groupDef.rightPinned) {
|
1975
|
+
groupDef.rightPinned = false;
|
1976
|
+
this.moveGroup(groupId, firstRightPinnedIndex);
|
1977
|
+
this._freezeColumn(leftPinnedCount - 1, rightPinnedCount - len);
|
1978
|
+
}
|
1979
|
+
|
1980
|
+
if(destId != null) {
|
1981
|
+
this.moveGroup(groupId, destId);
|
1982
|
+
}
|
1983
|
+
};
|
1984
|
+
/** @public
|
1985
|
+
* @param {Array<number>} colIndices
|
1986
|
+
*/
|
1987
|
+
ColumnGroupingPlugin.prototype.selectGroupHeaders = function(colIndices) {
|
1988
|
+
let host = this._hosts[0];
|
1989
|
+
let count = colIndices.length;
|
1990
|
+
if(host && count){
|
1991
|
+
let colIds = [];
|
1992
|
+
for(let i = 0; i < count; i++){
|
1993
|
+
colIds.push(host.getColumnId(colIndices[i]));
|
1994
|
+
}
|
1995
|
+
let colMap = host.createColumnMap(colIds);
|
1996
|
+
if(colMap){
|
1997
|
+
this._selectedColMap = colMap;
|
1998
|
+
}
|
1999
|
+
} else {
|
2000
|
+
this._selectedColMap = null;
|
2001
|
+
}
|
2002
|
+
this._requestGroupRendering();
|
2003
|
+
};
|
2004
|
+
|
2005
|
+
/** Get column index from column object
|
2006
|
+
* @public
|
2007
|
+
* @function
|
2008
|
+
* @param {Object} column
|
2009
|
+
* @return {number}
|
2010
|
+
*/
|
2011
|
+
ColumnGroupingPlugin.getObjectIndex = function(column) {
|
2012
|
+
return column["index"];
|
2013
|
+
};
|
2014
|
+
|
2015
|
+
/** Get column id from column object
|
2016
|
+
* @public
|
2017
|
+
* @function
|
2018
|
+
* @param {Object} column
|
2019
|
+
* @return {string}
|
2020
|
+
*/
|
2021
|
+
ColumnGroupingPlugin.getObjectId = function(column) {
|
2022
|
+
return column["id"];
|
2023
|
+
};
|
2024
|
+
|
2025
|
+
|
2026
|
+
|
2027
|
+
export default ColumnGroupingPlugin;
|
2028
|
+
export { ColumnGroupingPlugin, ColumnGroupingPlugin as ColumnGrouping, ColumnGroupingPlugin as ColumnGroupingExtension };
|