@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,1977 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import Ext from "../../../../tr-grid-util/es6/Ext.js";
|
3
|
+
import EventDispatcher from "../event/EventDispatcher.js";
|
4
|
+
import Core from "../Core.js";
|
5
|
+
import ILayoutGrid from "../ILayoutGrid.js";
|
6
|
+
import ElementWrapper from "../components/ElementWrapper.js";
|
7
|
+
import DataTable from "../../data/DataTable.js";
|
8
|
+
import { isEmptyObject } from "../../../../tr-grid-util/es6/Util.js";
|
9
|
+
/* eslint-enable */
|
10
|
+
|
11
|
+
/** Fired when user click and before the sorting operation.
|
12
|
+
* @event SortableTitlePlugin#preClicked
|
13
|
+
* @property {number} colIndex
|
14
|
+
* @property {Element} target Element being clicked
|
15
|
+
* @example
|
16
|
+
* function onPreClicked(e) {
|
17
|
+
* e.cancel = true; // Cancel sorting operation
|
18
|
+
* }
|
19
|
+
*/
|
20
|
+
|
21
|
+
/** Fired when user click and after the sorting operation
|
22
|
+
* @event SortableTitlePlugin#clicked
|
23
|
+
* @property {number} colIndex
|
24
|
+
* @property {string} sortOrder "a" for "ascending, "d" for descending, and "n" for none
|
25
|
+
* @property {string} dataColumnName Field that is used for sorting
|
26
|
+
*/
|
27
|
+
|
28
|
+
/** Fired just before sorting data. This allows additional modification before the actual sorting
|
29
|
+
* @event SortableTitlePlugin#preDataSorting
|
30
|
+
* @property {boolean=} isUserAction This has true value, if event initiate from clicking title/header section
|
31
|
+
*/
|
32
|
+
|
33
|
+
/** Fired once column is sorted and before {@link SortableTitlePlugin#clicked}
|
34
|
+
* @event SortableTitlePlugin#columnSorted
|
35
|
+
* @property {number} colIndex
|
36
|
+
* @property {string} sortOrder "a" for "ascending, "d" for descending, and "n" for none
|
37
|
+
* @property {string} sortedField Field that is used for sorting
|
38
|
+
* @property {Array.<number>} colIndices An array of colIndex
|
39
|
+
* @property {Array.<string>} sortOrders An array of sortOrder
|
40
|
+
* @property {Array.<string>} sortedFields An array of sortedField
|
41
|
+
*/
|
42
|
+
|
43
|
+
/** @private
|
44
|
+
* @type {string}
|
45
|
+
*@constant
|
46
|
+
*/
|
47
|
+
const ROW_DEF = "ROW_DEF";
|
48
|
+
|
49
|
+
/** @constructor
|
50
|
+
* @extends {EventDispatcher}
|
51
|
+
* @param {SortableTitlePlugin.Options=} options
|
52
|
+
*/
|
53
|
+
let SortableTitlePlugin = function (options) { // TODO: Extract SortableTitlePlugin to grid extension.
|
54
|
+
let _t = this;
|
55
|
+
_t._onSectionAdded = _t._onSectionAdded.bind(_t);
|
56
|
+
_t._onMouseDown = _t._onMouseDown.bind(_t);
|
57
|
+
|
58
|
+
_t._onUIUpdated = _t._onUIUpdated.bind(_t);
|
59
|
+
|
60
|
+
_t._onColumnAdded = _t._onColumnAdded.bind(_t);
|
61
|
+
_t._onColumnRemoved = _t._onColumnRemoved.bind(_t);
|
62
|
+
_t._onItemSortingClicked = _t._onItemSortingClicked.bind(_t);
|
63
|
+
_t.refresh = _t.refresh.bind(_t);
|
64
|
+
_t._rowDefSorter = _t._rowDefSorter.bind(_t);
|
65
|
+
|
66
|
+
_t._hosts = [];
|
67
|
+
_t._sortLogic = {};
|
68
|
+
|
69
|
+
_t._addEvents(
|
70
|
+
"preClicked"
|
71
|
+
, "clicked"
|
72
|
+
, "preDataSorting"
|
73
|
+
, "columnSorted"
|
74
|
+
);
|
75
|
+
|
76
|
+
_t._sortStates = [];
|
77
|
+
_t._sortingSequence = ["a", "d"];
|
78
|
+
|
79
|
+
if(options) {
|
80
|
+
_t.config({ "sorting": options });
|
81
|
+
}
|
82
|
+
};
|
83
|
+
Ext.inherits(SortableTitlePlugin, EventDispatcher);
|
84
|
+
|
85
|
+
/**
|
86
|
+
* @typedef {"a" | "ascending" | "d" | "descending" | "n" | null} SortableTitlePlugin~SortOrder
|
87
|
+
*/
|
88
|
+
|
89
|
+
/** An object that specifies how sorting should be performed
|
90
|
+
* @typedef {Object} SortableTitlePlugin~InitialSort
|
91
|
+
* @property {number=} colIndex Column index of a column to be sorted
|
92
|
+
* @property {string=} colId Column id of a column to be sorted
|
93
|
+
* @property {string=} field Field of a column to be sorted
|
94
|
+
* @property {SortableTitlePlugin~SortOrder=} sortOrder=null Set to "d" for descending order and "a" for ascending order
|
95
|
+
* @property {SortableTitlePlugin~SortOrder=} order Alias to sortOrder
|
96
|
+
*/
|
97
|
+
SortableTitlePlugin.InitialSort;
|
98
|
+
|
99
|
+
/** An object that specifies how sorting should be performed
|
100
|
+
* @typedef {Object} SortableTitlePlugin~SortingDefinition
|
101
|
+
* @property {number=} colIndex Column index of a column to be sorted
|
102
|
+
* @property {string=} colId Column id of a column to be sorted
|
103
|
+
* @property {string=} field Field of a column to be sorted
|
104
|
+
* @property {SortableTitlePlugin~SortOrder=} sortOrder=null Set to "d" for descending order and "a" for ascending order
|
105
|
+
* @property {SortableTitlePlugin~SortOrder=} order Alias to sortOrder
|
106
|
+
*/
|
107
|
+
SortableTitlePlugin.SortingDefinition;
|
108
|
+
|
109
|
+
/** The sorting properties for column option.
|
110
|
+
* @typedef {Object} SortableTitlePlugin~ColumnOptions
|
111
|
+
* @property {boolean=} sortable=false If enable, the column can be sorted by user click
|
112
|
+
* @property {string=} sortBy Field to be used for sorting. If defined, user can click at the header section to sort the column
|
113
|
+
* @property {string=} sort="" Deprecated Alias to `sortOrder`
|
114
|
+
* @property {string=} sortOrder="" The column can be sorted in ascending and descending order by specifying the order "a", "d". This option will sort the column when it is initialized or inserted at runtime.
|
115
|
+
* @property {DataTable.SortLogic=} sortLogic=null Custom compare function for sorting
|
116
|
+
* @property {DataTable.SortLogic=} sortingLogic Alias to `sortLogic`
|
117
|
+
* @property {DataTable.SortLogic=} sorter Alias to `sortLogic`
|
118
|
+
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence Collection of sorting direction for the particular field.
|
119
|
+
*/
|
120
|
+
SortableTitlePlugin.ColumnOptions;
|
121
|
+
|
122
|
+
/** The configuration object for sorting options. This can be defined by `sorting` property in CompositeGrid configuration object.
|
123
|
+
* @typedef {Object} SortableTitlePlugin~Options
|
124
|
+
* @property {(SortableTitlePlugin~InitialSort|Array.<SortableTitlePlugin.SortingDefinition>)=} initialSort=null Set this config to initiate sorting after grid is created.
|
125
|
+
* @property {(boolean|number)=} multicolumn=false Allow multiple columns to be sorted at the same time. If number is defined, it is treated as maximum number of column to be sorted.
|
126
|
+
* @property {(boolean|number)=} multiColumn=false Alias to `multicolumn`
|
127
|
+
* @property {boolean=} threeStatesSorting=false If enabled, sorting will cycle through ascending, descending and original order states. This option is deprecated in favor of sortingSequence option
|
128
|
+
* @property {Object.<string, DataTable.SortLogic>=} sortLogic=null Custom logic for sorting based on the specified field. The key is field name and the value pair is a function.
|
129
|
+
* @property {boolean=} disableDoubleClickToSort=true If disabled, double click will trigger sorting operation
|
130
|
+
* @property {boolean=} sortableColumns=false If enabled, all columns will be sortable by field automatically
|
131
|
+
* @property {boolean=} sortableIndicator=false If enabled, sort indicator (diamond) icon will always show regardless of sorting states. In Halo theme, this option will be enabled by default.
|
132
|
+
* @property {boolean=} indicatorOnly=false If enabled, data will not be sorted, but the UI is rendered normally. This is useful for server side sorting.
|
133
|
+
* @property {string=} mode Set to "manual" to disable data sorting. Deprecated in favor of `indicatorOnly`
|
134
|
+
* @property {boolean=} disabled=false If enabled, header section cannot be clicked and no sort UI is rendered. Sorting can still be triggered only through `sortColumn` method.
|
135
|
+
* @property {Function=} columnSorted A shortcut to define the columnSorted event handler
|
136
|
+
* @property {Function=} preClicked A shortcut to define the preClicked event handler
|
137
|
+
* @property {Function=} clicked A shortcut to define the clicked event handler
|
138
|
+
* @property {Function=} preDataSorting A shortcut to define the preDataSorting event handler
|
139
|
+
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option overrides threeStatesSorting
|
140
|
+
* @property {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
141
|
+
*/
|
142
|
+
SortableTitlePlugin.Options;
|
143
|
+
|
144
|
+
|
145
|
+
/** @type {Array.<Core>}
|
146
|
+
* @private
|
147
|
+
*/
|
148
|
+
SortableTitlePlugin.prototype._hosts = null; // For a plug-in that support multi-table
|
149
|
+
|
150
|
+
/** Order of item indicates sort priorities used in DataView. <br>
|
151
|
+
* Each state contains column name{string}, sort order {string}, and rendering cell {ElementWrapper}
|
152
|
+
* @private
|
153
|
+
* @type {!Array.<Object>}
|
154
|
+
*/
|
155
|
+
SortableTitlePlugin.prototype._sortStates;
|
156
|
+
/** Maximum possible number of sorting columns at any time. how a column is sorted.
|
157
|
+
* @private
|
158
|
+
* @type {number}
|
159
|
+
*/
|
160
|
+
SortableTitlePlugin.prototype._maxCount = 1;
|
161
|
+
|
162
|
+
/** @private
|
163
|
+
* @type {boolean}
|
164
|
+
*/
|
165
|
+
SortableTitlePlugin.prototype._dataSorting = true;
|
166
|
+
/** @private
|
167
|
+
* @type {boolean}
|
168
|
+
*/
|
169
|
+
SortableTitlePlugin.prototype._dblClickAllowed = false;
|
170
|
+
|
171
|
+
/** @private
|
172
|
+
* @type {number}
|
173
|
+
*/
|
174
|
+
SortableTitlePlugin.prototype._clickTimer = 0;
|
175
|
+
/** @private
|
176
|
+
* @type {number}
|
177
|
+
*/
|
178
|
+
SortableTitlePlugin.prototype._delayInterval = 0;
|
179
|
+
/** @private
|
180
|
+
* @type {number}
|
181
|
+
*/
|
182
|
+
SortableTitlePlugin.prototype._lastMouseDown = 0;
|
183
|
+
/** @private
|
184
|
+
* @type {SortableTitlePlugin.SortingDefinition}
|
185
|
+
*/
|
186
|
+
SortableTitlePlugin.prototype._initialSort = null;
|
187
|
+
/** @private
|
188
|
+
* @type {string}
|
189
|
+
*/
|
190
|
+
SortableTitlePlugin.prototype._mode = "";
|
191
|
+
/** @private
|
192
|
+
* @type {boolean}
|
193
|
+
*/
|
194
|
+
SortableTitlePlugin.prototype._sortableColumns = true;
|
195
|
+
/** @private
|
196
|
+
* @type {boolean}
|
197
|
+
*/
|
198
|
+
SortableTitlePlugin.prototype._sortableIndicator = false;
|
199
|
+
/** @private
|
200
|
+
* @type {boolean}
|
201
|
+
*/
|
202
|
+
SortableTitlePlugin.prototype._solarTheme = false;
|
203
|
+
/** Logic map based on field name
|
204
|
+
* @private
|
205
|
+
* @type {Object.<string, Function>}
|
206
|
+
*/
|
207
|
+
SortableTitlePlugin.prototype._sortLogic;
|
208
|
+
/** To allow users/clients to store and provide all sorting logics by themselve
|
209
|
+
* @private
|
210
|
+
* @type {boolean}
|
211
|
+
*/
|
212
|
+
SortableTitlePlugin.prototype._userManagedLogic = false;
|
213
|
+
/** @private
|
214
|
+
* @type {boolean}
|
215
|
+
*/
|
216
|
+
SortableTitlePlugin.prototype._disabled = false;
|
217
|
+
/** @private
|
218
|
+
* @type {boolean}
|
219
|
+
*/
|
220
|
+
SortableTitlePlugin.prototype._frozenIndicator = false;
|
221
|
+
/** Since DataView in real-time grid has only one ROW_DEF column, we need to re-map sorting field to sort correctly.
|
222
|
+
* @private
|
223
|
+
* @type {boolean}
|
224
|
+
*/
|
225
|
+
SortableTitlePlugin.prototype._rowDefMode = false;
|
226
|
+
/**
|
227
|
+
* @private
|
228
|
+
* @type {Function}
|
229
|
+
*/
|
230
|
+
SortableTitlePlugin.prototype._userComparer = null;
|
231
|
+
|
232
|
+
/** @private
|
233
|
+
* @type {!Object.<string, string>}
|
234
|
+
*/
|
235
|
+
SortableTitlePlugin._icons = {};
|
236
|
+
|
237
|
+
/** @private
|
238
|
+
* @type {!Array.<string>}
|
239
|
+
*/
|
240
|
+
SortableTitlePlugin.prototype._sortingSequence;
|
241
|
+
/** @private
|
242
|
+
* @type {Object.<string, Array>}
|
243
|
+
*/
|
244
|
+
SortableTitlePlugin.prototype._sortingSequenceMap = null;
|
245
|
+
|
246
|
+
|
247
|
+
/** @type {string}
|
248
|
+
* @private
|
249
|
+
* @const
|
250
|
+
*/
|
251
|
+
let CODE_UP = "\u25B2";
|
252
|
+
/** @type {string}
|
253
|
+
* @private
|
254
|
+
* @const
|
255
|
+
*/
|
256
|
+
let CODE_DOWN = "\u25BC";
|
257
|
+
/** @type {string}
|
258
|
+
* @private
|
259
|
+
* @const
|
260
|
+
*/
|
261
|
+
let CODE_DIAMOND = "\u25CA";
|
262
|
+
|
263
|
+
/** The name must be readonly and unique among all other plugins
|
264
|
+
* @public
|
265
|
+
* @return {string}
|
266
|
+
*/
|
267
|
+
SortableTitlePlugin.prototype.getName = function () {
|
268
|
+
return "SortableTitlePlugin"; // Read Only
|
269
|
+
};
|
270
|
+
|
271
|
+
/** @public
|
272
|
+
* @param {!Core} host
|
273
|
+
* @param {Object=} options
|
274
|
+
* @description Suppress google compiler for argument options because Internal Plugin doesn't support.
|
275
|
+
* @suppress {checkTypes}
|
276
|
+
*/
|
277
|
+
SortableTitlePlugin.prototype.initialize = function (host, options) {
|
278
|
+
if (this._hosts.indexOf(host) >= 0) { return; }
|
279
|
+
this._hosts.push(host);
|
280
|
+
|
281
|
+
if (this._hosts.length === 1) {
|
282
|
+
host.listen("columnAdded", this._onColumnAdded);
|
283
|
+
host.listen("columnRemoved", this._onColumnRemoved);
|
284
|
+
}
|
285
|
+
host.listen("sectionAdded", this._onSectionAdded);
|
286
|
+
host.listen("postSectionRender", this._onUIUpdated);
|
287
|
+
host.listen("dataSourceChanged", this.refresh);
|
288
|
+
|
289
|
+
this.config(options);
|
290
|
+
};
|
291
|
+
|
292
|
+
/**For disposing any resource
|
293
|
+
* @public
|
294
|
+
* @param {!Core} host
|
295
|
+
*/
|
296
|
+
SortableTitlePlugin.prototype.unload = function (host) {
|
297
|
+
let at = this._hosts.indexOf(host);
|
298
|
+
if (at < 0) { return; }
|
299
|
+
|
300
|
+
this._hosts.splice(at, 1);
|
301
|
+
host.unlisten("sectionAdded", this._onSectionAdded);
|
302
|
+
host.unlisten("postSectionRender", this._onUIUpdated);
|
303
|
+
host.unlisten("dataSourceChanged", this.refresh);
|
304
|
+
|
305
|
+
host.unlisten("columnAdded", this._onColumnAdded);
|
306
|
+
host.unlisten("columnRemoved", this._onColumnRemoved);
|
307
|
+
|
308
|
+
if (this._hosts.length <= 0) {
|
309
|
+
if (this._clickTimer) {
|
310
|
+
clearTimeout(this._clickTimer);
|
311
|
+
this._clickTimer = 0;
|
312
|
+
}
|
313
|
+
}
|
314
|
+
};
|
315
|
+
|
316
|
+
/** @public
|
317
|
+
*/
|
318
|
+
SortableTitlePlugin.prototype.afterInit = function () {
|
319
|
+
let t = this;
|
320
|
+
|
321
|
+
// Set logic to the data source, since the data source not available during the initialization
|
322
|
+
t.setSortLogics(t._sortLogic);
|
323
|
+
|
324
|
+
let userInput = t._initialSort; // This will be passed from the user when they want to start with initialize sort
|
325
|
+
if (userInput != null) {
|
326
|
+
if(Array.isArray(userInput)) {
|
327
|
+
if(t._maxCount === 1) { // TODO: max count could be part of sortColumns method
|
328
|
+
t.sortColumns(userInput.slice(0, 1));
|
329
|
+
} else {
|
330
|
+
t.sortColumns(userInput);
|
331
|
+
}
|
332
|
+
} else {
|
333
|
+
t.sortColumns([userInput]);
|
334
|
+
}
|
335
|
+
}
|
336
|
+
};
|
337
|
+
|
338
|
+
/** @public
|
339
|
+
* @param {Object=} options Core model object
|
340
|
+
*/
|
341
|
+
SortableTitlePlugin.prototype.config = function (options) {
|
342
|
+
if (!options) { return; }
|
343
|
+
|
344
|
+
let t = this;
|
345
|
+
|
346
|
+
let icons = options["icons"];
|
347
|
+
if (icons != null) {
|
348
|
+
if (icons["sorting"]) {
|
349
|
+
SortableTitlePlugin._icons = icons["sorting"];
|
350
|
+
}
|
351
|
+
}
|
352
|
+
let themeName = options["themeName"];
|
353
|
+
if (!themeName || themeName.indexOf("solar") >= 0) {
|
354
|
+
t._solarTheme = true;
|
355
|
+
} else {
|
356
|
+
t._solarTheme = false;
|
357
|
+
}
|
358
|
+
t._initialSort = t._initialSortByColumnField(options);
|
359
|
+
|
360
|
+
let extOptions = options["sorting"];
|
361
|
+
if (!extOptions) {
|
362
|
+
return;
|
363
|
+
}
|
364
|
+
|
365
|
+
if(extOptions["ROW_DEF"]) {
|
366
|
+
this._rowDefMode = true;
|
367
|
+
}
|
368
|
+
if(extOptions["userManagedLogic"]) {
|
369
|
+
t._userManagedLogic = true;
|
370
|
+
}
|
371
|
+
|
372
|
+
let val = extOptions["multiColumn"] || extOptions["multicolumn"];
|
373
|
+
if (val != null) {
|
374
|
+
if (val === true) val = -1;
|
375
|
+
if (val === false) val = 1;
|
376
|
+
t.setSortableColumnCount((typeof val == "number" && val > 0) ? val : -1);
|
377
|
+
}
|
378
|
+
|
379
|
+
val = extOptions["sortableIndicator"];
|
380
|
+
if (val != null) {
|
381
|
+
t._sortableIndicator = val; // This can override default halo theme
|
382
|
+
}
|
383
|
+
|
384
|
+
val = extOptions["disabled"];
|
385
|
+
if (val != null) {
|
386
|
+
t._disabled = val ? true : false;
|
387
|
+
}
|
388
|
+
|
389
|
+
val = extOptions["threeStatesSorting"];
|
390
|
+
if (val != null) {
|
391
|
+
t.disableTwoStateSorting(val);
|
392
|
+
}
|
393
|
+
|
394
|
+
val = extOptions["sortingSequence"];
|
395
|
+
if (val != null) {
|
396
|
+
if(Array.isArray(val)) {
|
397
|
+
t._sortingSequence = val;
|
398
|
+
}
|
399
|
+
}
|
400
|
+
|
401
|
+
val = extOptions["mode"];
|
402
|
+
if (val != null) {
|
403
|
+
t._mode = val;
|
404
|
+
if (val === "manual") {
|
405
|
+
t.disableDataSorting();
|
406
|
+
}
|
407
|
+
}
|
408
|
+
|
409
|
+
val = extOptions["indicatorOnly"];
|
410
|
+
if (val != null) {
|
411
|
+
t.disableDataSorting(val);
|
412
|
+
}
|
413
|
+
|
414
|
+
val = extOptions["disableDoubleClickToSort"];
|
415
|
+
if (val != null) {
|
416
|
+
t.disableDoubleClickToSort(val);
|
417
|
+
}
|
418
|
+
|
419
|
+
val = extOptions["columnSorted"];
|
420
|
+
if (typeof val === "function") {
|
421
|
+
t.listen("columnSorted", val);
|
422
|
+
}
|
423
|
+
val = extOptions["preClicked"];
|
424
|
+
if (typeof val === "function") {
|
425
|
+
t.listen("preClicked", val);
|
426
|
+
}
|
427
|
+
val = extOptions["clicked"];
|
428
|
+
if (typeof val === "function") {
|
429
|
+
t.listen("clicked", val);
|
430
|
+
}
|
431
|
+
val = extOptions["preDataSorting"];
|
432
|
+
if (typeof val === "function") {
|
433
|
+
t.listen("preDataSorting", val);
|
434
|
+
}
|
435
|
+
|
436
|
+
val = extOptions["sortableColumns"];
|
437
|
+
if (val != null) {
|
438
|
+
t._sortableColumns = val;
|
439
|
+
}
|
440
|
+
|
441
|
+
// Override _initialSortByColumnField
|
442
|
+
val = extOptions["initialSort"];
|
443
|
+
if (typeof val === "object") {
|
444
|
+
t._initialSort = val;
|
445
|
+
}
|
446
|
+
|
447
|
+
val = extOptions["sortLogic"];
|
448
|
+
if (typeof val === "object") {
|
449
|
+
for (let field in val) {
|
450
|
+
if (typeof val[field] === "function") {
|
451
|
+
t._sortLogic[field] = val[field];
|
452
|
+
}
|
453
|
+
}
|
454
|
+
}
|
455
|
+
};
|
456
|
+
|
457
|
+
/** @public
|
458
|
+
* @param {Object=} gridOptions
|
459
|
+
* @return {!Object}
|
460
|
+
*/
|
461
|
+
SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
462
|
+
let obj = gridOptions || {};
|
463
|
+
|
464
|
+
let columns = obj["columns"];
|
465
|
+
if (!columns) {
|
466
|
+
columns = obj["columns"] = [];
|
467
|
+
}
|
468
|
+
|
469
|
+
let host = this._hosts[0];
|
470
|
+
|
471
|
+
if (!host) return obj;
|
472
|
+
|
473
|
+
let sortedColumns = this.getSortedColumns();
|
474
|
+
let col, i, len;
|
475
|
+
// Multiple column sorting cannot retain the sort order in the column option.
|
476
|
+
if(this._maxCount === 1 && sortedColumns != null) {
|
477
|
+
// assign sorting state to each columns
|
478
|
+
len = sortedColumns.length;
|
479
|
+
for (i = 0; i < len; i++) {
|
480
|
+
let sortedColumn = sortedColumns[i];
|
481
|
+
let colIndex = sortedColumn["colIndex"];
|
482
|
+
col = columns[colIndex];
|
483
|
+
if (!col) {
|
484
|
+
col = columns[colIndex] = {};
|
485
|
+
}
|
486
|
+
col["sortOrder"] = sortedColumn["sortOrder"];
|
487
|
+
}
|
488
|
+
}
|
489
|
+
|
490
|
+
len = host.getColumnCount();
|
491
|
+
let opt, field;
|
492
|
+
for(i = 0; i < len; ++i) {
|
493
|
+
col = columns[i];
|
494
|
+
if (!col) {
|
495
|
+
col = columns[i] = {};
|
496
|
+
}
|
497
|
+
|
498
|
+
// TODO: We should get the state from the core, instead of getting the sort options.
|
499
|
+
opt = this._getSortOptions(i);
|
500
|
+
|
501
|
+
if (!opt) { continue; }
|
502
|
+
|
503
|
+
if(this._sortableColumns) {
|
504
|
+
if (opt["disabled"]) {
|
505
|
+
col["sortable"] = false;
|
506
|
+
}
|
507
|
+
} else if(!opt["disabled"]) {
|
508
|
+
col["sortable"] = true;
|
509
|
+
}
|
510
|
+
field = opt["field"];
|
511
|
+
if (field) {
|
512
|
+
// WARNING: When Core's column has no field, sortBy property does not get returned
|
513
|
+
if(col["field"] != null && col["field"] !== field) {
|
514
|
+
col["sortBy"] = field;
|
515
|
+
} // else The default value is an empty sortBy, which refers to the same column field by default.
|
516
|
+
|
517
|
+
if (this._sortingSequenceMap && this._sortingSequenceMap[field]) {
|
518
|
+
col["sortingSequence"] = this._sortingSequenceMap[field];
|
519
|
+
}
|
520
|
+
}
|
521
|
+
|
522
|
+
}
|
523
|
+
|
524
|
+
let extOptions = obj["sorting"];
|
525
|
+
if(!extOptions) {
|
526
|
+
extOptions = obj["sorting"] = {};
|
527
|
+
}
|
528
|
+
|
529
|
+
let val = sortedColumns;
|
530
|
+
if(val != null) {
|
531
|
+
extOptions["initialSort"] = val;
|
532
|
+
}
|
533
|
+
|
534
|
+
val = this._sortableIndicator;
|
535
|
+
if(val !== false) {
|
536
|
+
extOptions["sortableIndicator"] = val;
|
537
|
+
}
|
538
|
+
|
539
|
+
if(this._maxCount !== 1) {
|
540
|
+
extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
|
541
|
+
}
|
542
|
+
if(this._dblClickAllowed) {
|
543
|
+
extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
|
544
|
+
}
|
545
|
+
|
546
|
+
val = this._sortableColumns;
|
547
|
+
if(val !== true) {
|
548
|
+
extOptions["sortableColumns"] = val;
|
549
|
+
}
|
550
|
+
|
551
|
+
val = this._dataSorting;
|
552
|
+
if(val !== true) {
|
553
|
+
extOptions["indicatorOnly"] = val;
|
554
|
+
}
|
555
|
+
// extOptions["mode"] = this._mode;
|
556
|
+
if(this._disabled) {
|
557
|
+
extOptions["disabled"] = true;
|
558
|
+
}
|
559
|
+
|
560
|
+
let sortingSeq = this._sortingSequence;
|
561
|
+
let notDefaultSeq = true;
|
562
|
+
if (sortingSeq.length === 2) {
|
563
|
+
if (sortingSeq[0] === "a" && sortingSeq[1] === "d") { // Sorting Sequence is not the default one
|
564
|
+
notDefaultSeq = false;
|
565
|
+
}
|
566
|
+
}
|
567
|
+
if(notDefaultSeq) {
|
568
|
+
extOptions["sortingSequence"] = sortingSeq.slice();
|
569
|
+
}
|
570
|
+
|
571
|
+
if(isEmptyObject(obj["sorting"])) {
|
572
|
+
delete obj["sorting"];
|
573
|
+
}
|
574
|
+
|
575
|
+
return obj;
|
576
|
+
};
|
577
|
+
|
578
|
+
/** @public
|
579
|
+
* @description Function for ColumnMenuExtension to collect config of column menu
|
580
|
+
* @param {number} colIndex Column index
|
581
|
+
* @param {Object} config Column Menu configuration
|
582
|
+
* @return {!Object}
|
583
|
+
*/
|
584
|
+
SortableTitlePlugin.prototype.getColumnMenu = function (colIndex, config) {
|
585
|
+
if (!config) {
|
586
|
+
config = {};
|
587
|
+
}
|
588
|
+
|
589
|
+
let menus = config["menus"];
|
590
|
+
if (!menus) {
|
591
|
+
menus = config["menus"] = [];
|
592
|
+
}
|
593
|
+
|
594
|
+
let menu = menus[0];
|
595
|
+
if (!menu) {
|
596
|
+
menu = menus[0] = {
|
597
|
+
"menuItems": []
|
598
|
+
};
|
599
|
+
}
|
600
|
+
|
601
|
+
let order = this.getSortOrder(colIndex);
|
602
|
+
|
603
|
+
// Menu items for this extension
|
604
|
+
let extMenuItem = {
|
605
|
+
"indexScore": 100,
|
606
|
+
"label": "Sort Column",
|
607
|
+
"icon": "sort-a-to-z",
|
608
|
+
"group": "FREQUENTLY_USED",
|
609
|
+
"subMenu": {
|
610
|
+
"menuItems": [{
|
611
|
+
"indexScore": 3,
|
612
|
+
"label": "Ascending",
|
613
|
+
"radioMode": true,
|
614
|
+
"value": {
|
615
|
+
"colIndex": colIndex,
|
616
|
+
"order": "a"
|
617
|
+
},
|
618
|
+
"selected": order === "a",
|
619
|
+
"click": this._onItemSortingClicked
|
620
|
+
}, {
|
621
|
+
"indexScore": 2,
|
622
|
+
"label": "Descending",
|
623
|
+
"radioMode": true,
|
624
|
+
"value": {
|
625
|
+
"colIndex": colIndex,
|
626
|
+
"order": "d"
|
627
|
+
},
|
628
|
+
"selected": order === "d",
|
629
|
+
"click": this._onItemSortingClicked
|
630
|
+
}, {
|
631
|
+
"indexScore": 1,
|
632
|
+
"label": "Un-Sort",
|
633
|
+
"radioMode": true,
|
634
|
+
"value": {
|
635
|
+
"colIndex": colIndex,
|
636
|
+
"order": "n"
|
637
|
+
},
|
638
|
+
"selected": order === "n",
|
639
|
+
"click": this._onItemSortingClicked
|
640
|
+
}]
|
641
|
+
}
|
642
|
+
};
|
643
|
+
|
644
|
+
// Push menu items to config
|
645
|
+
menu["menuItems"].push(extMenuItem);
|
646
|
+
|
647
|
+
return config;
|
648
|
+
};
|
649
|
+
|
650
|
+
/** @private
|
651
|
+
* @param {Object} e
|
652
|
+
*/
|
653
|
+
SortableTitlePlugin.prototype._onItemSortingClicked = function (e) {
|
654
|
+
let host = this._hosts[0];
|
655
|
+
let columnMenuExt = host["getPlugin"]("ColumnMenuPlugin");
|
656
|
+
columnMenuExt["hide"]();
|
657
|
+
|
658
|
+
let value = e["currentTarget"]["value"];
|
659
|
+
let colIndex = value["colIndex"];
|
660
|
+
let order = value["sortOrder"];
|
661
|
+
this.sortColumn(colIndex, order);
|
662
|
+
};
|
663
|
+
|
664
|
+
/** @public
|
665
|
+
* @return {Object.<string, string>} "a" for ascending, "d" for descending, and "n" for no sorting
|
666
|
+
*/
|
667
|
+
SortableTitlePlugin.prototype.getIcons = function () {
|
668
|
+
return SortableTitlePlugin._icons;
|
669
|
+
};
|
670
|
+
|
671
|
+
/** @public
|
672
|
+
* @param {Object.<string, Function>} sortLogic
|
673
|
+
*/
|
674
|
+
SortableTitlePlugin.prototype.setSortLogics = function (sortLogic) { // TODO: This should be deprecated
|
675
|
+
if (sortLogic != null) {
|
676
|
+
let host = this._hosts[0];
|
677
|
+
if (host) {
|
678
|
+
let ds = host.getDataSource();
|
679
|
+
for (let field in sortLogic) {
|
680
|
+
this._setSortLogic(ds, field, sortLogic[field]);
|
681
|
+
}
|
682
|
+
}
|
683
|
+
}
|
684
|
+
};
|
685
|
+
|
686
|
+
/** @public
|
687
|
+
* @param {string} field
|
688
|
+
* @param {Function} func
|
689
|
+
*/
|
690
|
+
SortableTitlePlugin.prototype.setSortLogic = function (field, func) { // TODO: This should be deprecated
|
691
|
+
if (typeof field === "string") {
|
692
|
+
let host = this._hosts[0];
|
693
|
+
if (host) {
|
694
|
+
let ds = host.getDataSource();
|
695
|
+
this._setSortLogic(ds, field, func);
|
696
|
+
}
|
697
|
+
}
|
698
|
+
};
|
699
|
+
|
700
|
+
/** @private
|
701
|
+
* @param {Object} ds
|
702
|
+
* @param {string} field
|
703
|
+
* @param {Function} func
|
704
|
+
*/
|
705
|
+
SortableTitlePlugin.prototype._setSortLogic = function (ds, field, func) { // TODO: This is deprecated
|
706
|
+
if (ds && typeof field === "string") {
|
707
|
+
if (field === "*") {
|
708
|
+
ds.setSortingLogic(func);
|
709
|
+
} else {
|
710
|
+
ds.setColumnSortingLogic(field, func);
|
711
|
+
}
|
712
|
+
}
|
713
|
+
};
|
714
|
+
|
715
|
+
/** @public
|
716
|
+
* @param {number=} colIndex If colIndex is undefined or null the first sorted column is used instead
|
717
|
+
* @return {string} "a" for ascending, "d" for descending, and "n" for no sorting
|
718
|
+
*/
|
719
|
+
SortableTitlePlugin.prototype.getSortOrder = function (colIndex) {
|
720
|
+
let priority = (colIndex != null) ? this.getSortPriority(colIndex) : 0;
|
721
|
+
let state = this._sortStates[priority];
|
722
|
+
let sortOrder = state ? state["sortOrder"] : "";
|
723
|
+
return sortOrder || "n";
|
724
|
+
};
|
725
|
+
/** Return the first (highest priority) sorted column's index
|
726
|
+
* @public
|
727
|
+
* @param {number=} priority
|
728
|
+
* @return {number} Return negative value if there is no sorted column
|
729
|
+
*/
|
730
|
+
SortableTitlePlugin.prototype.getSortedColumnIndex = function (priority) {
|
731
|
+
return this._getColumnIndex(this._sortStates[priority || 0]);
|
732
|
+
};
|
733
|
+
/** Start with 0 (the first column that is being sorted). The highest number will be sorted last. Negative value means the specified column is not sorted
|
734
|
+
* @public
|
735
|
+
* @param {number} colIndex
|
736
|
+
* @param {string=} colRef field or column id
|
737
|
+
* @return {number}
|
738
|
+
*/
|
739
|
+
SortableTitlePlugin.prototype.getSortPriority = function (colIndex, colRef) {
|
740
|
+
let host = this._hosts[0];
|
741
|
+
if(host) {
|
742
|
+
let i;
|
743
|
+
let len = this._sortStates.length;
|
744
|
+
if(colIndex >= 0) {
|
745
|
+
let colId = host.getColumnId(colIndex);
|
746
|
+
if(colId) {
|
747
|
+
for(i = 0; i < len; ++i) {
|
748
|
+
if(this._sortStates[i]["colId"] === colId) {
|
749
|
+
return i;
|
750
|
+
}
|
751
|
+
}
|
752
|
+
}
|
753
|
+
} else if(colRef) {
|
754
|
+
for(i = 0; i < len; ++i) {
|
755
|
+
let sortState = this._sortStates[i];
|
756
|
+
if(sortState["colId"] === colRef) {
|
757
|
+
return i;
|
758
|
+
}
|
759
|
+
if(sortState["field"] === colRef) {
|
760
|
+
return i;
|
761
|
+
}
|
762
|
+
}
|
763
|
+
}
|
764
|
+
}
|
765
|
+
return -1;
|
766
|
+
};
|
767
|
+
/** @public
|
768
|
+
* @param {number} colIndex
|
769
|
+
* @return {boolean}
|
770
|
+
*/
|
771
|
+
SortableTitlePlugin.prototype.isColumnSorted = function (colIndex) {
|
772
|
+
return this.getSortPriority(colIndex) >= 0;
|
773
|
+
};
|
774
|
+
/** @public
|
775
|
+
* @return {Array.<Object>} Array of objects with colIndex, colId, field, and sortOrder properties
|
776
|
+
*/
|
777
|
+
SortableTitlePlugin.prototype.getSortedColumns = function () {
|
778
|
+
let len = this._sortStates.length;
|
779
|
+
if (len <= 0) { return null; }
|
780
|
+
|
781
|
+
let arr = new Array(len);
|
782
|
+
for (let i = 0; i < len; ++i) {
|
783
|
+
let colIndex = this.getSortedColumnIndex(i);
|
784
|
+
let state = this._sortStates[i];
|
785
|
+
let retObj = {};
|
786
|
+
let colId = "";
|
787
|
+
if(colIndex >= 0) {
|
788
|
+
retObj["colIndex"] = colIndex;
|
789
|
+
colId = this._getColumnId(colIndex);
|
790
|
+
}
|
791
|
+
if(colId) {
|
792
|
+
retObj["colId"] = colId;
|
793
|
+
}
|
794
|
+
let field = state["field"] || "";
|
795
|
+
if(field) {
|
796
|
+
retObj["field"] = field;
|
797
|
+
}
|
798
|
+
retObj["sortOrder"] = state["sortOrder"] || "n";
|
799
|
+
arr[i] = retObj;
|
800
|
+
}
|
801
|
+
return arr;
|
802
|
+
};
|
803
|
+
/** @public
|
804
|
+
* @return {boolean}
|
805
|
+
*/
|
806
|
+
SortableTitlePlugin.prototype.isSorting = function () {
|
807
|
+
return this._sortStates.length ? true : false;
|
808
|
+
};
|
809
|
+
|
810
|
+
/** @public
|
811
|
+
* @param {number|string} colRef Column index or field
|
812
|
+
* @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
|
813
|
+
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
814
|
+
* @fires SortableTitlePlugin#preDataSorting
|
815
|
+
* @fires SortableTitlePlugin#columnSorted
|
816
|
+
*/
|
817
|
+
SortableTitlePlugin.prototype.sortColumn = function (colRef, sortOrder, opt_arg) {
|
818
|
+
let sortOptions = this._prepareSorting(colRef, sortOrder);
|
819
|
+
this._sortColumn(sortOptions, opt_arg);
|
820
|
+
if (opt_arg && opt_arg["isUserAction"]) { // Currently, the 'isUserAction' flag is triggered by a user clicking on the title and clicking the filter dialog. TODO: preClicked should be firing too.
|
821
|
+
let ce = {};
|
822
|
+
ce["colIndex"] = sortOptions.colIndex;
|
823
|
+
ce["sortOrder"] = this.getSortOrder(sortOptions.colIndex);
|
824
|
+
ce["dataColumnName"] = this.getColumnSortingField(sortOptions.colIndex); // This should be deprecated
|
825
|
+
this._dispatch("clicked", ce);
|
826
|
+
}
|
827
|
+
};
|
828
|
+
|
829
|
+
/** Sort multiple columns at once
|
830
|
+
* @public
|
831
|
+
* @param {Array.<SortableTitlePlugin.SortingDefinition>} sortOptions Input an array to specify the multiple column sort order
|
832
|
+
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
833
|
+
* @fires SortableTitlePlugin#preDataSorting
|
834
|
+
* @fires SortableTitlePlugin#columnSorted
|
835
|
+
*/
|
836
|
+
SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
|
837
|
+
if (Array.isArray(sortOptions)) {
|
838
|
+
let len = sortOptions.length;
|
839
|
+
let states = new Array(len);
|
840
|
+
for (let i = 0; i < len; i++) {
|
841
|
+
states[i] = this._prepareSorting(sortOptions[i]);
|
842
|
+
}
|
843
|
+
this._sortColumn(states, opt_arg);
|
844
|
+
}
|
845
|
+
};
|
846
|
+
/** @description Clear all sorting states
|
847
|
+
* @public
|
848
|
+
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
849
|
+
*/
|
850
|
+
SortableTitlePlugin.prototype.clearSortState = function (opt_arg) {
|
851
|
+
if(this._popSortState(0, opt_arg)) {
|
852
|
+
this.updateSortSymbols();
|
853
|
+
}
|
854
|
+
};
|
855
|
+
/** @description Perform sorting with the same parameter.
|
856
|
+
* @public
|
857
|
+
* @fires SortableTitlePlugin#preDataSorting
|
858
|
+
*/
|
859
|
+
SortableTitlePlugin.prototype.refresh = function () {
|
860
|
+
if (this._sortStates.length) {
|
861
|
+
this._sortDataView();
|
862
|
+
this.updateSortSymbols();
|
863
|
+
}
|
864
|
+
};
|
865
|
+
|
866
|
+
/** @description Perform sorting with the same parameter. Alias to {@link SortableTitlePlugin#refresh}
|
867
|
+
* @public
|
868
|
+
* @function
|
869
|
+
*/
|
870
|
+
SortableTitlePlugin.prototype.restoreUserActions = SortableTitlePlugin.prototype.refresh;
|
871
|
+
|
872
|
+
/** @public
|
873
|
+
* @param {number} count
|
874
|
+
*/
|
875
|
+
SortableTitlePlugin.prototype.setSortableColumnCount = function (count) {
|
876
|
+
this._maxCount = count ? count : 1;
|
877
|
+
this._popSortState(this._maxCount);
|
878
|
+
};
|
879
|
+
|
880
|
+
/** Deprecated. Use getSortedColumns instead of this
|
881
|
+
* @public
|
882
|
+
* @return {Array.<Object>} Array of sorted column states ordered by priority
|
883
|
+
* @see {@link SortableTitlePlugin#getSortedColumns}
|
884
|
+
*/
|
885
|
+
SortableTitlePlugin.prototype.getSortingStates = function () {
|
886
|
+
return this._sortStates; // WARNING: Exposing internal variable
|
887
|
+
};
|
888
|
+
|
889
|
+
/** @public
|
890
|
+
*/
|
891
|
+
SortableTitlePlugin.prototype.updateSortSymbols = function () {
|
892
|
+
if(!this._disabled) {
|
893
|
+
for (let i = this._hosts.length; --i >= 0;) {
|
894
|
+
this._updateSortableIndicator(i);
|
895
|
+
}
|
896
|
+
}
|
897
|
+
};
|
898
|
+
|
899
|
+
/** Get Array of fields used for sorting
|
900
|
+
* @public
|
901
|
+
* @return {!Array.<string>}
|
902
|
+
*/
|
903
|
+
SortableTitlePlugin.prototype.getDataColumnMap = function () {
|
904
|
+
let host = this._hosts[0];
|
905
|
+
let dataMap = [];
|
906
|
+
if (host) {
|
907
|
+
let colCount = host.getColumnCount();
|
908
|
+
for (let i = 0; i < colCount; ++i) {
|
909
|
+
dataMap[i] = this.getColumnSortingField(i);
|
910
|
+
}
|
911
|
+
}
|
912
|
+
return dataMap;
|
913
|
+
};
|
914
|
+
SortableTitlePlugin.prototype.getDataColumnNames = SortableTitlePlugin.prototype.getDataColumnMap;
|
915
|
+
|
916
|
+
/** Set sorting field for multiple columns at once
|
917
|
+
* @public
|
918
|
+
* @param {Array.<string|null>} dataMap
|
919
|
+
*/
|
920
|
+
SortableTitlePlugin.prototype.setDataColumnMap = function (dataMap) { // TODO: This should be deprecated
|
921
|
+
// This should work just like "sortBy"
|
922
|
+
if (Array.isArray(dataMap)) {
|
923
|
+
for (let i = dataMap.length; --i >= 0;) {
|
924
|
+
this.setColumnSortingField(i, dataMap[i]);
|
925
|
+
}
|
926
|
+
}
|
927
|
+
};
|
928
|
+
SortableTitlePlugin.prototype.setDataColumnNames = SortableTitlePlugin.prototype.setDataColumnMap;
|
929
|
+
|
930
|
+
/** @public
|
931
|
+
* @param {number} colIndex
|
932
|
+
* @return {string} field A field used for sorting
|
933
|
+
*/
|
934
|
+
SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
|
935
|
+
let sortOptions = this._getSortOptions(colIndex);
|
936
|
+
// options["field"] is already consolidated from field, sortBy, and sortable properties.
|
937
|
+
let field = (sortOptions) ? sortOptions["field"] : null;
|
938
|
+
|
939
|
+
if (field == null && !this._rowDefMode) { // Old CompositeGrid may store sorting field in DataColumnName
|
940
|
+
let host = this._hosts[0];
|
941
|
+
if (host) {
|
942
|
+
field = host.getColumnField(colIndex);
|
943
|
+
if(!field) {
|
944
|
+
field = host.getDataColumnName(colIndex);
|
945
|
+
}
|
946
|
+
if(field && sortOptions) {
|
947
|
+
sortOptions["field"] = field; // Cache for later use
|
948
|
+
}
|
949
|
+
}
|
950
|
+
}
|
951
|
+
|
952
|
+
return field || "";
|
953
|
+
};
|
954
|
+
/** This is equivalent to setting sortBy in the configuration object.
|
955
|
+
* @public
|
956
|
+
* @param {number} colIndex
|
957
|
+
* @param {string|null} field A field used for sorting
|
958
|
+
* @param {Function=} sortLogic=null
|
959
|
+
* @param {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
960
|
+
*/
|
961
|
+
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic, rowSorting) {
|
962
|
+
if (typeof colIndex == "number" && field != null) {
|
963
|
+
let options = this._newSortOptions(colIndex);
|
964
|
+
if (!field) {
|
965
|
+
field = "";
|
966
|
+
}
|
967
|
+
if (options["field"] !== field) {
|
968
|
+
options["field"] = field;
|
969
|
+
}
|
970
|
+
if(sortLogic != null && !this._userManagedLogic) {
|
971
|
+
if (options["sortLogic"] !== sortLogic) {
|
972
|
+
options["sortLogic"] = sortLogic || null;
|
973
|
+
if(rowSorting && sortLogic) {
|
974
|
+
sortLogic["rowSorting"] = true; // Tell data view/table about the argument
|
975
|
+
}
|
976
|
+
}
|
977
|
+
}
|
978
|
+
}
|
979
|
+
};
|
980
|
+
|
981
|
+
/** @private
|
982
|
+
* @param {Object} sortState
|
983
|
+
* @returns {string}
|
984
|
+
*/
|
985
|
+
let _toField = function(sortState) {
|
986
|
+
return sortState["field"] || "";
|
987
|
+
};
|
988
|
+
/** Return array of the fields from the currently sorted columns
|
989
|
+
* @public
|
990
|
+
* @return {!Array.<string>} fields of each sorting states
|
991
|
+
*/
|
992
|
+
SortableTitlePlugin.prototype.getColumnSortingFields = function () {
|
993
|
+
return this._sortStates.map(_toField);
|
994
|
+
};
|
995
|
+
|
996
|
+
/** This is deprecated in favor of setSortingSequence method. Move existing sort order to the front of sorting sequence. New sort order will be added, if the specified sort order does not exist in current sorting sequence.
|
997
|
+
* @public
|
998
|
+
* @param {string|number|Array.<string|number>} colIdentifier string is data column name, while number is display column index. If null value is given, first sort order is set to grid level configuration
|
999
|
+
* @param {string=} sortOrder="a" "ascending", "descending", "none"
|
1000
|
+
* @see {@link SortableTitlePlugin#setSortingSequence}
|
1001
|
+
*/
|
1002
|
+
SortableTitlePlugin.prototype.setFirstSortOrder = function (colIdentifier, sortOrder) {
|
1003
|
+
if (sortOrder) {
|
1004
|
+
sortOrder = SortableTitlePlugin._toSortOrder(sortOrder);
|
1005
|
+
} else {
|
1006
|
+
sortOrder = "a";
|
1007
|
+
}
|
1008
|
+
if (sortOrder !== "a" && sortOrder !== "d") {
|
1009
|
+
sortOrder = "a"; // There is no "none" as the first sorting order
|
1010
|
+
}
|
1011
|
+
|
1012
|
+
let fields = null;
|
1013
|
+
if (Array.isArray(colIdentifier)) {
|
1014
|
+
fields = colIdentifier;
|
1015
|
+
} else {
|
1016
|
+
fields = [/** @type{string|number} */(colIdentifier)];
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
let len = fields.length;
|
1020
|
+
for (let i = 0; i < len; ++i) {
|
1021
|
+
let field = fields[i];
|
1022
|
+
let sortingSeq = this.getSortingSequence(field).slice();
|
1023
|
+
let index = sortingSeq.indexOf(sortOrder);
|
1024
|
+
if (index >= 0) {
|
1025
|
+
sortingSeq.splice(index, 1);
|
1026
|
+
}
|
1027
|
+
sortingSeq.unshift(sortOrder);
|
1028
|
+
this.setSortingSequence(sortingSeq, field);
|
1029
|
+
|
1030
|
+
}
|
1031
|
+
};
|
1032
|
+
|
1033
|
+
/** This is deprecated in favor of setSortingSequence method. If two-state sorting is disabled, "n" (original order) will be added to current sorting sequence. If two-state sorting is enabled, "n" will be removed from current sorting sequence.
|
1034
|
+
* @public
|
1035
|
+
* @param {boolean=} disabled
|
1036
|
+
* @see {@link SortableTitlePlugin#setSortingSequence}
|
1037
|
+
*/
|
1038
|
+
SortableTitlePlugin.prototype.disableTwoStateSorting = function (disabled) {
|
1039
|
+
let at = this._sortingSequence.indexOf("n");
|
1040
|
+
if(disabled === false) { // two-state sorting
|
1041
|
+
if(at >= 0) {
|
1042
|
+
this._sortingSequence.splice(at, 1);
|
1043
|
+
}
|
1044
|
+
} else { // three-state sorting
|
1045
|
+
if(at < 0) {
|
1046
|
+
this._sortingSequence.push("n");
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
};
|
1051
|
+
/** @public
|
1052
|
+
* @param {boolean=} bool=true, if set to false it will be unfreeze indicator
|
1053
|
+
*/
|
1054
|
+
SortableTitlePlugin.prototype.freezeIndicator = function (bool) {
|
1055
|
+
let prevState = this._frozenIndicator;
|
1056
|
+
this._frozenIndicator = bool !== false;
|
1057
|
+
if(prevState && !this._frozenIndicator) { // from frozen to unfrozen, update the ui
|
1058
|
+
for (let i = this._hosts.length; --i >= 0;) {
|
1059
|
+
this._updateSortableIndicator(i);
|
1060
|
+
}
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
};
|
1064
|
+
/** @public
|
1065
|
+
* @param {boolean=} disabled
|
1066
|
+
*/
|
1067
|
+
SortableTitlePlugin.prototype.disableSortSymbols = function (disabled) {
|
1068
|
+
// this._sortSymbols = disabled === false;
|
1069
|
+
// TODO: Clear existing UIs at run-time
|
1070
|
+
};
|
1071
|
+
/** @public
|
1072
|
+
* @param {boolean=} disabled
|
1073
|
+
*/
|
1074
|
+
SortableTitlePlugin.prototype.disableDataSorting = function (disabled) {
|
1075
|
+
this._dataSorting = disabled === false;
|
1076
|
+
};
|
1077
|
+
/** @public
|
1078
|
+
* @description To allow double click action to sort. Default value is false.
|
1079
|
+
* @param {boolean=} disabled=false
|
1080
|
+
*/
|
1081
|
+
SortableTitlePlugin.prototype.disableDoubleClickToSort = function (disabled) {
|
1082
|
+
this._dblClickAllowed = !disabled;
|
1083
|
+
};
|
1084
|
+
/** This api is deprecated. Use {@link SortableTitlePlugin.prototype.disableColumnSorting} instead
|
1085
|
+
* @public
|
1086
|
+
* @param {ElementWrapper} cell
|
1087
|
+
* @param {boolean=} disabled
|
1088
|
+
*/
|
1089
|
+
SortableTitlePlugin.prototype.disableCellClick = function (cell, disabled) {
|
1090
|
+
if (cell) {
|
1091
|
+
cell.enableClass("no-sort", disabled !== false);
|
1092
|
+
}
|
1093
|
+
};
|
1094
|
+
/** @public
|
1095
|
+
* @param {number|Array.<number>} columns
|
1096
|
+
* @param {boolean=} disabled
|
1097
|
+
*/
|
1098
|
+
SortableTitlePlugin.prototype.disableColumnSorting = function (columns, disabled) {
|
1099
|
+
disabled = disabled !== false;
|
1100
|
+
if (typeof columns === "number") {
|
1101
|
+
this._disableColumnSorting(columns, disabled);
|
1102
|
+
} else if (Array.isArray(columns)) {
|
1103
|
+
let len = columns.length;
|
1104
|
+
for (let i = 0; i < len; ++i) {
|
1105
|
+
this._disableColumnSorting(columns[i] || 0, disabled);
|
1106
|
+
}
|
1107
|
+
}
|
1108
|
+
};
|
1109
|
+
/** @private
|
1110
|
+
* @param {number} colIndex
|
1111
|
+
* @param {boolean} disabled
|
1112
|
+
*/
|
1113
|
+
SortableTitlePlugin.prototype._disableColumnSorting = function (colIndex, disabled) {
|
1114
|
+
let sortOptions = this._newSortOptions(colIndex);
|
1115
|
+
if (sortOptions["disabled"] !== disabled) {
|
1116
|
+
sortOptions["disabled"] = disabled;
|
1117
|
+
// TODO: Remove existing sort
|
1118
|
+
}
|
1119
|
+
};
|
1120
|
+
|
1121
|
+
/** @public
|
1122
|
+
* @param {number=} opt_ms Delay before actual sorting in milliseconds. Setting undefined value will be 500ms. Setting 0 to instantly perform sorting
|
1123
|
+
*/
|
1124
|
+
SortableTitlePlugin.prototype.setClickDelayInterval = function (opt_ms) {
|
1125
|
+
this._delayInterval = (opt_ms != null) ? opt_ms : 500;
|
1126
|
+
};
|
1127
|
+
|
1128
|
+
/** @private
|
1129
|
+
* @description Get initial sort from column option `defaultSort` or `sort`
|
1130
|
+
* @param {Object} options Core model object
|
1131
|
+
* @returns {Object}
|
1132
|
+
*/
|
1133
|
+
SortableTitlePlugin.prototype._initialSortByColumnField = function (options) {
|
1134
|
+
let columns = options["columns"];
|
1135
|
+
let colCount = columns ? columns.length : 0;
|
1136
|
+
for (let i = 0; i < colCount; i++) {
|
1137
|
+
let column = columns[i];
|
1138
|
+
let sortOrder = column["defaultSort"]; // composite and rt grid option for default sort order
|
1139
|
+
if (sortOrder) {
|
1140
|
+
// TODO: Support multi-column sorting
|
1141
|
+
return {
|
1142
|
+
"colIndex": i,
|
1143
|
+
"sortOrder": sortOrder
|
1144
|
+
};
|
1145
|
+
}
|
1146
|
+
}
|
1147
|
+
return null;
|
1148
|
+
};
|
1149
|
+
|
1150
|
+
/** @private
|
1151
|
+
* @param {Object} e
|
1152
|
+
*/
|
1153
|
+
SortableTitlePlugin.prototype._onSectionAdded = function (e) {
|
1154
|
+
if (e["sectionType"] !== "title") { return; }
|
1155
|
+
|
1156
|
+
let section = /** @type{ILayoutGrid} */(e["section"]);
|
1157
|
+
if (section.getIndex() !== 0) return; // only topmost header can click
|
1158
|
+
section.listen("mousedown", this._onMouseDown);
|
1159
|
+
section.listen("click", this._onClickTitle.bind(this, e["sender"]), 0); // Sorting has higher priority
|
1160
|
+
};
|
1161
|
+
|
1162
|
+
/** @private
|
1163
|
+
* @param {Object} e
|
1164
|
+
*/
|
1165
|
+
SortableTitlePlugin.prototype._onUIUpdated = function (e) {
|
1166
|
+
if (e["sectionType"] === "title") {
|
1167
|
+
this.updateSortSymbols();
|
1168
|
+
}
|
1169
|
+
};
|
1170
|
+
|
1171
|
+
/** @private
|
1172
|
+
* @param {Object} hitObj
|
1173
|
+
* @return {boolean}
|
1174
|
+
* @fires SortableTitlePlugin#preClicked
|
1175
|
+
*/
|
1176
|
+
SortableTitlePlugin.prototype._canClickToSort = function (hitObj) {
|
1177
|
+
if(this._disabled) {
|
1178
|
+
return false;
|
1179
|
+
}
|
1180
|
+
|
1181
|
+
let grid = hitObj["grid"];
|
1182
|
+
if (!grid || !grid.getElement()) { // The given grid has been disposed
|
1183
|
+
return false;
|
1184
|
+
}
|
1185
|
+
|
1186
|
+
let cep = this._getPlugin("CellEditingPlugin");
|
1187
|
+
if (cep && cep["isEditing"]()) { // Current cell is being edited, so skip the sort
|
1188
|
+
return false;
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
this._dispatch("preClicked", hitObj);
|
1192
|
+
if (hitObj["cancel"]) { // User want to cancel the operation
|
1193
|
+
return false;
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
let colIndex = hitObj["colIndex"];
|
1197
|
+
let section = hitObj["section"];
|
1198
|
+
let rowIndex = hitObj["rowIndex"];
|
1199
|
+
|
1200
|
+
if (!this._isCellSortable(section, colIndex, rowIndex)) {
|
1201
|
+
return false;
|
1202
|
+
}
|
1203
|
+
|
1204
|
+
return true;
|
1205
|
+
};
|
1206
|
+
|
1207
|
+
/** @private
|
1208
|
+
* @param {Object} hitObj
|
1209
|
+
* @fires SortableTitlePlugin#preDataSorting
|
1210
|
+
* @fires SortableTitlePlugin#columnSorted
|
1211
|
+
* @fires SortableTitlePlugin#clicked
|
1212
|
+
*/
|
1213
|
+
SortableTitlePlugin.prototype._proceedSorting = function (hitObj) {
|
1214
|
+
this._clickTimer = 0;
|
1215
|
+
|
1216
|
+
if (this._canClickToSort(hitObj)) {
|
1217
|
+
let colIndex = hitObj["colIndex"];
|
1218
|
+
// _proceedSorting() method is always produced by user clicking at the header // Thus, this operation is guaranteed to be a user action
|
1219
|
+
this.sortColumn(colIndex, null, { "isUserAction": true });
|
1220
|
+
|
1221
|
+
let grid = hitObj["grid"];
|
1222
|
+
if(grid && grid["focus"]) {
|
1223
|
+
grid["focus"]();
|
1224
|
+
}
|
1225
|
+
}
|
1226
|
+
};
|
1227
|
+
|
1228
|
+
/** @private
|
1229
|
+
* @param {MouseEvent} e
|
1230
|
+
*/
|
1231
|
+
SortableTitlePlugin.prototype._onMouseDown = function (e) {
|
1232
|
+
if (!e.button) { // left mouse only
|
1233
|
+
this._lastMouseDown = e.timeStamp;
|
1234
|
+
}
|
1235
|
+
};
|
1236
|
+
/** @private
|
1237
|
+
* @param {string} pluginName
|
1238
|
+
* @return {*|null}
|
1239
|
+
*/
|
1240
|
+
SortableTitlePlugin.prototype._getPlugin = function(pluginName) {
|
1241
|
+
let host = this._hosts[0];
|
1242
|
+
return (host) ? host.getPlugin(pluginName) : null;
|
1243
|
+
};
|
1244
|
+
|
1245
|
+
/** @public
|
1246
|
+
* @description Click title to sort with mouse event. This is for testing purpose.
|
1247
|
+
* @ignore
|
1248
|
+
* @param {Core} grid
|
1249
|
+
* @param {Object=} mouseEvt
|
1250
|
+
*/
|
1251
|
+
SortableTitlePlugin.prototype.clickTitleByMouse = function (grid, mouseEvt) {
|
1252
|
+
this._onClickTitle(grid, mouseEvt);
|
1253
|
+
};
|
1254
|
+
|
1255
|
+
/** @private
|
1256
|
+
* @param {Core} grid
|
1257
|
+
* @param {MouseEvent} e
|
1258
|
+
*/
|
1259
|
+
SortableTitlePlugin.prototype._onClickTitle = function (grid, e) {
|
1260
|
+
if(this._disabled) {
|
1261
|
+
return;
|
1262
|
+
}
|
1263
|
+
if (e.detail === 2 && !this._dblClickAllowed) { // dblclick
|
1264
|
+
if (this._clickTimer) {
|
1265
|
+
clearTimeout(this._clickTimer);
|
1266
|
+
this._clickTimer = 0;
|
1267
|
+
}
|
1268
|
+
return; // This is registered as double click in modern browser so we ignored the click
|
1269
|
+
} else if (e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) { // If any modifier key is pressed, ignored the click
|
1270
|
+
return;
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
// Avoid click by dragging
|
1274
|
+
if (!(e.timeStamp - this._lastMouseDown < 500)) {
|
1275
|
+
return;
|
1276
|
+
}
|
1277
|
+
|
1278
|
+
let hitObj = grid.getRelativePosition(e);
|
1279
|
+
if (!hitObj["hit"]) { // Click across multiple elements (dragging)
|
1280
|
+
return;
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
let csp = this._getPlugin("ColumnSelectionPlugin");
|
1284
|
+
if (csp && csp["isEnabled"]()) {
|
1285
|
+
let colIndex = hitObj["colIndex"];
|
1286
|
+
if (!csp["isSelectedColumn"](colIndex)) { // Sort only if the column is selected
|
1287
|
+
return;
|
1288
|
+
}
|
1289
|
+
}
|
1290
|
+
hitObj["target"] = e["target"];
|
1291
|
+
|
1292
|
+
if (this._delayInterval > 0) {
|
1293
|
+
if (!this._clickTimer) {
|
1294
|
+
this._clickTimer = setTimeout(
|
1295
|
+
this._proceedSorting.bind(this, hitObj),
|
1296
|
+
this._delayInterval
|
1297
|
+
);
|
1298
|
+
}
|
1299
|
+
} else {
|
1300
|
+
this._proceedSorting(hitObj);
|
1301
|
+
}
|
1302
|
+
};
|
1303
|
+
|
1304
|
+
/** @private
|
1305
|
+
* @param {number} toIndex INCLUSIVE
|
1306
|
+
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
1307
|
+
* @return {boolean}
|
1308
|
+
* @fires SortableTitlePlugin#preDataSorting
|
1309
|
+
*/
|
1310
|
+
SortableTitlePlugin.prototype._popSortState = function (toIndex, opt_arg) {
|
1311
|
+
if (toIndex < 0 || this._sortStates.length <= toIndex) { return false; }
|
1312
|
+
|
1313
|
+
let dirty = false;
|
1314
|
+
for (let i = this._sortStates.length; --i >= toIndex;) {
|
1315
|
+
this._clearSortSymbols(this._sortStates[i]);
|
1316
|
+
dirty = true;
|
1317
|
+
}
|
1318
|
+
this._sortStates.length = toIndex;
|
1319
|
+
this._sortDataView(opt_arg);
|
1320
|
+
return dirty;
|
1321
|
+
};
|
1322
|
+
|
1323
|
+
/** @private
|
1324
|
+
* @param {string=} order "ascending", "descending", "none"
|
1325
|
+
* @return {string}
|
1326
|
+
*/
|
1327
|
+
SortableTitlePlugin._toSortOrder = function(order) {
|
1328
|
+
if (order && typeof order === "string") {
|
1329
|
+
order = order.charAt(0).toLowerCase();
|
1330
|
+
if (order === "d" || order === "a") {
|
1331
|
+
return order;
|
1332
|
+
}
|
1333
|
+
}
|
1334
|
+
return "n";
|
1335
|
+
};
|
1336
|
+
|
1337
|
+
/** Returns current sorting sequence for either a grid (all columns), or a single column.
|
1338
|
+
* @public
|
1339
|
+
* @param {(number|string)=} colRef Column index or column field. If no value is given or no field is found, grid level sorting sequence is returned
|
1340
|
+
* @return {!Array.<string>}
|
1341
|
+
*/
|
1342
|
+
SortableTitlePlugin.prototype.getSortingSequence = function (colRef) {
|
1343
|
+
if (this._sortingSequenceMap && (colRef || colRef === 0)) {
|
1344
|
+
if(typeof colRef !== "string") {
|
1345
|
+
colRef = this.getColumnSortingField(/** @type{number} */(colRef));
|
1346
|
+
}
|
1347
|
+
if(this._sortingSequenceMap[colRef]) {
|
1348
|
+
return /** @type{!Array.<string>} */(this._sortingSequenceMap[colRef]);
|
1349
|
+
}
|
1350
|
+
}
|
1351
|
+
return this._sortingSequence;
|
1352
|
+
};
|
1353
|
+
/** Specify sorting sequence for either a grid (all columns), or a single column.
|
1354
|
+
* @public
|
1355
|
+
* @param {Array.<string>} sequence Collection of sorting direction. If null value or empty Array is given, sorting sequence will be reverted to default.
|
1356
|
+
* @param {(number|string)=} colRef Column index or column field. If no value is given, sorting sequence will be set to grid level configuration.
|
1357
|
+
* @example
|
1358
|
+
* stPlugin.setSortingSequence(["d", "a", "n"]); // Set three-state sorting and start with "d"
|
1359
|
+
* stPlugin.setSortingSequence(["a"]); // Force to sort with ascending order only and cannot change to other order
|
1360
|
+
* stPlugin.setSortingSequence(["d", "a"], "field"); // The specified column will have different sorting sequence
|
1361
|
+
*/
|
1362
|
+
SortableTitlePlugin.prototype.setSortingSequence = function (sequence, colRef) {
|
1363
|
+
if (Array.isArray(sequence)) {
|
1364
|
+
if(!sequence.length) {
|
1365
|
+
sequence = null; // Empty array is treated as null value
|
1366
|
+
}
|
1367
|
+
} else if(sequence) { // true, 1, "string", and other datatypes are not allowed
|
1368
|
+
return;
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
let field;
|
1372
|
+
if (colRef != null) {
|
1373
|
+
if (typeof colRef === "string") {
|
1374
|
+
field = colRef;
|
1375
|
+
} else if (typeof colRef === "number") {
|
1376
|
+
field = this.getColumnSortingField(colRef);
|
1377
|
+
}
|
1378
|
+
}
|
1379
|
+
|
1380
|
+
if (sequence) {
|
1381
|
+
// Ensure that user sequence has only valid sort order
|
1382
|
+
let sortingSequence = sequence.map(SortableTitlePlugin._toSortOrder);
|
1383
|
+
if (field) {
|
1384
|
+
if (!this._sortingSequenceMap) {
|
1385
|
+
this._sortingSequenceMap = {};
|
1386
|
+
}
|
1387
|
+
|
1388
|
+
this._sortingSequenceMap[field] = sortingSequence;
|
1389
|
+
} else {
|
1390
|
+
this._sortingSequence = sortingSequence;
|
1391
|
+
}
|
1392
|
+
} else { // No sequence is specified, revert existing sequence to default
|
1393
|
+
if(field) {
|
1394
|
+
if (this._sortingSequenceMap) {
|
1395
|
+
delete this._sortingSequenceMap[field];
|
1396
|
+
}
|
1397
|
+
} else { // Reset current sorting sequence to default
|
1398
|
+
this._sortingSequence = this._sortingSequence.length > 2 ? ["a", "d", "n"] : ["a", "d"];
|
1399
|
+
}
|
1400
|
+
}
|
1401
|
+
};
|
1402
|
+
/** @public
|
1403
|
+
*/
|
1404
|
+
SortableTitlePlugin.prototype.clearAllColumnSortingSequences = function () {
|
1405
|
+
this._sortingSequenceMap = null;
|
1406
|
+
};
|
1407
|
+
/** @private
|
1408
|
+
* @param {Object} rowA
|
1409
|
+
* @param {Object} rowB
|
1410
|
+
* @param {number} sortOrder
|
1411
|
+
* @param {*} context
|
1412
|
+
* @returns {number}
|
1413
|
+
*/
|
1414
|
+
SortableTitlePlugin.prototype._rowDefSorter = function (rowA, rowB, sortOrder, context) {
|
1415
|
+
return this._userComparer(
|
1416
|
+
rowA[ROW_DEF].getRowData(),
|
1417
|
+
rowB[ROW_DEF].getRowData(),
|
1418
|
+
sortOrder,
|
1419
|
+
context
|
1420
|
+
);
|
1421
|
+
};
|
1422
|
+
/** @public
|
1423
|
+
* @description Sorting all separators according to compare function. If compare function is not specified, separators will will be sort by current sorting states.
|
1424
|
+
* @param {Function} comparer Compare function
|
1425
|
+
*/
|
1426
|
+
SortableTitlePlugin.prototype.sortSeparators = function (comparer) {
|
1427
|
+
let host = this._hosts[0];
|
1428
|
+
let dv = host.getDataSource();
|
1429
|
+
if(comparer){
|
1430
|
+
if(this._rowDefMode) {
|
1431
|
+
this._userComparer = comparer;
|
1432
|
+
dv.sortSeparators(this._rowDefSorter);
|
1433
|
+
this._userComparer = null;
|
1434
|
+
} else {
|
1435
|
+
dv.sortSeparators(comparer);
|
1436
|
+
}
|
1437
|
+
} else {
|
1438
|
+
let sortLogics = dv.getSortingLogics();
|
1439
|
+
let sortOrders = [];
|
1440
|
+
let sortFields = [];
|
1441
|
+
let sortStateCount = this._sortStates.length;
|
1442
|
+
for(let i = 0; i < sortStateCount; i++){
|
1443
|
+
let sortState = this._sortStates[i];
|
1444
|
+
let field = this._rowDefMode ? ROW_DEF : sortState["field"];
|
1445
|
+
sortOrders.push(sortState["sortOrder"]);
|
1446
|
+
sortFields.push(field);
|
1447
|
+
}
|
1448
|
+
dv.sortSeparators(sortLogics, sortOrders, sortFields);
|
1449
|
+
}
|
1450
|
+
};
|
1451
|
+
|
1452
|
+
|
1453
|
+
/** @private
|
1454
|
+
* @param {(number|string|SortableTitlePlugin.SortingDefinition)} sortingDef This could be column index, field, or SortingDefinition
|
1455
|
+
* @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
|
1456
|
+
* @returns {Object} state Returns null, if nothing is changed
|
1457
|
+
*/
|
1458
|
+
SortableTitlePlugin.prototype._prepareSorting = function (sortingDef, sortOrder) {
|
1459
|
+
if (!this._maxCount) {
|
1460
|
+
return null;
|
1461
|
+
}
|
1462
|
+
let host = this._hosts[0];
|
1463
|
+
if(!host) {
|
1464
|
+
return null;
|
1465
|
+
}
|
1466
|
+
|
1467
|
+
let colIndex = -1;
|
1468
|
+
let colRef = "";
|
1469
|
+
if(typeof sortingDef === "number") {
|
1470
|
+
colIndex = sortingDef;
|
1471
|
+
} else if(typeof sortingDef === "string") { // This would be either column id or field
|
1472
|
+
colRef = sortingDef;
|
1473
|
+
colIndex = this._getColumnIndex(colRef);
|
1474
|
+
} else if(sortingDef && typeof sortingDef === "object") {
|
1475
|
+
colRef = sortingDef["colId"] || sortingDef["field"];
|
1476
|
+
if(colRef) {
|
1477
|
+
colIndex = this._getColumnIndex(colRef);
|
1478
|
+
} else if(typeof sortingDef["colIndex"] === "number") {
|
1479
|
+
colIndex = sortingDef["colIndex"];
|
1480
|
+
}
|
1481
|
+
if(!sortOrder) {
|
1482
|
+
sortOrder = sortingDef["sortOrder"] || sortingDef["order"] || null;
|
1483
|
+
}
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
let field = "";
|
1487
|
+
let sortLogic = null;
|
1488
|
+
if(colIndex >= 0) {
|
1489
|
+
field = this.getColumnSortingField(colIndex);
|
1490
|
+
let sortOptions = this._getSortOptions(colIndex);
|
1491
|
+
if(sortOptions) {
|
1492
|
+
sortLogic = sortOptions["sortLogic"];
|
1493
|
+
}
|
1494
|
+
} else if(colRef) {
|
1495
|
+
field = colRef; // Assume that colRef is a field and not a column id
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
let priority = this.getSortPriority(colIndex, field);
|
1499
|
+
let curState = (priority >= 0) ? this._sortStates[priority] : null;
|
1500
|
+
let curOrder = curState ? curState["sortOrder"] : "n";
|
1501
|
+
|
1502
|
+
// Getting next sort order
|
1503
|
+
let nextOrder = "n";
|
1504
|
+
if (sortOrder == null) { // Auto order switch
|
1505
|
+
let sortingSequence = this.getSortingSequence(field);
|
1506
|
+
|
1507
|
+
let sequenceIndex = sortingSequence.indexOf(curOrder);
|
1508
|
+
if (sequenceIndex < 0) {
|
1509
|
+
sequenceIndex = 0;
|
1510
|
+
} else {
|
1511
|
+
sequenceIndex = (sequenceIndex + 1) % sortingSequence.length;
|
1512
|
+
}
|
1513
|
+
nextOrder = sortingSequence[sequenceIndex];
|
1514
|
+
} else {
|
1515
|
+
nextOrder = SortableTitlePlugin._toSortOrder(sortOrder);
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
if (curState) { // Remove existing state to rearrange priority later
|
1519
|
+
if (curOrder === nextOrder) {
|
1520
|
+
this.updateSortSymbols(); // Update Display
|
1521
|
+
return null; // Nothing has changed
|
1522
|
+
}
|
1523
|
+
|
1524
|
+
this._sortStates.splice(priority, 1); // Remove sort states
|
1525
|
+
this._clearSortSymbols(curState); // Clear any previous symbols
|
1526
|
+
}
|
1527
|
+
|
1528
|
+
if (nextOrder === "a" || nextOrder === "d") { // Reorder sort states
|
1529
|
+
if(colIndex < 0 && !field) {
|
1530
|
+
return null;
|
1531
|
+
}
|
1532
|
+
if (!curState) {
|
1533
|
+
curState = {};
|
1534
|
+
let colId = host.getColumnId(colIndex);
|
1535
|
+
if(colId) {
|
1536
|
+
curState["colId"] = colId;
|
1537
|
+
}
|
1538
|
+
}
|
1539
|
+
curState["field"] = field;
|
1540
|
+
curState["sortLogic"] = sortLogic || null;
|
1541
|
+
|
1542
|
+
this._sortStates.push(curState); // Latest sorting have lowest priority (multiColumn sorting)
|
1543
|
+
}
|
1544
|
+
|
1545
|
+
if (curState) { // Update current state
|
1546
|
+
if(curOrder !== "n") {
|
1547
|
+
curState["prevOrder"] = curOrder; // For backward compatibility
|
1548
|
+
} else {
|
1549
|
+
delete curState["prevOrder"];
|
1550
|
+
}
|
1551
|
+
curState["order"] = nextOrder; // For backward compatibility
|
1552
|
+
curState["sortOrder"] = nextOrder;
|
1553
|
+
}
|
1554
|
+
|
1555
|
+
let clearedSortColIndexes = [];
|
1556
|
+
if (this._maxCount > 0) {
|
1557
|
+
while (this._sortStates.length > this._maxCount) { // Shift excess
|
1558
|
+
let index = this._clearSortSymbols(this._sortStates.shift());
|
1559
|
+
if (index !== null) {
|
1560
|
+
clearedSortColIndexes.push(index);
|
1561
|
+
}
|
1562
|
+
}
|
1563
|
+
}
|
1564
|
+
|
1565
|
+
return { // TODO: Refactor this code as it is only used by "columnSorted" event (unnecessarily complex).
|
1566
|
+
"colIndex": colIndex,
|
1567
|
+
"sortedField": field,
|
1568
|
+
"sortOrder": nextOrder || "n",
|
1569
|
+
"prevOrder": curOrder,
|
1570
|
+
"clearedSortColIndexes": clearedSortColIndexes
|
1571
|
+
};
|
1572
|
+
};
|
1573
|
+
|
1574
|
+
/** @private
|
1575
|
+
* @param {Object|Array.<Object>} states States from _prepareSorting for dispatching columnSorted event.
|
1576
|
+
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
1577
|
+
* @fires SortableTitlePlugin#preDataSorting
|
1578
|
+
* @fires SortableTitlePlugin#columnSorted
|
1579
|
+
*/
|
1580
|
+
SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
|
1581
|
+
if(!states) {
|
1582
|
+
return;
|
1583
|
+
}
|
1584
|
+
|
1585
|
+
this._sortDataView(opt_arg); // Update Data
|
1586
|
+
this.updateSortSymbols(); // Update Display
|
1587
|
+
|
1588
|
+
let evtArg = null;
|
1589
|
+
if(Array.isArray(states)) {
|
1590
|
+
let len = states.length;
|
1591
|
+
for(let i = 0; i < len; ++i) {
|
1592
|
+
let state = states[i];
|
1593
|
+
if(state) {
|
1594
|
+
if(evtArg) {
|
1595
|
+
if(!evtArg["colIndices"]) {
|
1596
|
+
evtArg["colIndices"] = [];
|
1597
|
+
evtArg["sortedFields"] = [];
|
1598
|
+
evtArg["sortOrders"] = [];
|
1599
|
+
evtArg["prevOrders"] = [];
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
evtArg["colIndices"].push(state["colIndex"]);
|
1603
|
+
evtArg["sortedFields"].push(state["sortedField"]);
|
1604
|
+
evtArg["sortOrders"].push(state["sortOrder"]);
|
1605
|
+
evtArg["prevOrders"].push(state["prevOrder"]);
|
1606
|
+
} else {
|
1607
|
+
evtArg = state;
|
1608
|
+
}
|
1609
|
+
}
|
1610
|
+
}
|
1611
|
+
evtArg = states[0];
|
1612
|
+
} else {
|
1613
|
+
evtArg = states;
|
1614
|
+
}
|
1615
|
+
this._dispatch("columnSorted", evtArg);
|
1616
|
+
};
|
1617
|
+
|
1618
|
+
/** @private
|
1619
|
+
* @param {Object} e
|
1620
|
+
*/
|
1621
|
+
SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
1622
|
+
let t = this;
|
1623
|
+
let colIndex = e["colIndex"];
|
1624
|
+
let column = e["context"] || {};
|
1625
|
+
|
1626
|
+
let sortable = !!t._sortableColumns;
|
1627
|
+
let field = column["field"];
|
1628
|
+
let sortBy = column["sortBy"];
|
1629
|
+
|
1630
|
+
if (sortBy != null) { // composite grid option
|
1631
|
+
sortable = !!sortBy;
|
1632
|
+
field = sortBy;
|
1633
|
+
}
|
1634
|
+
if (column["sortable"] != null) { // rt grid option
|
1635
|
+
sortable = !!column["sortable"];
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
let sortLogic = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
1639
|
+
if(!sortLogic) {
|
1640
|
+
sortLogic = t._sortLogic[field];
|
1641
|
+
}
|
1642
|
+
if(typeof sortLogic !== "function") {
|
1643
|
+
sortLogic = null;
|
1644
|
+
}
|
1645
|
+
|
1646
|
+
let sortingSequence = column["sortingSequence"];
|
1647
|
+
if (sortingSequence != null && field) { // Make sure that column config does not affect grid level config
|
1648
|
+
t.setSortingSequence(sortingSequence, field);
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
if (sortable) { // TODO: Check if empty field should be sortable
|
1652
|
+
t.setColumnSortingField(colIndex, field, sortLogic, column["rowSorting"]);
|
1653
|
+
} else {
|
1654
|
+
t.disableColumnSorting(colIndex, true);
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
let sortOrder = column["sortOrder"] || column["sort"];
|
1658
|
+
if(sortOrder != null) {
|
1659
|
+
sortOrder = SortableTitlePlugin._toSortOrder(sortOrder); // Invalid input will return "n"
|
1660
|
+
if(sortOrder !== "n") {
|
1661
|
+
t.clearSortState(); // clear previous sorting state
|
1662
|
+
t.sortColumn(colIndex, sortOrder);
|
1663
|
+
}
|
1664
|
+
}
|
1665
|
+
};
|
1666
|
+
|
1667
|
+
/** @private
|
1668
|
+
* @param {Object} e
|
1669
|
+
* @fires SortableTitlePlugin#preDataSorting
|
1670
|
+
* @fires SortableTitlePlugin#columnSorted
|
1671
|
+
*/
|
1672
|
+
SortableTitlePlugin.prototype._onColumnRemoved = function (e) {
|
1673
|
+
let sortCount = this._sortStates.length;
|
1674
|
+
if (!sortCount) {
|
1675
|
+
return;
|
1676
|
+
}
|
1677
|
+
let colId = e["colId"];
|
1678
|
+
if (!colId) {
|
1679
|
+
return;
|
1680
|
+
}
|
1681
|
+
// WARNING: columnRemoved event could be fired repeatedly. Sorting could be triggered multiple times
|
1682
|
+
for(let i = 0; i < sortCount; ++i) {
|
1683
|
+
let sortState = this._sortStates[i];
|
1684
|
+
if (sortState["colId"] === colId) {
|
1685
|
+
this._sortStates.splice(i, 1);
|
1686
|
+
this._clearSortSymbols(sortState);
|
1687
|
+
this._sortDataView();
|
1688
|
+
break;
|
1689
|
+
}
|
1690
|
+
}
|
1691
|
+
};
|
1692
|
+
|
1693
|
+
/** @private
|
1694
|
+
* @return {string}
|
1695
|
+
*/
|
1696
|
+
SortableTitlePlugin._toRowDefField = function() {
|
1697
|
+
return ROW_DEF;
|
1698
|
+
};
|
1699
|
+
/** @private
|
1700
|
+
* @param {Object=} opt_action Action that raised the sort. This is optional
|
1701
|
+
* @fires SortableTitlePlugin#preDataSorting
|
1702
|
+
*/
|
1703
|
+
SortableTitlePlugin.prototype._sortDataView = function (opt_action) {
|
1704
|
+
opt_action = opt_action || {};
|
1705
|
+
this._dispatch("preDataSorting", opt_action);
|
1706
|
+
|
1707
|
+
if (!this._dataSorting) { return; }
|
1708
|
+
|
1709
|
+
let sortCount = this._sortStates.length;
|
1710
|
+
if(this._userManagedLogic && sortCount > 1) { // The logic is managed by the user. There is no point in using multi-column sorting
|
1711
|
+
sortCount = 1;
|
1712
|
+
}
|
1713
|
+
let orders = null;
|
1714
|
+
let sortLogics = null;
|
1715
|
+
let c_ref = null;
|
1716
|
+
if (sortCount) {
|
1717
|
+
orders = new Array(sortCount);
|
1718
|
+
sortLogics = new Array(sortCount);
|
1719
|
+
for (let i = 0; i < sortCount; ++i) {
|
1720
|
+
orders[i] = this._sortStates[i]["sortOrder"];
|
1721
|
+
sortLogics[i] = this._sortStates[i]["sortLogic"]; // sortLogic can be null
|
1722
|
+
}
|
1723
|
+
if(this._rowDefMode) { // DataView in real-time grid has only ROW_DEF column
|
1724
|
+
c_ref = this._sortStates.map(SortableTitlePlugin._toRowDefField);
|
1725
|
+
} else {
|
1726
|
+
c_ref = this.getColumnSortingFields();
|
1727
|
+
}
|
1728
|
+
if(this._userManagedLogic && c_ref.length > 1) {
|
1729
|
+
c_ref = c_ref.slice(0, 1);
|
1730
|
+
}
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
// Perform sorting even if there is no sort state
|
1734
|
+
for (let j = this._hosts.length; --j >= 0;) {
|
1735
|
+
let host = this._hosts[j];
|
1736
|
+
// TODO: In wrap mode all hosts does not need to be sorted
|
1737
|
+
let dataSource = host.getDataSource();
|
1738
|
+
if (dataSource) {
|
1739
|
+
let noOptimization = opt_action["isUserAction"] == true;
|
1740
|
+
dataSource.sort(c_ref, orders, sortLogics, noOptimization); // If length === 0 data is not sorted
|
1741
|
+
}
|
1742
|
+
}
|
1743
|
+
};
|
1744
|
+
/**`section` and `cell` variable in this scope can either be instance of LayoutGrid or SectionWriter (from tr-grid-printer).
|
1745
|
+
* Need to force calling public methods (section["isColumnActive"] and section["getCell"]) so it works while being minified.
|
1746
|
+
* @private
|
1747
|
+
* @param {Object} state
|
1748
|
+
* @return {number|null} The column index of cleared sort
|
1749
|
+
*/
|
1750
|
+
SortableTitlePlugin.prototype._clearSortSymbols = function (state) {
|
1751
|
+
let cells = state["targetCells"];
|
1752
|
+
if (!cells) {
|
1753
|
+
return null;
|
1754
|
+
}
|
1755
|
+
let colIndex = null;
|
1756
|
+
for (let j = cells.length; --j >= 0;) { // One single cell per host
|
1757
|
+
let cell = cells[j];
|
1758
|
+
cell["removeClass"]("sorting");
|
1759
|
+
cell["removeClass"]("sortable");
|
1760
|
+
cell["removeFloatingIcon"]("sort-symbol");
|
1761
|
+
cell["removeFloatingIcon"]("priority-symbol");
|
1762
|
+
let section;
|
1763
|
+
if(colIndex == null && (section = cell["getSection"]())) {
|
1764
|
+
colIndex = section["getColumnIndex"](cell["getParent"]());
|
1765
|
+
}
|
1766
|
+
}
|
1767
|
+
cells.length = 0;
|
1768
|
+
return colIndex;
|
1769
|
+
};
|
1770
|
+
/**`section` and `cell` variable in this scope can either be instance of LayoutGrid or SectionWriter (from tr-grid-printer).
|
1771
|
+
* Need to force calling public methods (section["getColumnCount"] and section["getCell"]) so it works while being minified.
|
1772
|
+
* @private
|
1773
|
+
* @param {number} hostIndex
|
1774
|
+
*/
|
1775
|
+
SortableTitlePlugin.prototype._updateSortableIndicator = function (hostIndex) {
|
1776
|
+
let t = this;
|
1777
|
+
let host = t._hosts[hostIndex];
|
1778
|
+
if (!host || this._frozenIndicator) { return; }
|
1779
|
+
|
1780
|
+
let section = host.getSection("title");
|
1781
|
+
if (section == null) { return; }
|
1782
|
+
let colCount = section["getColumnCount"]();
|
1783
|
+
for (let col = colCount; --col >= 0;) {
|
1784
|
+
|
1785
|
+
let rowCount = section["getRowCount"]();
|
1786
|
+
for (let r = 0; r < rowCount; r++) {
|
1787
|
+
|
1788
|
+
let cell = section["getCell"](col, r, true);
|
1789
|
+
if (!cell) { continue; }
|
1790
|
+
|
1791
|
+
// Clear all sorting icons
|
1792
|
+
cell["removeClass"]("sorting");
|
1793
|
+
cell["removeClass"]("sortable");
|
1794
|
+
cell["removeClass"]("asc");
|
1795
|
+
cell["removeClass"]("desc");
|
1796
|
+
cell["removeClass"]("edge-indicator");
|
1797
|
+
cell["removeFloatingIcon"]("sort-symbol");
|
1798
|
+
cell["removeFloatingIcon"]("priority-symbol");
|
1799
|
+
cell["removeFloatingIcon"]("sortable-indicator");
|
1800
|
+
|
1801
|
+
if (r !== rowCount - 1) { continue; } // Sort icon should only appear in last row of section otherwise skip
|
1802
|
+
if (!t._isCellSortable(section, col, r)) { continue; }
|
1803
|
+
|
1804
|
+
cell["addClass"]("sortable");
|
1805
|
+
|
1806
|
+
let priority = t.getSortPriority(col);
|
1807
|
+
let state = t._sortStates[priority];
|
1808
|
+
|
1809
|
+
let isSorting = state && state["sortOrder"] !== "n";
|
1810
|
+
let symbol, icon;
|
1811
|
+
if (isSorting) {
|
1812
|
+
if (!state["targetCells"]) {
|
1813
|
+
state["targetCells"] = [];
|
1814
|
+
}
|
1815
|
+
|
1816
|
+
state["targetCells"][hostIndex] = cell; // NOTE: This can be improved.
|
1817
|
+
|
1818
|
+
if (state["sortOrder"] === "a") {
|
1819
|
+
cell["addClass"]("asc");
|
1820
|
+
} else {
|
1821
|
+
cell["addClass"]("desc");
|
1822
|
+
}
|
1823
|
+
cell["addClass"]("sorting");
|
1824
|
+
|
1825
|
+
if(t._solarTheme) { // Insert icon when use solar theme
|
1826
|
+
let textContent;
|
1827
|
+
|
1828
|
+
if (state["sortOrder"] === "a") {
|
1829
|
+
textContent = CODE_UP;
|
1830
|
+
icon = SortableTitlePlugin._icons["ascending"];
|
1831
|
+
} else {
|
1832
|
+
textContent = CODE_DOWN;
|
1833
|
+
icon = SortableTitlePlugin._icons["descending"];
|
1834
|
+
}
|
1835
|
+
|
1836
|
+
symbol = t._createIconElem(icon, textContent);
|
1837
|
+
symbol.className = "sort-symbol";
|
1838
|
+
cell["insertFloatingIcon"](symbol, 0);
|
1839
|
+
} else {
|
1840
|
+
cell["addClass"]("edge-indicator");
|
1841
|
+
}
|
1842
|
+
|
1843
|
+
if (t._sortStates.length > 1) {
|
1844
|
+
symbol = document.createElement("span");
|
1845
|
+
symbol.className = "priority-symbol";
|
1846
|
+
symbol.textContent = priority + 1;
|
1847
|
+
cell["insertFloatingIcon"](symbol, 1);
|
1848
|
+
}
|
1849
|
+
} else if (t._sortableIndicator) { // Can sort but currently not sorting
|
1850
|
+
icon = SortableTitlePlugin._icons["sortable"];
|
1851
|
+
symbol = t._createIconElem(icon, CODE_DIAMOND);
|
1852
|
+
symbol.className = "sortable-indicator";
|
1853
|
+
cell["insertFloatingIcon"](symbol, 0);
|
1854
|
+
}
|
1855
|
+
}
|
1856
|
+
}
|
1857
|
+
};
|
1858
|
+
|
1859
|
+
/** @private
|
1860
|
+
* @param {string} icon - valid elf icon name
|
1861
|
+
* @param {string} fallback - a fallback in case icon in not defined
|
1862
|
+
* @return {Element}
|
1863
|
+
*/
|
1864
|
+
SortableTitlePlugin.prototype._createIconElem = function (icon, fallback) {
|
1865
|
+
let elem;
|
1866
|
+
if (!icon || typeof icon !== "string") {
|
1867
|
+
elem = document.createElement("span");
|
1868
|
+
elem.textContent = fallback;
|
1869
|
+
} else {
|
1870
|
+
elem = document.createElement("ef-icon");
|
1871
|
+
elem.setAttribute("icon", icon);
|
1872
|
+
}
|
1873
|
+
return elem;
|
1874
|
+
};
|
1875
|
+
|
1876
|
+
/** @private
|
1877
|
+
* @param {string|number|Object} colRef This can be sortState, column id, column field, or column index
|
1878
|
+
* @return {number}
|
1879
|
+
*/
|
1880
|
+
SortableTitlePlugin.prototype._getColumnIndex = function (colRef) {
|
1881
|
+
if(colRef != null) {
|
1882
|
+
let host = this._hosts[0];
|
1883
|
+
if(host) {
|
1884
|
+
if(typeof colRef === "number") {
|
1885
|
+
return colRef;
|
1886
|
+
} else if(typeof colRef === "string") {
|
1887
|
+
return host.getColumnIndex(colRef);
|
1888
|
+
} else {
|
1889
|
+
return host.getColumnIndex(colRef["colId"]);
|
1890
|
+
}
|
1891
|
+
}
|
1892
|
+
}
|
1893
|
+
return -1;
|
1894
|
+
};
|
1895
|
+
|
1896
|
+
/** @private
|
1897
|
+
* @param {string|number} colRef
|
1898
|
+
* @return {string} column id or empty string for not found
|
1899
|
+
*/
|
1900
|
+
SortableTitlePlugin.prototype._getColumnId = function (colRef) {
|
1901
|
+
let host = this._hosts[0];
|
1902
|
+
if(host && colRef != null) {
|
1903
|
+
return host.getColumnId(colRef);
|
1904
|
+
}
|
1905
|
+
return "";
|
1906
|
+
};
|
1907
|
+
|
1908
|
+
/** @private
|
1909
|
+
* @param {number} colIndex
|
1910
|
+
* @return {Object}
|
1911
|
+
*/
|
1912
|
+
SortableTitlePlugin.prototype._getSortOptions = function (colIndex) {
|
1913
|
+
let host = this._hosts[0];
|
1914
|
+
if (host) {
|
1915
|
+
return host.getColumnData(colIndex)["sortableTitle"] || null;
|
1916
|
+
}
|
1917
|
+
return null;
|
1918
|
+
};
|
1919
|
+
/** @private
|
1920
|
+
* @param {number} colIndex
|
1921
|
+
* @return {!Object}
|
1922
|
+
*/
|
1923
|
+
SortableTitlePlugin.prototype._newSortOptions = function (colIndex) {
|
1924
|
+
let host = this._hosts[0];
|
1925
|
+
let sortOptions = null;
|
1926
|
+
if (host && colIndex >= 0) {
|
1927
|
+
let colData = host.getColumnData(colIndex); // colData is guaranteed to exist
|
1928
|
+
sortOptions = colData["sortableTitle"];
|
1929
|
+
if (!sortOptions) {
|
1930
|
+
sortOptions = colData["sortableTitle"] = {};
|
1931
|
+
}
|
1932
|
+
}
|
1933
|
+
return sortOptions || {};
|
1934
|
+
};
|
1935
|
+
/** @private
|
1936
|
+
* @param {ILayoutGrid} section
|
1937
|
+
* @param {number} colIndex
|
1938
|
+
* @param {number} rowIndex
|
1939
|
+
* @return {boolean}
|
1940
|
+
*/
|
1941
|
+
SortableTitlePlugin.prototype._isCellSortable = function (section, colIndex, rowIndex) {
|
1942
|
+
let options = this._getSortOptions(colIndex);
|
1943
|
+
if (options) {
|
1944
|
+
if (options["disabled"]) {
|
1945
|
+
return false;
|
1946
|
+
}
|
1947
|
+
|
1948
|
+
let field = options["field"];
|
1949
|
+
if (field != null) {
|
1950
|
+
if (!field) {
|
1951
|
+
return false;
|
1952
|
+
}
|
1953
|
+
}
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
let targetCell = section["getCell"](colIndex, rowIndex, true);
|
1957
|
+
if (targetCell.hasClass("no-sort")) {
|
1958
|
+
return false; // The cell is not allowed for sorting
|
1959
|
+
}
|
1960
|
+
let bottomCell = section["getCell"](colIndex, section["getRowCount"]() - 1, true);
|
1961
|
+
if (targetCell !== bottomCell) {
|
1962
|
+
return false;
|
1963
|
+
}
|
1964
|
+
let parentCell = targetCell.getParent();
|
1965
|
+
let classList = parentCell["classList"];
|
1966
|
+
// "collapsed" class in column element only enable by column stack in spreading mode
|
1967
|
+
if (classList.contains("collapsed")) { // HACK: unsortable for collapsed stack in spreading mode
|
1968
|
+
return false;
|
1969
|
+
}
|
1970
|
+
|
1971
|
+
return true; // By default all cells are sortable
|
1972
|
+
};
|
1973
|
+
|
1974
|
+
SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
|
1975
|
+
|
1976
|
+
export default SortableTitlePlugin;
|
1977
|
+
export { SortableTitlePlugin };
|