@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,2155 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
4
|
+
import { Icon } from "../../tr-grid-util/es6/Icon.js";
|
5
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
6
|
+
import { GroupDefinitions } from "../../tr-grid-util/es6/GroupDefinitions.js";
|
7
|
+
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
8
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
9
|
+
import { preventDefault } from "../../tr-grid-util/es6/EventDispatcher.js";
|
10
|
+
|
11
|
+
/** @typedef {Object} ColumnStackPlugin~Options
|
12
|
+
* @description Available options describing `columnStack` object specified in grid's option
|
13
|
+
* @property {Array.<string>} fields Fields for stacking. The minimum is 2 fields
|
14
|
+
* @property {Array.<ColumnStackPlugin~StackDefinition>} stacks List of stacking configuration
|
15
|
+
* @property {boolean=} autoStacking Deprecated. Stacks are automatically maintained as long as its members exist
|
16
|
+
* @property {Function=} clicked=null Event handler when user clicks on stack/expanding icon
|
17
|
+
* @property {Element=} menuElement Element used to display a column selection list
|
18
|
+
* @property {Function=} menuItemClicked When the menuElement is specified and menu item is clicked, an event handler is called
|
19
|
+
*/
|
20
|
+
|
21
|
+
/** @typedef {Object} ColumnStackPlugin~ColumnOptions
|
22
|
+
* @description Extension column options that can be specified on each individual grid's column option.
|
23
|
+
* @property {string=} stackId Group ID
|
24
|
+
* @property {(string|ColumnStackPlugin~StackOptions)=} stack Group ID or StackOptions object
|
25
|
+
*/
|
26
|
+
|
27
|
+
/** @typedef {Object} ColumnStackPlugin~StackOptions
|
28
|
+
* @description Available options describing grouped column displaying
|
29
|
+
* @property {string} id Group ID
|
30
|
+
* @property {boolean=} spreading=false If specified true, this group will be running in collapsing mode
|
31
|
+
* @property {boolean=} collapsed=true If disabled, this group will be expanded at the first time
|
32
|
+
*/
|
33
|
+
|
34
|
+
/** @typedef {Object} ColumnStackPlugin~StackDefinition
|
35
|
+
* @description Available options for setting stack
|
36
|
+
* @property {string} id Group Id
|
37
|
+
* @property {boolean=} spreading=false If specified true, this group will be running in collapsing mode
|
38
|
+
* @property {boolean=} collapsed=true If disabled, this group will be expanded at the first time
|
39
|
+
* @property {Array.<string>=} children=null List of column Ids for the stack members. String in this array is assumed to be column ids
|
40
|
+
* @property {Array.<string>=} fields=null List of column fields for the stack members. This will override children property
|
41
|
+
* @property {string=} name="" Name defined for specific stack
|
42
|
+
* @property {string=} activeColumn="" Column Id or field of the active column.
|
43
|
+
*/
|
44
|
+
|
45
|
+
/** @typedef {Object} ColumnStackPlugin~StackConfiguration
|
46
|
+
* @description Available options describing grouped column displaying
|
47
|
+
* @property {boolean=} spreading=false If specified true, this group will be running in collapsing mode
|
48
|
+
* @property {boolean=} collapsed=true If disabled, this group will be expanded at the first time
|
49
|
+
* @property {string=} activeColumn="" Column index, column id, or field for set as active column
|
50
|
+
*/
|
51
|
+
|
52
|
+
/** @event ColumnStackPlugin#clicked
|
53
|
+
* @description Fired when user clicks on stack/expanding icon
|
54
|
+
* @type {Object}
|
55
|
+
* @property {number} colIndex The column index that was clicked
|
56
|
+
* @property {number} rowIndex The row index that was clicked
|
57
|
+
* @property {Array.<Object>} menuData Data for populating context menu
|
58
|
+
* @property {number} activeIndex The index of the item in the menuData that corresponds to the active column
|
59
|
+
* @property {Array.<number>} columnIndices Members column index
|
60
|
+
* @property {number} activeColIndex The column index that is currently active
|
61
|
+
* @property {Event} event Native event argument from click event
|
62
|
+
* @property {boolean} spreading True if the column being clicked is a member of the collapsing group
|
63
|
+
* @property {boolean} collapsed True If the clicked group is collapsed
|
64
|
+
*/
|
65
|
+
|
66
|
+
/** @private
|
67
|
+
* @function
|
68
|
+
* @param {Object} indexMap
|
69
|
+
* @param {*} refA
|
70
|
+
* @param {*} refB
|
71
|
+
* @return {number}
|
72
|
+
*/
|
73
|
+
let _indexSorter = function(indexMap, refA, refB) {
|
74
|
+
let numA = indexMap[refA];
|
75
|
+
let numB = indexMap[refB];
|
76
|
+
if(numA === numB) {
|
77
|
+
return 0;
|
78
|
+
}
|
79
|
+
if(numA < 0) {
|
80
|
+
return 1;
|
81
|
+
}
|
82
|
+
if(numB < 0) {
|
83
|
+
return -1;
|
84
|
+
}
|
85
|
+
return numA - numB;
|
86
|
+
};
|
87
|
+
/** @private
|
88
|
+
* @function
|
89
|
+
* @param {Object} indexMap
|
90
|
+
* @param {*} refA
|
91
|
+
* @return {boolean}
|
92
|
+
*/
|
93
|
+
let _byValidIndex = function(indexMap, refA) {
|
94
|
+
return indexMap[refA] >= 0;
|
95
|
+
};
|
96
|
+
|
97
|
+
/** @private
|
98
|
+
* @description Resolve active column from the given stack object, if activeColumn is invalid
|
99
|
+
* @param {Object} stackOpt
|
100
|
+
* @return {boolean} Return true if there is any change
|
101
|
+
*/
|
102
|
+
let _resolveActiveColumn = function(stackOpt) {
|
103
|
+
if(stackOpt) {
|
104
|
+
let children = stackOpt.children;
|
105
|
+
if(children && children.length) {
|
106
|
+
let activeColumn = stackOpt.activeColumn;
|
107
|
+
if(!activeColumn || children.indexOf(activeColumn) < 0) {
|
108
|
+
stackOpt.activeColumn = stackOpt.spreading ? children[children.length - 1] : children[0];
|
109
|
+
return true;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
return false;
|
114
|
+
};
|
115
|
+
|
116
|
+
/** @constructor
|
117
|
+
* @extends {GridPlugin}
|
118
|
+
*/
|
119
|
+
let ColumnStackPlugin = function () {
|
120
|
+
this._onPreSectionRender = this._onPreSectionRender.bind(this);
|
121
|
+
this._onColumnRemoved = this._onColumnRemoved.bind(this);
|
122
|
+
this._onColumnMoved = this._onColumnMoved.bind(this);
|
123
|
+
this._onColumnAdded = this._onColumnAdded.bind(this);
|
124
|
+
this._onBeforeBatchOperation = this._onBeforeBatchOperation.bind(this);
|
125
|
+
this._onAfterBatchOperation = this._onAfterBatchOperation.bind(this);
|
126
|
+
this._onMenuItemClicked = this._onMenuItemClicked.bind(this);
|
127
|
+
|
128
|
+
this._onStackButtonClicked = this._onStackButtonClicked.bind(this);
|
129
|
+
this._updateUI = this._updateUI.bind(this);
|
130
|
+
this._toColumnId = this._toColumnId.bind(this);
|
131
|
+
this._requestFilterRefresh = this._requestFilterRefresh.bind(this);
|
132
|
+
|
133
|
+
this._hosts = [];
|
134
|
+
this._groupDefs = new GroupDefinitions();
|
135
|
+
|
136
|
+
this._filterConflator = new Conflator(50, this._requestFilterRefresh);
|
137
|
+
this._conflator = new Conflator(50, this._updateUI);
|
138
|
+
};
|
139
|
+
|
140
|
+
Ext.inherits(ColumnStackPlugin, GridPlugin);
|
141
|
+
|
142
|
+
/** @type {!GroupDefinitions}
|
143
|
+
* @private
|
144
|
+
*/
|
145
|
+
ColumnStackPlugin.prototype._groupDefs;
|
146
|
+
/** @type {Object.<string, string>}
|
147
|
+
* @private
|
148
|
+
*/
|
149
|
+
ColumnStackPlugin.prototype._pendingStacks;
|
150
|
+
/** @type {Object.<string, string>}
|
151
|
+
* @private
|
152
|
+
*/
|
153
|
+
ColumnStackPlugin.prototype._usingField = false;
|
154
|
+
|
155
|
+
/** @type {boolean}
|
156
|
+
* @private
|
157
|
+
*/
|
158
|
+
ColumnStackPlugin.prototype._updating = false;
|
159
|
+
|
160
|
+
/** @type {number}
|
161
|
+
* @private
|
162
|
+
*/
|
163
|
+
ColumnStackPlugin.prototype._inReordering = 0;
|
164
|
+
/** @type {boolean}
|
165
|
+
* @private
|
166
|
+
*/
|
167
|
+
ColumnStackPlugin.prototype._inResetting = false;
|
168
|
+
/** @type {Element}
|
169
|
+
* @private
|
170
|
+
*/
|
171
|
+
ColumnStackPlugin.prototype._menuElement = null;
|
172
|
+
/** @type {Function}
|
173
|
+
* @private
|
174
|
+
*/
|
175
|
+
ColumnStackPlugin.prototype._menuItemClicked = null;
|
176
|
+
|
177
|
+
/** @type {number}
|
178
|
+
* @private
|
179
|
+
*/
|
180
|
+
ColumnStackPlugin._runningId = 0;
|
181
|
+
/** @private
|
182
|
+
* @return {string}
|
183
|
+
*/
|
184
|
+
ColumnStackPlugin.prototype._generateStackId = function() {
|
185
|
+
let sid = "Stack" + ColumnStackPlugin._runningId++;
|
186
|
+
while(this._groupDefs.getGroup(sid)) {
|
187
|
+
sid = "Stack" + ColumnStackPlugin._runningId++;
|
188
|
+
}
|
189
|
+
return sid;
|
190
|
+
};
|
191
|
+
|
192
|
+
/** @override
|
193
|
+
* @return {string}
|
194
|
+
*/
|
195
|
+
ColumnStackPlugin.prototype.getName = function () {
|
196
|
+
return "ColumnStackPlugin"; // Readonly
|
197
|
+
};
|
198
|
+
/** @override
|
199
|
+
* @return {boolean}
|
200
|
+
*/
|
201
|
+
ColumnStackPlugin.prototype.hasMultiTableSupport = function() {
|
202
|
+
return true;
|
203
|
+
};
|
204
|
+
/** @public
|
205
|
+
* @param {Object} host core grid object
|
206
|
+
* @param {Object=} options
|
207
|
+
*/
|
208
|
+
ColumnStackPlugin.prototype.initialize = function (host, options) {
|
209
|
+
if(this._hosts.indexOf(host) >= 0) { return; }
|
210
|
+
this._hosts.push(host);
|
211
|
+
|
212
|
+
if(options) {
|
213
|
+
if(options["icons"]) {
|
214
|
+
let icons = options["icons"]["columnStack"];
|
215
|
+
if(icons) {
|
216
|
+
this._stackIconName = icons["stack"];
|
217
|
+
this._expandIconName = icons["expand"];
|
218
|
+
this._collapseIconName = icons["collapse"];
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
let opt = options["columnStack"];
|
223
|
+
if(opt && this._hosts.length === 1) {
|
224
|
+
let menuElement = opt["menuElement"];
|
225
|
+
if(menuElement && typeof menuElement === "object" && menuElement.nodeType === 1) {
|
226
|
+
menuElement.addEventListener("item-trigger", this._onMenuItemClicked);
|
227
|
+
this._menuElement = menuElement;
|
228
|
+
}
|
229
|
+
|
230
|
+
let menuItemClicked = opt["menuItemClicked"];
|
231
|
+
if(typeof menuItemClicked === "function") {
|
232
|
+
this._menuItemClicked = menuItemClicked;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
ColumnStackPlugin._applyThemeColor(host);
|
238
|
+
|
239
|
+
if(this._hosts.length === 1) {
|
240
|
+
this.config(options); // WARNING: Configure only for the first host
|
241
|
+
host.listen("columnRemoved", this._onColumnRemoved);
|
242
|
+
host.listen("columnMoved", this._onColumnMoved);
|
243
|
+
host.listen("columnAdded", this._onColumnAdded);
|
244
|
+
host.listen("beforeBatchOperation", this._onBeforeBatchOperation);
|
245
|
+
host.listen("afterBatchOperation", this._onAfterBatchOperation);
|
246
|
+
}
|
247
|
+
host.listen("preSectionRender", this._onPreSectionRender);
|
248
|
+
|
249
|
+
// In case of lazy loading
|
250
|
+
// DO something
|
251
|
+
};
|
252
|
+
/** @public
|
253
|
+
* @param {Object} host core grid object
|
254
|
+
*/
|
255
|
+
ColumnStackPlugin.prototype.unload = function (host) {
|
256
|
+
let at = this._hosts.indexOf(host);
|
257
|
+
if(at < 0) { return; }
|
258
|
+
this._hosts.splice(at, 1);
|
259
|
+
|
260
|
+
host.unlisten("columnRemoved", this._onColumnRemoved);
|
261
|
+
host.unlisten("columnMoved", this._onColumnMoved);
|
262
|
+
host.unlisten("columnAdded", this._onColumnAdded);
|
263
|
+
host.unlisten("beforeBatchOperation", this._onBeforeBatchOperation);
|
264
|
+
host.unlisten("afterBatchOperation", this._onAfterBatchOperation);
|
265
|
+
host.unlisten("preSectionRender", this._onPreSectionRender);
|
266
|
+
|
267
|
+
if(this._menuElement) {
|
268
|
+
this._menuElement.removeEventListener("item-trigger", this._onMenuItemClicked);
|
269
|
+
}
|
270
|
+
|
271
|
+
if(this._hosts.length <= 0) {
|
272
|
+
this._conflator.reset();
|
273
|
+
this._filterConflator.reset();
|
274
|
+
this._groupDefs.removeAllGroups();
|
275
|
+
}
|
276
|
+
this._dispose();
|
277
|
+
};
|
278
|
+
|
279
|
+
/** @private
|
280
|
+
* @type {string}
|
281
|
+
*/
|
282
|
+
ColumnStackPlugin._styles = prettifyCss([
|
283
|
+
".tr-grid .collapsed .cell.grouping .valigner", [
|
284
|
+
"width: 0;"
|
285
|
+
],
|
286
|
+
".tr-grid .collapsed .cell.grouping .floating-panel", [
|
287
|
+
"width: 100%;",
|
288
|
+
"margin: 0;",
|
289
|
+
"justify-content: center;"
|
290
|
+
],
|
291
|
+
".tr-grid .collapsed .cell.grouping .front-panel," +
|
292
|
+
".tr-grid .collapsed .cell.grouping .floating-panel *:not(.stack-icon)," +
|
293
|
+
".tr-grid .collapsed .cell.grouping .sort-symbol", [ // V3 Hide arrow sorting in collapse state in speading mode
|
294
|
+
"display: none;"
|
295
|
+
],
|
296
|
+
".floating-panel .stack-icon", [
|
297
|
+
"cursor: pointer;" // change the mouse cursor on the collapsed stack icon to allow for expansion but disallow sorting
|
298
|
+
],
|
299
|
+
".tr-grid .collapsed .cell.grouping .floating-panel .stack-icon", [
|
300
|
+
"margin-left: 0;",
|
301
|
+
"margin-right: 0;"
|
302
|
+
],
|
303
|
+
".stack-icon", [
|
304
|
+
"color: var(--grid-title-filter-icon-color);"
|
305
|
+
],
|
306
|
+
".stack-icon:hover", [
|
307
|
+
"color: var(--grid-title-filter-icon-hover-color);"
|
308
|
+
]
|
309
|
+
]);
|
310
|
+
|
311
|
+
/** @private
|
312
|
+
* @param {Object} grid core grid object
|
313
|
+
*/
|
314
|
+
ColumnStackPlugin._applyThemeColor = function(grid) {
|
315
|
+
if(!grid._columnStackingStyles) {
|
316
|
+
grid._columnStackingStyles = true;
|
317
|
+
injectCss(ColumnStackPlugin._styles, grid.getElement());
|
318
|
+
}
|
319
|
+
};
|
320
|
+
|
321
|
+
/** @public
|
322
|
+
* @param {Object=} options
|
323
|
+
*/
|
324
|
+
ColumnStackPlugin.prototype.config = function (options) {
|
325
|
+
if(!options) { return; }
|
326
|
+
|
327
|
+
let columns = options["columns"];
|
328
|
+
if(!columns) {
|
329
|
+
columns = [];
|
330
|
+
}
|
331
|
+
|
332
|
+
let i;
|
333
|
+
let colCount = columns.length;
|
334
|
+
|
335
|
+
let columnStack = options.columnStack;
|
336
|
+
let stackId = "";
|
337
|
+
let stacks = {};
|
338
|
+
let hasStack = false;
|
339
|
+
let stackConfig = null;
|
340
|
+
if(columnStack) {
|
341
|
+
this.addListener(columnStack, "clicked");
|
342
|
+
this._usingField = false;
|
343
|
+
|
344
|
+
if(columnStack.fields && columnStack.fields.length > 1) {
|
345
|
+
this._usingField = true;
|
346
|
+
|
347
|
+
hasStack = true;
|
348
|
+
stackId = this._generateStackId(); // TODO: Stack id may need to be hardcoded
|
349
|
+
stacks[stackId] = {
|
350
|
+
id: stackId,
|
351
|
+
spreading: columnStack.spreading === true,
|
352
|
+
collapsed: columnStack.collapsed !== false,
|
353
|
+
fields: columnStack.fields
|
354
|
+
};
|
355
|
+
} else if(columnStack.stacks && columnStack.stacks.length) {
|
356
|
+
hasStack = true;
|
357
|
+
let stackLen = columnStack.stacks.length;
|
358
|
+
for(i = 0; i < stackLen; i++){
|
359
|
+
stackConfig = columnStack.stacks[i];
|
360
|
+
stackId = stackConfig.id || this._generateStackId();
|
361
|
+
if(stackConfig.collapsed == null){ // TODO: consolidate with the above
|
362
|
+
stackConfig.collapsed = true;
|
363
|
+
}
|
364
|
+
if(stackConfig.spreading == null){
|
365
|
+
stackConfig.spreading = false;
|
366
|
+
}
|
367
|
+
stacks[stackId] = stackConfig;
|
368
|
+
}
|
369
|
+
}
|
370
|
+
}
|
371
|
+
|
372
|
+
if(!hasStack) {
|
373
|
+
for(i = 0; i < colCount; ++i) {
|
374
|
+
let column = columns[i];
|
375
|
+
let stackOpt = column["stackId"] || column["stack"];
|
376
|
+
if(!stackOpt) {
|
377
|
+
continue;
|
378
|
+
}
|
379
|
+
|
380
|
+
stackId = "";
|
381
|
+
let spreading = false;
|
382
|
+
let collapsed = true;
|
383
|
+
let activeColumn = "";
|
384
|
+
if(typeof stackOpt === "string") {
|
385
|
+
stackId = stackOpt;
|
386
|
+
} else if(typeof stackOpt === "object") {
|
387
|
+
stackConfig = stackOpt;
|
388
|
+
stackId = stackConfig["id"] || "";
|
389
|
+
spreading = stackConfig["spreading"] === true; // WARNING: Only the first column in the stack has an effect
|
390
|
+
collapsed = stackConfig["collapsed"] !== false;
|
391
|
+
activeColumn = stackConfig["activeColumn"] || "";
|
392
|
+
}
|
393
|
+
if(stackId) {
|
394
|
+
stackOpt = stacks[stackId];
|
395
|
+
if(!stackOpt) {
|
396
|
+
stackOpt = stacks[stackId] = {
|
397
|
+
id: stackId,
|
398
|
+
spreading: spreading, // Default is false (stacking mode)
|
399
|
+
collapsed: collapsed // Default is true (columns are hidden)
|
400
|
+
};
|
401
|
+
if(activeColumn) {
|
402
|
+
stackOpt.activeColumn = activeColumn;
|
403
|
+
}
|
404
|
+
hasStack = true;
|
405
|
+
}
|
406
|
+
if(!stackOpt.children) {
|
407
|
+
stackOpt.children = [];
|
408
|
+
}
|
409
|
+
stackOpt.children.push(i);
|
410
|
+
}
|
411
|
+
}
|
412
|
+
}
|
413
|
+
|
414
|
+
if(this._initializedGrid) {
|
415
|
+
this._applyUserConfigs(hasStack ? stacks : null);
|
416
|
+
} else {
|
417
|
+
this._pendingStacks = this._pendingStacks || stacks;
|
418
|
+
}
|
419
|
+
};
|
420
|
+
|
421
|
+
|
422
|
+
/** @public
|
423
|
+
* @param {Object=} gridOptions
|
424
|
+
* @return {!Object}
|
425
|
+
*/
|
426
|
+
ColumnStackPlugin.prototype.getConfigObject = function (gridOptions) {
|
427
|
+
let obj = gridOptions || {};
|
428
|
+
|
429
|
+
// TODO: Handle the case where pendingStacks has not been applied
|
430
|
+
let stackOptions = this.getStacks();
|
431
|
+
|
432
|
+
if(stackOptions.length) {
|
433
|
+
obj.columnStack = {};
|
434
|
+
obj.columnStack.stacks = stackOptions;
|
435
|
+
}
|
436
|
+
return obj;
|
437
|
+
};
|
438
|
+
|
439
|
+
/** @override
|
440
|
+
* @ignore
|
441
|
+
*/
|
442
|
+
ColumnStackPlugin.prototype._afterInit = function () {
|
443
|
+
if(this._pendingStacks) {
|
444
|
+
this._applyUserConfigs(this._pendingStacks);
|
445
|
+
this._pendingStacks = null;
|
446
|
+
}
|
447
|
+
// In case of lazy loading
|
448
|
+
// DO something
|
449
|
+
};
|
450
|
+
|
451
|
+
/** @private
|
452
|
+
* @param {*} colRef
|
453
|
+
* @return {string} column id
|
454
|
+
*/
|
455
|
+
ColumnStackPlugin.prototype._toColumnId = function(colRef) {
|
456
|
+
if(typeof colRef !== "string") {
|
457
|
+
if(typeof colRef === "number") {
|
458
|
+
return this.getColumnId(colRef);
|
459
|
+
}
|
460
|
+
return "";
|
461
|
+
}
|
462
|
+
return colRef || "";
|
463
|
+
};
|
464
|
+
/** @private
|
465
|
+
* @param {Object=} stacks
|
466
|
+
*/
|
467
|
+
ColumnStackPlugin.prototype._applyUserConfigs = function(stacks) {
|
468
|
+
if(stacks) {
|
469
|
+
this.removeAllStacks(false); // No UI update
|
470
|
+
for(let stackId in stacks) {
|
471
|
+
let stack = stacks[stackId];
|
472
|
+
let children = stack.children;
|
473
|
+
let fields = stack.fields;
|
474
|
+
if(fields) { // Convert all fields and indices to column Ids
|
475
|
+
this._usingField = true;
|
476
|
+
children = fields; // override children with fields
|
477
|
+
}
|
478
|
+
this.stackColumns(children, stackId, stack);
|
479
|
+
}
|
480
|
+
} else {
|
481
|
+
this.removeAllStacks(); // with UI update
|
482
|
+
}
|
483
|
+
};
|
484
|
+
|
485
|
+
/** @private
|
486
|
+
* @param {number} colIndex
|
487
|
+
* @return {Object}
|
488
|
+
*/
|
489
|
+
ColumnStackPlugin.prototype._getColumnStackOptions = function(colIndex) {
|
490
|
+
if(colIndex >= 0 && colIndex < this.getColumnCount()) {
|
491
|
+
let colId = this.getColumnId(colIndex);
|
492
|
+
return this._groupDefs.getParentGroup(colId) || null;
|
493
|
+
}
|
494
|
+
return null;
|
495
|
+
};
|
496
|
+
/** @private
|
497
|
+
* @return {!Array.<number>} Sorted column indices
|
498
|
+
*/
|
499
|
+
ColumnStackPlugin.prototype._getSelectedColumns = function() {
|
500
|
+
let csp = this._getPlugin("ColumnSelectionPlugin");
|
501
|
+
return (csp && csp.isEnabled()) ? csp.getSelectedColumns() : [];
|
502
|
+
};
|
503
|
+
/** Hide the specified column to prevent it from flashing when it is added as a member of the stack
|
504
|
+
* @private
|
505
|
+
* @param {Object} stack
|
506
|
+
* @param {(number|Array.<number>)=} colRefs
|
507
|
+
* @param {number=} activeRef
|
508
|
+
*/
|
509
|
+
ColumnStackPlugin.prototype._hideStackedColumns = function(stack, colRefs, activeRef) {
|
510
|
+
if(stack.spreading && !stack.collapsed) {
|
511
|
+
return; // In spreading mode, columns in an expanded stack don't need to be hidden
|
512
|
+
}
|
513
|
+
// WARNING: activeIndex may not be valid
|
514
|
+
let activeIndex = (typeof activeRef === "number") ? activeRef : this.getColumnIndex(stack.activeColumn);
|
515
|
+
let colIndices = null;
|
516
|
+
if(typeof colRefs === "number") {
|
517
|
+
colIndices = [colRefs];
|
518
|
+
} else if(colIndices == null) {
|
519
|
+
colIndices = this.getColumnIndices(stack.children);
|
520
|
+
} else {
|
521
|
+
colIndices = colRefs;
|
522
|
+
}
|
523
|
+
let validCount = colIndices.length;
|
524
|
+
for(let i = 0; i < validCount; ++i) {
|
525
|
+
let colIndex = colIndices[i];
|
526
|
+
if(colIndex !== activeIndex) {
|
527
|
+
this._setColumnVisibility(colIndex, false); // Hide a column
|
528
|
+
}
|
529
|
+
}
|
530
|
+
};
|
531
|
+
/** @private
|
532
|
+
* @param {number} colIndex
|
533
|
+
* @param {boolean} shown
|
534
|
+
*/
|
535
|
+
ColumnStackPlugin.prototype._setColumnVisibility = function(colIndex, shown) {
|
536
|
+
if(colIndex >= 0) {
|
537
|
+
let dirty = false;
|
538
|
+
for(let g = this._hosts.length; --g >= 0;) {
|
539
|
+
dirty |= this._hosts[g].setColumnVisibility(colIndex, shown, 2);
|
540
|
+
}
|
541
|
+
|
542
|
+
if(dirty){
|
543
|
+
this._requestFilterRefresh();
|
544
|
+
}
|
545
|
+
}
|
546
|
+
};
|
547
|
+
/** @private */
|
548
|
+
ColumnStackPlugin.prototype._requestFilterRefresh = function() {
|
549
|
+
if(this._filterConflator.conflate()) {
|
550
|
+
return;
|
551
|
+
}
|
552
|
+
let rfp = this._getPlugin("RowFilteringPlugin");
|
553
|
+
if(rfp && rfp["refresh"]) {
|
554
|
+
rfp["refresh"]();
|
555
|
+
}
|
556
|
+
};
|
557
|
+
/** @private
|
558
|
+
* @param {Array} colRefs Array of column index, id, or field
|
559
|
+
*/
|
560
|
+
ColumnStackPlugin.prototype._moveStackedColumns = function (colRefs) {
|
561
|
+
let colIndices = this.getColumnIndices(colRefs);
|
562
|
+
if(colIndices.length > 1) {
|
563
|
+
this.reorderColumns(colIndices, colIndices[0]);
|
564
|
+
}
|
565
|
+
};
|
566
|
+
/** @private
|
567
|
+
* @return {boolean}
|
568
|
+
*/
|
569
|
+
ColumnStackPlugin.prototype._isIconAvailable = function() {
|
570
|
+
return ElfUtil.hasComponent("ef-icon") &&
|
571
|
+
(ElfUtil.hasTheme("elf-theme-solar") ||
|
572
|
+
ElfUtil.hasTheme("elf-theme-luna"));
|
573
|
+
};
|
574
|
+
/** @private
|
575
|
+
* @param {number} colIndex
|
576
|
+
* @param {Object} stackOpt
|
577
|
+
*/
|
578
|
+
ColumnStackPlugin.prototype._updateIcon = function(colIndex, stackOpt) {
|
579
|
+
let spreading = (stackOpt) ? stackOpt.spreading : false;
|
580
|
+
let gridCount = this._hosts.length;
|
581
|
+
|
582
|
+
for(let g = 0; g < gridCount; ++g) {
|
583
|
+
let host = this._hosts[g];
|
584
|
+
let tSect = host.getSection("title");
|
585
|
+
let rowCount = tSect.getRowCount();
|
586
|
+
let cell = tSect.getCell(colIndex, rowCount - 1, true);
|
587
|
+
if(!cell) { continue; }
|
588
|
+
|
589
|
+
let stackIcon = cell._stackIcon;
|
590
|
+
if(stackOpt) {
|
591
|
+
let activeStackedColumn = this.isActiveStackedColumn(colIndex);
|
592
|
+
if(!stackIcon && activeStackedColumn) {
|
593
|
+
if(spreading) {
|
594
|
+
cell.addClass("grouping");
|
595
|
+
if(this._expandIconName) {
|
596
|
+
if(stackOpt.collapsed) {
|
597
|
+
stackIcon = Icon.create(this._expandIconName);
|
598
|
+
} else {
|
599
|
+
stackIcon = Icon.create(this._collapseIconName);
|
600
|
+
}
|
601
|
+
} else {
|
602
|
+
if(stackOpt.collapsed) {
|
603
|
+
stackIcon = Dom.text(">");
|
604
|
+
} else {
|
605
|
+
stackIcon = Dom.text("<");
|
606
|
+
}
|
607
|
+
}
|
608
|
+
} else {
|
609
|
+
cell.addClass("stacking");
|
610
|
+
if(this._stackIconName) {
|
611
|
+
stackIcon = Icon.create(this._stackIconName);
|
612
|
+
} else {
|
613
|
+
stackIcon = Dom.text("\u2261");
|
614
|
+
stackIcon.style.fontSize = "1.3em";
|
615
|
+
}
|
616
|
+
}
|
617
|
+
stackIcon.className = "stack-icon";
|
618
|
+
stackIcon.addEventListener("click", this._onStackButtonClicked, false);
|
619
|
+
stackIcon.addEventListener("dblclick", preventDefault, false);
|
620
|
+
stackIcon.addEventListener("mousedown", preventDefault, false);
|
621
|
+
stackIcon.addEventListener("keydown", preventDefault, false);
|
622
|
+
|
623
|
+
cell.insertFloatingIcon(stackIcon, 20);
|
624
|
+
cell._stackIcon = stackIcon;
|
625
|
+
|
626
|
+
this._dispatch("iconCreated", {"icon": stackIcon, "colIndex": colIndex, "grid": host, "cell": cell});
|
627
|
+
} else if(stackIcon && !activeStackedColumn) {
|
628
|
+
cell.removeFloatingIcon(cell._stackIcon);
|
629
|
+
cell._stackIcon = null;
|
630
|
+
}
|
631
|
+
} else if(stackIcon) {
|
632
|
+
cell.removeFloatingIcon(cell._stackIcon);
|
633
|
+
cell._stackIcon = null;
|
634
|
+
|
635
|
+
// Do not know the previous stacking mode so it needs to remove all the classes here.
|
636
|
+
cell.removeClass("grouping");
|
637
|
+
cell.removeClass("stacking");
|
638
|
+
}
|
639
|
+
}
|
640
|
+
};
|
641
|
+
/** @private */
|
642
|
+
ColumnStackPlugin.prototype._updateUI = function() {
|
643
|
+
if(this._updating) { // Avoid infinite loop
|
644
|
+
return;
|
645
|
+
}
|
646
|
+
if(this._conflator.conflate()) {
|
647
|
+
return;
|
648
|
+
}
|
649
|
+
|
650
|
+
this._updating = true;
|
651
|
+
let colCount = this.getColumnCount();
|
652
|
+
let gridCount = this._hosts.length;
|
653
|
+
let stackOpt, spreading;
|
654
|
+
for(let c = 0; c < colCount; ++c) {
|
655
|
+
stackOpt = this._getColumnStackOptions(c);
|
656
|
+
spreading = (stackOpt) ? stackOpt.spreading : false;
|
657
|
+
spreading = spreading === true;
|
658
|
+
for(let g = 0; g < gridCount; ++g) {
|
659
|
+
let host = this._hosts[g];
|
660
|
+
host.enableColumnClass(c, "grouped", spreading);
|
661
|
+
}
|
662
|
+
|
663
|
+
this._updateIcon(c, stackOpt);
|
664
|
+
if(stackOpt) {
|
665
|
+
if(stackOpt.spreading) {
|
666
|
+
this._collapseMember(c, stackOpt.collapsed);
|
667
|
+
} else {
|
668
|
+
this._setColumnVisibility(c, this._isActiveStackedColumn(c, stackOpt)); // a little slow
|
669
|
+
}
|
670
|
+
}
|
671
|
+
}
|
672
|
+
this._updating = false;
|
673
|
+
};
|
674
|
+
/** @private */
|
675
|
+
ColumnStackPlugin.prototype._forceUpdateUI = function() {
|
676
|
+
this._conflator.disable();
|
677
|
+
this._updateUI();
|
678
|
+
this._conflator.enable();
|
679
|
+
};
|
680
|
+
/** @private
|
681
|
+
* @param {number} colIndex
|
682
|
+
* @param {boolean} collapsed
|
683
|
+
*/
|
684
|
+
ColumnStackPlugin.prototype._collapseMember = function(colIndex, collapsed) {
|
685
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
686
|
+
if(!stackOpt) {
|
687
|
+
return;
|
688
|
+
}
|
689
|
+
|
690
|
+
for(let i = this._hosts.length; --i >= 0;) {
|
691
|
+
let host = this._hosts[i];
|
692
|
+
host.enableColumnClass(colIndex, "collapsed", collapsed);
|
693
|
+
|
694
|
+
if(this.isActiveStackedColumn(colIndex)) {
|
695
|
+
host.setColumnVisibility(colIndex, true, 2);
|
696
|
+
let tSect = host.getSection("title");
|
697
|
+
let rowCount = tSect.getRowCount();
|
698
|
+
let cell = tSect.getCell(colIndex, rowCount - 1, true);
|
699
|
+
if(collapsed) {
|
700
|
+
if(stackOpt.collapsed !== collapsed || !stackOpt._origWidth) { // Prevent from getting width while column is collapsed
|
701
|
+
stackOpt._origWidth = this._getColumnWidth(host, colIndex);
|
702
|
+
stackOpt._scalable = host.getColumnScalability(colIndex);
|
703
|
+
}
|
704
|
+
|
705
|
+
host.setColumnWidth(colIndex, tSect.getRowHeight(0), false);
|
706
|
+
|
707
|
+
if(cell._stackIcon) {
|
708
|
+
if(this._expandIconName) {
|
709
|
+
cell._stackIcon.setAttribute("icon", "right");
|
710
|
+
} else {
|
711
|
+
cell._stackIcon.textContent = ">";
|
712
|
+
}
|
713
|
+
}
|
714
|
+
} else {
|
715
|
+
if(stackOpt._origWidth != null) {
|
716
|
+
host.setColumnWidth(colIndex, stackOpt._origWidth, stackOpt._scalable);
|
717
|
+
}
|
718
|
+
|
719
|
+
if(cell._stackIcon) {
|
720
|
+
if(this._collapseIconName) {
|
721
|
+
cell._stackIcon.setAttribute("icon", "left");
|
722
|
+
} else {
|
723
|
+
cell._stackIcon.textContent = "<";
|
724
|
+
}
|
725
|
+
}
|
726
|
+
}
|
727
|
+
} else {
|
728
|
+
host.setColumnVisibility(colIndex, !collapsed, 2);
|
729
|
+
}
|
730
|
+
}
|
731
|
+
};
|
732
|
+
/** Get column width that is currently defined in the layout inside grid <br>
|
733
|
+
* (not included the effect by this extension). <br>
|
734
|
+
* Hidden column still gives positive size as oppose to visibly 0 size
|
735
|
+
* @private
|
736
|
+
* @param {Object} host core grid object
|
737
|
+
* @param {number} colIndex
|
738
|
+
* @return {number}
|
739
|
+
*/
|
740
|
+
ColumnStackPlugin.prototype._getColumnWidth = function(host, colIndex) {
|
741
|
+
if(host) {
|
742
|
+
let min = host.getMinimumColumnWidth(colIndex);
|
743
|
+
let size = host.getColumnCustomLaneSize(colIndex);
|
744
|
+
return (size < min) ? min : size; // Column width cannot be smaller than min
|
745
|
+
}
|
746
|
+
return NaN;
|
747
|
+
};
|
748
|
+
/** @public
|
749
|
+
* @param {number} colIndex
|
750
|
+
* @return {Array.<number>} Null if there is no column data
|
751
|
+
*/
|
752
|
+
ColumnStackPlugin.prototype.getMemberIndices = function(colIndex) {
|
753
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
754
|
+
if(stackOpt) {
|
755
|
+
return this.getColumnIndices(stackOpt.children);
|
756
|
+
}
|
757
|
+
return null;
|
758
|
+
};
|
759
|
+
/** @public
|
760
|
+
* @param {number} colIndex
|
761
|
+
* @param {boolean=} collapsed
|
762
|
+
* @return {Array.<number>} Null if it is non-grouped column
|
763
|
+
*/
|
764
|
+
ColumnStackPlugin.prototype.collapseGroup = function(colIndex, collapsed) {
|
765
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
766
|
+
if(!stackOpt) {
|
767
|
+
return null;
|
768
|
+
}
|
769
|
+
if(!stackOpt.spreading) {
|
770
|
+
return null;
|
771
|
+
}
|
772
|
+
|
773
|
+
collapsed = collapsed !== false;
|
774
|
+
if(stackOpt.collapsed !== collapsed) {
|
775
|
+
let groupMembers = this.getColumnIndices(stackOpt.children);
|
776
|
+
if(groupMembers) {
|
777
|
+
for(let j = groupMembers.length; --j >= 0;) {
|
778
|
+
this._collapseMember(groupMembers[j], collapsed);
|
779
|
+
}
|
780
|
+
stackOpt.collapsed = collapsed;
|
781
|
+
|
782
|
+
return groupMembers;
|
783
|
+
}
|
784
|
+
}
|
785
|
+
return null;
|
786
|
+
};
|
787
|
+
/** @public
|
788
|
+
* @param {number} colIndex
|
789
|
+
* @return {Array.<number>} Null if it is non-grouped column
|
790
|
+
*/
|
791
|
+
ColumnStackPlugin.prototype.expandGroup = function(colIndex) {
|
792
|
+
return this.collapseGroup(colIndex, false);
|
793
|
+
};
|
794
|
+
/** Intended for determining if the selected columns can be stacked from the context menu
|
795
|
+
* @public
|
796
|
+
* @param {Array.<number>} colIndices
|
797
|
+
* @return {boolean} Return true if all of the given columns can be stacked together
|
798
|
+
*/
|
799
|
+
ColumnStackPlugin.prototype.isColumnStackable = function(colIndices) {
|
800
|
+
if(!colIndices) {
|
801
|
+
return false;
|
802
|
+
}
|
803
|
+
let len = colIndices.length;
|
804
|
+
for(let i = 0; i < len; ++i) {
|
805
|
+
if(this._getColumnStackOptions(colIndices[i])) {
|
806
|
+
return false;
|
807
|
+
}
|
808
|
+
}
|
809
|
+
return true;
|
810
|
+
};
|
811
|
+
/** Deprecated. Use isColumnInCollection instead.
|
812
|
+
* @public
|
813
|
+
* @param {Array.<number>=} colIndices
|
814
|
+
* @return {boolean} Return true if one of the columns is being stacked
|
815
|
+
*/
|
816
|
+
ColumnStackPlugin.prototype.isColumnStacked = function(colIndices) {
|
817
|
+
if(!colIndices) {
|
818
|
+
colIndices = this._getSelectedColumns();
|
819
|
+
}
|
820
|
+
let len = colIndices.length;
|
821
|
+
for(let i = 0; i < len; ++i) {
|
822
|
+
if(this._getColumnStackOptions(colIndices[i])) {
|
823
|
+
return true;
|
824
|
+
}
|
825
|
+
}
|
826
|
+
return false;
|
827
|
+
};
|
828
|
+
/** This method is deprecated in favor of isColumnActive method. This method checks if the given column is inactive or doesn't have the icon.
|
829
|
+
* @public
|
830
|
+
* @param {number} colIndex
|
831
|
+
* @return {boolean} Return true if the columns is grouped and inactive
|
832
|
+
* @see {@link ColumnStackPlugin#isColumnActive}
|
833
|
+
*/
|
834
|
+
ColumnStackPlugin.prototype.isInactiveStackedColumn = function(colIndex) {
|
835
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
836
|
+
if(stackOpt) {
|
837
|
+
return !this._isActiveStackedColumn(colIndex, stackOpt);
|
838
|
+
}
|
839
|
+
return false;
|
840
|
+
};
|
841
|
+
/** This method is deprecated in favor of isColumnActive method. This method checks if the given column is active and has the icon.
|
842
|
+
* @public
|
843
|
+
* @param {number} colIndex
|
844
|
+
* @return {boolean}
|
845
|
+
* @see {@link ColumnStackPlugin#isColumnActive}
|
846
|
+
*/
|
847
|
+
ColumnStackPlugin.prototype.isActiveStackedColumn = function(colIndex) {
|
848
|
+
return this._isActiveStackedColumn(colIndex, this._getColumnStackOptions(colIndex));
|
849
|
+
};
|
850
|
+
/** @private
|
851
|
+
* @param {number} colIndex
|
852
|
+
* @param {Object} stackOpt
|
853
|
+
* @return {boolean}
|
854
|
+
*/
|
855
|
+
ColumnStackPlugin.prototype._isActiveStackedColumn = function(colIndex, stackOpt) {
|
856
|
+
if(stackOpt) {
|
857
|
+
_resolveActiveColumn(stackOpt);
|
858
|
+
|
859
|
+
return colIndex === this.getColumnIndex(stackOpt.activeColumn);
|
860
|
+
}
|
861
|
+
return false;
|
862
|
+
};
|
863
|
+
|
864
|
+
/** @public
|
865
|
+
* @param {number} colIndex
|
866
|
+
* @return {boolean}
|
867
|
+
*/
|
868
|
+
ColumnStackPlugin.prototype.isStackingMode = function(colIndex) {
|
869
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
870
|
+
if(stackOpt) {
|
871
|
+
return stackOpt.spreading !== true;
|
872
|
+
}
|
873
|
+
return false;
|
874
|
+
};
|
875
|
+
/** @public
|
876
|
+
* @param {number} colIndex
|
877
|
+
* @return {boolean}
|
878
|
+
*/
|
879
|
+
ColumnStackPlugin.prototype.isCollapsingMode = function(colIndex) {
|
880
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
881
|
+
if(stackOpt) {
|
882
|
+
return stackOpt.spreading === true;
|
883
|
+
}
|
884
|
+
return false;
|
885
|
+
};
|
886
|
+
/** @public
|
887
|
+
* @param {number} colIndex
|
888
|
+
* @return {boolean}
|
889
|
+
*/
|
890
|
+
ColumnStackPlugin.prototype.isColumnInCollection = function(colIndex) {
|
891
|
+
return this._getColumnStackOptions(colIndex) ? true : false;
|
892
|
+
};
|
893
|
+
/** Alias of isColumnInCollection
|
894
|
+
* @public
|
895
|
+
* @function
|
896
|
+
* @param {number} colIndex
|
897
|
+
* @return {boolean}
|
898
|
+
*/
|
899
|
+
ColumnStackPlugin.prototype.isInCollection = ColumnStackPlugin.prototype.isColumnInCollection;
|
900
|
+
/** Return collapsing state in collapsing mode. Always return false for stacking mode
|
901
|
+
* @public
|
902
|
+
* @param {number} colIndex
|
903
|
+
* @return {boolean}
|
904
|
+
*/
|
905
|
+
ColumnStackPlugin.prototype.isColumnCollapsed = function(colIndex) {
|
906
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
907
|
+
if(stackOpt) {
|
908
|
+
return (stackOpt.spreading === true) && (stackOpt.collapsed === true);
|
909
|
+
}
|
910
|
+
return false;
|
911
|
+
};
|
912
|
+
/** @public
|
913
|
+
* @param {number} colIndex
|
914
|
+
* @return {boolean}
|
915
|
+
*/
|
916
|
+
ColumnStackPlugin.prototype.isColumnActive = function(colIndex) {
|
917
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
918
|
+
if(stackOpt) {
|
919
|
+
if(stackOpt.spreading) {
|
920
|
+
if(!stackOpt.collapsed) {
|
921
|
+
return true;
|
922
|
+
} else {
|
923
|
+
return false;
|
924
|
+
}
|
925
|
+
} else {
|
926
|
+
return colIndex === this.getColumnIndex(stackOpt.activeColumn);
|
927
|
+
}
|
928
|
+
}
|
929
|
+
return false;
|
930
|
+
};
|
931
|
+
|
932
|
+
/** @public
|
933
|
+
* @param {number|string} colRef Column Id, index or field
|
934
|
+
* @return {string}
|
935
|
+
*/
|
936
|
+
ColumnStackPlugin.prototype.getStackId = function(colRef) {
|
937
|
+
let colIndex = (typeof colRef === "number") ? colRef : this.getColumnIndex(colRef);
|
938
|
+
if(colIndex >= 0) {
|
939
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
940
|
+
if(stackOpt) {
|
941
|
+
return stackOpt.id || "";
|
942
|
+
}
|
943
|
+
}
|
944
|
+
return "";
|
945
|
+
};
|
946
|
+
/** @public
|
947
|
+
* @param {Array.<number|string>=} colRefs Column Ids, indices, or fields. If not specified, selected columns will be used.
|
948
|
+
* @param {string=} stackId Must be unique
|
949
|
+
* @param {ColumnStackPlugin~StackConfiguration=} options
|
950
|
+
* @return {boolean} Return true if there is any change.
|
951
|
+
*/
|
952
|
+
ColumnStackPlugin.prototype.stackColumns = function(colRefs, stackId, options) {
|
953
|
+
let updateRequired = false;
|
954
|
+
let sid = stackId;
|
955
|
+
if(sid) {
|
956
|
+
if(this._removeStack(sid)) {
|
957
|
+
// TODO: pinning state are removed and may need to be kept
|
958
|
+
updateRequired = true;
|
959
|
+
}
|
960
|
+
} else {
|
961
|
+
sid = this._generateStackId();
|
962
|
+
}
|
963
|
+
|
964
|
+
if(!colRefs) {
|
965
|
+
colRefs = this._getSelectedColumns();
|
966
|
+
}
|
967
|
+
|
968
|
+
let refCount = colRefs ? colRefs.length : 0;
|
969
|
+
if(refCount < 2) {
|
970
|
+
if(updateRequired) {
|
971
|
+
this._updateUI();
|
972
|
+
}
|
973
|
+
return updateRequired; // Only two or more columns can be stacked
|
974
|
+
}
|
975
|
+
|
976
|
+
if(!options) {
|
977
|
+
options = {};
|
978
|
+
}
|
979
|
+
// Clone user data
|
980
|
+
let isSpreading = options.spreading === true;
|
981
|
+
let isCollapsed = options.collapsed !== false;
|
982
|
+
let activeColumn = options.activeColumn || ""; // field or id
|
983
|
+
// WARNING: fields property in user option is ignored
|
984
|
+
let stack = {};
|
985
|
+
stack.id = sid;
|
986
|
+
stack.name = options.name || "";
|
987
|
+
stack.spreading = isSpreading;
|
988
|
+
stack.collapsed = isCollapsed;
|
989
|
+
stack.activeColumn = activeColumn; // field or id
|
990
|
+
|
991
|
+
// If grid is not initialized, add setting to pending stacks
|
992
|
+
if(!this._initializedGrid) {
|
993
|
+
let pendingStacks = this._pendingStacks;
|
994
|
+
if(!pendingStacks) {
|
995
|
+
pendingStacks = this._pendingStacks = {};
|
996
|
+
}
|
997
|
+
stack.children = colRefs;
|
998
|
+
pendingStacks[sid] = stack;
|
999
|
+
return false;
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
let colIndices = this.getColumnIndices(colRefs); // WARNING: Invalid columns are filtered out
|
1003
|
+
|
1004
|
+
// Prevent columns already in a stack from moving out to another stack
|
1005
|
+
if(!this.isColumnStackable(colIndices)) {
|
1006
|
+
if(updateRequired) {
|
1007
|
+
this._updateUI();
|
1008
|
+
}
|
1009
|
+
return updateRequired;
|
1010
|
+
}
|
1011
|
+
|
1012
|
+
// WARNING: Invalid columns are filtered out
|
1013
|
+
let children = colIndices.map(this._toColumnId); // All fields and indices from colRefs will be converted to column Ids
|
1014
|
+
stack.children = children; // Note: children property now contains only valid column ids
|
1015
|
+
|
1016
|
+
let activeIndex = -1;
|
1017
|
+
if(activeColumn && typeof activeColumn === "string") {
|
1018
|
+
activeIndex = this.getColumnIndex(activeColumn);
|
1019
|
+
stack.activeColumn = activeColumn = this.getColumnId(activeIndex); // Convert field or invalid column id to a valid id
|
1020
|
+
} else if(typeof activeColumn === "number"){
|
1021
|
+
activeIndex = activeColumn;
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
if(_resolveActiveColumn(stack)) {
|
1025
|
+
activeColumn = stack.activeColumn;
|
1026
|
+
activeIndex = this.getColumnIndex(activeColumn);
|
1027
|
+
}
|
1028
|
+
|
1029
|
+
this._hideStackedColumns(stack, colIndices, activeIndex);
|
1030
|
+
|
1031
|
+
// Make sure that all columns stay packed together
|
1032
|
+
this.reorderColumns(colIndices, colIndices[0]);
|
1033
|
+
|
1034
|
+
// Update column selection
|
1035
|
+
let validCount = colIndices.length;
|
1036
|
+
if(!isSpreading) {
|
1037
|
+
let csp = this._getPlugin("ColumnSelectionPlugin");
|
1038
|
+
if(csp && csp.isEnabled()){
|
1039
|
+
let stackSelection = false;
|
1040
|
+
for(let i = 0; i < validCount; ++i){
|
1041
|
+
let colIndex = colIndices[i];
|
1042
|
+
if(colIndex === activeIndex){
|
1043
|
+
continue;
|
1044
|
+
}
|
1045
|
+
if(csp.isSelectedColumn(colIndex)){
|
1046
|
+
stackSelection = true;
|
1047
|
+
break;
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
if(stackSelection) {
|
1051
|
+
csp.selectSingleColumn(activeIndex);
|
1052
|
+
if(csp.dispatchSelectionChanged) {
|
1053
|
+
csp.dispatchSelectionChanged();
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
}
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
this._verifyColumnPinning(stack);
|
1060
|
+
|
1061
|
+
this._groupDefs.setGroup(sid, stack);
|
1062
|
+
|
1063
|
+
this._updateUI(); // asyncronuos
|
1064
|
+
return true;
|
1065
|
+
};
|
1066
|
+
|
1067
|
+
/** @private
|
1068
|
+
* @param {Object} stack
|
1069
|
+
*/
|
1070
|
+
ColumnStackPlugin.prototype._verifyColumnPinning = function(stack) {
|
1071
|
+
stack.leftPinned = false;
|
1072
|
+
stack.rightPinned = false;
|
1073
|
+
|
1074
|
+
let host = this._hosts[0];
|
1075
|
+
let leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
1076
|
+
let rightPinnedIndex = host.getFirstPinnedRightIndex();
|
1077
|
+
let colCount = this.getColumnCount();
|
1078
|
+
|
1079
|
+
if(leftPinnedIndex < 0 && rightPinnedIndex === colCount) {
|
1080
|
+
return;
|
1081
|
+
}
|
1082
|
+
|
1083
|
+
let colIndices = this.getColumnIndices(stack.children);
|
1084
|
+
let min = colIndices[0];
|
1085
|
+
let max = colIndices[0];
|
1086
|
+
for(let i = 1; i < colIndices.length; i++) {
|
1087
|
+
let colIndex = colIndices[i];
|
1088
|
+
if(colIndex > max) { max = colIndex; }
|
1089
|
+
if(colIndex < min) { min = colIndex; }
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
if(min <= leftPinnedIndex) {
|
1093
|
+
stack.leftPinned = true;
|
1094
|
+
if(max > leftPinnedIndex) {
|
1095
|
+
this._freezeColumn(max, colCount - rightPinnedIndex);
|
1096
|
+
}
|
1097
|
+
} else if(max >= rightPinnedIndex) {
|
1098
|
+
stack.rightPinned = true;
|
1099
|
+
if(min < rightPinnedIndex) {
|
1100
|
+
this._freezeColumn(leftPinnedIndex, colCount - min);
|
1101
|
+
}
|
1102
|
+
}
|
1103
|
+
};
|
1104
|
+
|
1105
|
+
/** @private
|
1106
|
+
* @param {number} frozenColIndex
|
1107
|
+
* @param {number=} numRightColumn
|
1108
|
+
*/
|
1109
|
+
ColumnStackPlugin.prototype._freezeColumn = function(frozenColIndex, numRightColumn) {
|
1110
|
+
let hosts = this._hosts;
|
1111
|
+
for(let i = 0; i < hosts.length; i++) {
|
1112
|
+
hosts[i].freezeColumn(frozenColIndex, numRightColumn);
|
1113
|
+
}
|
1114
|
+
};
|
1115
|
+
|
1116
|
+
/** @public
|
1117
|
+
* @description Replace all of the stacking in the Grid with a new one.
|
1118
|
+
* @param {Array.<number|string>=} colRefs Column Ids, indices, or fields.
|
1119
|
+
* @param {(number|string)=} activeColRef Column Id, index, or field.
|
1120
|
+
* @return {boolean} If the stack has been updated, return true.
|
1121
|
+
*/
|
1122
|
+
ColumnStackPlugin.prototype.setStack = function(colRefs, activeColRef) {
|
1123
|
+
this.removeAllStacks();
|
1124
|
+
|
1125
|
+
let stackOptions = {};
|
1126
|
+
if(activeColRef) {
|
1127
|
+
stackOptions.activeColumn = activeColRef;
|
1128
|
+
}
|
1129
|
+
// WARNING: Id is hardcoded for assign uniqe stacking id
|
1130
|
+
this.stackColumns(colRefs, "_uniqueStack", stackOptions);
|
1131
|
+
|
1132
|
+
return true;
|
1133
|
+
};
|
1134
|
+
/** @public
|
1135
|
+
* @description Remove all existing stacks and apply the given stack definitions to the Grid
|
1136
|
+
* @param {Array.<ColumnStackPlugin~StackDefinition>} stacks Array of stack definition objects
|
1137
|
+
*/
|
1138
|
+
ColumnStackPlugin.prototype.setStacks = function(stacks) {
|
1139
|
+
this.removeAllStacks();
|
1140
|
+
|
1141
|
+
let stackCount = stacks ? stacks.length : 0;
|
1142
|
+
for(let i = 0; i < stackCount; ++i) {
|
1143
|
+
let stack = stacks[i];
|
1144
|
+
if(stack) {
|
1145
|
+
if(stack.children) {
|
1146
|
+
this.stackColumns(stack.children, stack.id, stack);
|
1147
|
+
}
|
1148
|
+
}
|
1149
|
+
}
|
1150
|
+
};
|
1151
|
+
/** @public
|
1152
|
+
* @description Get stack defintion objects like those returned from getConfigObject
|
1153
|
+
* @return {!Array.<ColumnStackPlugin~StackDefinition>} Array of stack definition objects
|
1154
|
+
*/
|
1155
|
+
ColumnStackPlugin.prototype.getStacks = function() {
|
1156
|
+
let stacks = this._groupDefs.getGroupMap();
|
1157
|
+
let stackOptions = [];
|
1158
|
+
|
1159
|
+
for(let stackKey in stacks) {
|
1160
|
+
let stackOption = stacks[stackKey];
|
1161
|
+
let stackId = stackOption.id;
|
1162
|
+
|
1163
|
+
let stackConfigObj = {
|
1164
|
+
id: stackId
|
1165
|
+
};
|
1166
|
+
let name = stackOption.name;
|
1167
|
+
let collapsed = stackOption.collapsed;
|
1168
|
+
let spreading = stackOption.spreading;
|
1169
|
+
|
1170
|
+
if(name) {
|
1171
|
+
stackConfigObj.name = name;
|
1172
|
+
}
|
1173
|
+
if(collapsed !== true) {
|
1174
|
+
stackConfigObj.collapsed = collapsed;
|
1175
|
+
}
|
1176
|
+
if(spreading !== false) {
|
1177
|
+
stackConfigObj.spreading = spreading;
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
if(this._usingField) {
|
1181
|
+
let colIndices = this.getStackMemberIndices(stackId);
|
1182
|
+
let memberCount = colIndices.length;
|
1183
|
+
let fields = new Array(memberCount);
|
1184
|
+
for(let i = 0; i < memberCount; ++i) {
|
1185
|
+
fields[i] = this.getColumnField(colIndices[i]);
|
1186
|
+
}
|
1187
|
+
stackConfigObj.fields = fields;
|
1188
|
+
stackConfigObj.activeColumn = this.getActiveColumnField(stackId);
|
1189
|
+
} else {
|
1190
|
+
stackConfigObj.children = this.getStackMemberIds(stackId).slice();
|
1191
|
+
if(stackOption.activeColumn) {
|
1192
|
+
stackConfigObj.activeColumn = stackOption.activeColumn;
|
1193
|
+
}
|
1194
|
+
}
|
1195
|
+
stackOptions.push(stackConfigObj);
|
1196
|
+
}
|
1197
|
+
return stackOptions;
|
1198
|
+
};
|
1199
|
+
|
1200
|
+
/** @public
|
1201
|
+
* @param {Array.<number>=} colIndices Selected columns will be used, if it is not given
|
1202
|
+
* @return {boolean}
|
1203
|
+
*/
|
1204
|
+
ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
|
1205
|
+
if(!colIndices) {
|
1206
|
+
colIndices = this._getSelectedColumns();
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
let dirty = false;
|
1210
|
+
let len = colIndices.length;
|
1211
|
+
for(let i = 0; i < len; ++i) {
|
1212
|
+
let colIndex = colIndices[i];
|
1213
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
1214
|
+
if(stackOpt) {
|
1215
|
+
dirty = true;
|
1216
|
+
this._removeStack(stackOpt.id);
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
if(dirty) {
|
1220
|
+
this._updateUI(); // asyncronuos
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
return dirty;
|
1224
|
+
};
|
1225
|
+
/** @private
|
1226
|
+
* @param {string} stackId
|
1227
|
+
* @return {boolean} Returns true if there is any change
|
1228
|
+
*/
|
1229
|
+
ColumnStackPlugin.prototype._removeStack = function(stackId) {
|
1230
|
+
let stack = this._groupDefs.getGroup(stackId);
|
1231
|
+
if(!stack) {
|
1232
|
+
return false;
|
1233
|
+
}
|
1234
|
+
|
1235
|
+
let colIndices = this.getColumnIndices(stack.children);
|
1236
|
+
let len = colIndices.length;
|
1237
|
+
for(let i = 0; i < len; ++i) {
|
1238
|
+
let colIndex = colIndices[i]; // colIndex is guaranteed to be positive (verified)
|
1239
|
+
if(stack.spreading && stack.collapsed) {
|
1240
|
+
this._collapseMember(colIndex, false);
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
this._setColumnVisibility(colIndex, true);
|
1244
|
+
}
|
1245
|
+
this._groupDefs.removeGroup(stackId);
|
1246
|
+
return true;
|
1247
|
+
};
|
1248
|
+
/** @public
|
1249
|
+
* @param {string} stackId
|
1250
|
+
* @return {boolean} Returns true if there is any change
|
1251
|
+
*/
|
1252
|
+
ColumnStackPlugin.prototype.removeStack = function(stackId) {
|
1253
|
+
if(this._removeStack(stackId)) {
|
1254
|
+
this._updateUI();
|
1255
|
+
return true;
|
1256
|
+
}
|
1257
|
+
return false;
|
1258
|
+
};
|
1259
|
+
/** @public
|
1260
|
+
* @param {boolean=} enableUpdateUI=true Set false if you want to remove without update UI
|
1261
|
+
* @return {boolean} true if at least one stacking removed
|
1262
|
+
*/
|
1263
|
+
ColumnStackPlugin.prototype.removeAllStacks = function(enableUpdateUI) {
|
1264
|
+
let groupIds = this._groupDefs.getGroupIds();
|
1265
|
+
let groupCount = groupIds.length;
|
1266
|
+
if(groupCount) {
|
1267
|
+
for(let i = 0; i < groupCount; ++i) {
|
1268
|
+
this._removeStack(groupIds[i]);
|
1269
|
+
}
|
1270
|
+
this._groupDefs.removeAllGroups(); // TODO: May not necessary
|
1271
|
+
|
1272
|
+
if(enableUpdateUI !== false) {
|
1273
|
+
this._updateUI(); // asyncronous
|
1274
|
+
}
|
1275
|
+
}
|
1276
|
+
return groupCount ? true : false;
|
1277
|
+
};
|
1278
|
+
/** If the column is in a stack, the column become an activeColumn of the stack.
|
1279
|
+
* @public
|
1280
|
+
* @param {number|string} activeColumn Column index, id, or field
|
1281
|
+
* @return {boolean}
|
1282
|
+
*/
|
1283
|
+
ColumnStackPlugin.prototype.setActiveColumn = function(activeColumn) {
|
1284
|
+
let colIndex = this.getColumnIndex(activeColumn);
|
1285
|
+
if(colIndex < 0) {
|
1286
|
+
return false;
|
1287
|
+
}
|
1288
|
+
let colCount = this.getColumnCount();
|
1289
|
+
if(colIndex >= colCount) {
|
1290
|
+
return false;
|
1291
|
+
}
|
1292
|
+
|
1293
|
+
let colId = this.getColumnId(colIndex);
|
1294
|
+
let stack = this._groupDefs.getParentGroup(colId);
|
1295
|
+
if(!stack) {
|
1296
|
+
return false;
|
1297
|
+
}
|
1298
|
+
let chdr = stack.children;
|
1299
|
+
let memberIndex = chdr.indexOf(colId);
|
1300
|
+
if(memberIndex < 0) {
|
1301
|
+
return false;
|
1302
|
+
}
|
1303
|
+
return this._setActiveColumn(stack, chdr[memberIndex]);
|
1304
|
+
};
|
1305
|
+
/** This method is deprecated in favor of setActiveColumn. Make the specified column switch place with the item in the stack.
|
1306
|
+
* @public
|
1307
|
+
* @param {number|Event} colRef
|
1308
|
+
* @param {number} swappingIndex
|
1309
|
+
* @return {boolean}
|
1310
|
+
* @see {@link ColumnStackPlugin#setActiveColumn}
|
1311
|
+
*/
|
1312
|
+
ColumnStackPlugin.prototype.swapColumn = function(colRef, swappingIndex) {
|
1313
|
+
let colIndex = (typeof colRef === "number") ? colRef : this.getColumnIndex(colRef);
|
1314
|
+
|
1315
|
+
let stackOpt = this._getColumnStackOptions(colIndex);
|
1316
|
+
if(!stackOpt) {
|
1317
|
+
return false; // Invalid column index
|
1318
|
+
}
|
1319
|
+
let children = stackOpt.children;
|
1320
|
+
if(!children) {
|
1321
|
+
return false; // Invalid column type
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
return this._setActiveColumn(stackOpt, children[swappingIndex]);
|
1325
|
+
};
|
1326
|
+
/** @private
|
1327
|
+
* @param {Object} stack Stack object
|
1328
|
+
* @param {string} newActiveColumn Column id or field
|
1329
|
+
* @return {boolean}
|
1330
|
+
*/
|
1331
|
+
ColumnStackPlugin.prototype._setActiveColumn = function(stack, newActiveColumn) {
|
1332
|
+
if(!newActiveColumn) {
|
1333
|
+
return false; // Invalid active column
|
1334
|
+
}
|
1335
|
+
if(newActiveColumn === stack.activeColumn) {
|
1336
|
+
return false; // The given index is already active stacked column
|
1337
|
+
}
|
1338
|
+
|
1339
|
+
let prevActiveColumnIndex = this.getColumnIndex(stack.activeColumn);
|
1340
|
+
let newActiveColumnIndex = this.getColumnIndex(newActiveColumn);
|
1341
|
+
stack.activeColumn = newActiveColumn; // Change active column
|
1342
|
+
|
1343
|
+
this._setColumnVisibility(newActiveColumnIndex, true);
|
1344
|
+
this._setColumnVisibility(prevActiveColumnIndex, false); // Hide current active column
|
1345
|
+
|
1346
|
+
this._updateIcon(prevActiveColumnIndex, stack);
|
1347
|
+
this._updateIcon(newActiveColumnIndex, stack);
|
1348
|
+
|
1349
|
+
let csp = this._getPlugin("ColumnSelectionPlugin");
|
1350
|
+
if(csp && csp.isEnabled()) {
|
1351
|
+
csp.selectSingleColumn(newActiveColumnIndex);
|
1352
|
+
if(csp.dispatchSelectionChanged) {
|
1353
|
+
csp.dispatchSelectionChanged();
|
1354
|
+
}
|
1355
|
+
}
|
1356
|
+
return true;
|
1357
|
+
};
|
1358
|
+
|
1359
|
+
/** @private
|
1360
|
+
* @param {Object} e
|
1361
|
+
*/
|
1362
|
+
ColumnStackPlugin.prototype._onPreSectionRender = function (e) {
|
1363
|
+
if(e["sectionType"] !== "title") {
|
1364
|
+
return;
|
1365
|
+
}
|
1366
|
+
this._forceUpdateUI();
|
1367
|
+
};
|
1368
|
+
/** @private
|
1369
|
+
* @param {Object} e
|
1370
|
+
*/
|
1371
|
+
ColumnStackPlugin.prototype._onColumnRemoved = function (e) {
|
1372
|
+
if(this._inResetting) {
|
1373
|
+
return;
|
1374
|
+
}
|
1375
|
+
|
1376
|
+
let colId = e.colId;
|
1377
|
+
let stackOpt = this._groupDefs.getParentGroup(colId);
|
1378
|
+
|
1379
|
+
if(!stackOpt) {
|
1380
|
+
return;
|
1381
|
+
}
|
1382
|
+
// update members
|
1383
|
+
let children = stackOpt.children;
|
1384
|
+
if(children.length <= 2) {
|
1385
|
+
this._removeStack(stackOpt.id);
|
1386
|
+
this._updateUI();
|
1387
|
+
} else {
|
1388
|
+
this._groupDefs.removeGroupChild(stackOpt.id, colId);
|
1389
|
+
this._updateActiveColumn(stackOpt); // This may trigger _updateUI
|
1390
|
+
}
|
1391
|
+
};
|
1392
|
+
/** @private
|
1393
|
+
* @param {Object} e
|
1394
|
+
*/
|
1395
|
+
ColumnStackPlugin.prototype._onColumnMoved = function (e) {
|
1396
|
+
if(this._inReordering || this._inResetting) {
|
1397
|
+
if(this._inReordering) {
|
1398
|
+
this._inReordering = 2; // Mark dirty
|
1399
|
+
}
|
1400
|
+
return; // during the reordering or resetting, there is no need to recalculate stacks
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
let toIndex = e.toColIndex;
|
1404
|
+
let colId = this.getColumnId(toIndex);
|
1405
|
+
let stackOpt = this._groupDefs.getParentGroup(colId);
|
1406
|
+
if(!stackOpt) {
|
1407
|
+
return;
|
1408
|
+
}
|
1409
|
+
|
1410
|
+
let leftStackOpt = this._getColumnStackOptions(toIndex - 1);
|
1411
|
+
let rightStackOpt = this._getColumnStackOptions(toIndex + 1);
|
1412
|
+
|
1413
|
+
let stackChange = true;
|
1414
|
+
let dirty = false;
|
1415
|
+
if(stackOpt) {
|
1416
|
+
// The move was within the same stack
|
1417
|
+
if(stackOpt === leftStackOpt || stackOpt === rightStackOpt) {
|
1418
|
+
this._repositionMembers(stackOpt);
|
1419
|
+
stackChange = false;
|
1420
|
+
} else { // The move was out from its own stack
|
1421
|
+
if(stackOpt.children.length <= 2) {
|
1422
|
+
this._removeStack(stackOpt.id);
|
1423
|
+
} else {
|
1424
|
+
this._removeRefFromStack(stackOpt, colId, toIndex);
|
1425
|
+
}
|
1426
|
+
}
|
1427
|
+
dirty = true;
|
1428
|
+
}
|
1429
|
+
|
1430
|
+
if(stackChange) {
|
1431
|
+
if(this._isWithinStack(toIndex)) {
|
1432
|
+
if(this._addRefToStack(leftStackOpt, toIndex)) {
|
1433
|
+
dirty = true;
|
1434
|
+
}
|
1435
|
+
}
|
1436
|
+
}
|
1437
|
+
|
1438
|
+
if(dirty) {
|
1439
|
+
this._updateUI();
|
1440
|
+
}
|
1441
|
+
};
|
1442
|
+
/** @private
|
1443
|
+
* @param {Object} e
|
1444
|
+
*/
|
1445
|
+
ColumnStackPlugin.prototype._onColumnAdded = function (e) {
|
1446
|
+
if(this._inResetting) {
|
1447
|
+
return;
|
1448
|
+
}
|
1449
|
+
|
1450
|
+
let colIndex = e.colIndex;
|
1451
|
+
let stackOpt = this._isWithinStack(colIndex);
|
1452
|
+
if(stackOpt) {
|
1453
|
+
if(this._addRefToStack(stackOpt, colIndex)) {
|
1454
|
+
this._updateUI();
|
1455
|
+
}
|
1456
|
+
}
|
1457
|
+
};
|
1458
|
+
/** @private
|
1459
|
+
* @param {Object} e
|
1460
|
+
*/
|
1461
|
+
ColumnStackPlugin.prototype._onBeforeBatchOperation = function (e) {
|
1462
|
+
if(e.batchType === "reset") {
|
1463
|
+
this._inResetting = true;
|
1464
|
+
} else if(e.batchType === "move") {
|
1465
|
+
this._inReordering = 1;
|
1466
|
+
}
|
1467
|
+
};
|
1468
|
+
/** @private
|
1469
|
+
* @param {Object} e
|
1470
|
+
*/
|
1471
|
+
ColumnStackPlugin.prototype._onAfterBatchOperation = function (e) {
|
1472
|
+
let groups, groupCount, i, group;
|
1473
|
+
if(e.batchType === "reset") {
|
1474
|
+
this._inResetting = false;
|
1475
|
+
|
1476
|
+
groups = this._groupDefs.getGroups();
|
1477
|
+
groupCount = groups.length;
|
1478
|
+
for(i = 0; i < groupCount; ++i) {
|
1479
|
+
this._repositionMembers(groups[i], true); // validate the group
|
1480
|
+
}
|
1481
|
+
groups = this._groupDefs.getGroups();
|
1482
|
+
groupCount = groups.length;
|
1483
|
+
for(i = 0; i < groupCount; ++i) {
|
1484
|
+
group = groups[i];
|
1485
|
+
this._updateActiveColumn(group);
|
1486
|
+
this._hideStackedColumns(group);
|
1487
|
+
}
|
1488
|
+
} else if(e.batchType === "move") {
|
1489
|
+
if(this._inReordering === 2) {
|
1490
|
+
groups = this._groupDefs.getGroups();
|
1491
|
+
groupCount = groups.length;
|
1492
|
+
for(i = 0; i < groupCount; ++i) {
|
1493
|
+
this._repositionMembers(groups[i]);
|
1494
|
+
}
|
1495
|
+
}
|
1496
|
+
this._inReordering = 0;
|
1497
|
+
}
|
1498
|
+
};
|
1499
|
+
/** @private
|
1500
|
+
* @param {number} colIndex
|
1501
|
+
* @return {Object} stackOption
|
1502
|
+
*/
|
1503
|
+
ColumnStackPlugin.prototype._isWithinStack = function (colIndex) {
|
1504
|
+
let leftStackOpt = this._getColumnStackOptions(colIndex - 1);
|
1505
|
+
if(leftStackOpt) {
|
1506
|
+
let rightStackOpt = this._getColumnStackOptions(colIndex + 1);
|
1507
|
+
if(leftStackOpt === rightStackOpt) {
|
1508
|
+
return leftStackOpt;
|
1509
|
+
}
|
1510
|
+
}
|
1511
|
+
return null;
|
1512
|
+
};
|
1513
|
+
/** Add unique ref of the specified index to the proper position within the stack
|
1514
|
+
* @private
|
1515
|
+
* @param {Object} stackOption
|
1516
|
+
* @param {number} colIndex
|
1517
|
+
* @return {boolean}
|
1518
|
+
*/
|
1519
|
+
ColumnStackPlugin.prototype._addRefToStack = function (stackOption, colIndex) {
|
1520
|
+
let colId = this._toColumnId(colIndex);
|
1521
|
+
|
1522
|
+
this._hideStackedColumns(stackOption, colIndex);
|
1523
|
+
|
1524
|
+
// Find a position to be placed in the stack
|
1525
|
+
let rightColRef = this._toColumnId(colIndex + 1);
|
1526
|
+
let children = stackOption.children;
|
1527
|
+
let pos = children.indexOf(rightColRef); // WARNING This does not work for field
|
1528
|
+
return this._groupDefs.addGroupChild(stackOption.id, colId, pos);
|
1529
|
+
};
|
1530
|
+
/** Remove unique ref of the specified index from the stack
|
1531
|
+
* @private
|
1532
|
+
* @param {Object} stackOption
|
1533
|
+
* @param {string} colId For removing state
|
1534
|
+
* @param {number} colIndex For updating UI
|
1535
|
+
* @return {boolean}
|
1536
|
+
*/
|
1537
|
+
ColumnStackPlugin.prototype._removeRefFromStack = function (stackOption, colId, colIndex) {
|
1538
|
+
if(!this._groupDefs.removeGroupChild(stackOption.id, colId)) {
|
1539
|
+
return false;
|
1540
|
+
}
|
1541
|
+
|
1542
|
+
let isCollapsed = stackOption.spreading && stackOption.collapsed;
|
1543
|
+
if(isCollapsed) {
|
1544
|
+
this._collapseMember(colIndex, false);
|
1545
|
+
} else {
|
1546
|
+
this._setColumnVisibility(colIndex, true);
|
1547
|
+
}
|
1548
|
+
this._updateActiveColumn(stackOption); // This may trigger _updateUI
|
1549
|
+
|
1550
|
+
return true;
|
1551
|
+
};
|
1552
|
+
|
1553
|
+
/** @private
|
1554
|
+
* @param {Object} stackOption
|
1555
|
+
* @param {boolean=} validate Remove invalid members and stack
|
1556
|
+
*/
|
1557
|
+
ColumnStackPlugin.prototype._repositionMembers = function (stackOption, validate) {
|
1558
|
+
let children = stackOption.children;
|
1559
|
+
let refCount = children ? children.length : 0;
|
1560
|
+
|
1561
|
+
let indexMap = {};
|
1562
|
+
let prevIndex = -1;
|
1563
|
+
let dirty = false;
|
1564
|
+
let hasInvalid = false;
|
1565
|
+
for(let i = 0; i < refCount; i++) {
|
1566
|
+
let colRef = children[i];
|
1567
|
+
let colIndex = this.getColumnIndex(colRef);
|
1568
|
+
indexMap[colRef] = colIndex;
|
1569
|
+
if(colIndex >= 0) {
|
1570
|
+
if(colIndex < prevIndex) {
|
1571
|
+
dirty = true;
|
1572
|
+
}
|
1573
|
+
} else { // Found invalid member
|
1574
|
+
hasInvalid = true;
|
1575
|
+
}
|
1576
|
+
prevIndex = colIndex;
|
1577
|
+
}
|
1578
|
+
if(validate && hasInvalid) {
|
1579
|
+
children = children.filter(_byValidIndex.bind(null, indexMap));
|
1580
|
+
// WARNING: this._groupDefs._childToParent may be out of sync after children are filtered
|
1581
|
+
// TODO: Create a new API to rebuild childToParent map
|
1582
|
+
this._groupDefs.removeAllChildren(stackOption.id);
|
1583
|
+
stackOption.children = children;
|
1584
|
+
this._groupDefs.setGroup(stackOption.id, stackOption);
|
1585
|
+
|
1586
|
+
refCount = children.length;
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
if(refCount < 2) {
|
1590
|
+
if(validate) {
|
1591
|
+
this._removeStack(stackOption.id);
|
1592
|
+
this._updateUI();
|
1593
|
+
}
|
1594
|
+
return;
|
1595
|
+
}
|
1596
|
+
|
1597
|
+
if(dirty || hasInvalid) {
|
1598
|
+
children.sort(_indexSorter.bind(null, indexMap));
|
1599
|
+
}
|
1600
|
+
};
|
1601
|
+
/** @private
|
1602
|
+
* @param {Object} e
|
1603
|
+
*/
|
1604
|
+
ColumnStackPlugin.prototype._onStackButtonClicked = function(e) {
|
1605
|
+
let elem = e.currentTarget;
|
1606
|
+
if(e.button) { // right click or middle click
|
1607
|
+
return;
|
1608
|
+
}
|
1609
|
+
|
1610
|
+
let grid = this.getRelativeGrid(e);
|
1611
|
+
let pos = grid.getRelativePosition(e);
|
1612
|
+
let colIndex = pos["colIndex"];
|
1613
|
+
let colData = this._getColumnStackOptions(colIndex);
|
1614
|
+
if(!colData) { return; }
|
1615
|
+
|
1616
|
+
e.stopPropagation();
|
1617
|
+
|
1618
|
+
let children = colData.children;
|
1619
|
+
let colIndices = this.getColumnIndices(children);
|
1620
|
+
if(colData.spreading) {
|
1621
|
+
let collapsed = !colData.collapsed;
|
1622
|
+
this.collapseGroup(colIndex, collapsed);
|
1623
|
+
pos["menuData"] = null;
|
1624
|
+
pos["activeIndex"] = -1;
|
1625
|
+
pos["collapsed"] = collapsed;
|
1626
|
+
} else {
|
1627
|
+
let activeIndex = children.indexOf(colData.activeColumn);
|
1628
|
+
let len = children.length;
|
1629
|
+
let menuData = new Array(len);
|
1630
|
+
for(let i = len; --i >= 0;) {
|
1631
|
+
menuData[i] = {
|
1632
|
+
value: i,
|
1633
|
+
selected: i === activeIndex,
|
1634
|
+
label: this.getColumnName(colIndices[i]),
|
1635
|
+
field: this.getColumnField(colIndices[i]),
|
1636
|
+
colId: children[i]
|
1637
|
+
};
|
1638
|
+
}
|
1639
|
+
pos["menuData"] = menuData;
|
1640
|
+
pos["activeIndex"] = activeIndex;
|
1641
|
+
pos["collapsed"] = false;
|
1642
|
+
}
|
1643
|
+
pos["spreading"] = colData.spreading;
|
1644
|
+
pos["columnIndices"] = colIndices;
|
1645
|
+
pos["activeColIndex"] = this.getColumnIndex(colData.activeColumn);
|
1646
|
+
pos["event"] = e;
|
1647
|
+
pos["stackId"] = colData.id;
|
1648
|
+
|
1649
|
+
elem.focus();
|
1650
|
+
|
1651
|
+
if(this._menuElement && !colData.spreading) {
|
1652
|
+
// Populate stack member
|
1653
|
+
let button = pos.event.srcElement;
|
1654
|
+
let el = this._menuElement;
|
1655
|
+
el.data = pos["menuData"];
|
1656
|
+
el.positionTarget = button;
|
1657
|
+
el.opened = true;
|
1658
|
+
}
|
1659
|
+
this._dispatch("clicked", pos);
|
1660
|
+
};
|
1661
|
+
/** @private
|
1662
|
+
* @param {Object} e
|
1663
|
+
*/
|
1664
|
+
ColumnStackPlugin.prototype._onMenuItemClicked = function(e) {
|
1665
|
+
if(e.detail) {
|
1666
|
+
let selectedIndex = parseInt(e.detail.value, 0);
|
1667
|
+
let menuData = this._menuElement.data[selectedIndex];
|
1668
|
+
let colId = menuData.colId;
|
1669
|
+
this.setActiveColumn(colId);
|
1670
|
+
}
|
1671
|
+
this._menuElement.opened = false;
|
1672
|
+
|
1673
|
+
if(this._menuItemClicked) {
|
1674
|
+
this._menuItemClicked(e);
|
1675
|
+
}
|
1676
|
+
};
|
1677
|
+
/** @public
|
1678
|
+
* @description Get member column indices in a stack
|
1679
|
+
* @param {string} stackId
|
1680
|
+
* @return {!Array.<number>} Member column indices
|
1681
|
+
*/
|
1682
|
+
ColumnStackPlugin.prototype.getStackMemberIndices = function(stackId) {
|
1683
|
+
return this.getColumnIndices(this.getStackMemberIds(stackId));
|
1684
|
+
};
|
1685
|
+
|
1686
|
+
/** @public
|
1687
|
+
* @description Get list member column id in a stack
|
1688
|
+
* @param {string} stackId
|
1689
|
+
* @return {!Array.<string>} Member column ids
|
1690
|
+
*/
|
1691
|
+
ColumnStackPlugin.prototype.getStackMemberIds = function(stackId) { // WARNING: This does not filter out invalid members
|
1692
|
+
if(stackId) {
|
1693
|
+
let stack = this._groupDefs.getGroup(stackId);
|
1694
|
+
if(stack){
|
1695
|
+
return stack.children;
|
1696
|
+
}
|
1697
|
+
}
|
1698
|
+
return [];
|
1699
|
+
};
|
1700
|
+
|
1701
|
+
/** @public
|
1702
|
+
* @description Get column id by column index or indices
|
1703
|
+
* @param {number|Array<number>} colIndices
|
1704
|
+
* @return {!Array.<string>} Column ids
|
1705
|
+
*/
|
1706
|
+
ColumnStackPlugin.prototype.getColumnIdsByIndex = function(colIndices) {
|
1707
|
+
if(!Array.isArray(colIndices)){
|
1708
|
+
colIndices = [colIndices];
|
1709
|
+
}
|
1710
|
+
let colIds = [];
|
1711
|
+
let colId;
|
1712
|
+
for(let i = 0; i < colIndices.length; ++i) {
|
1713
|
+
colId = this.getColumnId(colIndices[i]);
|
1714
|
+
colIds.push(colId);
|
1715
|
+
}
|
1716
|
+
return colIds;
|
1717
|
+
};
|
1718
|
+
|
1719
|
+
/** @public
|
1720
|
+
* @description Get column indices by column ids
|
1721
|
+
* @param {string|Array<string>} colIds
|
1722
|
+
* @return {!Array.<string>} Column indices
|
1723
|
+
*/
|
1724
|
+
ColumnStackPlugin.prototype.getColumnIndicesByColumnIds = function(colIds) {
|
1725
|
+
if(!Array.isArray(colIds)){
|
1726
|
+
colIds = [colIds];
|
1727
|
+
}
|
1728
|
+
let colIndices = [];
|
1729
|
+
let colIndex;
|
1730
|
+
for(let i = 0; i < colIds.length; ++i) {
|
1731
|
+
colIndex = this.getColumnIndex(colIds[i]);
|
1732
|
+
colIndices.push(colIndex);
|
1733
|
+
}
|
1734
|
+
return colIndices;
|
1735
|
+
};
|
1736
|
+
|
1737
|
+
/** @public
|
1738
|
+
* @description Get column ids by fields
|
1739
|
+
* @param {string|Array<string>} fields
|
1740
|
+
* @return {!Array.<string>} Column indices
|
1741
|
+
*/
|
1742
|
+
ColumnStackPlugin.prototype.getColumnIdsByFields = function(fields) {
|
1743
|
+
if(!fields) {
|
1744
|
+
return [];
|
1745
|
+
}
|
1746
|
+
let ary = Array.isArray(fields) ? fields : [fields];
|
1747
|
+
let count = fields.length;
|
1748
|
+
let outAry = new Array(count);
|
1749
|
+
for(let i = 0; i < count; ++i) {
|
1750
|
+
let ref = ary[i];
|
1751
|
+
let colIndex = -1;
|
1752
|
+
if(typeof ref === "number") {
|
1753
|
+
colIndex = ref;
|
1754
|
+
} else if(ref) {
|
1755
|
+
if(typeof ref === "string") {
|
1756
|
+
colIndex = this.getColumnIndex(ref);
|
1757
|
+
}
|
1758
|
+
}
|
1759
|
+
outAry[i] = (colIndex >= 0) ? this.getColumnId(colIndex) : "";
|
1760
|
+
}
|
1761
|
+
return outAry;
|
1762
|
+
};
|
1763
|
+
|
1764
|
+
/** @public
|
1765
|
+
* @description Add specific column to a stack
|
1766
|
+
* @param {number|string} colRef column field or column index
|
1767
|
+
* @param {string} stackId
|
1768
|
+
*/
|
1769
|
+
ColumnStackPlugin.prototype.addColumnToStack = function(colRef, stackId) {
|
1770
|
+
let colId = this._toColumnId(colRef);
|
1771
|
+
|
1772
|
+
let stack = this._groupDefs.getGroup(stackId);
|
1773
|
+
let isColumnStackable = !this._groupDefs.getParentGroup(colId);
|
1774
|
+
|
1775
|
+
// if column not stackable or destination stack not exist, do nothing
|
1776
|
+
if(!isColumnStackable || !stack){
|
1777
|
+
return;
|
1778
|
+
}
|
1779
|
+
|
1780
|
+
this._hideStackedColumns(stack, this.getColumnIndex(colId));
|
1781
|
+
|
1782
|
+
// apply stacking
|
1783
|
+
this._groupDefs.addGroupChild(stackId, colId);
|
1784
|
+
|
1785
|
+
// To avoid state interference from Core Grid, keep the pin state before moving the columns
|
1786
|
+
let host = this._hosts[0];
|
1787
|
+
let leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
1788
|
+
let rightPinnedCount = host.getPinnedRightColumnCount();
|
1789
|
+
let colIndex = this.getColumnIndex(colId);
|
1790
|
+
|
1791
|
+
// Pack stacked columns together
|
1792
|
+
this._moveStackedColumns(stack.children);
|
1793
|
+
|
1794
|
+
// If an unpinned column is added to a pinned stack, the pinning position should be updated
|
1795
|
+
if(stack.leftPinned || stack.rightPinned) {
|
1796
|
+
let colCount = this.getColumnCount();
|
1797
|
+
if(stack.leftPinned && colIndex > leftPinnedIndex) {
|
1798
|
+
leftPinnedIndex++;
|
1799
|
+
this._freezeColumn(leftPinnedIndex, rightPinnedCount);
|
1800
|
+
} else if(stack.rightPinned && colIndex < (colCount - rightPinnedCount)) {
|
1801
|
+
rightPinnedCount++;
|
1802
|
+
this._freezeColumn(leftPinnedIndex, rightPinnedCount);
|
1803
|
+
}
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
this._updateUI();
|
1807
|
+
};
|
1808
|
+
|
1809
|
+
/** @public
|
1810
|
+
* @description Remove specific column from its own stack
|
1811
|
+
* @param {number|string} colRef column field or column index
|
1812
|
+
*/
|
1813
|
+
ColumnStackPlugin.prototype.removeColumnFromStack = function(colRef) {
|
1814
|
+
let colIndex = (typeof colRef === "string") ? this.getColumnIndex(colRef) : colRef;
|
1815
|
+
if(colIndex < 0) {
|
1816
|
+
return;
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
let colId = this.getColumnId(colIndex);
|
1820
|
+
let stack = this._groupDefs.getParentGroup(colId);
|
1821
|
+
|
1822
|
+
if(!stack) {
|
1823
|
+
return;
|
1824
|
+
}
|
1825
|
+
|
1826
|
+
let children = stack.children;
|
1827
|
+
let memberCount = children.length;
|
1828
|
+
if(memberCount <= 2) {
|
1829
|
+
if(memberCount === 2) {
|
1830
|
+
if(colId === children[0]) { // If the first column is removed from the stack, move it to the end of stack
|
1831
|
+
// This assumes that the column order is already in correct position
|
1832
|
+
this.moveColumnById(colIndex, this.getColumnIndex(children[1]) + 1);
|
1833
|
+
}
|
1834
|
+
}
|
1835
|
+
this.removeStack(stack.id); // updateUI will be called
|
1836
|
+
return;
|
1837
|
+
}
|
1838
|
+
|
1839
|
+
let colIndices = this.getColumnIndices(children);
|
1840
|
+
this._removeRefFromStack(stack, colId, colIndex);
|
1841
|
+
|
1842
|
+
this.moveColumnById(colIndex, colIndices[memberCount - 1] + 1); // This assumes that the column order is already in correct position
|
1843
|
+
|
1844
|
+
this._updateUI();
|
1845
|
+
};
|
1846
|
+
|
1847
|
+
/** @public
|
1848
|
+
* @description Reorder columns in a stack
|
1849
|
+
* @param {Array.<number|string>} colRefs Column Ids, indices, or fields
|
1850
|
+
* @param {string} stackId
|
1851
|
+
*/
|
1852
|
+
ColumnStackPlugin.prototype.reorderStackColumns = function(colRefs, stackId) {
|
1853
|
+
let stack = this._groupDefs.getGroup(stackId);
|
1854
|
+
if(!stack) {
|
1855
|
+
return;
|
1856
|
+
}
|
1857
|
+
if(!colRefs || !colRefs.length) {
|
1858
|
+
return; // Nothing to be reordered
|
1859
|
+
}
|
1860
|
+
let colIndices = this.getColumnIndices(colRefs); // Slow
|
1861
|
+
if(!colIndices.length) {
|
1862
|
+
return; // Given input has no valid column
|
1863
|
+
}
|
1864
|
+
|
1865
|
+
let curMemberIndices = this.getStackMemberIndices(stackId); // Slow
|
1866
|
+
let memberCount = curMemberIndices.length;
|
1867
|
+
let indexMap = {};
|
1868
|
+
for(let i = 0; i < memberCount; ++i) {
|
1869
|
+
let colIndex = curMemberIndices[i];
|
1870
|
+
indexMap[colIndex] = colIndices.indexOf(colIndex);
|
1871
|
+
}
|
1872
|
+
|
1873
|
+
curMemberIndices.sort(_indexSorter.bind(null, indexMap));
|
1874
|
+
this.reorderColumns(curMemberIndices, curMemberIndices[0]);
|
1875
|
+
};
|
1876
|
+
|
1877
|
+
/** @public
|
1878
|
+
* @description Set stack name to a stack
|
1879
|
+
* @param {string} stackId
|
1880
|
+
* @param {string} name
|
1881
|
+
*/
|
1882
|
+
ColumnStackPlugin.prototype.setStackName = function(stackId, name) {
|
1883
|
+
this._groupDefs.setGroupName(stackId, name);
|
1884
|
+
};
|
1885
|
+
|
1886
|
+
/** @public
|
1887
|
+
* @description Get stack name from specific stack
|
1888
|
+
* @param {string} stackId
|
1889
|
+
* @return {string} Stack name
|
1890
|
+
*/
|
1891
|
+
ColumnStackPlugin.prototype.getStackName = function(stackId) {
|
1892
|
+
return this._groupDefs.getGroupName(stackId);
|
1893
|
+
};
|
1894
|
+
|
1895
|
+
/** @public
|
1896
|
+
* @description Get active column id of specific stack
|
1897
|
+
* @param {string} stackId
|
1898
|
+
* @return {string} active column id
|
1899
|
+
*/
|
1900
|
+
ColumnStackPlugin.prototype.getActiveColumnId = function(stackId) {
|
1901
|
+
let stack = this._groupDefs.getGroup(stackId);
|
1902
|
+
if(stack){
|
1903
|
+
return stack.activeColumn || "";
|
1904
|
+
}
|
1905
|
+
return "";
|
1906
|
+
};
|
1907
|
+
/** @public
|
1908
|
+
* @description Get active column field of specific stack
|
1909
|
+
* @param {string} stackId
|
1910
|
+
* @return {string} active column field
|
1911
|
+
*/
|
1912
|
+
ColumnStackPlugin.prototype.getActiveColumnField = function(stackId) {
|
1913
|
+
return this.getColumnField(this.getActiveColumnIndex(stackId));
|
1914
|
+
};
|
1915
|
+
|
1916
|
+
/** @public
|
1917
|
+
* @description Get active column index of specific stack
|
1918
|
+
* @param {string} stackId
|
1919
|
+
* @return {number} active column index
|
1920
|
+
*/
|
1921
|
+
ColumnStackPlugin.prototype.getActiveColumnIndex = function(stackId) {
|
1922
|
+
let stack = this._groupDefs.getGroup(stackId);
|
1923
|
+
if(stack){
|
1924
|
+
return this.getColumnIndex(stack.activeColumn);
|
1925
|
+
}
|
1926
|
+
return -1;
|
1927
|
+
};
|
1928
|
+
|
1929
|
+
/** @public
|
1930
|
+
* @param {string} stackId
|
1931
|
+
* @param {number|string} colRef Column Id, index or field
|
1932
|
+
*/
|
1933
|
+
ColumnStackPlugin.prototype.addStackChild = function(stackId, colRef) {
|
1934
|
+
this.addColumnToStack(colRef, stackId);
|
1935
|
+
};
|
1936
|
+
/**
|
1937
|
+
* @public
|
1938
|
+
* @param {string} stackId
|
1939
|
+
* @param {number|string} colRef Column Id, index or field
|
1940
|
+
*/
|
1941
|
+
ColumnStackPlugin.prototype.removeStackChild = function(stackId, colRef) {
|
1942
|
+
if(stackId === this.getStackId(colRef)) {
|
1943
|
+
this.removeColumnFromStack(colRef);
|
1944
|
+
}
|
1945
|
+
};
|
1946
|
+
/** @public
|
1947
|
+
* @function
|
1948
|
+
* @param {number|string} colRef Column Id, index or field
|
1949
|
+
*/
|
1950
|
+
ColumnStackPlugin.prototype.unsetParent = ColumnStackPlugin.prototype.removeColumnFromStack;
|
1951
|
+
|
1952
|
+
/** Move and reorder the specified columns to position before the destination
|
1953
|
+
* @public
|
1954
|
+
* @param {Array.<number|string>} colList Column list to be reordered
|
1955
|
+
* @param {(number|string)=} destCol Destination column id or index
|
1956
|
+
* @return {boolean}
|
1957
|
+
*/
|
1958
|
+
ColumnStackPlugin.prototype.reorderColumns = function(colList, destCol) {
|
1959
|
+
return this._reorderColumns(colList, destCol);
|
1960
|
+
};
|
1961
|
+
/** Move the specified column to position before the destination
|
1962
|
+
* @public
|
1963
|
+
* @param {number|string} srcCol Source column id or index
|
1964
|
+
* @param {(number|string)=} destCol Destination column id or index
|
1965
|
+
* @return {boolean}
|
1966
|
+
*/
|
1967
|
+
ColumnStackPlugin.prototype.moveColumnById = function(srcCol, destCol) {
|
1968
|
+
return this._moveColumnById(srcCol, destCol);
|
1969
|
+
};
|
1970
|
+
|
1971
|
+
/** @private
|
1972
|
+
* @description Check for active column in a stack if it needs an update.
|
1973
|
+
* @param {Object} stackOpt
|
1974
|
+
*/
|
1975
|
+
ColumnStackPlugin.prototype._updateActiveColumn = function(stackOpt) {
|
1976
|
+
if(_resolveActiveColumn(stackOpt)) {
|
1977
|
+
// TODO: Add a proper way to set visibility to activeColumn when activeColumn is changed
|
1978
|
+
let activeColIndex = this.getColumnIndex(stackOpt.activeColumn);
|
1979
|
+
if(activeColIndex >= 0) {
|
1980
|
+
this._setColumnVisibility(activeColIndex, true);
|
1981
|
+
this._updateUI();
|
1982
|
+
}
|
1983
|
+
}
|
1984
|
+
};
|
1985
|
+
|
1986
|
+
/** @public
|
1987
|
+
* @description Hide specific stack from grid
|
1988
|
+
* @param {string} stackId
|
1989
|
+
* @param {boolean=} hidden
|
1990
|
+
*/
|
1991
|
+
ColumnStackPlugin.prototype.hideStack = function(stackId, hidden) {
|
1992
|
+
if(!stackId){
|
1993
|
+
return;
|
1994
|
+
}
|
1995
|
+
let stackOption = this._groupDefs.getGroup(stackId);
|
1996
|
+
if(!stackOption){
|
1997
|
+
return;
|
1998
|
+
}
|
1999
|
+
|
2000
|
+
if(hidden == null){
|
2001
|
+
hidden = true;
|
2002
|
+
}
|
2003
|
+
let children = stackOption.children;
|
2004
|
+
for(let i = 0; i < children.length; i++){
|
2005
|
+
for(let g = this._hosts.length; --g >= 0;) {
|
2006
|
+
this._hosts[g].hideColumn(this.getColumnIndex(children[i]), hidden);
|
2007
|
+
}
|
2008
|
+
}
|
2009
|
+
};
|
2010
|
+
|
2011
|
+
/** @public
|
2012
|
+
* @description Show specific stack from grid
|
2013
|
+
* @param {string} stackId
|
2014
|
+
*/
|
2015
|
+
ColumnStackPlugin.prototype.showStack = function(stackId) {
|
2016
|
+
if(!stackId){
|
2017
|
+
return;
|
2018
|
+
}
|
2019
|
+
this.hideStack(stackId, false);
|
2020
|
+
};
|
2021
|
+
|
2022
|
+
/** @public
|
2023
|
+
* @description Get hidden status of specific stack
|
2024
|
+
* @param {string} stackId
|
2025
|
+
* @return {boolean|null}
|
2026
|
+
*/
|
2027
|
+
ColumnStackPlugin.prototype.isStackHidden = function(stackId) {
|
2028
|
+
let stackOption = this._groupDefs.getGroup(stackId);
|
2029
|
+
let host = this._host || this._hosts[0];
|
2030
|
+
|
2031
|
+
if(!stackOption || !host){
|
2032
|
+
return null;
|
2033
|
+
}
|
2034
|
+
|
2035
|
+
let activeColIndex = this.getColumnIndex(stackOption.activeColumn);
|
2036
|
+
let isVisible = host.isColumnVisible(activeColIndex);
|
2037
|
+
|
2038
|
+
return !isVisible;
|
2039
|
+
};
|
2040
|
+
/** Move an entire stack to position before the destination
|
2041
|
+
* @public
|
2042
|
+
* @param {string} stackId Stack id to be moved
|
2043
|
+
* @param {(number|string)=} destCol Destination column id or index
|
2044
|
+
* @return {boolean}
|
2045
|
+
*/
|
2046
|
+
ColumnStackPlugin.prototype.moveStack = function(stackId, destCol) {
|
2047
|
+
if(!stackId){
|
2048
|
+
return false;
|
2049
|
+
}
|
2050
|
+
let colList = this.getStackMemberIds(stackId);
|
2051
|
+
let dirty = this.reorderColumns(colList, destCol);
|
2052
|
+
return dirty;
|
2053
|
+
};
|
2054
|
+
|
2055
|
+
/** @public
|
2056
|
+
* @param {string} stackId
|
2057
|
+
* @param {string=} side Available values are: left|right. If no value is supplied, all columns will be pinned to the left.
|
2058
|
+
*/
|
2059
|
+
ColumnStackPlugin.prototype.pinStack = function(stackId, side) {
|
2060
|
+
if(!stackId) {
|
2061
|
+
return;
|
2062
|
+
}
|
2063
|
+
|
2064
|
+
let stack = this._groupDefs.getGroup(stackId);
|
2065
|
+
if(!stack) {
|
2066
|
+
return;
|
2067
|
+
}
|
2068
|
+
|
2069
|
+
let host = this._hosts[0];
|
2070
|
+
let leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
2071
|
+
let rightPinnedCount = host.getPinnedRightColumnCount();
|
2072
|
+
let colCount = this.getColumnCount();
|
2073
|
+
let colList = this.getStackMemberIds(stackId);
|
2074
|
+
let len = colList.length;
|
2075
|
+
|
2076
|
+
let dest;
|
2077
|
+
if(side === "right") {
|
2078
|
+
if(stack.rightPinned) {
|
2079
|
+
return;
|
2080
|
+
}
|
2081
|
+
if(stack.leftPinned) {
|
2082
|
+
this.unpinStack(stackId);
|
2083
|
+
leftPinnedIndex = host.getFrozenColumnCount() - 1;
|
2084
|
+
}
|
2085
|
+
stack.rightPinned = true;
|
2086
|
+
dest = colCount - rightPinnedCount;
|
2087
|
+
rightPinnedCount = rightPinnedCount + len;
|
2088
|
+
} else {
|
2089
|
+
if(stack.leftPinned) {
|
2090
|
+
return;
|
2091
|
+
}
|
2092
|
+
if(stack.rightPinned) {
|
2093
|
+
this.unpinStack(stackId);
|
2094
|
+
rightPinnedCount = host.getPinnedRightColumnCount();
|
2095
|
+
}
|
2096
|
+
stack.leftPinned = true;
|
2097
|
+
dest = leftPinnedIndex === -1 ? 0 : leftPinnedIndex + 1;
|
2098
|
+
leftPinnedIndex = leftPinnedIndex + len;
|
2099
|
+
}
|
2100
|
+
|
2101
|
+
this.reorderColumns(colList, dest);
|
2102
|
+
this._freezeColumn(leftPinnedIndex, rightPinnedCount);
|
2103
|
+
};
|
2104
|
+
|
2105
|
+
/** @public
|
2106
|
+
* @param {string} stackId
|
2107
|
+
* @param {(number|string)=} dest The unpinned stack will be placed before the destination position after the operation
|
2108
|
+
*/
|
2109
|
+
ColumnStackPlugin.prototype.unpinStack = function(stackId, dest) {
|
2110
|
+
if(!stackId) {
|
2111
|
+
return;
|
2112
|
+
}
|
2113
|
+
|
2114
|
+
let stack = this._groupDefs.getGroup(stackId);
|
2115
|
+
if(!stack) {
|
2116
|
+
return;
|
2117
|
+
}
|
2118
|
+
|
2119
|
+
if(!stack.leftPinned && !stack.rightPinned) {
|
2120
|
+
return;
|
2121
|
+
}
|
2122
|
+
|
2123
|
+
let host = this._hosts[0];
|
2124
|
+
let leftPinnedCount = host.getFrozenColumnCount();
|
2125
|
+
let rightPinnedCount = host.getPinnedRightColumnCount();
|
2126
|
+
let colCount = this.getColumnCount();
|
2127
|
+
let firstRightPinnedIndex = colCount - rightPinnedCount;
|
2128
|
+
let colList = this.getStackMemberIds(stackId);
|
2129
|
+
let len = colList.length;
|
2130
|
+
|
2131
|
+
let destId = null;
|
2132
|
+
if(dest != null) {
|
2133
|
+
let destIdx = this.getColumnIndex(dest);
|
2134
|
+
destId = this.getColumnId(destIdx);
|
2135
|
+
}
|
2136
|
+
|
2137
|
+
if(stack.leftPinned) {
|
2138
|
+
stack.leftPinned = false;
|
2139
|
+
this.reorderColumns(colList, leftPinnedCount);
|
2140
|
+
this._freezeColumn(leftPinnedCount - (1 + len));
|
2141
|
+
} else if(stack.rightPinned) {
|
2142
|
+
stack.rightPinned = false;
|
2143
|
+
this.reorderColumns(colList, firstRightPinnedIndex);
|
2144
|
+
this._freezeColumn(leftPinnedCount - 1, rightPinnedCount - len);
|
2145
|
+
}
|
2146
|
+
|
2147
|
+
if(destId != null) {
|
2148
|
+
this.reorderColumns(colList, destId);
|
2149
|
+
}
|
2150
|
+
};
|
2151
|
+
|
2152
|
+
|
2153
|
+
|
2154
|
+
export default ColumnStackPlugin;
|
2155
|
+
export { ColumnStackPlugin, ColumnStackPlugin as ColumnStack, ColumnStackPlugin as ColumnStackExtension };
|