@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,1728 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
|
4
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
|
+
import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
6
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
|
+
|
8
|
+
/** @typedef {Object} RowGroupingPlugin~Options
|
9
|
+
* @description The options can be specified by `rowGrouping` property of the main grid's options
|
10
|
+
* @property {boolean=} autoGroupRemoval=false Remove group that has no row member.
|
11
|
+
* @property {boolean=} autoGroupHiding=false Hide "null" or "undefined" group headers, while keeping the group's items intact.
|
12
|
+
* @property {(Array|Array.<Array>)=} predefinedGroups=null Add groups without content rows. Use 2D array for multi-level grouping.
|
13
|
+
* @property {RowGroupingPlugin~GroupCriteria=} groupBy=null GroupCriteria can be string, function, or array of string.
|
14
|
+
* @property {RowGroupingPlugin~GroupCriteria=} groupCriteria=null Alias to `groupBy`.
|
15
|
+
* @property {number=} displayColumn=0 Column Index for group header rendering.
|
16
|
+
* @property {boolean=} fixedDisplayColumn=false If enabled, displayColumn will remain in the same index, even if columns are shifted by insertion or removal.
|
17
|
+
* @property {boolean=} noCollapsible=false If enabled, arrows will be hidden and cell is not clickable. This flag takes precedence over `clickableCell` and `hiddenArrow`.
|
18
|
+
* @property {boolean=} clickableCell=true If disabled, clicking at cell will not expand that group
|
19
|
+
* @property {(boolean|number|Array.<number>)=} hiddenArrow Specify header levels which is a single number start from 1 or an array of number that want to hide arrow icon. If specify true all arrows will be hidden.
|
20
|
+
* @property {boolean=} contentAsHeader=false If enabled, second level group header rows are hidden, the first content rows become a header, cells are not be clickable, and arrows are hidden.
|
21
|
+
* @property {boolean=} headerSpanning=true If disabled, every cell on the group header row is displayed
|
22
|
+
* @property {boolean=} footerSpanning=false If enabled, only cells from the first column will be shown, spanning over other cells
|
23
|
+
* @property {RowGroupingPlugin~GroupSortLogic=} groupSortLogic=null Logic for group sorting. There is no sorting by default (i.e. groups are placed in order of their creation time)
|
24
|
+
* @property {boolean=} autoGroupSorting=false If enabled, group sorting will be performed after each `groupAdded` event
|
25
|
+
* @property {(boolean|number|Array.<number>)=} indentSize Use array to define indent for each group level. Use boolean to turn on or off indentation. Use number to define incremental step.
|
26
|
+
* @property {boolean=} colorTag If not specified, the color tag will be disabled when using extension without halo theme.
|
27
|
+
* @property {Object=} predefinedColors Predefined color object map for color tag
|
28
|
+
* @property {Object=} groupColors - The object map of group ID and predefined color.
|
29
|
+
* @property {boolean=} defaultCollapse=false Collapsing groups by default when a group is created
|
30
|
+
* @property {Function=} clicked=null Event handler when user clicks on arrows or cells
|
31
|
+
* @property {Function=} groupAdded=null Event handler
|
32
|
+
* @property {Function=} beforeGroupAdded=null Event handler
|
33
|
+
* @property {Function=} groupHeaderBinding=null Logic that will be executed on each group header row
|
34
|
+
* @property {Function=} groupFooterBinding=null Once defined, footer row will be added on each group
|
35
|
+
* @property {Function=} headerBinding=null Shorthand for `groupHeaderBinding`
|
36
|
+
* @property {Function=} footerBinding=null Shorthand for `groupFooterBinding`
|
37
|
+
* @property {Function=} nonGroupBinding=null This is used to clear any custom styling defined in groupHeaderBinding or groupFooterBinding
|
38
|
+
*/
|
39
|
+
|
40
|
+
/** @event RowGroupingPlugin#clicked
|
41
|
+
* @description Fired when users click on UIs that trigger expanding or collapsing a group
|
42
|
+
* @type {Object}
|
43
|
+
* @property {number} rowIndex
|
44
|
+
* @property {boolean} expanded
|
45
|
+
* @property {Object} group Data view that represents currently clicked group header row
|
46
|
+
*/
|
47
|
+
/** @event RowGroupingPlugin#beforeGroupAdded
|
48
|
+
* @description Fired each time before group added. Set property `cancel` to true to cancel adding of the new group
|
49
|
+
* @type {Object}
|
50
|
+
* @property {Object} dataView DataView instance
|
51
|
+
* @property {string} newGroupId
|
52
|
+
* @property {*} newGroupValue
|
53
|
+
* @property {string} newGroupRowId Unique row Id given for the group
|
54
|
+
*/
|
55
|
+
/** @event RowGroupingPlugin#groupAdded
|
56
|
+
* @property {Object} dataView Parent DataView that create the new group
|
57
|
+
* @property {Object} newGroup Child DataView that is newly created
|
58
|
+
*/
|
59
|
+
|
60
|
+
/** @event RowGroupingPlugin#groupFooterBinding
|
61
|
+
* @description Fired when footer of each group is rendered
|
62
|
+
* @type {Object}
|
63
|
+
* @property {object} rowData
|
64
|
+
* @property {number} colIndex
|
65
|
+
* @property {number} rowIndex
|
66
|
+
* @property {string} rowId
|
67
|
+
* @property {number} footerIndex
|
68
|
+
* @property {string} groupId
|
69
|
+
* @property {boolean} footerRow
|
70
|
+
* @property {Object} cell Grid cell instance
|
71
|
+
* @property {Object} section VirtualizedLayoutGrid
|
72
|
+
* @property {Object} dataSource Parent DataView of group
|
73
|
+
*/
|
74
|
+
/** @event RowGroupingPlugin#groupHeaderBinding
|
75
|
+
* @description Fired when header of each group is rendered
|
76
|
+
* @type {Object}
|
77
|
+
* @property {object} rowData
|
78
|
+
* @property {number} colIndex
|
79
|
+
* @property {number} rowIndex
|
80
|
+
* @property {string} rowId
|
81
|
+
* @property {number} footerIndex
|
82
|
+
* @property {string} groupId
|
83
|
+
* @property {boolean} footerRow
|
84
|
+
* @property {Object} cell Grid cell instance
|
85
|
+
* @property {Object} section VirtualizedLayoutGrid
|
86
|
+
* @property {Object} dataSource Parent DataView of group
|
87
|
+
*/
|
88
|
+
/** @event RowGroupingPlugin#nonGroupBinding
|
89
|
+
* @description Fired for each normal content row rendering
|
90
|
+
* @type {Object}
|
91
|
+
* @property {object} rowData
|
92
|
+
* @property {number} colIndex
|
93
|
+
* @property {number} rowIndex
|
94
|
+
* @property {string} rowId
|
95
|
+
* @property {Object} cell Grid cell instance
|
96
|
+
* @property {Object} section VirtualizedLayoutGrid
|
97
|
+
* @property {Object} dataSource Root DataView of all group
|
98
|
+
* @property {boolean} noIndent set this property to true to prevent cell add indent
|
99
|
+
*/
|
100
|
+
|
101
|
+
/** @callback RowGroupingPlugin~GroupSortLogic
|
102
|
+
* @description Method parameters provided by `groupSortLogic` callback
|
103
|
+
* @param {*} grpValA Group value of the group in left hand side
|
104
|
+
* @param {*} grpValB Group value of the group in right hand side
|
105
|
+
* @param {Object=} grpDataViewA DataView of the group in left hand side
|
106
|
+
* @param {Object=} grpDataViewB DataView of the group in right hand side
|
107
|
+
* @return {number}
|
108
|
+
*/
|
109
|
+
|
110
|
+
/** @typedef {string|Array.<string|Function>} RowGroupingPlugin~GroupCriteria
|
111
|
+
* @description GroupCriteria can be one of the following values: <br>
|
112
|
+
* <b>null</b> input will clear all existing grouping criteria <br>
|
113
|
+
* <b>string</b> input is treat as column/field name in the data table <br>
|
114
|
+
* <b>Function</b> input is for custom criteria <br>
|
115
|
+
* <b>Array</b> input will create multiple groups in tree like manner (nested group criteria)
|
116
|
+
*/
|
117
|
+
|
118
|
+
/** @typedef {Object} RowGroupingPlugin~GroupingState
|
119
|
+
* @description state of groupings or JSON String
|
120
|
+
* @property {boolean} collapsed
|
121
|
+
* @property {(number|string)=} groupId
|
122
|
+
*/
|
123
|
+
|
124
|
+
/** Creates groups based on the given criteria. Group should appears in order of data in the data view. Use {@link RowGroupingPlugin#sortGroups} to re-order groups manually.
|
125
|
+
* @constructor
|
126
|
+
* @extends {GridPlugin}
|
127
|
+
* @param {RowGroupingPlugin~Options=} options Extension's configuration object
|
128
|
+
*/
|
129
|
+
let RowGroupingPlugin = function (options) {
|
130
|
+
let t = this;
|
131
|
+
t._onColumnIndexChanged = t._onColumnIndexChanged.bind(t);
|
132
|
+
t._getRowsForContentAsHeader = t._getRowsForContentAsHeader.bind(t);
|
133
|
+
t._onPostSectionDataBinding = t._onPostSectionDataBinding.bind(t);
|
134
|
+
t._onCellClicked = t._onCellClicked.bind(t);
|
135
|
+
t._onMapCriteria = t._onMapCriteria.bind(t);
|
136
|
+
t._onGroupCriteriaChanged = t._onGroupCriteriaChanged.bind(t);
|
137
|
+
t._onGroupAdded = t._onGroupAdded.bind(t);
|
138
|
+
t._onBeforeGroupAdded = t._onBeforeGroupAdded.bind(t);
|
139
|
+
t._updateCursor = t._updateCursor.bind(t);
|
140
|
+
t.updateHeaders = t.updateHeaders.bind(t);
|
141
|
+
t.sortGroups = t.sortGroups.bind(t);
|
142
|
+
t._onItemGroupColumnClicked = t._onItemGroupColumnClicked.bind(t);
|
143
|
+
t._onItemUnGroupColumnClicked = t._onItemUnGroupColumnClicked.bind(t);
|
144
|
+
t._onItemExpandAllClicked = t._onItemExpandAllClicked.bind(t);
|
145
|
+
t._onItemCollapseAllClicked = t._onItemCollapseAllClicked.bind(t);
|
146
|
+
|
147
|
+
t._criteria = [];
|
148
|
+
t._criteriaFuncs = [];
|
149
|
+
t._hosts = [];
|
150
|
+
t.config({ "rowGrouping": options });
|
151
|
+
};
|
152
|
+
Ext.inherits(RowGroupingPlugin, GridPlugin);
|
153
|
+
|
154
|
+
/** @type {boolean}
|
155
|
+
* @private
|
156
|
+
*/
|
157
|
+
RowGroupingPlugin.prototype._dirty = false;
|
158
|
+
/** @type {boolean}
|
159
|
+
* @private
|
160
|
+
*/
|
161
|
+
RowGroupingPlugin.prototype._shouldUpdateDisplayColumn = true;
|
162
|
+
/** @type {!Array.<string|Function>}
|
163
|
+
* @private
|
164
|
+
*/
|
165
|
+
RowGroupingPlugin.prototype._criteria;
|
166
|
+
/** @type {!Array.<Function>}
|
167
|
+
* @private
|
168
|
+
*/
|
169
|
+
RowGroupingPlugin.prototype._criteriaFuncs;
|
170
|
+
/** @type {Array}
|
171
|
+
* @private
|
172
|
+
*/
|
173
|
+
RowGroupingPlugin.prototype._predefinedGroups = null;
|
174
|
+
/** @type {Function}
|
175
|
+
* @private
|
176
|
+
*/
|
177
|
+
RowGroupingPlugin.prototype._groupSortFunction;
|
178
|
+
|
179
|
+
/** @type {boolean}
|
180
|
+
* @private
|
181
|
+
*/
|
182
|
+
RowGroupingPlugin.prototype._disabled = false;
|
183
|
+
/** @type {boolean}
|
184
|
+
* @private
|
185
|
+
*/
|
186
|
+
RowGroupingPlugin.prototype._fixedDisplayColumn = -1;
|
187
|
+
/** @type {number}
|
188
|
+
* @private
|
189
|
+
*/
|
190
|
+
RowGroupingPlugin.prototype._displayColumn = 0; // Target prospect column
|
191
|
+
/** @type {number}
|
192
|
+
* @private
|
193
|
+
*/
|
194
|
+
RowGroupingPlugin.prototype._headerColumn = -1; // Actual display column
|
195
|
+
/** @type {string}
|
196
|
+
* @private
|
197
|
+
*/
|
198
|
+
RowGroupingPlugin.prototype._headerColumnField = ''; // Actual display column field
|
199
|
+
/** @type {Array.<number>}
|
200
|
+
* @private
|
201
|
+
*/
|
202
|
+
RowGroupingPlugin.prototype._indentSizes = null;
|
203
|
+
/** @type {number}
|
204
|
+
* @private
|
205
|
+
*/
|
206
|
+
RowGroupingPlugin.prototype._arrowSize = 9; // Solar theme's arrow size
|
207
|
+
/** @type {boolean}
|
208
|
+
* @private
|
209
|
+
*/
|
210
|
+
RowGroupingPlugin.prototype._noCollapsible = false;
|
211
|
+
/** @type {boolean}
|
212
|
+
* @private
|
213
|
+
*/
|
214
|
+
RowGroupingPlugin.prototype._headerSpanning = true;
|
215
|
+
/** @type {boolean}
|
216
|
+
* @private
|
217
|
+
*/
|
218
|
+
RowGroupingPlugin.prototype._footerSpanning = false;
|
219
|
+
/** @type {boolean}
|
220
|
+
* @private
|
221
|
+
*/
|
222
|
+
RowGroupingPlugin.prototype._autoGroupSorting = false;
|
223
|
+
/** @type {number}
|
224
|
+
* @private
|
225
|
+
*/
|
226
|
+
RowGroupingPlugin.prototype._sortingTimer = 0;
|
227
|
+
/** @type {number}
|
228
|
+
* @private
|
229
|
+
*/
|
230
|
+
RowGroupingPlugin.prototype._footerRows = 0;
|
231
|
+
/** @type {boolean}
|
232
|
+
* @private
|
233
|
+
*/
|
234
|
+
RowGroupingPlugin.prototype._autoGroupRemoval = false;
|
235
|
+
/** @type {boolean}
|
236
|
+
* @private
|
237
|
+
*/
|
238
|
+
RowGroupingPlugin.prototype._autoGroupHiding = false;
|
239
|
+
/** @type {boolean}
|
240
|
+
* @private
|
241
|
+
*/
|
242
|
+
RowGroupingPlugin.prototype._contentAsHeader = false;
|
243
|
+
/** @type {number}
|
244
|
+
* @private
|
245
|
+
*/
|
246
|
+
RowGroupingPlugin.prototype._timerId = 0;
|
247
|
+
/** @type {string}
|
248
|
+
* @private
|
249
|
+
*/
|
250
|
+
RowGroupingPlugin._iconName = ""; // static variable
|
251
|
+
/** @type {boolean}
|
252
|
+
* @private
|
253
|
+
*/
|
254
|
+
RowGroupingPlugin.prototype._clickableCell = true;
|
255
|
+
/** @type {boolean|Object}
|
256
|
+
* @private
|
257
|
+
*/
|
258
|
+
RowGroupingPlugin.prototype._hiddenArrow = false;
|
259
|
+
/** @type {boolean}
|
260
|
+
* @private
|
261
|
+
*/
|
262
|
+
RowGroupingPlugin.prototype._clickDisabled = false;
|
263
|
+
/** @type {Object}
|
264
|
+
* @private
|
265
|
+
*/
|
266
|
+
RowGroupingPlugin.prototype._rowPainter = null;
|
267
|
+
/** @type {boolean|null}
|
268
|
+
* @private
|
269
|
+
*/
|
270
|
+
RowGroupingPlugin.prototype._colorTag = null;
|
271
|
+
/** @type {Object}
|
272
|
+
* @private
|
273
|
+
*/
|
274
|
+
RowGroupingPlugin.prototype._predefinedColors = null;
|
275
|
+
/** @type {Object}
|
276
|
+
* @private
|
277
|
+
*/
|
278
|
+
RowGroupingPlugin.prototype._groupColors = null;
|
279
|
+
/** @type {string}
|
280
|
+
* @private
|
281
|
+
*/
|
282
|
+
RowGroupingPlugin._controlClass = "predefined-color-tag";
|
283
|
+
/** @type {Object}
|
284
|
+
* @private
|
285
|
+
*/
|
286
|
+
RowGroupingPlugin.prototype._styleTag = null;
|
287
|
+
|
288
|
+
/** @type {Function}
|
289
|
+
* @private
|
290
|
+
*/
|
291
|
+
RowGroupingPlugin.prototype._criteriaGetter = null;
|
292
|
+
|
293
|
+
|
294
|
+
/** @private
|
295
|
+
* @function
|
296
|
+
* @param {string} field
|
297
|
+
* @param {Object} dvRowData
|
298
|
+
* @return {Array.<string>}
|
299
|
+
*/
|
300
|
+
RowGroupingPlugin._defaultCriteriaGetter = function (field, dvRowData) {
|
301
|
+
let val = dvRowData[field];
|
302
|
+
return RowGroupingPlugin._toArrayOfString(val);
|
303
|
+
};
|
304
|
+
/** @private
|
305
|
+
* @function
|
306
|
+
* @param {string} field
|
307
|
+
* @param {Object} dvRowData
|
308
|
+
* @return {Array.<string>}
|
309
|
+
*/
|
310
|
+
RowGroupingPlugin._rowDefCriteriaGetter = function (field, dvRowData) {
|
311
|
+
let rowData = /** @type{Object} */(dvRowData.ROW_DEF.getRowData());
|
312
|
+
let val = rowData[field];
|
313
|
+
return RowGroupingPlugin._toArrayOfString(val);
|
314
|
+
};
|
315
|
+
/** @private
|
316
|
+
* @function
|
317
|
+
* @param {string|Array} data
|
318
|
+
* @return {Array.<string>}
|
319
|
+
*/
|
320
|
+
RowGroupingPlugin._toArrayOfString = function (data) {
|
321
|
+
if(Array.isArray(data)) {
|
322
|
+
return data.map(String);
|
323
|
+
} else {
|
324
|
+
return [data + ""];
|
325
|
+
}
|
326
|
+
};
|
327
|
+
|
328
|
+
/** @private
|
329
|
+
* @param {Array.<Object>} columns
|
330
|
+
* @return {number} Return negative number if the column not found
|
331
|
+
* Note: _findCheckboxColumnIndexFromConfig function is duplicated in CheckboxExtension
|
332
|
+
*/
|
333
|
+
RowGroupingPlugin.prototype._findCheckboxColumnIndexFromConfig = function (columns) {
|
334
|
+
if (!Array.isArray(columns)) return -1;
|
335
|
+
let index = -1, c = columns.length;
|
336
|
+
for (let i = 0; i < c; i++) {
|
337
|
+
if (columns[i].checkboxColumn) {
|
338
|
+
index = i;
|
339
|
+
break;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
return index;
|
343
|
+
};
|
344
|
+
|
345
|
+
/** Convert built-in grid config to extension config
|
346
|
+
* @public
|
347
|
+
* @param {string} optionName
|
348
|
+
* @param {*} optionVal
|
349
|
+
* @return {*} The transformed value of the option
|
350
|
+
*/
|
351
|
+
RowGroupingPlugin.prototype.beforeProcessOption = function (optionName, optionVal) {
|
352
|
+
if (optionName == "rowGrouping" && optionVal) {
|
353
|
+
this.config({ "rowGrouping": optionVal });
|
354
|
+
return null; // eslint-disable-line
|
355
|
+
}
|
356
|
+
return; // eslint-disable-line
|
357
|
+
};
|
358
|
+
|
359
|
+
/** @private
|
360
|
+
* @override
|
361
|
+
*/
|
362
|
+
RowGroupingPlugin.prototype._afterInit = function () {
|
363
|
+
if (this._realTimeGrid) {
|
364
|
+
this._criteriaGetter = RowGroupingPlugin._rowDefCriteriaGetter;
|
365
|
+
} else {
|
366
|
+
this._criteriaGetter = RowGroupingPlugin._defaultCriteriaGetter;
|
367
|
+
}
|
368
|
+
this._shouldUpdateDisplayColumn = true;
|
369
|
+
this._applyGrouping();
|
370
|
+
};
|
371
|
+
|
372
|
+
/** @public
|
373
|
+
* @return {string}
|
374
|
+
*/
|
375
|
+
RowGroupingPlugin.prototype.getName = function () {
|
376
|
+
return "RowGroupingPlugin"; // Read Only
|
377
|
+
};
|
378
|
+
|
379
|
+
/** @public
|
380
|
+
* @ignore
|
381
|
+
* @param {Element} elem
|
382
|
+
* @param {Object} config
|
383
|
+
*/
|
384
|
+
RowGroupingPlugin.prototype.beforeInit = function(elem, config) {
|
385
|
+
if (ElfUtil.isHaloTheme()) {
|
386
|
+
this._arrowSize = 18;
|
387
|
+
}
|
388
|
+
};
|
389
|
+
|
390
|
+
/** @public
|
391
|
+
* @param {Object} host core grid object
|
392
|
+
* @param {Object=} options
|
393
|
+
*/
|
394
|
+
RowGroupingPlugin.prototype.initialize = function (host, options) {
|
395
|
+
if (this._hosts.indexOf(host) >= 0) {
|
396
|
+
return;
|
397
|
+
}
|
398
|
+
|
399
|
+
if(options && !options.multitable) {
|
400
|
+
while (this._hosts.length) {
|
401
|
+
this.unload(this._hosts[0]);
|
402
|
+
}
|
403
|
+
}
|
404
|
+
|
405
|
+
this._hosts.push(host);
|
406
|
+
|
407
|
+
ExpanderIcon.loadExpanderStyles();
|
408
|
+
|
409
|
+
host.unloadPlugin("CollapsibleHeaderPlugin");
|
410
|
+
host.listen("columnMoved", this._onColumnIndexChanged);
|
411
|
+
host.listen("columnAdded", this._onColumnIndexChanged);
|
412
|
+
host.listen("columnRemoved", this._onColumnIndexChanged);
|
413
|
+
host.listen("postSectionDataBinding", this._onPostSectionDataBinding);
|
414
|
+
|
415
|
+
this.config(options);
|
416
|
+
|
417
|
+
let enabled = this._colorTag != null ? this._colorTag : ElfUtil.isHaloTheme();
|
418
|
+
RowPainter.disableColorTag(host, enabled === false);
|
419
|
+
|
420
|
+
if (this._predefinedColors != null) {
|
421
|
+
this._injectStyles(this._predefinedColors);
|
422
|
+
host.enableClass(RowGroupingPlugin._controlClass);
|
423
|
+
}
|
424
|
+
|
425
|
+
RowPainter.applyGroupingStyles(host);
|
426
|
+
|
427
|
+
this._applyGrouping(); // TODO: Support run-time theme loading
|
428
|
+
};
|
429
|
+
/** @public
|
430
|
+
* @param {Object=} host core grid object
|
431
|
+
*/
|
432
|
+
RowGroupingPlugin.prototype.unload = function (host) {
|
433
|
+
let at = this._hosts.indexOf(host);
|
434
|
+
if (at < 0) {
|
435
|
+
return;
|
436
|
+
}
|
437
|
+
|
438
|
+
host.unlisten("columnMoved", this._onColumnIndexChanged);
|
439
|
+
host.unlisten("columnAdded", this._onColumnIndexChanged);
|
440
|
+
host.unlisten("columnRemoved", this._onColumnIndexChanged);
|
441
|
+
host.unlisten("postSectionDataBinding", this._onPostSectionDataBinding);
|
442
|
+
|
443
|
+
this._hosts.splice(at, 1);
|
444
|
+
|
445
|
+
this._dispose();
|
446
|
+
|
447
|
+
if (!this._hosts.length) {
|
448
|
+
this._compositeGrid = null;
|
449
|
+
if (this._timerId) {
|
450
|
+
clearTimeout(this._timerId);
|
451
|
+
this._timerId = 0;
|
452
|
+
}
|
453
|
+
if (this._sortingTimer) {
|
454
|
+
clearTimeout(this._sortingTimer);
|
455
|
+
this._sortingTimer = 0;
|
456
|
+
}
|
457
|
+
}
|
458
|
+
};
|
459
|
+
|
460
|
+
/** @public
|
461
|
+
* @param {Object=} options Grid configuration object
|
462
|
+
*/
|
463
|
+
RowGroupingPlugin.prototype.config = function (options) {
|
464
|
+
if (!options) { return; }
|
465
|
+
|
466
|
+
let option = options.rowGrouping;
|
467
|
+
if (option) {
|
468
|
+
if (option.autoGroupRemoval != null) {
|
469
|
+
this._autoGroupRemoval = !!option.autoGroupRemoval;
|
470
|
+
}
|
471
|
+
if (option.autoGroupHiding != null) {
|
472
|
+
this._autoGroupHiding = !!option.autoGroupHiding;
|
473
|
+
}
|
474
|
+
if (option.headerSpanning != null) {
|
475
|
+
this._headerSpanning = !!option.headerSpanning;
|
476
|
+
}
|
477
|
+
if (option.footerSpanning != null) {
|
478
|
+
this._footerSpanning = !!option.footerSpanning;
|
479
|
+
}
|
480
|
+
if (option.autoGroupSorting != null) {
|
481
|
+
this._autoGroupSorting = !!option.autoGroupSorting;
|
482
|
+
}
|
483
|
+
if (option.defaultCollapse != null) {
|
484
|
+
this.setDefaultCollapse(option.defaultCollapse);
|
485
|
+
}
|
486
|
+
if (option.predefinedGroups != null) {
|
487
|
+
this.setPredefinedGroups(option.predefinedGroups);
|
488
|
+
}
|
489
|
+
if (option.groupBy || option.groupCriteria) {
|
490
|
+
this.setGroupingCriteria(option.groupBy || option.groupCriteria);
|
491
|
+
}
|
492
|
+
if (typeof option.displayColumn === "number") {
|
493
|
+
this._displayColumn = option.displayColumn;
|
494
|
+
}
|
495
|
+
if (option.fixedDisplayColumn != null) {
|
496
|
+
this._fixedDisplayColumn = option.fixedDisplayColumn ? this._displayColumn : -1;
|
497
|
+
}
|
498
|
+
if (typeof option.groupSortLogic === "function") {
|
499
|
+
this.setGroupSortingLogic(option.groupSortLogic);
|
500
|
+
}
|
501
|
+
if (!option.groupHeaderBinding && option.headerBinding) {
|
502
|
+
option.groupHeaderBinding = option.headerBinding;
|
503
|
+
}
|
504
|
+
if (!option.groupFooterBinding && option.footerBinding) {
|
505
|
+
option.groupFooterBinding = option.footerBinding;
|
506
|
+
}
|
507
|
+
if (option.hiddenArrow != null) {
|
508
|
+
let hiddenOption = option.hiddenArrow;
|
509
|
+
if (Array.isArray(hiddenOption)) {
|
510
|
+
let len = hiddenOption.length;
|
511
|
+
this._hiddenArrow = {};
|
512
|
+
for (let i = 0; i < len; i++) {
|
513
|
+
this._hiddenArrow[hiddenOption[i]] = true;
|
514
|
+
}
|
515
|
+
} else if (typeof hiddenOption === "number") {
|
516
|
+
this._hiddenArrow = {};
|
517
|
+
this._hiddenArrow[hiddenOption] = true;
|
518
|
+
} else {
|
519
|
+
this._hiddenArrow = !!option.hiddenArrow;
|
520
|
+
}
|
521
|
+
}
|
522
|
+
if (option.contentAsHeader != null) {
|
523
|
+
this._contentAsHeader = !!option.contentAsHeader;
|
524
|
+
}
|
525
|
+
if (option.clickableCell != null) {
|
526
|
+
this._clickableCell = !!option.clickableCell;
|
527
|
+
}
|
528
|
+
let indentSize = option.indentSize;
|
529
|
+
if (indentSize != null) {
|
530
|
+
if (typeof indentSize === "boolean") {
|
531
|
+
if (indentSize) {
|
532
|
+
this._indentSizes = null; // Set to default
|
533
|
+
} else {
|
534
|
+
this._indentSizes = [0];
|
535
|
+
} // TODO: Handle default case
|
536
|
+
} else if (typeof indentSize === "number") {
|
537
|
+
this._indentSizes = new Array(5);
|
538
|
+
for (let j = 0; j < 5; j++) {
|
539
|
+
this._indentSizes[j] = indentSize * j;
|
540
|
+
}
|
541
|
+
} else if (Array.isArray(indentSize)) {
|
542
|
+
this._indentSizes = indentSize;
|
543
|
+
}
|
544
|
+
}
|
545
|
+
if (option.noCollapsible != null) {
|
546
|
+
this._noCollapsible = !!option.noCollapsible;
|
547
|
+
if (this._noCollapsible) {
|
548
|
+
this._indentSizes = [0]; // Content will not be indented
|
549
|
+
}
|
550
|
+
}
|
551
|
+
if (this._contentAsHeader || this._noCollapsible) { // contentAsHeader has higher priority than hiddenArrow
|
552
|
+
this._clickableCell = false; // Cells are not clickable
|
553
|
+
this._hiddenArrow = true; // Arrows are hidden
|
554
|
+
}
|
555
|
+
|
556
|
+
this.addListener(option, "clicked");
|
557
|
+
this.addListener(option, "groupAdded");
|
558
|
+
this.addListener(option, "beforeGroupAdded");
|
559
|
+
this.addListener(option, "groupHeaderBinding");
|
560
|
+
this.addListener(option, "nonGroupBinding");
|
561
|
+
this.addListener(option, "groupFooterBinding");
|
562
|
+
if (this.hasListener("groupFooterBinding")) {
|
563
|
+
this._footerRows = 1;
|
564
|
+
}
|
565
|
+
|
566
|
+
if (option.colorTag != null) {
|
567
|
+
this._colorTag = option.colorTag;
|
568
|
+
}
|
569
|
+
|
570
|
+
if (option.groupColors != null && typeof option.groupColors === "object") {
|
571
|
+
this._groupColors = option.groupColors;
|
572
|
+
}
|
573
|
+
|
574
|
+
if (option.predefinedColors != null && typeof option.predefinedColors === "object") {
|
575
|
+
this._predefinedColors = option.predefinedColors;
|
576
|
+
}
|
577
|
+
}
|
578
|
+
|
579
|
+
this._rowPainter = new RowPainter({
|
580
|
+
clickableCell: this._clickableCell,
|
581
|
+
headerSpanning: this._headerSpanning,
|
582
|
+
footerSpanning: this._footerSpanning,
|
583
|
+
onCellClicked: this._onCellClicked
|
584
|
+
});
|
585
|
+
|
586
|
+
if (this._fixedDisplayColumn < 0) {
|
587
|
+
let checkboxColumnIndex = this._findCheckboxColumnIndexFromConfig(options.columns);
|
588
|
+
if (checkboxColumnIndex >= 0) { // has checkbox column
|
589
|
+
/** 27/04/21
|
590
|
+
* NOTE:: checkbox column could be
|
591
|
+
* 1. insert from the left side of _displayColumn
|
592
|
+
* 2. insert from the right side of _displayColumn
|
593
|
+
* 3. place at specific column (no column inserted)
|
594
|
+
* But row grouping can't distinguish of this 3 posibilities.
|
595
|
+
* But for now, (2) is not implement yet
|
596
|
+
* and method (3) is not public to user yet
|
597
|
+
* so we will assume that only (1) is occur at the moment and we will only support (1)
|
598
|
+
*/
|
599
|
+
|
600
|
+
// if checkbox column is insert to the left then we will +1 rowGroping display column
|
601
|
+
if (checkboxColumnIndex <= this._displayColumn) {
|
602
|
+
this._displayColumn++;
|
603
|
+
}
|
604
|
+
}
|
605
|
+
}
|
606
|
+
};
|
607
|
+
|
608
|
+
/** @public
|
609
|
+
* @param {Object=} gridOptions
|
610
|
+
* @return {!Object}
|
611
|
+
*/
|
612
|
+
RowGroupingPlugin.prototype.getConfigObject = function (gridOptions) {
|
613
|
+
let obj = gridOptions || {};
|
614
|
+
|
615
|
+
let extOptions = obj.rowGrouping;
|
616
|
+
if(!extOptions) {
|
617
|
+
extOptions = obj.rowGrouping = {};
|
618
|
+
}
|
619
|
+
if(this._autoGroupRemoval) {
|
620
|
+
extOptions.autoGroupRemoval = this._autoGroupRemoval;
|
621
|
+
}
|
622
|
+
if(this._autoGroupHiding) {
|
623
|
+
extOptions.autoGroupHiding = this._autoGroupHiding;
|
624
|
+
}
|
625
|
+
if(this._predefinedGroups) {
|
626
|
+
extOptions.predefinedGroups = this._predefinedGroups;
|
627
|
+
}
|
628
|
+
let criterion = this._criteria.filter(isNonFunction);
|
629
|
+
if(criterion.length) {
|
630
|
+
extOptions.groupBy = criterion;
|
631
|
+
}
|
632
|
+
if(this._displayColumn > 0) {
|
633
|
+
extOptions.displayColumn = this._displayColumn;
|
634
|
+
}
|
635
|
+
if(this._fixedDisplayColumn >= 0) {
|
636
|
+
extOptions.fixedDisplayColumn = true;
|
637
|
+
}
|
638
|
+
if (this._noCollapsible) {
|
639
|
+
extOptions.noCollapsible = this._noCollapsible;
|
640
|
+
}
|
641
|
+
extOptions.clickableCell = this._clickableCell;
|
642
|
+
if(this._hiddenArrow) {
|
643
|
+
if(this._hiddenArrow === true) {
|
644
|
+
extOptions.hiddenArrow = true;
|
645
|
+
} else {
|
646
|
+
let hiddenArrows = extOptions.hiddenArrow = [];
|
647
|
+
for(let key in this._hiddenArrow) {
|
648
|
+
hiddenArrows.push(+key);
|
649
|
+
}
|
650
|
+
}
|
651
|
+
}
|
652
|
+
if(this._contentAsHeader) {
|
653
|
+
extOptions.contentAsHeader = this._contentAsHeader;
|
654
|
+
}
|
655
|
+
if(!this._headerSpanning) {
|
656
|
+
extOptions.headerSpanning = this._headerSpanning;
|
657
|
+
}
|
658
|
+
if(this._footerSpanning) {
|
659
|
+
extOptions.footerSpanning = this._footerSpanning;
|
660
|
+
}
|
661
|
+
if(this._autoGroupSorting) {
|
662
|
+
extOptions.autoGroupSorting = this._autoGroupSorting;
|
663
|
+
}
|
664
|
+
if(this._indentSizes) {
|
665
|
+
extOptions.indentSize = this._indentSizes;
|
666
|
+
}
|
667
|
+
if(this._colorTag != null) {
|
668
|
+
extOptions.colorTag = this._colorTag;
|
669
|
+
}
|
670
|
+
if(this._groupColors != null) {
|
671
|
+
extOptions.groupColors = this._groupColors;
|
672
|
+
}
|
673
|
+
if(this._predefinedColors != null) {
|
674
|
+
extOptions.predefinedColors = this._predefinedColors;
|
675
|
+
}
|
676
|
+
|
677
|
+
let defaultCollapse = this.getDefaultCollapse();
|
678
|
+
if(defaultCollapse != null) {
|
679
|
+
extOptions.defaultCollapse = defaultCollapse;
|
680
|
+
}
|
681
|
+
|
682
|
+
return obj;
|
683
|
+
};
|
684
|
+
|
685
|
+
/** Function for ColumnMenuExtension to collect config of column menu
|
686
|
+
* @public
|
687
|
+
* @param {number} colIndex Column index
|
688
|
+
* @param {Object} config Column Menu configuration
|
689
|
+
* @return {!Object}
|
690
|
+
*/
|
691
|
+
RowGroupingPlugin.prototype.getColumnMenu = function (colIndex, config) {
|
692
|
+
if (!config) {
|
693
|
+
config = {};
|
694
|
+
}
|
695
|
+
|
696
|
+
let menus = config.menus;
|
697
|
+
if (!menus) {
|
698
|
+
menus = config.menus = [];
|
699
|
+
}
|
700
|
+
|
701
|
+
let menu = menus[0];
|
702
|
+
if (!menu) {
|
703
|
+
menu = menus[0] = {
|
704
|
+
menuItems: []
|
705
|
+
};
|
706
|
+
}
|
707
|
+
|
708
|
+
// Menu items for this extension
|
709
|
+
let field = this._getField(colIndex);
|
710
|
+
let isGrouping = this.hasGroupingCriteria();
|
711
|
+
let extMenuItems = [{
|
712
|
+
indexScore: 200,
|
713
|
+
label: "Group",
|
714
|
+
group: "FREQUENTLY_USED",
|
715
|
+
subMenu: {
|
716
|
+
menuItems: [{
|
717
|
+
indexScore: 220,
|
718
|
+
label: "Expand All",
|
719
|
+
group: "FREQUENTLY_USED",
|
720
|
+
click: this._onItemExpandAllClicked,
|
721
|
+
disabled: !isGrouping
|
722
|
+
}, {
|
723
|
+
indexScore: 210,
|
724
|
+
label: "Collapse All",
|
725
|
+
group: "FREQUENTLY_USED",
|
726
|
+
click: this._onItemCollapseAllClicked,
|
727
|
+
disabled: !isGrouping
|
728
|
+
}]
|
729
|
+
}
|
730
|
+
}];
|
731
|
+
|
732
|
+
if (!this._hasInGroupCriteria(field)) {
|
733
|
+
extMenuItems[0].subMenu.menuItems.push({
|
734
|
+
indexScore: 230,
|
735
|
+
label: "Group by This Column",
|
736
|
+
group: "FREQUENTLY_USED",
|
737
|
+
value: { colIndex: colIndex },
|
738
|
+
click: this._onItemGroupColumnClicked
|
739
|
+
});
|
740
|
+
} else {
|
741
|
+
extMenuItems[0].subMenu.menuItems.push({
|
742
|
+
indexScore: 230,
|
743
|
+
label: "Un-Group by This Column",
|
744
|
+
group: "FREQUENTLY_USED",
|
745
|
+
value: { colIndex: colIndex },
|
746
|
+
click: this._onItemUnGroupColumnClicked
|
747
|
+
});
|
748
|
+
}
|
749
|
+
|
750
|
+
// Push menu items to config
|
751
|
+
Array.prototype.push.apply(menu.menuItems, extMenuItems);
|
752
|
+
|
753
|
+
return config;
|
754
|
+
};
|
755
|
+
|
756
|
+
/** @private
|
757
|
+
* @param {Object} predefinedColors Predefined color object map
|
758
|
+
*/
|
759
|
+
RowGroupingPlugin.prototype._injectStyles = function(predefinedColors) {
|
760
|
+
let prefix = ".tr-grid." + RowGroupingPlugin._controlClass + " .tr-lg .cell";
|
761
|
+
let css = [];
|
762
|
+
let value;
|
763
|
+
for (let className in predefinedColors) {
|
764
|
+
css.push(prefix + "." + className + "::before");
|
765
|
+
value = predefinedColors[className]["backgroundColor"];
|
766
|
+
if (value) {
|
767
|
+
css.push(["background-color: " + value + ";"]);
|
768
|
+
}
|
769
|
+
}
|
770
|
+
|
771
|
+
let host = this._hosts[0];
|
772
|
+
|
773
|
+
if (this._styleTag) {
|
774
|
+
if (this._styleTag.parentNode) {
|
775
|
+
this._styleTag.parentNode.removeChild(this._styleTag);
|
776
|
+
}
|
777
|
+
this._styleTag = null;
|
778
|
+
}
|
779
|
+
this._styleTag = injectCss(prettifyCss(css), host.getElement());
|
780
|
+
};
|
781
|
+
|
782
|
+
/** @private
|
783
|
+
* @param {Object} e
|
784
|
+
*/
|
785
|
+
RowGroupingPlugin.prototype._onItemGroupColumnClicked = function (e) {
|
786
|
+
let field = this._getField(e.currentTarget.value.colIndex);
|
787
|
+
this._addGroup(field);
|
788
|
+
this._hideColumnMenu();
|
789
|
+
};
|
790
|
+
|
791
|
+
/** @private
|
792
|
+
* @param {Object} e
|
793
|
+
*/
|
794
|
+
RowGroupingPlugin.prototype._onItemUnGroupColumnClicked = function (e) {
|
795
|
+
let field = this._getField(e.currentTarget.value.colIndex);
|
796
|
+
this._ungroup(field);
|
797
|
+
this._hideColumnMenu();
|
798
|
+
};
|
799
|
+
|
800
|
+
/** @private
|
801
|
+
* @param {Object} e
|
802
|
+
*/
|
803
|
+
RowGroupingPlugin.prototype._onItemExpandAllClicked = function (e) {
|
804
|
+
this.expandAll();
|
805
|
+
this._hideColumnMenu();
|
806
|
+
};
|
807
|
+
|
808
|
+
/** @private
|
809
|
+
* @param {Object} e
|
810
|
+
*/
|
811
|
+
RowGroupingPlugin.prototype._onItemCollapseAllClicked = function (e) {
|
812
|
+
this.collapseAll();
|
813
|
+
this._hideColumnMenu();
|
814
|
+
};
|
815
|
+
|
816
|
+
/** @private
|
817
|
+
*/
|
818
|
+
RowGroupingPlugin.prototype._hideColumnMenu = function () {
|
819
|
+
let host = this._hosts[0];
|
820
|
+
let columnMenuExt = host.getPlugin('ColumnMenuPlugin');
|
821
|
+
if (columnMenuExt) columnMenuExt.hide();
|
822
|
+
};
|
823
|
+
|
824
|
+
/** @private
|
825
|
+
* @param {string} field
|
826
|
+
*/
|
827
|
+
RowGroupingPlugin.prototype._addGroup = function (field) {
|
828
|
+
let criteria = this.getGroupingCriteria();
|
829
|
+
let index = criteria.indexOf(field);
|
830
|
+
if (index < 0) {
|
831
|
+
criteria.push(field);
|
832
|
+
}
|
833
|
+
this._dirty = true;
|
834
|
+
this._applyGrouping();
|
835
|
+
};
|
836
|
+
|
837
|
+
/** @private
|
838
|
+
* @param {string} field
|
839
|
+
*/
|
840
|
+
RowGroupingPlugin.prototype._ungroup = function (field) {
|
841
|
+
let criteria = this.getGroupingCriteria();
|
842
|
+
let index = criteria.indexOf(field);
|
843
|
+
if (index >= 0) {
|
844
|
+
criteria.splice(index, 1);
|
845
|
+
}
|
846
|
+
this._dirty = true;
|
847
|
+
this._applyGrouping();
|
848
|
+
};
|
849
|
+
|
850
|
+
/** @public
|
851
|
+
* @return {!Array.<string>}
|
852
|
+
*/
|
853
|
+
RowGroupingPlugin.prototype.getGroupingCriteria = function () {
|
854
|
+
return this._criteria;
|
855
|
+
};
|
856
|
+
/** @public
|
857
|
+
* @return {boolean}
|
858
|
+
*/
|
859
|
+
RowGroupingPlugin.prototype.hasGroupingCriteria = function () {
|
860
|
+
return this._criteria.length > 0;
|
861
|
+
};
|
862
|
+
|
863
|
+
/** Check specific field is in group criteria
|
864
|
+
* @private
|
865
|
+
* @param {string} field
|
866
|
+
* @return {boolean}
|
867
|
+
*/
|
868
|
+
RowGroupingPlugin.prototype._hasInGroupCriteria = function (field) {
|
869
|
+
return this._criteria.indexOf(field) >= 0;
|
870
|
+
};
|
871
|
+
|
872
|
+
/** Each duplicate values in the given columns will be grouped together. Number of generated groups will equal to number of unique values in the given columns.
|
873
|
+
* @public
|
874
|
+
* @param {RowGroupingPlugin~GroupCriteria} criteria <br>
|
875
|
+
* Null input will clear all existing grouping criteria. <br>
|
876
|
+
* String input is treat as column name in data table <br>
|
877
|
+
* Array input will create mutilple groups in tree like manner (nested group criteria) <br>
|
878
|
+
* Any previous given values will be cleared out after calling this method
|
879
|
+
*/
|
880
|
+
RowGroupingPlugin.prototype.setGroupingCriteria = function (criteria) {
|
881
|
+
if (this._criteria.length > 0) {
|
882
|
+
this._dirty = true;
|
883
|
+
this._criteria.length = 0;
|
884
|
+
}
|
885
|
+
if ((typeof criteria === "string") || (typeof criteria === "function")) {
|
886
|
+
this._dirty = true;
|
887
|
+
this._criteria.push(/** @type{string|Function} */(criteria));
|
888
|
+
} else if (Array.isArray(criteria)) {
|
889
|
+
this._dirty = true;
|
890
|
+
this._criteria = /** @type{!Array.<string>} */(criteria.concat());
|
891
|
+
}
|
892
|
+
|
893
|
+
this._applyGrouping();
|
894
|
+
};
|
895
|
+
/** Alias for {@link RowGroupingPlugin#setGroupingCriteria}
|
896
|
+
* @public
|
897
|
+
* @function
|
898
|
+
* @param {RowGroupingPlugin~GroupCriteria} criteria
|
899
|
+
* @see {@link RowGroupingPlugin#setGroupingCriteria}
|
900
|
+
*/
|
901
|
+
RowGroupingPlugin.prototype.groupBy = RowGroupingPlugin.prototype.setGroupingCriteria;
|
902
|
+
|
903
|
+
/** @private */
|
904
|
+
RowGroupingPlugin.prototype._applyGrouping = function () {
|
905
|
+
if (!this._dirty || !this._criteriaGetter) {
|
906
|
+
return;
|
907
|
+
}
|
908
|
+
|
909
|
+
let dv = this.getDataView();
|
910
|
+
if (!dv) {
|
911
|
+
return;
|
912
|
+
}
|
913
|
+
if(typeof dv.enableContentAsHeader === "function") {
|
914
|
+
dv.enableContentAsHeader(this._contentAsHeader);
|
915
|
+
}
|
916
|
+
if (this._criteria.length) {
|
917
|
+
dv.listen("groupCriteriaChanged", this._onGroupCriteriaChanged);
|
918
|
+
dv.listen("groupAdded", this._onGroupAdded);
|
919
|
+
dv.listen("beforeGroupAdded", this._onBeforeGroupAdded);
|
920
|
+
|
921
|
+
if (this._autoGroupRemoval && dv.enableAutoGroupRemoval) {
|
922
|
+
dv.enableAutoGroupRemoval();
|
923
|
+
}
|
924
|
+
if (this._autoGroupHiding && dv.enableAutoGroupHiding) {
|
925
|
+
dv.enableAutoGroupHiding();
|
926
|
+
}
|
927
|
+
if (this._predefinedGroups) {
|
928
|
+
dv.setPredefinedGroups(this._predefinedGroups);
|
929
|
+
}
|
930
|
+
|
931
|
+
this._criteriaFuncs = this._criteria.map(this._onMapCriteria);
|
932
|
+
dv.groupBy(this._criteriaFuncs);
|
933
|
+
this.sortGroups();
|
934
|
+
} else {
|
935
|
+
this._clearSectionStyles(this._headerColumn);
|
936
|
+
dv.groupBy(null);
|
937
|
+
}
|
938
|
+
|
939
|
+
this._dirty = false;
|
940
|
+
};
|
941
|
+
/** @public
|
942
|
+
* @return {Object} DataView instance
|
943
|
+
*/
|
944
|
+
RowGroupingPlugin.prototype.getDataView = function () {
|
945
|
+
let host = this._hosts[0];
|
946
|
+
if (host) {
|
947
|
+
return host.getDataSource();
|
948
|
+
}
|
949
|
+
return null;
|
950
|
+
};
|
951
|
+
|
952
|
+
/** @public
|
953
|
+
* @param {RowGroupingPlugin~GroupSortLogic} sortFunction Comparer function for comparing the order of 2 groups. The function should take at least 2 parameters. <br>
|
954
|
+
* The function should return -1 if the first parameter should comes first, 1 for the other way, and 0 if they are equal. <br>
|
955
|
+
* The two first parameters passed to the function are group value that separates group. <br>
|
956
|
+
* The two last parameters passed to the function are data views of corresponding group.
|
957
|
+
* @example
|
958
|
+
* let compare = function(grpA, grpB, dataViewA, dataViewB) {
|
959
|
+
* return (grpA <= grpB) ? -1 : 1;
|
960
|
+
* }
|
961
|
+
* let dstp = new RowGroupingExtension();
|
962
|
+
* dstp.setGroupSortingLogic(compare);
|
963
|
+
*/
|
964
|
+
RowGroupingPlugin.prototype.setGroupSortingLogic = function (sortFunction) {
|
965
|
+
this._groupSortFunction = sortFunction;
|
966
|
+
};
|
967
|
+
|
968
|
+
/** Get the current group sort function. If none specified by setGroupSortingLogic() return <br>
|
969
|
+
* standard string sort function.
|
970
|
+
* @public
|
971
|
+
* @return {Function}
|
972
|
+
*/
|
973
|
+
RowGroupingPlugin.prototype.getGroupSortingLogic = function () {
|
974
|
+
if (this._groupSortFunction) {
|
975
|
+
return this._groupSortFunction;
|
976
|
+
} else {
|
977
|
+
return RowGroupingPlugin._standardGroupSortFunction; // WARNING: To external method
|
978
|
+
}
|
979
|
+
};
|
980
|
+
|
981
|
+
/** Specify empty group in case of grouping values are known prior to requesting data
|
982
|
+
* @public
|
983
|
+
* @param {Array|Array.<Array>} predefinedGroups <br>
|
984
|
+
* Values in the given array should be matched the value coming from a data table, or else no content is added to the group <br>
|
985
|
+
* Use null value to clear all predefined groups. <br>
|
986
|
+
* Use 2D array to specify nested groups. <br>
|
987
|
+
* Any previous given values will be cleared out after calling this method
|
988
|
+
*/
|
989
|
+
RowGroupingPlugin.prototype.setPredefinedGroups = function (predefinedGroups) {
|
990
|
+
if (predefinedGroups && !Array.isArray(predefinedGroups)) {
|
991
|
+
return;
|
992
|
+
}
|
993
|
+
this._predefinedGroups = predefinedGroups;
|
994
|
+
|
995
|
+
let dv = this.getDataView();
|
996
|
+
if (dv) {
|
997
|
+
dv.setPredefinedGroups(this._predefinedGroups);
|
998
|
+
}
|
999
|
+
};
|
1000
|
+
|
1001
|
+
/** @public
|
1002
|
+
* @param {Object} predefinedColors Predefined color object map
|
1003
|
+
*/
|
1004
|
+
RowGroupingPlugin.prototype.setPredefinedColors = function(predefinedColors) {
|
1005
|
+
if(predefinedColors != null && typeof predefinedColors === "object") {
|
1006
|
+
this._predefinedColors = predefinedColors;
|
1007
|
+
this._injectStyles(predefinedColors);
|
1008
|
+
}
|
1009
|
+
};
|
1010
|
+
|
1011
|
+
/** @public
|
1012
|
+
* @param {boolean} collapse Predefined color object map
|
1013
|
+
*/
|
1014
|
+
RowGroupingPlugin.prototype.setDefaultCollapse = function(collapse) {
|
1015
|
+
let dv = this.getDataView();
|
1016
|
+
if (dv) {
|
1017
|
+
dv.setDefaultCollapse(collapse);
|
1018
|
+
}
|
1019
|
+
};
|
1020
|
+
|
1021
|
+
/** @public
|
1022
|
+
* @param {string} groupRef
|
1023
|
+
* @param {string} groupColor color name from predefinedColors
|
1024
|
+
*/
|
1025
|
+
RowGroupingPlugin.prototype.setGroupColor = function(groupRef, groupColor) {
|
1026
|
+
let dv = this.getDataView();
|
1027
|
+
if(!dv) {
|
1028
|
+
return;
|
1029
|
+
}
|
1030
|
+
let grp = dv.getGroup(groupRef);
|
1031
|
+
if(grp) {
|
1032
|
+
grp.setGroupColor(groupColor);
|
1033
|
+
let host = this._hosts[0];
|
1034
|
+
if(host) {
|
1035
|
+
host.requestRowRefresh();
|
1036
|
+
}
|
1037
|
+
}
|
1038
|
+
};
|
1039
|
+
|
1040
|
+
/** @public
|
1041
|
+
* @return {boolean}
|
1042
|
+
*/
|
1043
|
+
RowGroupingPlugin.prototype.getDefaultCollapse = function() {
|
1044
|
+
let dv = this.getDataView();
|
1045
|
+
if (dv) {
|
1046
|
+
return dv.getDefaultCollapse();
|
1047
|
+
}
|
1048
|
+
return false; // if dv did't load, the value will be false by default
|
1049
|
+
};
|
1050
|
+
|
1051
|
+
/** Trigger group sorting logic -- re-sort the existing groups. This will not continuously apply to each data update.
|
1052
|
+
* @public
|
1053
|
+
*/
|
1054
|
+
RowGroupingPlugin.prototype.sortGroups = function () {
|
1055
|
+
this._sortingTimer = 0;
|
1056
|
+
if (this._groupSortFunction) {
|
1057
|
+
let dv = this.getDataView();
|
1058
|
+
if (dv) {
|
1059
|
+
dv.sortGroups(this._groupSortFunction);
|
1060
|
+
}
|
1061
|
+
}
|
1062
|
+
};
|
1063
|
+
|
1064
|
+
/** @private
|
1065
|
+
* @param {Object} e
|
1066
|
+
*/
|
1067
|
+
RowGroupingPlugin.prototype._onPostSectionDataBinding = function (e) {
|
1068
|
+
if (!this._disabled) {
|
1069
|
+
|
1070
|
+
this._updateHeader(
|
1071
|
+
e.sectionSettings,
|
1072
|
+
e.fromRowIndex,
|
1073
|
+
e.toRowIndex - 1
|
1074
|
+
);
|
1075
|
+
}
|
1076
|
+
};
|
1077
|
+
|
1078
|
+
/** @private
|
1079
|
+
* @param {*} valA
|
1080
|
+
* @param {*} valB
|
1081
|
+
* @return {number}
|
1082
|
+
*/
|
1083
|
+
RowGroupingPlugin._standardGroupSortFunction = function (valA, valB) {
|
1084
|
+
let strA = "" + valA;
|
1085
|
+
let strB = "" + valB;
|
1086
|
+
if (strA < strB) {
|
1087
|
+
return -1;
|
1088
|
+
}
|
1089
|
+
if (strA > strB) {
|
1090
|
+
return 1;
|
1091
|
+
}
|
1092
|
+
return 0;
|
1093
|
+
};
|
1094
|
+
|
1095
|
+
/** @private
|
1096
|
+
* @param {Object=} dv DataView
|
1097
|
+
* @return {boolean}
|
1098
|
+
*/
|
1099
|
+
RowGroupingPlugin.prototype._isArrowHidden = function(dv) {
|
1100
|
+
if (this._hiddenArrow && dv) { // Object or boolean
|
1101
|
+
if (this._hiddenArrow === true) {
|
1102
|
+
return true;
|
1103
|
+
} else { // Object map
|
1104
|
+
let lvl = dv.getGroupLevel();
|
1105
|
+
if (this._hiddenArrow[lvl]) {
|
1106
|
+
return true;
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
}
|
1110
|
+
return false;
|
1111
|
+
};
|
1112
|
+
|
1113
|
+
/** @private
|
1114
|
+
* @param {Object} settings SectionSettings
|
1115
|
+
* @return {boolean}
|
1116
|
+
*/
|
1117
|
+
RowGroupingPlugin.prototype._hasGroupHeader = function (settings) {
|
1118
|
+
if (settings && settings.getType() === "content") {
|
1119
|
+
let dv = settings.getDataSource();
|
1120
|
+
if (dv) {
|
1121
|
+
return dv.hasGroup();
|
1122
|
+
}
|
1123
|
+
}
|
1124
|
+
return false;
|
1125
|
+
};
|
1126
|
+
|
1127
|
+
/** @private
|
1128
|
+
* @param {number} colIndex
|
1129
|
+
*/
|
1130
|
+
RowGroupingPlugin.prototype._clearSectionStyles = function (colIndex) {
|
1131
|
+
let host = this._hosts[0];
|
1132
|
+
if (!host || !(colIndex >= 0)) {
|
1133
|
+
return;
|
1134
|
+
}
|
1135
|
+
// TODO: Optimize by checking isHeaderColumn flag
|
1136
|
+
|
1137
|
+
let sections = host.getAllSections("content");
|
1138
|
+
let rowPainter = this._rowPainter;
|
1139
|
+
for (let i = sections.length; --i >= 0;) {
|
1140
|
+
let section = sections[i];
|
1141
|
+
|
1142
|
+
let fi = section.getFirstIndexInView();
|
1143
|
+
let li = section.getLastIndexInView();
|
1144
|
+
for (let r = fi; r <= li; r++) {
|
1145
|
+
rowPainter.removeAllStyles(section, colIndex, r);
|
1146
|
+
}
|
1147
|
+
}
|
1148
|
+
};
|
1149
|
+
|
1150
|
+
/** retrive headerColumn index
|
1151
|
+
* @private
|
1152
|
+
* @return {number} headerColumn index, return -1 = not found
|
1153
|
+
*/
|
1154
|
+
RowGroupingPlugin.prototype._getHeaderColumnIndex = function () {
|
1155
|
+
let colCount = this.getColumnCount();
|
1156
|
+
for (let columnIndex = 0; columnIndex < colCount; columnIndex++) {
|
1157
|
+
if (this._getColumnOption(columnIndex, "isHeaderColumn")) {
|
1158
|
+
return columnIndex;
|
1159
|
+
}
|
1160
|
+
}
|
1161
|
+
return -1;
|
1162
|
+
};
|
1163
|
+
|
1164
|
+
/** @private
|
1165
|
+
* @param {Object} e
|
1166
|
+
*/
|
1167
|
+
RowGroupingPlugin.prototype._onGroupCriteriaChanged = function (e) {
|
1168
|
+
let dv = e.sender;
|
1169
|
+
|
1170
|
+
if (dv.hasGroup()) {
|
1171
|
+
if (this._fixedDisplayColumn < 0 // no fixed index
|
1172
|
+
|| this._displayColumn < 0 || this._displayColumn >= this.getColumnCount() // _displayColumn not in range of column
|
1173
|
+
|| this._getHeaderColumnIndex() < 0 // and not found headerColumn
|
1174
|
+
) {
|
1175
|
+
// reset _displayColumn = 0 and updatDisplayColumn
|
1176
|
+
// this._displayColumn = 0;
|
1177
|
+
this._shouldUpdateDisplayColumn = true;
|
1178
|
+
this._updateDisplayColumn();
|
1179
|
+
}
|
1180
|
+
} else {
|
1181
|
+
// if not have group then we will clear display column
|
1182
|
+
this._shouldUpdateDisplayColumn = true;
|
1183
|
+
this._updateDisplayColumn();
|
1184
|
+
}
|
1185
|
+
};
|
1186
|
+
/** @private
|
1187
|
+
* @param {Object} e
|
1188
|
+
*/
|
1189
|
+
RowGroupingPlugin.prototype._onGroupAdded = function (e) {
|
1190
|
+
if (this._footerRows) {
|
1191
|
+
e.newGroup.addFooter(this._footerRows);
|
1192
|
+
}
|
1193
|
+
let newGroup = e.newGroup;
|
1194
|
+
// WARNING: contentAsHeader mode is overwrite arrow hidden to boolean
|
1195
|
+
if(!this._contentAsHeader && newGroup.disableCollapsing) {
|
1196
|
+
if(this._isArrowHidden(newGroup)) {
|
1197
|
+
newGroup.disableCollapsing();
|
1198
|
+
}
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
let groupColors = this._groupColors;
|
1202
|
+
let groupColor;
|
1203
|
+
if(groupColors) { // Backward compatibility
|
1204
|
+
let groupId = newGroup.getGroupId();
|
1205
|
+
groupColor = groupColors[groupId];
|
1206
|
+
if(groupColor) {
|
1207
|
+
newGroup.setGroupColor(groupColor);
|
1208
|
+
}
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
this._dispatch("groupAdded", e);
|
1212
|
+
if (this._autoGroupSorting) {
|
1213
|
+
if (!this._sortingTimer) {
|
1214
|
+
this._sortingTimer = setTimeout(this.sortGroups, 100);
|
1215
|
+
}
|
1216
|
+
}
|
1217
|
+
};
|
1218
|
+
/** @private
|
1219
|
+
* @param {Object} e
|
1220
|
+
*/
|
1221
|
+
RowGroupingPlugin.prototype._onBeforeGroupAdded = function (e) {
|
1222
|
+
if (this._contentAsHeader) {
|
1223
|
+
if (e.dataView.getGroupLevel() >= this._criteria.length - 1) {
|
1224
|
+
e.hideHeaderRow = true;
|
1225
|
+
}
|
1226
|
+
}
|
1227
|
+
this._dispatch("beforeGroupAdded", e);
|
1228
|
+
};
|
1229
|
+
|
1230
|
+
/** @private
|
1231
|
+
* @return {number}
|
1232
|
+
*/
|
1233
|
+
RowGroupingPlugin.prototype._updateDisplayColumn = function () {
|
1234
|
+
if (this._shouldUpdateDisplayColumn) {
|
1235
|
+
this._shouldUpdateDisplayColumn = false;
|
1236
|
+
|
1237
|
+
let host = this._hosts[0];
|
1238
|
+
let c, colCount = host.getColumnCount();
|
1239
|
+
this._headerColumn = this._getHeaderColumnIndex();
|
1240
|
+
|
1241
|
+
if (this._displayColumn < 0) {
|
1242
|
+
if (this._headerColumn < 0) { // if header column not found we will use column field instead
|
1243
|
+
for (c = 0; c < colCount; ++c) {
|
1244
|
+
if (this._headerColumnField === this._getField(c)) {
|
1245
|
+
this._displayColumn = c;
|
1246
|
+
break;
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
} else {
|
1250
|
+
this._displayColumn = this._headerColumn;
|
1251
|
+
}
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
let tgtHeaderColumn = -1;
|
1255
|
+
if (this._displayColumn >= 0) {
|
1256
|
+
for (c = this._displayColumn; c < colCount; ++c) {
|
1257
|
+
if (host.isColumnVisible(c)) {
|
1258
|
+
if (!this._getColumnOption(c, "isCheckboxColumn")) {
|
1259
|
+
tgtHeaderColumn = c;
|
1260
|
+
break;
|
1261
|
+
}
|
1262
|
+
}
|
1263
|
+
}
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
if (this._headerColumn !== tgtHeaderColumn) {
|
1267
|
+
let colData;
|
1268
|
+
this._clearSectionStyles(this._headerColumn);
|
1269
|
+
if (this._headerColumn >= 0) {
|
1270
|
+
colData = this._getColumnData(this._headerColumn);
|
1271
|
+
if (colData) {
|
1272
|
+
colData.isHeaderColumn = false;
|
1273
|
+
}
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
if (tgtHeaderColumn >= 0) {
|
1277
|
+
colData = this._newColumnData(tgtHeaderColumn);
|
1278
|
+
colData.isHeaderColumn = true;
|
1279
|
+
this._headerColumnField = this._getField(tgtHeaderColumn);
|
1280
|
+
}
|
1281
|
+
this._headerColumn = tgtHeaderColumn;
|
1282
|
+
}
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
return this._headerColumn;
|
1286
|
+
};
|
1287
|
+
|
1288
|
+
/** TODO: Need to support when column reordered
|
1289
|
+
* @private
|
1290
|
+
* @param {Object} settings SectionSettings
|
1291
|
+
* @param {number=} firstRowIndex
|
1292
|
+
* @param {number=} lastRowIndex INCLUSIVE
|
1293
|
+
*/
|
1294
|
+
RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, lastRowIndex) {
|
1295
|
+
if (!this._hasGroupHeader(settings)) {
|
1296
|
+
return;
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
let headerColumn = this._updateDisplayColumn();
|
1300
|
+
if (headerColumn < 0) {
|
1301
|
+
return;
|
1302
|
+
} else if (!this._getColumnOption(headerColumn, "isHeaderColumn")) {
|
1303
|
+
return; // Workaround: Newly inserted column doesn't have the flag
|
1304
|
+
}
|
1305
|
+
|
1306
|
+
let dataSource = settings.getDataSource();
|
1307
|
+
let section = settings.getSection();
|
1308
|
+
let fi = (firstRowIndex != null) ? firstRowIndex : section.getFirstIndexInView();
|
1309
|
+
let li = (lastRowIndex != null) ? lastRowIndex : section.getLastIndexInView();
|
1310
|
+
let rowsForContentHeader = this._getRowsForContentAsHeader();
|
1311
|
+
|
1312
|
+
let maxColWidth = -1; // -1 means no limit
|
1313
|
+
let colCell = section.getCell(headerColumn, 0, false);
|
1314
|
+
if (!this._headerSpanning && colCell) {
|
1315
|
+
maxColWidth = colCell.getWidth() - 27; // Ensure padding will subtract icon width (25px for halo, 27px for solar)
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
let colCount = section.getColumnCount();
|
1319
|
+
let nonGroupListener = this.hasListener("nonGroupBinding");
|
1320
|
+
let curGroupLevel = dataSource.getGroupLevel(fi);
|
1321
|
+
let arg = {
|
1322
|
+
section: section,
|
1323
|
+
colCount: colCount
|
1324
|
+
};
|
1325
|
+
let currentGroup;
|
1326
|
+
let needCal = this._autoGroupHiding || this._contentAsHeader;
|
1327
|
+
|
1328
|
+
for (let c = 0; c < colCount; c++) {
|
1329
|
+
if(this._getColumnOption(c, "isCheckboxColumn")) {
|
1330
|
+
arg.checkboxColumnIndex = c;
|
1331
|
+
break;
|
1332
|
+
}
|
1333
|
+
}
|
1334
|
+
|
1335
|
+
let rowPainter = this._rowPainter;
|
1336
|
+
for (let r = fi; r <= li; r++) {
|
1337
|
+
let indentOffset = 0;
|
1338
|
+
let rowId = dataSource.getRowId(r); // Slow
|
1339
|
+
let cell = section.getCell(headerColumn, r, false); // Work only one row
|
1340
|
+
if (!cell) { // There may be no header to be updated
|
1341
|
+
continue;
|
1342
|
+
}
|
1343
|
+
|
1344
|
+
arg.cell = cell;
|
1345
|
+
arg.rowIndex = r;
|
1346
|
+
arg.colIndex = headerColumn;
|
1347
|
+
arg.rowId = rowId;
|
1348
|
+
arg.rowData = this._rowGetter(dataSource.getRowData(rowId));
|
1349
|
+
arg.noIndent = false;
|
1350
|
+
|
1351
|
+
let contentHeaderGroup = rowsForContentHeader[rowId];
|
1352
|
+
let groupView = dataSource.getGroupByRowId(rowId);
|
1353
|
+
let footerRow = false;
|
1354
|
+
if (groupView) { // Header Render
|
1355
|
+
currentGroup = groupView;
|
1356
|
+
curGroupLevel = groupView.getGroupLevel();
|
1357
|
+
|
1358
|
+
arg.footerIndex = groupView.getFooterRowIndex(rowId);
|
1359
|
+
footerRow = arg.footerRow = (arg.footerIndex >= 0);
|
1360
|
+
arg.groupId = groupView.getGroupId();
|
1361
|
+
arg.dataSource = groupView;
|
1362
|
+
arg.collapsed = groupView.isCollapsed();
|
1363
|
+
|
1364
|
+
arg.hiddenArrow = (footerRow || this._isArrowHidden(groupView)) ? true : false;
|
1365
|
+
} else { // Content Render
|
1366
|
+
if(needCal) {
|
1367
|
+
currentGroup = dataSource.getGroup(rowId); // Slow
|
1368
|
+
curGroupLevel = currentGroup.getGroupLevel();
|
1369
|
+
} else if(!currentGroup) {
|
1370
|
+
currentGroup = dataSource.getGroup(rowId); // Slow
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
if (contentHeaderGroup || nonGroupListener) {
|
1374
|
+
arg.dataSource = dataSource;
|
1375
|
+
arg.footerIndex = null;
|
1376
|
+
arg.groupId = null;
|
1377
|
+
|
1378
|
+
if (contentHeaderGroup) {
|
1379
|
+
arg.collapsed = contentHeaderGroup.isCollapsed();
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
if (nonGroupListener) {
|
1383
|
+
arg.rowData = this._rowGetter(dataSource.getRowData(rowId));
|
1384
|
+
}
|
1385
|
+
}
|
1386
|
+
if (contentHeaderGroup) { // In contentHeader mode indent in contentHeader will same the parent header when group level 2
|
1387
|
+
indentOffset = -2;
|
1388
|
+
} else {
|
1389
|
+
// In contentHeader mode with 1 level the content indent more than contentHeader 1
|
1390
|
+
if(this._contentAsHeader && this._criteria.length > 1) {
|
1391
|
+
indentOffset = -1;
|
1392
|
+
}
|
1393
|
+
}
|
1394
|
+
}
|
1395
|
+
|
1396
|
+
arg.groupLevel = curGroupLevel;
|
1397
|
+
|
1398
|
+
let rowLevel = 0;
|
1399
|
+
let nonGroupRow = this._autoGroupHiding && currentGroup.getGroupValue() == null && curGroupLevel === 1 && !this._contentAsHeader;
|
1400
|
+
arg.nonGroupRow = nonGroupRow;
|
1401
|
+
|
1402
|
+
if (arg.noIndent || nonGroupRow) { // if user specific indent level, and if group hidden
|
1403
|
+
rowLevel = 0;
|
1404
|
+
} else if (groupView) { // group header
|
1405
|
+
rowLevel = curGroupLevel - 1;
|
1406
|
+
} else { // content
|
1407
|
+
rowLevel = curGroupLevel + indentOffset; // content have indent more than header 1
|
1408
|
+
}
|
1409
|
+
|
1410
|
+
let indentSize = 0;
|
1411
|
+
if(this._indentSizes) {
|
1412
|
+
indentSize = this._indentSizes[0];
|
1413
|
+
if(rowLevel > 0) {
|
1414
|
+
let indentLimit = this._indentSizes.length;
|
1415
|
+
indentSize = rowLevel < indentLimit ? this._indentSizes[rowLevel] : this._indentSizes[indentLimit - 1];
|
1416
|
+
}
|
1417
|
+
} else if(rowLevel > 0) {
|
1418
|
+
indentSize = 8 + rowLevel * 4; // 8 is default cell padding
|
1419
|
+
if(!groupView) {
|
1420
|
+
indentSize += this._arrowSize;
|
1421
|
+
}
|
1422
|
+
}
|
1423
|
+
if (maxColWidth > -1 && maxColWidth < indentSize) {
|
1424
|
+
indentSize = maxColWidth;
|
1425
|
+
}
|
1426
|
+
|
1427
|
+
let groupColor;
|
1428
|
+
if(currentGroup.getGroupColor) {
|
1429
|
+
groupColor = currentGroup.getGroupColor();
|
1430
|
+
} else { // Backward compatibility
|
1431
|
+
if (this._groupColors) {
|
1432
|
+
// TODO: Need better method to find the first level parent's group id
|
1433
|
+
let rootGroup = currentGroup ? currentGroup : dataSource.getGroup(rowId); // Slow
|
1434
|
+
if (curGroupLevel > 1) {
|
1435
|
+
for (let i = curGroupLevel; i > 1; i--) {
|
1436
|
+
rootGroup = rootGroup.getDataSource();
|
1437
|
+
}
|
1438
|
+
}
|
1439
|
+
let groupId = rootGroup.getGroupId();
|
1440
|
+
groupColor = this._groupColors[groupId];
|
1441
|
+
}
|
1442
|
+
}
|
1443
|
+
arg.colorTagClass = groupColor;
|
1444
|
+
arg.indentSize = indentSize;
|
1445
|
+
if (groupView) {
|
1446
|
+
rowPainter.applyHeaderStyle(arg);
|
1447
|
+
this._dispatch(footerRow ? "groupFooterBinding" : "groupHeaderBinding", arg);
|
1448
|
+
} else {
|
1449
|
+
rowPainter.removeHeaderStyle(section, headerColumn, r);
|
1450
|
+
if (contentHeaderGroup) {
|
1451
|
+
rowPainter.applyContentAsHeaderStyle(arg);
|
1452
|
+
}
|
1453
|
+
rowPainter.applyRowStyle(arg);
|
1454
|
+
this._dispatch("nonGroupBinding", arg);
|
1455
|
+
}
|
1456
|
+
}
|
1457
|
+
if(!this._updateCursorTimer) {
|
1458
|
+
this._updateCursorTimer = setTimeout(this._updateCursor, 100);
|
1459
|
+
}
|
1460
|
+
};
|
1461
|
+
|
1462
|
+
/** @private
|
1463
|
+
* @return {Object}
|
1464
|
+
*/
|
1465
|
+
RowGroupingPlugin.prototype._getRowsForContentAsHeader = function () {
|
1466
|
+
if (!this._contentAsHeader) return {};
|
1467
|
+
|
1468
|
+
let result = {};
|
1469
|
+
let dv = this.getDataView();
|
1470
|
+
let allGroups = dv.getAllGroups();
|
1471
|
+
for (let grpId in allGroups) {
|
1472
|
+
let grp = allGroups[grpId];
|
1473
|
+
if (!grp.hasGroup()) { // Deepest level group
|
1474
|
+
let firstRowId = grp.getAllRowIds(true)[0]; // Prepare first row in group for contentAsHeader mode to use.
|
1475
|
+
if (firstRowId) {
|
1476
|
+
result[firstRowId] = grp;
|
1477
|
+
}
|
1478
|
+
}
|
1479
|
+
}
|
1480
|
+
return result;
|
1481
|
+
};
|
1482
|
+
|
1483
|
+
/** @private
|
1484
|
+
* @param {Object} e
|
1485
|
+
*/
|
1486
|
+
RowGroupingPlugin.prototype._onColumnIndexChanged = function (e) {
|
1487
|
+
if (this._fixedDisplayColumn >= 0) {
|
1488
|
+
this._displayColumn = this._fixedDisplayColumn;
|
1489
|
+
this.updateHeaders(); // Instant updating
|
1490
|
+
} else {
|
1491
|
+
if (this._headerColumn >= 0) {
|
1492
|
+
this._displayColumn = -1; // Index will move along current display
|
1493
|
+
}
|
1494
|
+
if (!this._timerId) {
|
1495
|
+
this._timerId = setTimeout(this.updateHeaders, 50);
|
1496
|
+
}
|
1497
|
+
}
|
1498
|
+
};
|
1499
|
+
|
1500
|
+
/** @public */
|
1501
|
+
RowGroupingPlugin.prototype.updateHeaders = function () {
|
1502
|
+
this._timerId = 0;
|
1503
|
+
this._shouldUpdateDisplayColumn = true;
|
1504
|
+
let host = this._hosts[0];
|
1505
|
+
if (!host || this._disabled) {
|
1506
|
+
return;
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
let settingList = host.getAllSectionSettings("content");
|
1510
|
+
for (let i = settingList.length; --i >= 0;) {
|
1511
|
+
this._updateHeader(settingList[i]);
|
1512
|
+
}
|
1513
|
+
};
|
1514
|
+
|
1515
|
+
/** @private
|
1516
|
+
* @param {string} rowId
|
1517
|
+
* @param {boolean=} opt_collapsed=true
|
1518
|
+
*/
|
1519
|
+
RowGroupingPlugin.prototype._collapseDataRowId = function (rowId, opt_collapsed) {
|
1520
|
+
let dv = this.getDataView();
|
1521
|
+
if (dv) {
|
1522
|
+
let rowsForContentHeader = this._getRowsForContentAsHeader();
|
1523
|
+
let grp = rowsForContentHeader[rowId];
|
1524
|
+
if (grp) {
|
1525
|
+
grp.collapse(opt_collapsed);
|
1526
|
+
}
|
1527
|
+
}
|
1528
|
+
};
|
1529
|
+
|
1530
|
+
/** @private
|
1531
|
+
* @param {MouseEvent} e
|
1532
|
+
*/
|
1533
|
+
RowGroupingPlugin.prototype._onCellClicked = function (e) {
|
1534
|
+
if (this._clickDisabled) { return; }
|
1535
|
+
|
1536
|
+
let changed = false;
|
1537
|
+
let host = this._hosts[0];
|
1538
|
+
let info = host.getRelativePosition(e);
|
1539
|
+
let cellElem = info.cell ? info.cell.getElement() : null;
|
1540
|
+
if(!cellElem) {
|
1541
|
+
return;
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
let collapsed = cellElem.classList.contains("closed");
|
1545
|
+
let rowIndex = info.rowIndex;
|
1546
|
+
let settings = info.sectionSettings;
|
1547
|
+
|
1548
|
+
let dv = settings.getDataSource();
|
1549
|
+
let rowId = dv.getRowId(rowIndex);
|
1550
|
+
let grpView = dv.getGroupByRowId(rowId);
|
1551
|
+
if (grpView) {
|
1552
|
+
changed = true;
|
1553
|
+
if(grpView.isCollapsible && !grpView.isCollapsible()) { // Prevent applied styles
|
1554
|
+
return;
|
1555
|
+
}
|
1556
|
+
grpView.collapse(!collapsed);
|
1557
|
+
} else if (this._contentAsHeader) {
|
1558
|
+
changed = true;
|
1559
|
+
this._collapseDataRowId(rowId, !collapsed);
|
1560
|
+
}
|
1561
|
+
if (changed) {
|
1562
|
+
if (collapsed) {
|
1563
|
+
cellElem.classList.remove("closed");
|
1564
|
+
} else {
|
1565
|
+
cellElem.classList.add("closed");
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
|
1569
|
+
info.expanded = collapsed; // After toggled
|
1570
|
+
info.group = grpView;
|
1571
|
+
this._dispatch("clicked", info);
|
1572
|
+
};
|
1573
|
+
|
1574
|
+
/** @private */
|
1575
|
+
RowGroupingPlugin.prototype._updateCursor = function () {
|
1576
|
+
let host = this._hosts[0]; // TODO: Make this work for multi-table
|
1577
|
+
if (host) {
|
1578
|
+
let disableExpander = false;
|
1579
|
+
let disableFolder = false;
|
1580
|
+
if (!this._clickableCell) {
|
1581
|
+
disableFolder = true;
|
1582
|
+
}
|
1583
|
+
if (this._clickDisabled) {
|
1584
|
+
disableExpander = true;
|
1585
|
+
disableFolder = true;
|
1586
|
+
}
|
1587
|
+
if (disableExpander) {
|
1588
|
+
host.addClass("expander-disabled");
|
1589
|
+
} else {
|
1590
|
+
host.removeClass("expander-disabled");
|
1591
|
+
}
|
1592
|
+
if (disableFolder) {
|
1593
|
+
host.addClass("folder-disabled");
|
1594
|
+
} else {
|
1595
|
+
host.removeClass("folder-disabled");
|
1596
|
+
}
|
1597
|
+
}
|
1598
|
+
this._updateCursorTimer = 0;
|
1599
|
+
};
|
1600
|
+
|
1601
|
+
/** @private
|
1602
|
+
* @param {string|Function} field
|
1603
|
+
* @return {Function} Row data
|
1604
|
+
*/
|
1605
|
+
RowGroupingPlugin.prototype._onMapCriteria = function (field) {
|
1606
|
+
if (typeof field === "string") {
|
1607
|
+
return this._criteriaGetter.bind(null, field);
|
1608
|
+
}
|
1609
|
+
return field;
|
1610
|
+
};
|
1611
|
+
|
1612
|
+
/** @public
|
1613
|
+
* @param {boolean=} opt_expanded
|
1614
|
+
*/
|
1615
|
+
RowGroupingPlugin.prototype.expandAll = function (opt_expanded) {
|
1616
|
+
this.collapseAll(opt_expanded === false);
|
1617
|
+
};
|
1618
|
+
|
1619
|
+
/** @public
|
1620
|
+
* @param {boolean=} opt_collapsed
|
1621
|
+
*/
|
1622
|
+
RowGroupingPlugin.prototype.collapseAll = function (opt_collapsed) {
|
1623
|
+
let dv = this.getDataView();
|
1624
|
+
if (dv) {
|
1625
|
+
dv.collapseAllGroups(opt_collapsed);
|
1626
|
+
}
|
1627
|
+
};
|
1628
|
+
|
1629
|
+
/** @public
|
1630
|
+
* @param {string} groupRowId
|
1631
|
+
* @param {boolean=} opt_expanded
|
1632
|
+
*/
|
1633
|
+
RowGroupingPlugin.prototype.expand = function (groupRowId, opt_expanded) {
|
1634
|
+
this.collapse(groupRowId, opt_expanded === false);
|
1635
|
+
};
|
1636
|
+
/** @public
|
1637
|
+
* @param {string} groupRowId
|
1638
|
+
* @param {boolean=} opt_collapsed
|
1639
|
+
*/
|
1640
|
+
RowGroupingPlugin.prototype.collapse = function (groupRowId, opt_collapsed) {
|
1641
|
+
let dv = this.getDataView();
|
1642
|
+
if (dv) {
|
1643
|
+
let grp = dv.getGroup(groupRowId);
|
1644
|
+
if (grp) {
|
1645
|
+
grp.collapse(opt_collapsed);
|
1646
|
+
}
|
1647
|
+
}
|
1648
|
+
};
|
1649
|
+
|
1650
|
+
/** @public
|
1651
|
+
* @param {boolean=} opt_disabled
|
1652
|
+
*/
|
1653
|
+
RowGroupingPlugin.prototype.disableClicking = function (opt_disabled) {
|
1654
|
+
this._clickDisabled = opt_disabled !== false;
|
1655
|
+
this._updateCursor();
|
1656
|
+
};
|
1657
|
+
|
1658
|
+
/** Returns an array of states (collapsed or expanded)
|
1659
|
+
* @public
|
1660
|
+
* @returns {Array.<RowGroupingPlugin~GroupingState>}
|
1661
|
+
*/
|
1662
|
+
RowGroupingPlugin.prototype.getGroupingStates = function () {
|
1663
|
+
let dv = this.getDataView();
|
1664
|
+
|
1665
|
+
return dv.getAllGroups().map(function (group) {
|
1666
|
+
return {
|
1667
|
+
groupId: group.getGroupId(),
|
1668
|
+
collapsed: group.isCollapsed()
|
1669
|
+
};
|
1670
|
+
});
|
1671
|
+
};
|
1672
|
+
|
1673
|
+
/** Set state for groups
|
1674
|
+
* @public
|
1675
|
+
* @param {Array.<RowGroupingPlugin~GroupingState>|string} states Array state of groupings or JSON String
|
1676
|
+
*/
|
1677
|
+
RowGroupingPlugin.prototype.setGroupingStates = function (states) {
|
1678
|
+
if (typeof states === 'string') {
|
1679
|
+
states = JSON.parse(states);
|
1680
|
+
}
|
1681
|
+
|
1682
|
+
for (let i = 0; i < states.length; i++) {
|
1683
|
+
let state = states[i];
|
1684
|
+
let groupRowId = state.groupId == null ? i : state.groupId;
|
1685
|
+
this.collapse(groupRowId, state.collapsed);
|
1686
|
+
}
|
1687
|
+
};
|
1688
|
+
|
1689
|
+
/** Fixed display column to stay at the same position even though the column has been moved, or shifted by removing and inserting column
|
1690
|
+
* @public
|
1691
|
+
* @param {boolean=} opt_enabled
|
1692
|
+
*/
|
1693
|
+
RowGroupingPlugin.prototype.enableFixedDisplayColumn = function (opt_enabled) {
|
1694
|
+
this._fixedDisplayColumn = (opt_enabled !== false) ? this._displayColumn : -1;
|
1695
|
+
};
|
1696
|
+
|
1697
|
+
/** @public
|
1698
|
+
* @param {(boolean|number)=} opt_num
|
1699
|
+
*/
|
1700
|
+
RowGroupingPlugin.prototype.enableFooterRow = function (opt_num) {
|
1701
|
+
if(opt_num == null || opt_num === true) {
|
1702
|
+
opt_num = 1;
|
1703
|
+
} else if(opt_num <= 0) { // Including false and null
|
1704
|
+
opt_num = 0;
|
1705
|
+
}
|
1706
|
+
|
1707
|
+
this._footerRows = /** @type{number} */(opt_num);
|
1708
|
+
};
|
1709
|
+
|
1710
|
+
/** @public
|
1711
|
+
* @return {number}
|
1712
|
+
*/
|
1713
|
+
RowGroupingPlugin.prototype.getFooterRowCount = function () {
|
1714
|
+
return this._footerRows;
|
1715
|
+
};
|
1716
|
+
|
1717
|
+
/** @function
|
1718
|
+
* @param {Object} obj
|
1719
|
+
* @return {boolean}
|
1720
|
+
*/
|
1721
|
+
function isNonFunction(obj) {
|
1722
|
+
return obj ? (typeof obj !== "function") : false;
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
|
1726
|
+
|
1727
|
+
export default RowGroupingPlugin;
|
1728
|
+
export { RowGroupingPlugin, RowGroupingPlugin as RowGrouping, RowGroupingPlugin as RowGroupingExtension };
|