@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,2568 @@
|
|
1
|
+
import {Ext} from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import {FilterBuilder, stringToDateObject} from "../../tr-grid-util/es6/FilterBuilder.js";
|
4
|
+
import {FilterOperators} from "../../tr-grid-util/es6/FilterOperators.js";
|
5
|
+
import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
|
6
|
+
import { injectCss, prettifyCss, cloneObject } from "../../tr-grid-util/es6/Util.js";
|
7
|
+
|
8
|
+
/** @event RowFilteringPlugin#click
|
9
|
+
* @description click event is dispatched when a user clicks the column filter icon.
|
10
|
+
*/
|
11
|
+
/** @event RowFilteringPlugin#beforeDialogOpened
|
12
|
+
* @description Fired before the opening of filter dialog. This can be used to cancel the operation or set a dialog configuration at runtime.
|
13
|
+
* @property {number} colIndex Column index
|
14
|
+
* @property {string} field Field
|
15
|
+
* @property {Object} grid Core grid instance
|
16
|
+
* @example
|
17
|
+
* beforeDialogOpened: function(e) {
|
18
|
+
* e.cancel = true; // To cancel the operation
|
19
|
+
* },
|
20
|
+
* beforeDialogOpened: function(e) {
|
21
|
+
* e.dialogOptions = { sortLogic: func }; // To set a dialog configuration
|
22
|
+
* },
|
23
|
+
*/
|
24
|
+
/** @event RowFilteringPlugin#dialogCommitted
|
25
|
+
* @description Fired after a user clicks done button from the filter dialog or changes sort order.
|
26
|
+
* @property {number} colIndex
|
27
|
+
* @property {Object=} value When filter is changed, the change will be passed through this property
|
28
|
+
* @property {number=} sortOrder When sort order is changed, the change will be passed through this property
|
29
|
+
* @property {string=} fieldDataType
|
30
|
+
*/
|
31
|
+
/** @event RowFilteringPlugin#iconCreated
|
32
|
+
* @description iconCreated event is dispatched when a new column filter icon is created.
|
33
|
+
* @property {Element} icon Filter icon element
|
34
|
+
* @property {number} colIndex Column index
|
35
|
+
* @property {Object} grid Core grid instance
|
36
|
+
*/
|
37
|
+
/** @event RowFilteringPlugin#filterChanged
|
38
|
+
* @description Fired whenever global or column filter is changed by either adding or removing. The change will not immediately applied to grid's data view
|
39
|
+
* @property {string} filterType This can be either "global" or "column"
|
40
|
+
* @property {string} changeType This can be either "add" or "remove"
|
41
|
+
* @property {number} colIndex Column index
|
42
|
+
* @property {string} field specified by the current column
|
43
|
+
*/
|
44
|
+
/** @event RowFilteringPlugin#refreshed
|
45
|
+
* @description Fired after new filter is applied to grid's data view
|
46
|
+
*/
|
47
|
+
|
48
|
+
/** @callback RowFilteringPlugin~FilterLogic
|
49
|
+
* @description Logic used to filter in or out on each row
|
50
|
+
* @param {Object.<string, *>} rowData Row data is an object with field as key and user data as value
|
51
|
+
* @param {string} rid Row Id used in DataView
|
52
|
+
* @param {*} ctx Context object contains context/states given by user
|
53
|
+
* @return {boolean}
|
54
|
+
*/
|
55
|
+
|
56
|
+
/** @typedef {*} RowFilteringPlugin~Expression
|
57
|
+
* @description An expression that can be parsed into RowFilteringPlugin~FilterLogic. The expression is intended for saving and restoring filters, so it is serializable by JSON.stringify.
|
58
|
+
The expression can take various forms:<br>
|
59
|
+
* 1. String for free style text input e.g., "[col1] > 10", "[field] == 20"<br>
|
60
|
+
* 2. 2D-Array for predefined filter operators e.g., [["GT", 10, "AND"], ["EQ", "text"]]<br>
|
61
|
+
* 3. Object map for value filters e.g., {"value": true, "10": true}<br>
|
62
|
+
* 4. Function for RowFilteringPlugin~FilterLogic
|
63
|
+
*/
|
64
|
+
|
65
|
+
/** @typedef {Object} RowFilteringPlugin~FilterExpression
|
66
|
+
* @description Deprecated. FilterExpression contains all data used for saving and restoring filter in a column
|
67
|
+
* @property {string} field
|
68
|
+
* @property {RowFilteringPlugin~Expression} expression Expression representing filter function
|
69
|
+
* @property {*} context Context object contains context/states given by user
|
70
|
+
*/
|
71
|
+
|
72
|
+
/** @typedef {Object} RowFilteringPlugin~ColumnOptions
|
73
|
+
* @description Extension column options that can be specified on each individual grid's column option:
|
74
|
+
* @property {RowFilteringPlugin~Expression=} filter An expression string or Function
|
75
|
+
* @property {*=} filterState Context object that will be passed as the third parameter for the filter logic
|
76
|
+
* @property {boolean=} filterIcon=true If disabled, filter icon will not be shown. This property only works with "always" mode
|
77
|
+
* @property {RowFilteringPlugin~FilterDialogOptions=} filterDialogOptions=null Configuration for Filter Dialog, applying to column.
|
78
|
+
*/
|
79
|
+
|
80
|
+
/** @typedef {Object} RowFilteringPlugin~FilterDialogOptions
|
81
|
+
* @description Options that specify UIs of filter dialog
|
82
|
+
* @property {boolean=} sortUI=true show/hide sort UI
|
83
|
+
* @property {boolean=} filterUI=true show/hide filter UI
|
84
|
+
* @property {boolean=} advancedFilter=true show advaced filter tab
|
85
|
+
* @property {string=} fieldDataType data type of column
|
86
|
+
* @property {string=} lang dialog language
|
87
|
+
* @property {Function=} rawDataAccessor In case you have custom data type for the specified field, data getter is needed to retrieve raw value for filtering
|
88
|
+
* @property {Function=} formattedDataAccessor This function will be called on each raw data, allowing formatting data to be displayed on the filter item list
|
89
|
+
* @property {Function=} sortLogic This function for sorting filter item list in the dialog. The comparison will perform on raw values, and not formatted values
|
90
|
+
* @property {Function=} groupCriteria This function for specify group of items to show group as headers.
|
91
|
+
* @property {Function=} groupSortLogic This function for sorting of group header, used with `groupCriteria` to show as group.
|
92
|
+
* @property {Array=} itemList Item list to be shown in the dialog. If this is not specified, the list will be collected from existing data on the grid
|
93
|
+
* @property {Array=} additionalItems Additional items to be put on the itemList
|
94
|
+
* @property {boolean=} compactMode=false force compact mode in dialog
|
95
|
+
* @property {(boolean|string)=} blankValues=false Display a "(Blanks)" item in the filter dialog to represent an empty value. If a string is passed, it will be used as the label for the blank item
|
96
|
+
* @property {string=} dateTimeFormat="dd-MM-yy" Specifies the string format for the date time picker in the filter dialog based on date-fns format, follow https://date-fns.org/v3.6.0/docs/format.
|
97
|
+
* @property {boolean=} showOnlyFilteredItems=false If enabled, rows that are filtered out by other columns will not appear in the list, regardless of the current filter settings.
|
98
|
+
*/
|
99
|
+
|
100
|
+
/** @typedef {Object} RowFilteringPlugin~FilterEntry
|
101
|
+
* @description item object to rendered element-item
|
102
|
+
* @property {string=} type=null Available types are "header" and "divider". If null, it will be shown as a normal item.
|
103
|
+
* @property {string} label="" Text of each item. If the type is "header", it will be shown as a header. If the type is "divider", it will not be shown.
|
104
|
+
* @property {boolean} checked=false Set to true to check the checkbox item in the filter dialog basic item.
|
105
|
+
*/
|
106
|
+
|
107
|
+
/** @typedef {Object} RowFilteringPlugin~Options
|
108
|
+
* @description The options can be specified by `rowFiltering` property of the main grid's options
|
109
|
+
* @property {boolean=} emptySegmentFiltering=false If enabled, the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter. A segment with no child is treated the same way as an empty segment.
|
110
|
+
* @property {boolean=} separatorFiltering=false If enabled, segment separators will be filtered as if they were normal rows. Note that even if a separator row is filtered out, its child row may remain in the view and not be filtered out.
|
111
|
+
* @property {boolean=} disabledUI=false Deprecated in favor of `iconActivation`. Set iconActivation to none instead.
|
112
|
+
* @property {string=} iconActivation=onActiveFilter Filter icon redering behavior, can be set to `always`,`onHover`,`onActiveFilter`,or `none`
|
113
|
+
* @property {RowFilteringPlugin~FilterDialogOptions=} dialogOptions=null Default configuration for Filter Dialog, applying to all columns.
|
114
|
+
* @property {Function=} click=null Event handler dispatched when a user clicks the column filter icon.
|
115
|
+
* @property {Function=} clicked=null Alias to `click` event handler
|
116
|
+
* @property {Function=} iconCreated=null Event handler dispatched when a new column filter icon is created.
|
117
|
+
* @property {Function=} filterChanged=null Event handler dispatched whenever global or column filter is changed by either adding or removing.
|
118
|
+
* @property {Function=} beforeDialogOpened=null Event handler dispatched before dialog opening.
|
119
|
+
* @property {Function=} dialogCommitted=null Event handler dispatched whenever the new settings from dialog are applied.
|
120
|
+
* @property {Function=} refreshed=null Event handler dispatched after new filter is applied to grid's data view.
|
121
|
+
* @property {boolean=} activeIconState=true If disabled, filter icon won't be automatically changed its state when filter in a column is changed.
|
122
|
+
*/
|
123
|
+
|
124
|
+
/** @private
|
125
|
+
* @function
|
126
|
+
* @param {Object} cfo
|
127
|
+
* @return {!RowFilteringPlugin~FilterExpression}
|
128
|
+
*/
|
129
|
+
let _toFilterExpression = function(cfo) {
|
130
|
+
let ctx = cfo._context[0];
|
131
|
+
// TODO: Handle rawDataAccessor and formattedDataAccessor (saving and loading of functions)
|
132
|
+
return {
|
133
|
+
field: cfo._field || "",
|
134
|
+
expression: cfo._expressions[0],
|
135
|
+
context: (ctx != null && !ctx._autoGenerated) ? ctx : null
|
136
|
+
};
|
137
|
+
};
|
138
|
+
/** @private
|
139
|
+
* @function
|
140
|
+
* @param {Array} ary
|
141
|
+
* @param {*} val
|
142
|
+
* @return {Array}
|
143
|
+
*/
|
144
|
+
let _arrayConcat = function(ary, val) {
|
145
|
+
if(Array.isArray(val) && val.length) {
|
146
|
+
if(ary) {
|
147
|
+
return ary.concat(val);
|
148
|
+
} else {
|
149
|
+
return val;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
return ary;
|
153
|
+
};
|
154
|
+
|
155
|
+
/** @type {Object}
|
156
|
+
* @private
|
157
|
+
* @const
|
158
|
+
*/
|
159
|
+
const BlankValues = {
|
160
|
+
"": true,
|
161
|
+
"null": true,
|
162
|
+
"undefined": true,
|
163
|
+
"NaN": true
|
164
|
+
};
|
165
|
+
/** @private
|
166
|
+
* @function
|
167
|
+
* @param {Array} ary
|
168
|
+
* @param {string} str
|
169
|
+
* @param {*=} orignalValue
|
170
|
+
* @returns {boolean} Returns true if there is any change
|
171
|
+
*/
|
172
|
+
let _pushRawValue = function(ary, str, orignalValue) {
|
173
|
+
if(str) {
|
174
|
+
if(!BlankValues[str]) {
|
175
|
+
let dateObj = stringToDateObject(str);
|
176
|
+
if(dateObj !== str) {
|
177
|
+
if(orignalValue && typeof orignalValue === "number") {
|
178
|
+
let originalDate = new Date(orignalValue);
|
179
|
+
if(originalDate.getTime()) {
|
180
|
+
dateObj = originalDate;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
ary.push(dateObj);
|
184
|
+
} else {
|
185
|
+
try {
|
186
|
+
ary.push(JSON.parse(str));
|
187
|
+
} catch (err) {
|
188
|
+
ary.push(str);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
return true;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
return false;
|
195
|
+
};
|
196
|
+
|
197
|
+
/** @private
|
198
|
+
* @function
|
199
|
+
* @param {Object} obj
|
200
|
+
* @return {boolean}
|
201
|
+
*/
|
202
|
+
let _handledBlankProperties = function(obj) {
|
203
|
+
if(obj[""] || obj["null"] || obj["undefined"] || obj["NaN"]) {
|
204
|
+
let objClone = cloneObject(obj); // Blank item need to clone to prevent changes in the expression
|
205
|
+
delete objClone[""];
|
206
|
+
delete objClone["null"];
|
207
|
+
delete objClone["undefined"];
|
208
|
+
delete objClone["NaN"];
|
209
|
+
objClone[BLANKS] = true;
|
210
|
+
return objClone;
|
211
|
+
}
|
212
|
+
return obj;
|
213
|
+
};
|
214
|
+
|
215
|
+
/** @type {string}
|
216
|
+
* @private
|
217
|
+
* @const
|
218
|
+
*/
|
219
|
+
const BLANKS = "(Blanks)";
|
220
|
+
|
221
|
+
/** @constructor
|
222
|
+
* @extends {GridPlugin}
|
223
|
+
*/
|
224
|
+
let RowFilteringPlugin = function () {
|
225
|
+
let t = this;
|
226
|
+
|
227
|
+
t._onPreSectionRender = t._onPreSectionRender.bind(t);
|
228
|
+
t._onColumnAdded = t._onColumnAdded.bind(t);
|
229
|
+
t._onColumnRemoved = t._onColumnRemoved.bind(t);
|
230
|
+
t._onPreLoadedDialog = t._onPreLoadedDialog.bind(t);
|
231
|
+
|
232
|
+
t._onIconClicked = t._onIconClicked.bind(t);
|
233
|
+
t._filterLogic = t._filterLogic.bind(t);
|
234
|
+
t._updateAllColumnIcons = t._updateAllColumnIcons.bind(t);
|
235
|
+
t.refresh = t.refresh.bind(t);
|
236
|
+
t._requestFilterRefresh = t._requestFilterRefresh.bind(t);
|
237
|
+
|
238
|
+
t._onDialogSortChanged = t._onDialogSortChanged.bind(t);
|
239
|
+
t._onDialogFilterChanged = t._onDialogFilterChanged.bind(t);
|
240
|
+
t._onDialogClosed = t._onDialogClosed.bind(t);
|
241
|
+
|
242
|
+
t._globalFilters = [];
|
243
|
+
t._globalContexts = [];
|
244
|
+
t._columnFilters = [];
|
245
|
+
t._hosts = [];
|
246
|
+
t._dvs = [];
|
247
|
+
|
248
|
+
t._funcMap = {};
|
249
|
+
t._nameMap = {};
|
250
|
+
};
|
251
|
+
Ext.inherits(RowFilteringPlugin, GridPlugin);
|
252
|
+
|
253
|
+
|
254
|
+
/** @type {!Object.<string, Function>}
|
255
|
+
* @private
|
256
|
+
*/
|
257
|
+
RowFilteringPlugin.prototype._funcMap = null; // For preventing repetition of resolving the same expression
|
258
|
+
/** @type {!Object.<string, Function>}
|
259
|
+
* @private
|
260
|
+
*/
|
261
|
+
RowFilteringPlugin.prototype._nameMap; // Mapping name to filter function for referencing
|
262
|
+
|
263
|
+
/** @type {boolean}
|
264
|
+
* @private
|
265
|
+
*/
|
266
|
+
RowFilteringPlugin.prototype._disabled = false;
|
267
|
+
/** @type {Object.<string, boolean>}
|
268
|
+
* @private
|
269
|
+
*/
|
270
|
+
RowFilteringPlugin.prototype._disablingIds = null; // For nested disabling
|
271
|
+
|
272
|
+
/** @type {!Array.<Function>}
|
273
|
+
* @private
|
274
|
+
*/
|
275
|
+
RowFilteringPlugin.prototype._globalFilters;
|
276
|
+
/** @type {!Array.<Object>}
|
277
|
+
* @private
|
278
|
+
*/
|
279
|
+
RowFilteringPlugin.prototype._globalContexts;
|
280
|
+
/** @type {!Array.<Object>}
|
281
|
+
* @private
|
282
|
+
*/
|
283
|
+
RowFilteringPlugin.prototype._columnFilters;
|
284
|
+
/** @type {Array.<Object>}
|
285
|
+
* @private
|
286
|
+
*/
|
287
|
+
RowFilteringPlugin.prototype._activeColFilters = null;
|
288
|
+
/** @type {string}
|
289
|
+
* @private
|
290
|
+
*/
|
291
|
+
RowFilteringPlugin.prototype._iconActivation = "onActiveFilter";
|
292
|
+
/** @type {string}
|
293
|
+
* @private
|
294
|
+
*/
|
295
|
+
RowFilteringPlugin.prototype._iconTag = "";
|
296
|
+
/** @type {number}
|
297
|
+
* @private
|
298
|
+
*/
|
299
|
+
RowFilteringPlugin.prototype._filterId = 0;
|
300
|
+
/** @type {number}
|
301
|
+
* @private
|
302
|
+
*/
|
303
|
+
RowFilteringPlugin.prototype._uiTimerId = 0;
|
304
|
+
/** @type {number}
|
305
|
+
* @private
|
306
|
+
*/
|
307
|
+
RowFilteringPlugin.prototype._filterTimerId = 0;
|
308
|
+
/** @type {Function}
|
309
|
+
* @private
|
310
|
+
*/
|
311
|
+
RowFilteringPlugin.prototype._overridingFilter = null;
|
312
|
+
/** @type {Function}
|
313
|
+
* @private
|
314
|
+
*/
|
315
|
+
RowFilteringPlugin.prototype._preTransform = null;
|
316
|
+
/** @type {Function}
|
317
|
+
* @private
|
318
|
+
*/
|
319
|
+
RowFilteringPlugin.prototype._rowTransform = null;
|
320
|
+
/** @type {Element}
|
321
|
+
* @private
|
322
|
+
*/
|
323
|
+
RowFilteringPlugin.prototype._filterDialog = null;
|
324
|
+
/** @type {boolean}
|
325
|
+
* @private
|
326
|
+
*/
|
327
|
+
RowFilteringPlugin.prototype._dialogInitialized = false;
|
328
|
+
/** @type {RowFilteringPlugin~FilterDialogOptions}
|
329
|
+
* @private
|
330
|
+
*/
|
331
|
+
RowFilteringPlugin.prototype._dialogOptions = null;
|
332
|
+
/** @type {FilterBuilder}
|
333
|
+
* @private
|
334
|
+
*/
|
335
|
+
RowFilteringPlugin._filterBuilder = null;
|
336
|
+
/** @type {string}
|
337
|
+
* @private
|
338
|
+
*/
|
339
|
+
RowFilteringPlugin._dialogTagName; // intentionally left undefined
|
340
|
+
/** Array of DataView objects
|
341
|
+
* @type {!Array.<Object>}
|
342
|
+
* @private
|
343
|
+
*/
|
344
|
+
RowFilteringPlugin.prototype._dvs;
|
345
|
+
/** @type {boolean}
|
346
|
+
* @private
|
347
|
+
*/
|
348
|
+
RowFilteringPlugin.prototype._activeIconState = true;
|
349
|
+
|
350
|
+
|
351
|
+
/** @public
|
352
|
+
* @return {string}
|
353
|
+
*/
|
354
|
+
RowFilteringPlugin.prototype.getName = function () {
|
355
|
+
return "RowFilteringPlugin"; // Read Only
|
356
|
+
};
|
357
|
+
/** @public
|
358
|
+
* @param {Object} host core grid instance
|
359
|
+
* @param {Object=} options
|
360
|
+
*/
|
361
|
+
RowFilteringPlugin.prototype.initialize = function (host, options) {
|
362
|
+
if(this._hosts.indexOf(host) >= 0) { return; }
|
363
|
+
this._hosts.push(host);
|
364
|
+
|
365
|
+
if(!RowFilteringPlugin._styles) {
|
366
|
+
RowFilteringPlugin._styles = prettifyCss([
|
367
|
+
".hovering-filter-icon .cell:not(.active-filter):hover .floating-panel .title-filter-icon", [
|
368
|
+
"display: flex;"
|
369
|
+
],
|
370
|
+
".hovering-filter-icon .cell:not(.active-filter) .floating-panel .title-filter-icon", [
|
371
|
+
"display: none;"
|
372
|
+
],
|
373
|
+
".floating-panel", [
|
374
|
+
"position:relative;"
|
375
|
+
],
|
376
|
+
".floating-panel .title-filter-icon", [
|
377
|
+
"color: var(--grid-title-filter-icon-color,inherit);"
|
378
|
+
],
|
379
|
+
".title .floating-panel .title-filter-icon:hover", [
|
380
|
+
"color: var(--grid-title-filter-icon-hover-color,inherit);"
|
381
|
+
],
|
382
|
+
".always-on-filter .floating-panel .title-filter-icon", [
|
383
|
+
"color: var(--grid-header-txtcolor,inherit);"
|
384
|
+
],
|
385
|
+
".always-on-filter .active-filter .floating-panel .title-filter-icon", [
|
386
|
+
"color: var(--grid-title-icon-color,inherit);"
|
387
|
+
],
|
388
|
+
".always-on-filter .active-filter .floating-panel .title-filter-icon:hover", [
|
389
|
+
"color: var(--grid-title-filter-icon-hover-color,inherit);"
|
390
|
+
],
|
391
|
+
".hovering-filter-icon .tiny-col .cell:hover, .tr-grid .tiny-col .cell.active-filter", [
|
392
|
+
"padding-left:0px;"
|
393
|
+
],
|
394
|
+
".tiny-col.movable .cell .floating-panel .title-filter-icon:before", [
|
395
|
+
"content: '.';",
|
396
|
+
"position: absolute;",
|
397
|
+
"margin-left: auto;",
|
398
|
+
"margin-right: auto;",
|
399
|
+
"left: 0;",
|
400
|
+
"right: 0;",
|
401
|
+
"top: -10px;",
|
402
|
+
"font-size: 10px;",
|
403
|
+
"font-family: monospace;",
|
404
|
+
"color: var(--grid-title-dot-icon,inherit);",
|
405
|
+
"text-align:center;"
|
406
|
+
]
|
407
|
+
]);
|
408
|
+
}
|
409
|
+
|
410
|
+
if(!host._rowFilteringStyles){
|
411
|
+
host._rowFilteringStyles = true;
|
412
|
+
injectCss(RowFilteringPlugin._styles, host.getElement());
|
413
|
+
}
|
414
|
+
|
415
|
+
|
416
|
+
host.unloadPlugin("ColumnFilterPlugin");
|
417
|
+
host.listen("preSectionRender", this._onPreSectionRender);
|
418
|
+
host.listen("postDataSourceChanged", this._requestFilterRefresh); // TODO: Check if this is necessary
|
419
|
+
host.listen("columnAdded", this._onColumnAdded);
|
420
|
+
host.listen("columnRemoved", this._onColumnRemoved);
|
421
|
+
|
422
|
+
this.config(options);
|
423
|
+
// In case of lazy loading
|
424
|
+
// TODO
|
425
|
+
};
|
426
|
+
/** @public
|
427
|
+
* @param {Object} host core grid instance
|
428
|
+
*/
|
429
|
+
RowFilteringPlugin.prototype.unload = function (host) {
|
430
|
+
let at = this._hosts.indexOf(host);
|
431
|
+
if(at < 0) { return; }
|
432
|
+
|
433
|
+
this._hosts.splice(at, 1);
|
434
|
+
|
435
|
+
host.unlisten("preSectionRender", this._onPreSectionRender);
|
436
|
+
host.unlisten("postDataSourceChanged", this._requestFilterRefresh);
|
437
|
+
host.unlisten("columnAdded", this._onColumnAdded);
|
438
|
+
host.unlisten("columnRemoved", this._onColumnRemoved);
|
439
|
+
|
440
|
+
if(!this._hosts.length) {
|
441
|
+
if(this._uiTimerId) {
|
442
|
+
clearTimeout(this._uiTimerId);
|
443
|
+
this._uiTimerId = 0;
|
444
|
+
}
|
445
|
+
if(this._filterTimerId) {
|
446
|
+
clearTimeout(this._filterTimerId);
|
447
|
+
this._filterTimerId = 0;
|
448
|
+
}
|
449
|
+
|
450
|
+
this._hasPendingFilter = false;
|
451
|
+
if(this._filterDialog) {
|
452
|
+
this._filterDialog.hide(); // Remove the dialog from document
|
453
|
+
this._filterDialog = null;
|
454
|
+
this._dialogInitialized = false;
|
455
|
+
}
|
456
|
+
}
|
457
|
+
|
458
|
+
this._dispose();
|
459
|
+
};
|
460
|
+
/**
|
461
|
+
* @protected
|
462
|
+
* @ignore
|
463
|
+
*/
|
464
|
+
RowFilteringPlugin.prototype._afterInit = function() {
|
465
|
+
if(!this._iconTag) {
|
466
|
+
let tagName = "ef-icon";
|
467
|
+
if(ElfUtil.hasComponent(tagName) >= 3) {
|
468
|
+
this._iconTag = tagName;
|
469
|
+
} else if(ElfUtil.hasComponent("ef-icon")) {
|
470
|
+
this._iconTag = "ef-icon";
|
471
|
+
} else {
|
472
|
+
this._iconTag = "div";
|
473
|
+
}
|
474
|
+
this._updateAllColumnIcons();
|
475
|
+
}
|
476
|
+
if(!this._filterDialog) {
|
477
|
+
this._filterDialog = RowFilteringPlugin._createDialog();
|
478
|
+
this._dialogInitialized = false;
|
479
|
+
if(this._filterDialog) {
|
480
|
+
this._filterDialog.style.display = "none";
|
481
|
+
document.body.appendChild(this._filterDialog);
|
482
|
+
setTimeout(this._onPreLoadedDialog, 10);
|
483
|
+
}
|
484
|
+
}
|
485
|
+
this._applyPendingFilter();
|
486
|
+
};
|
487
|
+
|
488
|
+
/** @private
|
489
|
+
*/
|
490
|
+
RowFilteringPlugin.prototype._applyPendingFilter = function() {
|
491
|
+
if(!this._initializedGrid) {
|
492
|
+
return;
|
493
|
+
}
|
494
|
+
if(!this._hasPendingFilter) {
|
495
|
+
return;
|
496
|
+
}
|
497
|
+
|
498
|
+
this._hasPendingFilter = false;
|
499
|
+
let colCount = this.getColumnCount();
|
500
|
+
for(let c = 0; c < colCount; ++c) {
|
501
|
+
let colSettings = this._getUserColumnSettings(c);
|
502
|
+
if(colSettings.expression) {
|
503
|
+
this.addColumnFilter(c, colSettings.expression, colSettings.filterState);
|
504
|
+
} else {
|
505
|
+
this._removeColumnFilters(c);
|
506
|
+
}
|
507
|
+
}
|
508
|
+
};
|
509
|
+
/** @private
|
510
|
+
*/
|
511
|
+
RowFilteringPlugin.prototype._onPreLoadedDialog = function() {
|
512
|
+
if(this._filterDialog) {
|
513
|
+
this._filterDialog.style.display = "";
|
514
|
+
let pn = this._filterDialog.parentNode;
|
515
|
+
if(pn) {
|
516
|
+
pn.removeChild(this._filterDialog);
|
517
|
+
}
|
518
|
+
}
|
519
|
+
};
|
520
|
+
|
521
|
+
/** @public
|
522
|
+
* @param {Object=} options
|
523
|
+
*/
|
524
|
+
RowFilteringPlugin.prototype.config = function (options) {
|
525
|
+
if(!options) { return; }
|
526
|
+
|
527
|
+
let rowFiltering = options["rowFiltering"];
|
528
|
+
if(rowFiltering) {
|
529
|
+
if(rowFiltering["disabledUI"] || rowFiltering["uiDisabled"]) {
|
530
|
+
this._iconActivation = "none";
|
531
|
+
}
|
532
|
+
if(rowFiltering["emptySegmentFiltering"] != null) {
|
533
|
+
// TODO: there is a chance that there is no DataView during the configuration
|
534
|
+
this.enableEmptySegmentFiltering(rowFiltering["emptySegmentFiltering"] ? true : false);
|
535
|
+
}
|
536
|
+
if(rowFiltering["separatorFiltering"] != null) {
|
537
|
+
// TODO: there is a chance that there is no DataView during the configuration
|
538
|
+
this.enableSeparatorFiltering(rowFiltering["separatorFiltering"] ? true : false);
|
539
|
+
}
|
540
|
+
if(rowFiltering["iconActivation"]){
|
541
|
+
this._iconActivation = rowFiltering["iconActivation"];
|
542
|
+
|
543
|
+
for(let index = 0; index < this._hosts.length; index++){
|
544
|
+
if(this._iconActivation === "onHover"){
|
545
|
+
this._hosts[index].enableClass("hovering-filter-icon", true);
|
546
|
+
}else{
|
547
|
+
this._hosts[index].enableClass("hovering-filter-icon", false);
|
548
|
+
}
|
549
|
+
if(this._iconActivation === "always"){
|
550
|
+
this._hosts[index].enableClass("always-on-filter", true);
|
551
|
+
} else {
|
552
|
+
this._hosts[index].enableClass("always-on-filter", false);
|
553
|
+
}
|
554
|
+
}
|
555
|
+
}
|
556
|
+
if(rowFiltering["dialogOptions"]){
|
557
|
+
this._dialogOptions = rowFiltering["dialogOptions"];
|
558
|
+
}
|
559
|
+
if(rowFiltering["activeIconState"] != null){
|
560
|
+
this._activeIconState = !!rowFiltering["activeIconState"];
|
561
|
+
}
|
562
|
+
if(rowFiltering["clicked"]) {
|
563
|
+
rowFiltering["click"] = rowFiltering["clicked"];
|
564
|
+
}
|
565
|
+
|
566
|
+
this.addListener(rowFiltering, "click");
|
567
|
+
this.addListener(rowFiltering, "beforeDialogOpened");
|
568
|
+
this.addListener(rowFiltering, "dialogCommitted");
|
569
|
+
this.addListener(rowFiltering, "iconCreated");
|
570
|
+
this.addListener(rowFiltering, "filterChanged");
|
571
|
+
this.addListener(rowFiltering, "refreshed");
|
572
|
+
}
|
573
|
+
|
574
|
+
let columns = options["columns"];
|
575
|
+
if(!columns) { return; }
|
576
|
+
|
577
|
+
// let host = this._hosts[0];
|
578
|
+
let len = columns.length;
|
579
|
+
for(let i = 0; i < len; ++i) {
|
580
|
+
let column = columns[i];
|
581
|
+
this._setColumnOptions(i, column);
|
582
|
+
}
|
583
|
+
this._applyPendingFilter();
|
584
|
+
};
|
585
|
+
/** @public
|
586
|
+
* @param {Object=} gridOptions
|
587
|
+
* @return {!Object}
|
588
|
+
*/
|
589
|
+
RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
|
590
|
+
let obj = gridOptions || {};
|
591
|
+
|
592
|
+
let columns = obj.columns;
|
593
|
+
if(!columns) {
|
594
|
+
columns = obj.columns = [];
|
595
|
+
}
|
596
|
+
|
597
|
+
let len = this.getColumnCount();
|
598
|
+
for(let i = 0; i < len; ++i) {
|
599
|
+
let column = columns[i];
|
600
|
+
if(!column) {
|
601
|
+
column = columns[i] = {};
|
602
|
+
}
|
603
|
+
|
604
|
+
let colSettings = this._getUserColumnSettings(i);
|
605
|
+
let exp = colSettings.expression;
|
606
|
+
if(exp && typeof exp !== "function") { // TODO: Accept function type
|
607
|
+
if(typeof exp === "object" && !Array.isArray(exp)) {
|
608
|
+
exp = _handledBlankProperties(exp);
|
609
|
+
column.filter = exp;
|
610
|
+
} else {
|
611
|
+
column.filter = exp; // This could be string or array
|
612
|
+
}
|
613
|
+
}
|
614
|
+
let ctx = colSettings.filterState;
|
615
|
+
if(ctx != null) {
|
616
|
+
if(typeof ctx !== "object" || !ctx._autoGenerated) {
|
617
|
+
column.filterState = ctx;
|
618
|
+
}
|
619
|
+
}
|
620
|
+
|
621
|
+
let filterIcon = colSettings.filterIcon;
|
622
|
+
if(!filterIcon) {
|
623
|
+
column.filterIcon = false;
|
624
|
+
}
|
625
|
+
|
626
|
+
let filterDialogOptions = colSettings.filterDialogOptions;
|
627
|
+
if(filterDialogOptions != null) {
|
628
|
+
column.filterDialogOptions = colSettings.filterDialogOptions;
|
629
|
+
}
|
630
|
+
}
|
631
|
+
|
632
|
+
let extOptions = obj.rowFiltering;
|
633
|
+
let dirty = false;
|
634
|
+
if(!extOptions) {
|
635
|
+
extOptions = {};
|
636
|
+
}
|
637
|
+
if(this._iconActivation !== "onActiveFilter") {
|
638
|
+
extOptions.iconActivation = this._iconActivation;
|
639
|
+
dirty = true;
|
640
|
+
}
|
641
|
+
if(this._dialogOptions) {
|
642
|
+
extOptions.dialogOptions = this._dialogOptions; // TODO: dialogOptions should not contain any function
|
643
|
+
dirty = true;
|
644
|
+
}
|
645
|
+
if(!this._activeIconState) {
|
646
|
+
extOptions.activeIconState = false;
|
647
|
+
dirty = true;
|
648
|
+
}
|
649
|
+
// TODO: get emptySegmentFiltering setting from DataView
|
650
|
+
// TODO: get separatorFiltering setting from DataView
|
651
|
+
if(dirty) {
|
652
|
+
obj.rowFiltering = extOptions;
|
653
|
+
}
|
654
|
+
|
655
|
+
return obj;
|
656
|
+
};
|
657
|
+
|
658
|
+
/** All filter logics in DataView will be temporarily removed until re-enabling. This is useful when trying to insert an item at the specified index. After re-enabling, both logics and icons will be restored.
|
659
|
+
* @public
|
660
|
+
* @param {boolean=} opt_disabled
|
661
|
+
* @param {string=} opt_id For handling nested called
|
662
|
+
*/
|
663
|
+
RowFilteringPlugin.prototype.disable = function(opt_disabled, opt_id) {
|
664
|
+
let disabled = opt_disabled !== false;
|
665
|
+
if(!this._disablingIds) {
|
666
|
+
this._disablingIds = {};
|
667
|
+
}
|
668
|
+
if(!opt_id) { opt_id = "_"; }
|
669
|
+
this._disablingIds[opt_id] = disabled;
|
670
|
+
|
671
|
+
disabled = false;
|
672
|
+
for(let key in this._disablingIds) { // Find cumulative state
|
673
|
+
if(this._disablingIds[key]) {
|
674
|
+
disabled = true;
|
675
|
+
break;
|
676
|
+
}
|
677
|
+
}
|
678
|
+
|
679
|
+
if(this._disabled !== disabled) {
|
680
|
+
this._disabled = disabled;
|
681
|
+
if(disabled) {
|
682
|
+
this.refresh(); // Take an effect immediately
|
683
|
+
this._updateAllColumnIcons();
|
684
|
+
} else {
|
685
|
+
this._requestFilterRefresh(); // Take an effect later
|
686
|
+
this._setTimerForUpdatingIcons();
|
687
|
+
}
|
688
|
+
}
|
689
|
+
};
|
690
|
+
|
691
|
+
/** Add a global filter that is not related to any column. No filter icon is created in this way
|
692
|
+
* @public
|
693
|
+
* @param {RowFilteringPlugin~Expression} exp Expression or Function
|
694
|
+
* @param {string=} funcName Optional function name for referencing the given function
|
695
|
+
* @param {*=} ctx Context that will be passed as the third parameter for the filter logic
|
696
|
+
* @return {string} If success, function name is returned, otherwise empty string
|
697
|
+
* @fires RowFilteringPlugin#filterChanged
|
698
|
+
*/
|
699
|
+
RowFilteringPlugin.prototype.addFilter = function(exp, funcName, ctx) {
|
700
|
+
let func = this._parseFilter(exp, -1);
|
701
|
+
if(!func) { return ""; }
|
702
|
+
|
703
|
+
if(!funcName) {
|
704
|
+
funcName = "_" + this._filterId++;
|
705
|
+
}
|
706
|
+
|
707
|
+
if(this._nameMap[funcName] || this._globalFilters.indexOf(func) >= 0) {
|
708
|
+
return ""; // Function is already exists
|
709
|
+
}
|
710
|
+
|
711
|
+
ctx = ctx != null ? ctx : null;
|
712
|
+
this._nameMap[funcName] = func;
|
713
|
+
this._globalFilters.push(func);
|
714
|
+
this._globalContexts.push(ctx);
|
715
|
+
|
716
|
+
this._dispatch("filterChanged", {
|
717
|
+
"filterType": "global",
|
718
|
+
"changeType": "add",
|
719
|
+
"colIndex": -1,
|
720
|
+
"field": null
|
721
|
+
});
|
722
|
+
|
723
|
+
this._requestFilterRefresh();
|
724
|
+
return funcName;
|
725
|
+
};
|
726
|
+
/** Add a global filter that is not related to any column. No filter icon is created in this way
|
727
|
+
* @public
|
728
|
+
* @param {RowFilteringPlugin~Expression} exp Expression or Function
|
729
|
+
* @param {*=} ctx Context that will be passed as the third parameter for the filter logic
|
730
|
+
* @return {string} If success, function name is returned, otherwise empty string
|
731
|
+
* @fires RowFilteringPlugin#filterChanged
|
732
|
+
*/
|
733
|
+
RowFilteringPlugin.prototype.addGridFilter = function(exp, ctx) {
|
734
|
+
return this.addFilter(exp, null, ctx);
|
735
|
+
};
|
736
|
+
/** @private
|
737
|
+
* @param {RowFilteringPlugin~Expression} exp
|
738
|
+
* @param {number=} colIndex
|
739
|
+
* @param {*=} ctx
|
740
|
+
* @return {Function}
|
741
|
+
*/
|
742
|
+
RowFilteringPlugin.prototype._parseFilter = function(exp, colIndex, ctx) {
|
743
|
+
if(!exp) {
|
744
|
+
return null;
|
745
|
+
}
|
746
|
+
if(typeof exp === "function") {
|
747
|
+
return exp;
|
748
|
+
}
|
749
|
+
let filterBuilder = RowFilteringPlugin._getFilterBuilder();
|
750
|
+
let validIdx = (colIndex || colIndex === 0);
|
751
|
+
let field = validIdx ? this._getField(colIndex) : "";
|
752
|
+
let formatter = validIdx ? this._getFormatter(colIndex) : null;
|
753
|
+
|
754
|
+
let func = null;
|
755
|
+
if(typeof exp === "string") { // Free text does not need data accessors
|
756
|
+
func = this._funcMap[exp];
|
757
|
+
if(func == null) {
|
758
|
+
func = this._funcMap[exp] = filterBuilder.parse(exp, field, formatter, field);
|
759
|
+
}
|
760
|
+
} else {
|
761
|
+
let rawDataAccessor = null;
|
762
|
+
let formattedDataAccessor = null;
|
763
|
+
if(ctx) {
|
764
|
+
rawDataAccessor = ctx.rawDataAccessor || null;
|
765
|
+
formattedDataAccessor = ctx.formattedDataAccessor || null;
|
766
|
+
}
|
767
|
+
if(!Array.isArray(exp)) { // If exp is an object
|
768
|
+
if(exp[BLANKS] || (ctx && ctx.blankValues)) { // it contains BLANKS key or context object has blank option
|
769
|
+
exp[""] = exp["null"] = exp["undefined"] = exp["NaN"] = true;
|
770
|
+
delete exp[BLANKS];
|
771
|
+
}
|
772
|
+
}
|
773
|
+
func = filterBuilder.parse(exp, field, formatter, field, rawDataAccessor, formattedDataAccessor);
|
774
|
+
}
|
775
|
+
return func;
|
776
|
+
};
|
777
|
+
/** If you want the column to always have one single filter, please use {@link RowFilteringPlugin#setColumnFilter} instead. This method allow a single column to have multiple filters.
|
778
|
+
* @public
|
779
|
+
* @param {number} colIndex
|
780
|
+
* @param {RowFilteringPlugin~Expression} exp Expression can be string, Array, Object, or Function
|
781
|
+
* @param {(Object|string)=} ctx Context object that will be passed as the third parameter for the filter logic
|
782
|
+
* @return {boolean} True if success
|
783
|
+
* @fires RowFilteringPlugin#filterChanged
|
784
|
+
*/
|
785
|
+
RowFilteringPlugin.prototype.addColumnFilter = function(colIndex, exp, ctx) {
|
786
|
+
if(colIndex < 0 || colIndex >= this.getColumnCount()) {
|
787
|
+
return false;
|
788
|
+
}
|
789
|
+
|
790
|
+
let cfo = this._getColumnFilterOption(colIndex);
|
791
|
+
if(cfo) {
|
792
|
+
if(cfo._expressions[0] === exp) {
|
793
|
+
return false; // The same expression is getting added on the same column twice
|
794
|
+
}
|
795
|
+
}
|
796
|
+
|
797
|
+
let func = null;
|
798
|
+
if(typeof exp === "function") {
|
799
|
+
func = /** @type{Function} */(exp);
|
800
|
+
if(ctx && typeof ctx === "string") {
|
801
|
+
exp = ctx;
|
802
|
+
}
|
803
|
+
} else {
|
804
|
+
func = this._parseFilter(exp, colIndex, ctx);
|
805
|
+
}
|
806
|
+
|
807
|
+
if(!func) {
|
808
|
+
return false;
|
809
|
+
}
|
810
|
+
|
811
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
812
|
+
colSettings.expression = exp; // WARNING: Only the last expression are saved (previous one is overwritten)
|
813
|
+
colSettings.filterState = ctx;
|
814
|
+
|
815
|
+
if(ctx == null) {
|
816
|
+
ctx = {"_autoGenerated": true};
|
817
|
+
}
|
818
|
+
|
819
|
+
let field = this._getField(colIndex);
|
820
|
+
if(ctx && typeof ctx === "object") {
|
821
|
+
ctx["field"] = field;
|
822
|
+
}
|
823
|
+
|
824
|
+
cfo = this._initColumnFilterOption(colIndex);
|
825
|
+
cfo._field = field; // TODO: Handle fieldDataType
|
826
|
+
cfo._filters.push(func);
|
827
|
+
cfo._expressions.push(exp);
|
828
|
+
cfo._context.push(ctx);
|
829
|
+
cfo._rawDataAccessor = ctx.rawDataAccessor || null;
|
830
|
+
cfo._formattedDataAccessor = ctx.formattedDataAccessor || null;
|
831
|
+
this._columnFilters.push(cfo);
|
832
|
+
|
833
|
+
this._dispatch("filterChanged", {
|
834
|
+
"filterType": "column",
|
835
|
+
"changeType": "add",
|
836
|
+
"colIndex": colIndex,
|
837
|
+
"field": field
|
838
|
+
});
|
839
|
+
|
840
|
+
// UI
|
841
|
+
this._requestFilterRefresh();
|
842
|
+
this._updateColumnIcon(colIndex);
|
843
|
+
return true;
|
844
|
+
};
|
845
|
+
/** This method guarantees that the column can have at most one filter at the time. It performs {@link RowFilteringPlugin#removeColumnFilters} before {@link RowFilteringPlugin#addColumnFilter}
|
846
|
+
* @public
|
847
|
+
* @param {number} colIndex
|
848
|
+
* @param {RowFilteringPlugin~Expression} exp Expression can be string, Array, Object, or Function
|
849
|
+
* @param {(Object|string)=} ctx Context object that will be passed as the third parameter for the filter logic
|
850
|
+
* @return {boolean} True If there is any change
|
851
|
+
* @fires RowFilteringPlugin#filterChanged
|
852
|
+
* @example
|
853
|
+
* extension.setColumnFilter(colIndex1,
|
854
|
+
* [["GT", 0]]
|
855
|
+
* );
|
856
|
+
* extension.setColumnFilter(colIndex2,
|
857
|
+
* "filter": "[PCTCHNG] > 0"
|
858
|
+
* );
|
859
|
+
* extension.setColumnFilter(colIndex3,
|
860
|
+
* function(rowData) {
|
861
|
+
* return rowData["PCTCHNG"] > 0;
|
862
|
+
* }
|
863
|
+
* );
|
864
|
+
*/
|
865
|
+
RowFilteringPlugin.prototype.setColumnFilter = function(colIndex, exp, ctx) {
|
866
|
+
let curExp = this.getColumnFilterExpression(colIndex);
|
867
|
+
if(curExp === exp) {
|
868
|
+
return false;
|
869
|
+
}
|
870
|
+
|
871
|
+
let removed = this._removeColumnFilters(colIndex);
|
872
|
+
|
873
|
+
let added = this.addColumnFilter(colIndex, exp, ctx);
|
874
|
+
if(!added && removed) {
|
875
|
+
this._updateColumnIcon(colIndex);
|
876
|
+
}
|
877
|
+
return removed || added;
|
878
|
+
};
|
879
|
+
/** @public
|
880
|
+
* @param {number} colIndex
|
881
|
+
* @return {RowFilteringPlugin~Expression}
|
882
|
+
*/
|
883
|
+
RowFilteringPlugin.prototype.getColumnFilterExpression = function(colIndex) {
|
884
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
885
|
+
return colSettings.expression || null;
|
886
|
+
};
|
887
|
+
/** Set data to colData["rowFiltering"]
|
888
|
+
* @private
|
889
|
+
* @param {number} colIndex
|
890
|
+
* @param {RowFilteringPlugin~ColumnOptions} userObj
|
891
|
+
* @returns {boolean} Returns true if there is an active filter in the column options
|
892
|
+
* @example
|
893
|
+
* let colDef1 = {
|
894
|
+
* "field": "PCTCHNG",
|
895
|
+
* "filter": [["GT", 0]]
|
896
|
+
* };
|
897
|
+
* let colDef2 = {
|
898
|
+
* "filter": "[PCTCHNG] > 0"
|
899
|
+
* };
|
900
|
+
* let colDef3 = {
|
901
|
+
* "filter": function(rowData) {
|
902
|
+
* return rowData["PCTCHNG"] > 0;
|
903
|
+
* }
|
904
|
+
* };
|
905
|
+
*/
|
906
|
+
RowFilteringPlugin.prototype._setColumnOptions = function(colIndex, userObj) {
|
907
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
908
|
+
let filterIcon = userObj["filterIcon"];
|
909
|
+
|
910
|
+
// TODO: This should not be set here, should retreive data type from Composite/Realtime Grid
|
911
|
+
let fieldDataType = userObj["fieldDataType"] || userObj["dataType"];
|
912
|
+
if(fieldDataType) {
|
913
|
+
colSettings.fieldDataType = fieldDataType; // TODO: This should not be set here, should retreive data type from Composite/Realtime Grid
|
914
|
+
}
|
915
|
+
if(filterIcon != null) {
|
916
|
+
colSettings.filterIcon = filterIcon;
|
917
|
+
}
|
918
|
+
let exp = userObj["filter"];
|
919
|
+
if(exp != null) {
|
920
|
+
colSettings.expression = exp;
|
921
|
+
colSettings.filterState = null;
|
922
|
+
this._hasPendingFilter = true;
|
923
|
+
}
|
924
|
+
let filterState = userObj["filterState"];
|
925
|
+
if(filterState != null) {
|
926
|
+
colSettings.filterState = filterState;
|
927
|
+
}
|
928
|
+
|
929
|
+
let iconActivation = filterIcon == false ? "none" : this._iconActivation;
|
930
|
+
if(iconActivation == "always" || iconActivation == "onHover") {
|
931
|
+
this._updateColumnIcon(colIndex);
|
932
|
+
}
|
933
|
+
|
934
|
+
let filterDialogOptions = userObj["filterDialogOptions"];
|
935
|
+
if(filterDialogOptions != null) {
|
936
|
+
colSettings.filterDialogOptions = filterDialogOptions;
|
937
|
+
}
|
938
|
+
|
939
|
+
return (exp != null);
|
940
|
+
};
|
941
|
+
/** @private
|
942
|
+
* @param {number} colIndex
|
943
|
+
* @return {!Object} colData["rowFiltering"]
|
944
|
+
*/
|
945
|
+
RowFilteringPlugin.prototype._getUserColumnSettings = function(colIndex) {
|
946
|
+
let colData = this._newColumnData(colIndex);
|
947
|
+
let colSettings = colData["rowFiltering"];
|
948
|
+
if(!colSettings) {
|
949
|
+
colSettings = colData["rowFiltering"] = {};
|
950
|
+
}
|
951
|
+
return colSettings;
|
952
|
+
};
|
953
|
+
/** @private
|
954
|
+
* @param {number} colIndex
|
955
|
+
* @return {Object} colData["rowFiltering"]["filterOption"]
|
956
|
+
*/
|
957
|
+
RowFilteringPlugin.prototype._getColumnFilterOption = function(colIndex) {
|
958
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
959
|
+
if(colSettings) {
|
960
|
+
return colSettings["filterOption"] || null;
|
961
|
+
} else {
|
962
|
+
return null;
|
963
|
+
}
|
964
|
+
};
|
965
|
+
/** Remove colData["rowFiltering"]["filterOption"]
|
966
|
+
* @private
|
967
|
+
* @param {number} colIndex
|
968
|
+
*/
|
969
|
+
RowFilteringPlugin.prototype._removeActiveFilterStates = function(colIndex) {
|
970
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
971
|
+
colSettings.expression = null;
|
972
|
+
colSettings.filterState = null;
|
973
|
+
let cfo = colSettings["filterOption"];
|
974
|
+
if(cfo) {
|
975
|
+
colSettings["filterOption"] = null;
|
976
|
+
if(cfo._filters.length) {
|
977
|
+
this._dispatch("filterChanged", {
|
978
|
+
"filterType": "column",
|
979
|
+
"changeType": "remove",
|
980
|
+
"colIndex": colIndex,
|
981
|
+
"field": this._getField(colIndex)
|
982
|
+
});
|
983
|
+
}
|
984
|
+
}
|
985
|
+
};
|
986
|
+
/** @private
|
987
|
+
* @param {number} colIndex
|
988
|
+
* @return {!Object}
|
989
|
+
*/
|
990
|
+
RowFilteringPlugin.prototype._initColumnFilterOption = function(colIndex) {
|
991
|
+
let cfo = this._getColumnFilterOption(colIndex);
|
992
|
+
if(!cfo) {
|
993
|
+
cfo = {};
|
994
|
+
cfo._filters = [];
|
995
|
+
cfo._expressions = [];
|
996
|
+
cfo._context = [];
|
997
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
998
|
+
colSettings["filterOption"] = cfo;
|
999
|
+
}
|
1000
|
+
return cfo;
|
1001
|
+
};
|
1002
|
+
|
1003
|
+
/** Remove the registered global filter. The column filter cannot be removed
|
1004
|
+
* @public
|
1005
|
+
* @param {Function|string} funcRef Function object or the function name can be used to remove
|
1006
|
+
* @return {boolean} True if success
|
1007
|
+
*/
|
1008
|
+
RowFilteringPlugin.prototype.removeFilter = function(funcRef) {
|
1009
|
+
let func = null;
|
1010
|
+
let funcName = "";
|
1011
|
+
let funcIndex = -1;
|
1012
|
+
if(typeof funcRef === "string") {
|
1013
|
+
funcName = /** @type{string} */(funcRef);
|
1014
|
+
func = this._nameMap[funcRef];
|
1015
|
+
funcIndex = this._globalFilters.indexOf(func);
|
1016
|
+
} else {
|
1017
|
+
func = /** @type{Function} */(funcRef);
|
1018
|
+
funcIndex = this._globalFilters.indexOf(func);
|
1019
|
+
if(funcIndex >= 0) {
|
1020
|
+
for(let key in this._nameMap) {
|
1021
|
+
if(this._nameMap[key] === func) {
|
1022
|
+
funcName = key;
|
1023
|
+
}
|
1024
|
+
}
|
1025
|
+
}
|
1026
|
+
}
|
1027
|
+
if(funcIndex < 0) { return false; }
|
1028
|
+
|
1029
|
+
delete this._nameMap[funcName];
|
1030
|
+
this._globalFilters.splice(funcIndex, 1);
|
1031
|
+
this._globalContexts.splice(funcIndex, 1);
|
1032
|
+
this._requestFilterRefresh();
|
1033
|
+
return true;
|
1034
|
+
};
|
1035
|
+
/** Remove all filters in from the specified column
|
1036
|
+
* @public
|
1037
|
+
* @param {number} colIndex
|
1038
|
+
* @return {boolean} True if there is any change
|
1039
|
+
* @fires RowFilteringPlugin#filterChanged
|
1040
|
+
*/
|
1041
|
+
RowFilteringPlugin.prototype.removeColumnFilters = function(colIndex) {
|
1042
|
+
if(colIndex == null) { // Prevent user mistake
|
1043
|
+
return this.removeAllColumnFilters();
|
1044
|
+
}
|
1045
|
+
|
1046
|
+
let dirty = this._removeColumnFilters(colIndex);
|
1047
|
+
if(dirty) {
|
1048
|
+
this._updateColumnIcon(colIndex);
|
1049
|
+
}
|
1050
|
+
return dirty;
|
1051
|
+
};
|
1052
|
+
/** @private
|
1053
|
+
* @param {number} colIndex
|
1054
|
+
* @return {boolean} True if there is any change
|
1055
|
+
* @fires RowFilteringPlugin#filterChanged
|
1056
|
+
*/
|
1057
|
+
RowFilteringPlugin.prototype._removeColumnFilters = function(colIndex) {
|
1058
|
+
let cfo = this._getColumnFilterOption(colIndex);
|
1059
|
+
if(cfo) {
|
1060
|
+
let funcIndex = this._columnFilters.indexOf(cfo);
|
1061
|
+
if(funcIndex >= 0) {
|
1062
|
+
this._columnFilters.splice(funcIndex, 1);
|
1063
|
+
}
|
1064
|
+
this._removeActiveFilterStates(colIndex); // filterChanged fired
|
1065
|
+
let inputExt = this._getPlugin("FilterInputPlugin"); // TODO: Use the event instead
|
1066
|
+
inputExt && inputExt.updateUI(colIndex, "");
|
1067
|
+
this._requestFilterRefresh();
|
1068
|
+
}
|
1069
|
+
return cfo ? true : false;
|
1070
|
+
};
|
1071
|
+
/** Alias to {@link RowFilteringPlugin#removeColumnFilters} Remove all filters from the specified column
|
1072
|
+
* @public
|
1073
|
+
* @function
|
1074
|
+
* @param {number} colIndex
|
1075
|
+
* @return {boolean} True if there is any change
|
1076
|
+
* @fires RowFilteringPlugin#filterChanged
|
1077
|
+
*/
|
1078
|
+
RowFilteringPlugin.prototype.removeColumnFilter = RowFilteringPlugin.prototype.removeColumnFilters;
|
1079
|
+
|
1080
|
+
/** Remove all column filters from all columns, excluding global filters
|
1081
|
+
* @public
|
1082
|
+
* @return {boolean} Return true if there is any change
|
1083
|
+
* @fires RowFilteringPlugin#filterChanged
|
1084
|
+
*/
|
1085
|
+
RowFilteringPlugin.prototype.removeAllColumnFilters = function() {
|
1086
|
+
if(this._columnFilters.length) {
|
1087
|
+
this._columnFilters.length = 0;
|
1088
|
+
|
1089
|
+
let inputExt = this._getPlugin("FilterInputPlugin");
|
1090
|
+
let colCount = this._getColumnCount();
|
1091
|
+
for(let i = 0; i < colCount; ++i) {
|
1092
|
+
this._removeActiveFilterStates(i); // filterChanged fired
|
1093
|
+
inputExt && inputExt.updateUI(i, ""); // TODO: Use the event instead
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
this._updateAllColumnIcons();
|
1097
|
+
|
1098
|
+
this._requestFilterRefresh();
|
1099
|
+
return true;
|
1100
|
+
}
|
1101
|
+
return false;
|
1102
|
+
};
|
1103
|
+
/** Remove all column and global filters. OverridingFilters are not removed by this method
|
1104
|
+
* @public
|
1105
|
+
*/
|
1106
|
+
RowFilteringPlugin.prototype.removeAllFilters = function() {
|
1107
|
+
let totalFilter = this._globalFilters.length + this._columnFilters.length;
|
1108
|
+
if(totalFilter <= 0) { return; }
|
1109
|
+
if(this._globalFilters.length) {
|
1110
|
+
this._globalFilters.length = 0;
|
1111
|
+
this._nameMap = {};
|
1112
|
+
|
1113
|
+
this._dispatch("filterChanged", {
|
1114
|
+
"filterType": "global",
|
1115
|
+
"changeType": "remove",
|
1116
|
+
"colIndex": -1,
|
1117
|
+
"field": ""
|
1118
|
+
});
|
1119
|
+
}
|
1120
|
+
|
1121
|
+
this.removeAllColumnFilters();
|
1122
|
+
|
1123
|
+
this._requestFilterRefresh();
|
1124
|
+
};
|
1125
|
+
|
1126
|
+
/** Column overriding function is processed before column filters and after global filters. If it returns non-zero, the result will override all other column filter results. If it returns 1, the row will be always included. If it returns -1, the row will be always excluded. If it returns 0, the column filters will be used as normal.
|
1127
|
+
* @public
|
1128
|
+
* @param {Function} func
|
1129
|
+
*/
|
1130
|
+
RowFilteringPlugin.prototype.setOverridingFilter = function(func) {
|
1131
|
+
this._overridingFilter = func;
|
1132
|
+
};
|
1133
|
+
/** PreTransform is used to minimize the same data transformation on multiple filters. Output from the given method will be used on all subsequent filters. Note that it will be used for every existing row, so performance should be critical in here. This is optional setting.
|
1134
|
+
* @public
|
1135
|
+
* @param {Function} func This function must return object with key and value pairs
|
1136
|
+
*/
|
1137
|
+
RowFilteringPlugin.prototype.setPreTransform = function(func) {
|
1138
|
+
this._preTransform = func;
|
1139
|
+
};
|
1140
|
+
/** This is the same as preTransform, only it is executed just before column filters and after the global filters. This is optional setting.
|
1141
|
+
* @public
|
1142
|
+
* @param {Function} func This function must return object with key and value pairs
|
1143
|
+
*/
|
1144
|
+
RowFilteringPlugin.prototype.setRowTransform = function(func) {
|
1145
|
+
this._rowTransform = func;
|
1146
|
+
};
|
1147
|
+
|
1148
|
+
/** @public
|
1149
|
+
* @return {!Array.<Function>} All global filters
|
1150
|
+
*/
|
1151
|
+
RowFilteringPlugin.prototype.getFilters = function() {
|
1152
|
+
return this._globalFilters;
|
1153
|
+
};
|
1154
|
+
/** Returns filter functions. Use getConfigObject for saving and loading instead of this function
|
1155
|
+
* @public
|
1156
|
+
* @return {!Array.<Function>} All column filters
|
1157
|
+
* @see {@link RowFilteringPlugin.getConfigObject}
|
1158
|
+
*/
|
1159
|
+
RowFilteringPlugin.prototype.getAllColumnFilters = function() {
|
1160
|
+
return this._getAllColumnFilters();
|
1161
|
+
};
|
1162
|
+
/**
|
1163
|
+
* @private
|
1164
|
+
* @param {Object=} excludedMap
|
1165
|
+
* @return {!Array.<Function>} All column filters
|
1166
|
+
*/
|
1167
|
+
RowFilteringPlugin.prototype._getAllColumnFilters = function(excludedMap) {
|
1168
|
+
if(!excludedMap || typeof excludedMap !== "object") {
|
1169
|
+
excludedMap = {};
|
1170
|
+
}
|
1171
|
+
let filters = [];
|
1172
|
+
let len = this._columnFilters.length;
|
1173
|
+
for(let i = 0; i < len; ++i) {
|
1174
|
+
let cfo = this._columnFilters[i];
|
1175
|
+
if(!excludedMap[cfo._field]) {
|
1176
|
+
let jLen = cfo._filters.length;
|
1177
|
+
for(let j = 0; j < jLen; ++j) {
|
1178
|
+
filters.push(cfo._filters[j]);
|
1179
|
+
}
|
1180
|
+
}
|
1181
|
+
}
|
1182
|
+
return filters;
|
1183
|
+
};
|
1184
|
+
|
1185
|
+
/** Deprecated in favor of getConfigObject(). Get existing filter expressions for saving and restoring.
|
1186
|
+
* @public
|
1187
|
+
* @return {Array.<RowFilteringPlugin~FilterExpression>} Return null if there is no column filter
|
1188
|
+
* @see {@link RowFilteringPlugin.getConfigObject}
|
1189
|
+
*/
|
1190
|
+
RowFilteringPlugin.prototype.getFilterExpressions = function() {
|
1191
|
+
if(this._columnFilters.length) {
|
1192
|
+
// TODO: Provide a way to save rawDataAccessor and formattedDataAccessor
|
1193
|
+
return this._columnFilters.map(_toFilterExpression);
|
1194
|
+
}
|
1195
|
+
return null;
|
1196
|
+
};
|
1197
|
+
/** Deprecated. Clear all existing column filters and restore column filters from the given valid filter expressions. If the parameter is null, the result is equivalent to calling removeAllColumnFilters();
|
1198
|
+
* @public
|
1199
|
+
* @param {Array.<RowFilteringPlugin~FilterExpression>} filterExps
|
1200
|
+
*/
|
1201
|
+
RowFilteringPlugin.prototype.setFilterExpressions = function(filterExps) {
|
1202
|
+
this.removeAllColumnFilters();
|
1203
|
+
|
1204
|
+
if(Array.isArray(filterExps)) {
|
1205
|
+
let api = this.getGridApi();
|
1206
|
+
let fields = api.getColumnFields();
|
1207
|
+
let len = filterExps.length;
|
1208
|
+
for(let i = 0; i < len; ++i) {
|
1209
|
+
let filterExp = filterExps[i];
|
1210
|
+
let field = filterExp.field;
|
1211
|
+
let colIndex = fields.indexOf(field);
|
1212
|
+
if(colIndex >= 0) {
|
1213
|
+
this.setColumnFilter(colIndex, filterExp.expression, filterExp.context);
|
1214
|
+
}
|
1215
|
+
}
|
1216
|
+
}
|
1217
|
+
};
|
1218
|
+
|
1219
|
+
/** @public
|
1220
|
+
* @return {boolean}
|
1221
|
+
*/
|
1222
|
+
RowFilteringPlugin.prototype.hasColumnFilter = function() {
|
1223
|
+
return (this._columnFilters.length > 0);
|
1224
|
+
};
|
1225
|
+
|
1226
|
+
/** @private
|
1227
|
+
* @param {number} colIndex
|
1228
|
+
* @return {Array.<Element>} Bottom cells from title section of all grids
|
1229
|
+
*/
|
1230
|
+
RowFilteringPlugin.prototype._getBottomTitleCells = function(colIndex) {
|
1231
|
+
var cells = [];
|
1232
|
+
for(let i = this._hosts.length; --i >= 0;) {
|
1233
|
+
let host = this._hosts[i];
|
1234
|
+
let tsect = host.getSection("title");
|
1235
|
+
if(tsect) {
|
1236
|
+
let rowCount = tsect.getRowCount();
|
1237
|
+
let cell = tsect.getCell(colIndex, rowCount - 1, true); // Get bottom cell
|
1238
|
+
if(cell) {
|
1239
|
+
cells.push(cell);
|
1240
|
+
}
|
1241
|
+
}
|
1242
|
+
}
|
1243
|
+
return cells;
|
1244
|
+
};
|
1245
|
+
/** @public
|
1246
|
+
* @param {number} colIndex
|
1247
|
+
* @return {Array.<Element>} icons
|
1248
|
+
*/
|
1249
|
+
RowFilteringPlugin.prototype.getColumnFilterIcons = function(colIndex) {
|
1250
|
+
let icons = [];
|
1251
|
+
let cells = this._getBottomTitleCells(colIndex);
|
1252
|
+
let len = cells.length;
|
1253
|
+
for(let i = 0; i < len; ++i) {
|
1254
|
+
let cell = cells[i];
|
1255
|
+
if(cell._filterIcon) {
|
1256
|
+
icons.push(cell._filterIcon);
|
1257
|
+
}
|
1258
|
+
}
|
1259
|
+
return icons;
|
1260
|
+
};
|
1261
|
+
/** Change specified filter icon state regardless of existing filter in the column. This method does NOT change the visibility of the icon.
|
1262
|
+
* @public
|
1263
|
+
* @param {number} colIndex
|
1264
|
+
* @param {boolean} active
|
1265
|
+
*/
|
1266
|
+
RowFilteringPlugin.prototype.setColumnFilterIconState = function(colIndex, active) {
|
1267
|
+
let cells = this._getBottomTitleCells(colIndex);
|
1268
|
+
let len = cells.length;
|
1269
|
+
for(let i = 0; i < len; ++i) {
|
1270
|
+
let cell = cells[i];
|
1271
|
+
if(cell._filterIcon) {
|
1272
|
+
cell.enableClass("active-filter", active);
|
1273
|
+
}
|
1274
|
+
}
|
1275
|
+
};
|
1276
|
+
/** @public
|
1277
|
+
* @param {number} colIndex
|
1278
|
+
* @returns {boolean} active
|
1279
|
+
*/
|
1280
|
+
RowFilteringPlugin.prototype.getColumnFilterIconState = function(colIndex) {
|
1281
|
+
let cells = this._getBottomTitleCells(colIndex);
|
1282
|
+
let len = cells.length;
|
1283
|
+
for(let i = 0; i < len; ++i) {
|
1284
|
+
let cell = cells[i];
|
1285
|
+
if(cell._filterIcon) {
|
1286
|
+
if(cell.hasClass("active-filter")) {
|
1287
|
+
return true;
|
1288
|
+
}
|
1289
|
+
}
|
1290
|
+
}
|
1291
|
+
return false;
|
1292
|
+
};
|
1293
|
+
/** @public */
|
1294
|
+
RowFilteringPlugin.prototype.updateAllColumnIcons = function() {
|
1295
|
+
if(this._uiTimerId) {
|
1296
|
+
clearTimeout(this._uiTimerId);
|
1297
|
+
this._uiTimerId = 0;
|
1298
|
+
}
|
1299
|
+
this._updateAllColumnIcons();
|
1300
|
+
};
|
1301
|
+
|
1302
|
+
/** Specify a list of data views to be filtered, excluding default data views used by UI. <br>
|
1303
|
+
* This is useful when multiple shared or nested data views are employed.
|
1304
|
+
* @public
|
1305
|
+
* @param {Object} dv DataView
|
1306
|
+
*/
|
1307
|
+
RowFilteringPlugin.prototype.addDataView = function(dv) {
|
1308
|
+
let at = this._dvs.indexOf(dv);
|
1309
|
+
if(at < 0) {
|
1310
|
+
this._dvs.push(dv);
|
1311
|
+
this._requestFilterRefresh();
|
1312
|
+
}
|
1313
|
+
};
|
1314
|
+
/** @public
|
1315
|
+
* @param {Object} dv DataView
|
1316
|
+
*/
|
1317
|
+
RowFilteringPlugin.prototype.removeDataView = function(dv) {
|
1318
|
+
let at = this._dvs.indexOf(dv);
|
1319
|
+
if(at >= 0) {
|
1320
|
+
this._dvs.splice(at, 1);
|
1321
|
+
this._requestFilterRefresh(); // This could be unnecessary
|
1322
|
+
}
|
1323
|
+
};
|
1324
|
+
|
1325
|
+
|
1326
|
+
/** @private
|
1327
|
+
* @param {Object} e
|
1328
|
+
*/
|
1329
|
+
RowFilteringPlugin.prototype._onPreSectionRender = function (e) {
|
1330
|
+
if(e["sectionType"] !== "title") { return; }
|
1331
|
+
|
1332
|
+
this._setTimerForUpdatingIcons();
|
1333
|
+
};
|
1334
|
+
/** @private
|
1335
|
+
* @param {Event} e
|
1336
|
+
*/
|
1337
|
+
RowFilteringPlugin.prototype._onIconClicked = function(e) {
|
1338
|
+
let host = this._hosts[0];
|
1339
|
+
if(!host) { return; }
|
1340
|
+
|
1341
|
+
let pos = host.getRelativePosition(e);
|
1342
|
+
this.openDialog(pos.colIndex);
|
1343
|
+
|
1344
|
+
e.stopPropagation();
|
1345
|
+
e.preventDefault();
|
1346
|
+
this._dispatch("click", e);
|
1347
|
+
};
|
1348
|
+
/** @private
|
1349
|
+
* @param {string} rid
|
1350
|
+
* @param {Object} rowData
|
1351
|
+
* @return {boolean}
|
1352
|
+
*/
|
1353
|
+
RowFilteringPlugin.prototype._filterLogic = function(rid, rowData) {
|
1354
|
+
if(rowData) {
|
1355
|
+
if(this._rowGetter) {
|
1356
|
+
rowData = this._rowGetter(rowData);
|
1357
|
+
}
|
1358
|
+
if(this._preTransform) {
|
1359
|
+
rowData = this._preTransform(rowData);
|
1360
|
+
}
|
1361
|
+
let i;
|
1362
|
+
let len = this._globalFilters.length;
|
1363
|
+
for(i = 0; i < len; ++i) {
|
1364
|
+
if(!this._globalFilters[i](rowData, rid, this._globalContexts[i])) {
|
1365
|
+
return false;
|
1366
|
+
}
|
1367
|
+
}
|
1368
|
+
|
1369
|
+
len = this._activeColFilters.length;
|
1370
|
+
if(len) {
|
1371
|
+
if(this._overridingFilter) {
|
1372
|
+
let ret = this._overridingFilter(rowData, rid);
|
1373
|
+
if(ret) {
|
1374
|
+
return (ret > 0);
|
1375
|
+
}
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
if(this._rowTransform) {
|
1379
|
+
rowData = this._rowTransform(rowData);
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
for(i = 0; i < len; ++i) {
|
1383
|
+
let cfo = this._activeColFilters[i];
|
1384
|
+
let jLen = cfo._filters.length;
|
1385
|
+
for(let j = 0; j < jLen; ++j) {
|
1386
|
+
if(
|
1387
|
+
!cfo._filters[j](
|
1388
|
+
rowData,
|
1389
|
+
rid,
|
1390
|
+
cfo._context[j]
|
1391
|
+
)
|
1392
|
+
) {
|
1393
|
+
return false;
|
1394
|
+
}
|
1395
|
+
}
|
1396
|
+
}
|
1397
|
+
}
|
1398
|
+
}
|
1399
|
+
return true;
|
1400
|
+
};
|
1401
|
+
/** @private */
|
1402
|
+
RowFilteringPlugin.prototype._requestFilterRefresh = function() {
|
1403
|
+
if(!this._filterTimerId) {
|
1404
|
+
this._filterTimerId = setTimeout(this.refresh, 10);
|
1405
|
+
}
|
1406
|
+
};
|
1407
|
+
/** @private */
|
1408
|
+
RowFilteringPlugin.prototype._setTimerForUpdatingIcons = function() {
|
1409
|
+
if(this._iconActivation === "none") {
|
1410
|
+
return;
|
1411
|
+
}
|
1412
|
+
if(!this._uiTimerId) {
|
1413
|
+
this._uiTimerId = setTimeout(this._updateAllColumnIcons, 10);
|
1414
|
+
}
|
1415
|
+
};
|
1416
|
+
|
1417
|
+
/** Perform filtering with the same parameters. Do not call this method repeatedly as the operation is quite expensive.
|
1418
|
+
* @public
|
1419
|
+
* @suppress {checkTypes}
|
1420
|
+
* @fires RowFilteringPlugin#refreshed
|
1421
|
+
*/
|
1422
|
+
RowFilteringPlugin.prototype.refresh = function() {
|
1423
|
+
this._filterTimerId = 0;
|
1424
|
+
|
1425
|
+
this._activeColFilters = this._columnFilters;
|
1426
|
+
//check cstp
|
1427
|
+
let cstkp = this._getPlugin("ColumnStackPlugin");
|
1428
|
+
if(cstkp) {
|
1429
|
+
let colIndex, cfo;
|
1430
|
+
let host = this._hosts[0];
|
1431
|
+
let colCount = this._getColumnCount();
|
1432
|
+
|
1433
|
+
this._activeColFilters = [];
|
1434
|
+
for(colIndex = 0; colIndex < colCount; ++colIndex) {
|
1435
|
+
cfo = this._getColumnFilterOption(colIndex);
|
1436
|
+
if(cfo && host.getColumnVisibility(colIndex, 2)) {
|
1437
|
+
this._activeColFilters.push(cfo);
|
1438
|
+
}
|
1439
|
+
}
|
1440
|
+
}
|
1441
|
+
|
1442
|
+
let totalFilter = this._globalFilters.length + this._activeColFilters.length;
|
1443
|
+
let logic = (!this._disabled && totalFilter) ? this._filterLogic : null;
|
1444
|
+
|
1445
|
+
let dirty = 0;
|
1446
|
+
let dvs = this._getAvailableDataViews();
|
1447
|
+
for(let i = dvs.length; --i >= 0;) {
|
1448
|
+
dirty |= dvs[i].filterIn(logic);
|
1449
|
+
}
|
1450
|
+
|
1451
|
+
if(dirty) {
|
1452
|
+
this._dispatch("refreshed", {});
|
1453
|
+
}
|
1454
|
+
};
|
1455
|
+
/** @private
|
1456
|
+
* @param {number} colIndex
|
1457
|
+
*/
|
1458
|
+
RowFilteringPlugin.prototype._updateColumnIcon = function(colIndex) {
|
1459
|
+
if(!this._initializedGrid) {
|
1460
|
+
return;
|
1461
|
+
}
|
1462
|
+
|
1463
|
+
let colSettings = this._getUserColumnSettings(colIndex); // colData["rowFiltering"]
|
1464
|
+
if(colSettings.hiddenIcon) {
|
1465
|
+
return;
|
1466
|
+
}
|
1467
|
+
let cfo = this._getColumnFilterOption(colIndex); // colData["rowFiltering"]["filterOption"]
|
1468
|
+
let iconActivation = colSettings.filterIcon == false ? "none" : this._iconActivation;
|
1469
|
+
let hasFilter = cfo ? cfo._filters.length : 0;
|
1470
|
+
|
1471
|
+
for(let i = this._hosts.length; --i >= 0;) {
|
1472
|
+
let host = this._hosts[i];
|
1473
|
+
let tsect = host.getSection("title");
|
1474
|
+
if(!tsect) {
|
1475
|
+
continue;
|
1476
|
+
}
|
1477
|
+
let rCount = tsect.getRowCount();
|
1478
|
+
let cell = tsect.getCell(colIndex, rCount - 1, true); // Get bottom cell
|
1479
|
+
let column = tsect.getColumn(colIndex);
|
1480
|
+
if(!cell) {
|
1481
|
+
continue;
|
1482
|
+
}
|
1483
|
+
// HACK: Update cell padding for all type of icons (sorting and column grouping icons)
|
1484
|
+
if(cell["updatePadding"]) {
|
1485
|
+
cell["updatePadding"]();
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
let isColumnMovable = host.isColumnMovable(colIndex);
|
1489
|
+
if(isColumnMovable) {
|
1490
|
+
column.enableClass("movable", true);
|
1491
|
+
} else {
|
1492
|
+
column.enableClass("movable", false);
|
1493
|
+
}
|
1494
|
+
|
1495
|
+
let onActiveFilter = iconActivation !== "always" && iconActivation !== "onHover";
|
1496
|
+
let noFilterIcon = this._disabled || iconActivation === "none" || (onActiveFilter && !hasFilter);
|
1497
|
+
if(!noFilterIcon) {
|
1498
|
+
if(!cell._filterIcon) {
|
1499
|
+
let filterIcon;
|
1500
|
+
if(this._iconTag && this._iconTag !== "div") {
|
1501
|
+
filterIcon = document.createElement(this._iconTag);
|
1502
|
+
filterIcon.setAttribute("icon", "filter");
|
1503
|
+
} else {
|
1504
|
+
filterIcon = document.createElement("div");
|
1505
|
+
filterIcon.className = "filter-symbol icon-filter ef-icon";
|
1506
|
+
}
|
1507
|
+
filterIcon.classList.add("title-filter-icon"); // Icon reference
|
1508
|
+
filterIcon.addEventListener("click", this._onIconClicked, false);
|
1509
|
+
this._dispatch("iconCreated", {"icon": filterIcon, "colIndex": colIndex, "grid": host});
|
1510
|
+
cell.insertFloatingIcon(filterIcon, 10);
|
1511
|
+
cell._filterIcon = filterIcon;
|
1512
|
+
}
|
1513
|
+
if(this._activeIconState) {
|
1514
|
+
if(hasFilter){
|
1515
|
+
cell.enableClass("active-filter", true);
|
1516
|
+
}else{
|
1517
|
+
cell.enableClass("active-filter", false);
|
1518
|
+
}
|
1519
|
+
}
|
1520
|
+
} else {
|
1521
|
+
if(cell._filterIcon) {
|
1522
|
+
cell.removeFloatingIcon(cell._filterIcon);
|
1523
|
+
cell._filterIcon = null;
|
1524
|
+
if(this._activeIconState) {
|
1525
|
+
cell.enableClass("active-filter", false);
|
1526
|
+
}
|
1527
|
+
}
|
1528
|
+
}
|
1529
|
+
}
|
1530
|
+
};
|
1531
|
+
/** @private */
|
1532
|
+
RowFilteringPlugin.prototype._updateAllColumnIcons = function() {
|
1533
|
+
this._uiTimerId = 0;
|
1534
|
+
|
1535
|
+
let colCount = this._getColumnCount();
|
1536
|
+
for(let i = 0; i < colCount; ++i) {
|
1537
|
+
this._updateColumnIcon(i);
|
1538
|
+
}
|
1539
|
+
};
|
1540
|
+
|
1541
|
+
|
1542
|
+
/** @private
|
1543
|
+
* @return {number}
|
1544
|
+
*/
|
1545
|
+
RowFilteringPlugin.prototype._getColumnCount = function() {
|
1546
|
+
let grid = this._hosts[0];
|
1547
|
+
if(grid) {
|
1548
|
+
return grid.getColumnCount();
|
1549
|
+
}
|
1550
|
+
return 0;
|
1551
|
+
};
|
1552
|
+
|
1553
|
+
/** Update existing filter state by replacing the old one. Note that filtering will be performed asynchronously after executing this method.
|
1554
|
+
* @public
|
1555
|
+
* @param {number} colIndex
|
1556
|
+
* @param {*} ctx Context object that will be passed as the third parameter for the filter logic
|
1557
|
+
* @return {boolean} Returns true if there is any change
|
1558
|
+
*/
|
1559
|
+
RowFilteringPlugin.prototype.setColumnFilterState = function(colIndex, ctx) {
|
1560
|
+
let cfo = this._getColumnFilterOption(colIndex);
|
1561
|
+
if(cfo) {
|
1562
|
+
cfo._context[0] = ctx;
|
1563
|
+
this._requestFilterRefresh();
|
1564
|
+
return true;
|
1565
|
+
}
|
1566
|
+
return false;
|
1567
|
+
};
|
1568
|
+
/** Get the stored user context from the specified column
|
1569
|
+
* @public
|
1570
|
+
* @param {number} colIndex
|
1571
|
+
* @return {*} Context object that is passed as the third parameter for the filter logic
|
1572
|
+
*/
|
1573
|
+
RowFilteringPlugin.prototype.getColumnFilterState = function(colIndex) {
|
1574
|
+
let cfo = this._getColumnFilterOption(colIndex);
|
1575
|
+
if(cfo) {
|
1576
|
+
return cfo._context[0];
|
1577
|
+
}
|
1578
|
+
return null;
|
1579
|
+
};
|
1580
|
+
/** Deprecated in favor of getConfigObject(). Get the stored user context from all columns. The column with no filter will return null value
|
1581
|
+
* @public
|
1582
|
+
* @return {!Array} Array of context objects
|
1583
|
+
* @see {@link RowFilteringPlugin.getConfigObject}
|
1584
|
+
*/
|
1585
|
+
RowFilteringPlugin.prototype.getColumnFilterStates = function() {
|
1586
|
+
let colCount = this._hosts[0] ? this._hosts[0].getColumnCount() : 0;
|
1587
|
+
let states = new Array(colCount);
|
1588
|
+
for(let c = 0; c < colCount; ++c) {
|
1589
|
+
states[c] = this.getColumnFilterState(c);
|
1590
|
+
}
|
1591
|
+
return states;
|
1592
|
+
};
|
1593
|
+
|
1594
|
+
/** @private
|
1595
|
+
* @return {!Array.<Object>} array of DataView
|
1596
|
+
*/
|
1597
|
+
RowFilteringPlugin.prototype._getAvailableDataViews = function() {
|
1598
|
+
if(this._dvs.length) {
|
1599
|
+
return this._dvs;
|
1600
|
+
} else {
|
1601
|
+
let len = this._hosts.length;
|
1602
|
+
let ary = [];
|
1603
|
+
for(let i = 0; i < len; ++i) {
|
1604
|
+
let host = this._hosts[i];
|
1605
|
+
let dv = host.getDataSource();
|
1606
|
+
if(dv) {
|
1607
|
+
ary.push(dv);
|
1608
|
+
}
|
1609
|
+
}
|
1610
|
+
return ary;
|
1611
|
+
}
|
1612
|
+
};
|
1613
|
+
/** @private
|
1614
|
+
* @param {Object} dv DataView
|
1615
|
+
* @return {Object} DataTable
|
1616
|
+
*/
|
1617
|
+
RowFilteringPlugin.prototype._getDataTable = function(dv) {
|
1618
|
+
let dt = dv ? dv.getDataSource() : null;
|
1619
|
+
while(dt && dt.getDataSource()) {
|
1620
|
+
dt = dt.getDataSource();
|
1621
|
+
}
|
1622
|
+
return dt;
|
1623
|
+
};
|
1624
|
+
|
1625
|
+
/** @public
|
1626
|
+
* @deprecated
|
1627
|
+
* @ignore
|
1628
|
+
* @param {string} field A field name for getting raw value from row data
|
1629
|
+
* @param {Function=} formatter A formatter that takes row data, retrieves data, and modified the data for display.
|
1630
|
+
* @param {string=} fmtField A field name to be used instead of formatter for getting formatted value
|
1631
|
+
* @param {Function=} rawDataAccessor Data getter to retrieve raw value
|
1632
|
+
* @param {Function=} formattedDataAccessor Data getter to retrieve formatted value. This paramter will override formatted and fmtField parameters
|
1633
|
+
* @param {Array.<Function>=} filterFuncs
|
1634
|
+
* @param {Object=} selectedItems
|
1635
|
+
* @return {Object} Object that maps formatted value to array of raw values
|
1636
|
+
*/
|
1637
|
+
RowFilteringPlugin.prototype.getUniqueValues = function(field, formatter, fmtField, rawDataAccessor, formattedDataAccessor, filterFuncs, selectedItems) {
|
1638
|
+
let dialogConfig = {
|
1639
|
+
rawDataAccessor: rawDataAccessor,
|
1640
|
+
formattedDataAccessor: formattedDataAccessor
|
1641
|
+
};
|
1642
|
+
return this._getUniqueValues(field, dialogConfig, formatter, filterFuncs, selectedItems);
|
1643
|
+
};
|
1644
|
+
|
1645
|
+
/** @private
|
1646
|
+
* @param {*} formattedVal
|
1647
|
+
* @param {*} rawVal
|
1648
|
+
* @returns {string}
|
1649
|
+
*/
|
1650
|
+
let _valueToString = function(formattedVal, rawVal) {
|
1651
|
+
if(typeof formattedVal === "string") {
|
1652
|
+
return formattedVal;
|
1653
|
+
}
|
1654
|
+
if(formattedVal) {
|
1655
|
+
if(typeof formattedVal != "object") {
|
1656
|
+
return rawVal + "";
|
1657
|
+
} else if(formattedVal instanceof Date) {
|
1658
|
+
return formattedVal.toLocaleString("en-GB");
|
1659
|
+
} else { // Object type cannot be converted to string
|
1660
|
+
return "";
|
1661
|
+
}
|
1662
|
+
} else if(formattedVal === 0) {
|
1663
|
+
return "0";
|
1664
|
+
} else if(formattedVal === false) {
|
1665
|
+
return "false";
|
1666
|
+
}
|
1667
|
+
return "";
|
1668
|
+
};
|
1669
|
+
/** @private
|
1670
|
+
* @param {Object} selectedItems
|
1671
|
+
* @param {string} formattedVal
|
1672
|
+
* @param {Object} row
|
1673
|
+
* @param {!Array.<Function>} filterFuncs A selector function that execute on each item to determine the selection
|
1674
|
+
* @return {boolean}
|
1675
|
+
*/
|
1676
|
+
let _collectSelectedItem = function(selectedItems, formattedVal, row, filterFuncs) {
|
1677
|
+
if(filterFuncs) {
|
1678
|
+
if(!selectedItems[formattedVal]) {
|
1679
|
+
for(let i = filterFuncs.length; --i >= 0;) {
|
1680
|
+
if(!filterFuncs[i](row)) {
|
1681
|
+
return false;
|
1682
|
+
}
|
1683
|
+
}
|
1684
|
+
selectedItems[formattedVal] = true;
|
1685
|
+
return true;
|
1686
|
+
}
|
1687
|
+
}
|
1688
|
+
return false;
|
1689
|
+
};
|
1690
|
+
/** @private
|
1691
|
+
* @param {Object} uniqueValues
|
1692
|
+
* @param {string} formattedVal
|
1693
|
+
* @param {*} rawVal
|
1694
|
+
*/
|
1695
|
+
let _collectUniqueValue = function(uniqueValues, formattedVal, rawVal) {
|
1696
|
+
let rawValues = uniqueValues[formattedVal];
|
1697
|
+
if(rawValues) {
|
1698
|
+
if(rawValues.indexOf(rawVal) < 0) { // Check for unique raw values
|
1699
|
+
rawValues.push(rawVal);
|
1700
|
+
}
|
1701
|
+
} else { // The first unique formatted value detected
|
1702
|
+
uniqueValues[formattedVal] = [rawVal];
|
1703
|
+
}
|
1704
|
+
};
|
1705
|
+
|
1706
|
+
/** @private
|
1707
|
+
* @param {Object} row
|
1708
|
+
* @param {Array.<Function>} filterFuncs
|
1709
|
+
* @return {boolean}
|
1710
|
+
*/
|
1711
|
+
let isFilteredOutRow = function(row, filterFuncs) {
|
1712
|
+
let len = filterFuncs.length;
|
1713
|
+
if(len) {
|
1714
|
+
for(let i = 0; i < len; i++) {
|
1715
|
+
if(!filterFuncs[i](row)) {
|
1716
|
+
return true;
|
1717
|
+
}
|
1718
|
+
}
|
1719
|
+
}
|
1720
|
+
return false;
|
1721
|
+
};
|
1722
|
+
|
1723
|
+
/** @private
|
1724
|
+
* @param {string} field A field name for getting raw value from row data
|
1725
|
+
* @param {!Object} dialogConfig
|
1726
|
+
* @param {Function} formatter A formatter that takes row data, retrieves data, and modified the data for display.
|
1727
|
+
* @param {Array.<Function>} filterFuncs A selector function that execute on each item to determine the selection
|
1728
|
+
* @param {Object} selectedItems
|
1729
|
+
* @return {Object} Object that maps formatted value to array of raw values
|
1730
|
+
*/
|
1731
|
+
RowFilteringPlugin.prototype._getUniqueValues = function(field, dialogConfig, formatter, filterFuncs, selectedItems) {
|
1732
|
+
if(!field) {
|
1733
|
+
return null;
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
let rawDataAccessor = (dialogConfig.rawDataAccessor || null);
|
1737
|
+
let formattedDataAccessor = (dialogConfig.formattedDataAccessor || null);
|
1738
|
+
let userItemList = dialogConfig.itemList;
|
1739
|
+
|
1740
|
+
let uniqueValues = {};
|
1741
|
+
let formattedVal = null;
|
1742
|
+
let rawVal = null;
|
1743
|
+
let blankAtLeastOne = false;
|
1744
|
+
if(!Array.isArray(userItemList)) {
|
1745
|
+
userItemList = null;
|
1746
|
+
let excludedMap = {};
|
1747
|
+
excludedMap[field] = true;
|
1748
|
+
let funcs = this._getAllColumnFilters(excludedMap);
|
1749
|
+
let showOnlyFilteredItems = dialogConfig.showOnlyFilteredItems;
|
1750
|
+
let dvs = this._getAvailableDataViews();
|
1751
|
+
let dts = dvs.map(this._getDataTable);
|
1752
|
+
let tblCount = dts.length;
|
1753
|
+
for(let t = 0; t < tblCount; ++t) {
|
1754
|
+
let rows = dts[t].getAllRowData();
|
1755
|
+
let rowCount = rows.length;
|
1756
|
+
for(let r = 0; r < rowCount; ++r) {
|
1757
|
+
let row = rows[r];
|
1758
|
+
if(this._rowGetter) {
|
1759
|
+
row = this._rowGetter(row);
|
1760
|
+
}
|
1761
|
+
if(this._rowTransform) {
|
1762
|
+
row = this._rowTransform(row);
|
1763
|
+
}
|
1764
|
+
if(showOnlyFilteredItems && isFilteredOutRow(row, funcs)) {
|
1765
|
+
continue;
|
1766
|
+
}
|
1767
|
+
let fieldVal = row[field];
|
1768
|
+
rawVal = fieldVal;
|
1769
|
+
if(rawDataAccessor) {
|
1770
|
+
rawVal = rawDataAccessor(rawVal);
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
if(!rawVal) { // Only valid values are accepted
|
1774
|
+
if(rawVal !== 0 && rawVal !== false) {
|
1775
|
+
if(!blankAtLeastOne && BlankValues[rawVal]) {
|
1776
|
+
blankAtLeastOne = true;
|
1777
|
+
_collectUniqueValue(uniqueValues, BLANKS, rawVal);
|
1778
|
+
}
|
1779
|
+
continue;
|
1780
|
+
}
|
1781
|
+
}
|
1782
|
+
|
1783
|
+
formattedVal = rawVal;
|
1784
|
+
if(formattedDataAccessor) {
|
1785
|
+
formattedVal = formattedDataAccessor(fieldVal); // The function takes data value
|
1786
|
+
} else if(formatter) {
|
1787
|
+
formattedVal = formatter(row); // The function takes row data
|
1788
|
+
}
|
1789
|
+
|
1790
|
+
formattedVal = _valueToString(formattedVal, rawVal);
|
1791
|
+
if(formattedVal) {
|
1792
|
+
_collectSelectedItem(selectedItems, formattedVal, row, filterFuncs);
|
1793
|
+
_collectUniqueValue(uniqueValues, formattedVal, rawVal);
|
1794
|
+
}
|
1795
|
+
}
|
1796
|
+
}
|
1797
|
+
}
|
1798
|
+
|
1799
|
+
userItemList = _arrayConcat(userItemList, dialogConfig.additionalItems);
|
1800
|
+
|
1801
|
+
let dummyRow = {};
|
1802
|
+
let userItemCount = userItemList ? userItemList.length : 0;
|
1803
|
+
for(let i = 0; i < userItemCount; ++i) {
|
1804
|
+
rawVal = dummyRow[field] = userItemList[i];
|
1805
|
+
formattedVal = rawVal;
|
1806
|
+
if(formattedDataAccessor) {
|
1807
|
+
formattedVal = formattedDataAccessor(rawVal);
|
1808
|
+
} else if(formatter) {
|
1809
|
+
formattedVal = formatter(dummyRow);
|
1810
|
+
}
|
1811
|
+
|
1812
|
+
formattedVal = _valueToString(formattedVal, rawVal);
|
1813
|
+
if(formattedVal) {
|
1814
|
+
_collectSelectedItem(selectedItems, formattedVal, dummyRow, filterFuncs);
|
1815
|
+
_collectUniqueValue(uniqueValues, formattedVal, rawVal);
|
1816
|
+
}
|
1817
|
+
}
|
1818
|
+
return uniqueValues;
|
1819
|
+
};
|
1820
|
+
|
1821
|
+
|
1822
|
+
/** @private
|
1823
|
+
* @function
|
1824
|
+
* @returns {Element}
|
1825
|
+
*/
|
1826
|
+
RowFilteringPlugin._createDialog = function() {
|
1827
|
+
let tag = RowFilteringPlugin._dialogTagName;
|
1828
|
+
if(tag == null) {
|
1829
|
+
let dialogVersion = ElfUtil.hasComponent("filter-dialog"); // WARNING: this cannot detect version 2 or less
|
1830
|
+
if(dialogVersion) {
|
1831
|
+
RowFilteringPlugin._dialogTagName = (dialogVersion >= 3) ? "filter-dialog" : "tr-grid-filter-dialog";
|
1832
|
+
} else {
|
1833
|
+
RowFilteringPlugin._dialogTagName = "";
|
1834
|
+
}
|
1835
|
+
tag = RowFilteringPlugin._dialogTagName;
|
1836
|
+
}
|
1837
|
+
return tag ? document.createElement(tag) : null;
|
1838
|
+
};
|
1839
|
+
/** Prepare user's array expression to be displayed in Filter Dialog. Convert date string to date object. Format raw value for text input
|
1840
|
+
* @public
|
1841
|
+
* @ignore
|
1842
|
+
* @function
|
1843
|
+
* @param {Array} exp
|
1844
|
+
* @param {string} field
|
1845
|
+
* @param {Function} formatter
|
1846
|
+
* @returns {Array}
|
1847
|
+
*/
|
1848
|
+
RowFilteringPlugin._formatArrayExpression = function(exp, field, formatter) {
|
1849
|
+
if(Array.isArray(exp)) {
|
1850
|
+
let ary = exp.slice(); // Clone to avoid modifying original data
|
1851
|
+
let formattedVal = ary[1];
|
1852
|
+
let val = stringToDateObject(formattedVal);
|
1853
|
+
if(val !== formattedVal) {
|
1854
|
+
ary.rawValue = val;
|
1855
|
+
ary.formattedValue = formattedVal;
|
1856
|
+
}
|
1857
|
+
if(typeof val !== "string" && val != null) {
|
1858
|
+
if(field && formatter) {
|
1859
|
+
let dummyRow = {};
|
1860
|
+
dummyRow[field] = val;
|
1861
|
+
formattedVal = formatter(dummyRow);
|
1862
|
+
} else {
|
1863
|
+
formattedVal = _valueToString(val, val);
|
1864
|
+
}
|
1865
|
+
if(formattedVal) {
|
1866
|
+
ary.rawValue = val;
|
1867
|
+
ary.formattedValue = formattedVal;
|
1868
|
+
ary[1] = formattedVal;
|
1869
|
+
} else {
|
1870
|
+
ary[1] = val;
|
1871
|
+
}
|
1872
|
+
|
1873
|
+
}
|
1874
|
+
return ary;
|
1875
|
+
}
|
1876
|
+
return null;
|
1877
|
+
};
|
1878
|
+
/** For mocking dialog instance
|
1879
|
+
* @public
|
1880
|
+
* @ignore
|
1881
|
+
* @param {*} dialog
|
1882
|
+
*/
|
1883
|
+
RowFilteringPlugin.prototype.setDialog = function(dialog) {
|
1884
|
+
this._filterDialog = dialog;
|
1885
|
+
};
|
1886
|
+
/** @public
|
1887
|
+
* @param {number} colIndex
|
1888
|
+
* @param {RowFilteringPlugin~FilterDialogOptions=} runtimeDialogOptions
|
1889
|
+
*/
|
1890
|
+
RowFilteringPlugin.prototype.openDialog = function(colIndex, runtimeDialogOptions) {
|
1891
|
+
let stp = this._getPlugin("SortableTitlePlugin");
|
1892
|
+
|
1893
|
+
if(!this._filterDialog || !this._dialogInitialized) {
|
1894
|
+
if(!this._filterDialog) {
|
1895
|
+
this._filterDialog = RowFilteringPlugin._createDialog();
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
if(this._filterDialog) {
|
1899
|
+
this._dialogInitialized = true;
|
1900
|
+
if(!stp) {
|
1901
|
+
this._filterDialog.hideSortUI();
|
1902
|
+
} else {
|
1903
|
+
this._filterDialog.addEventListener("sortChanged", this._onDialogSortChanged);
|
1904
|
+
}
|
1905
|
+
this._filterDialog.addEventListener("filterChanged", this._onDialogFilterChanged);
|
1906
|
+
this._filterDialog.addEventListener("confirm", this._onDialogClosed);
|
1907
|
+
this._filterDialog.addEventListener("cancel", this._onDialogClosed);
|
1908
|
+
}
|
1909
|
+
}
|
1910
|
+
|
1911
|
+
if(!this._filterDialog) {
|
1912
|
+
console.log("Filter dialog does not exist");
|
1913
|
+
return;
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
if(this._filterDialog.isShown) {
|
1917
|
+
this._filterDialog.hide(); // Hide previously opened dialog
|
1918
|
+
if(this._filterDialog._colIndex === colIndex) { // The dialog is already openned
|
1919
|
+
return; // Toggle open state
|
1920
|
+
}
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
let host = this._hosts[0];
|
1924
|
+
if(!host) {
|
1925
|
+
return;
|
1926
|
+
}
|
1927
|
+
|
1928
|
+
// Find target cell for positioning filter dialog
|
1929
|
+
let tsect = host.getSection("title");
|
1930
|
+
if(!tsect) {
|
1931
|
+
return;
|
1932
|
+
}
|
1933
|
+
let rCount = tsect.getRowCount();
|
1934
|
+
let cell = tsect.getCell(colIndex, rCount - 1, true); // Get bottom cell
|
1935
|
+
if(!cell || !cell.getElement()) {
|
1936
|
+
return;
|
1937
|
+
}
|
1938
|
+
|
1939
|
+
// TODO: Handle newly inserted/added columns
|
1940
|
+
let field = this._getField(colIndex);
|
1941
|
+
if(!field) {
|
1942
|
+
return; // The specified column has no field
|
1943
|
+
}
|
1944
|
+
|
1945
|
+
if(this.hasListener("beforeDialogOpened")) {
|
1946
|
+
let arg = {
|
1947
|
+
colIndex: colIndex,
|
1948
|
+
field: field,
|
1949
|
+
grid: host
|
1950
|
+
};
|
1951
|
+
if(runtimeDialogOptions) {
|
1952
|
+
arg["dialogOptions"] = runtimeDialogOptions;
|
1953
|
+
}
|
1954
|
+
this._dispatch("beforeDialogOpened", arg);
|
1955
|
+
if(arg["cancel"]) {
|
1956
|
+
return;
|
1957
|
+
}
|
1958
|
+
if(arg["dialogOptions"]) {
|
1959
|
+
runtimeDialogOptions = arg["dialogOptions"];
|
1960
|
+
}
|
1961
|
+
}
|
1962
|
+
|
1963
|
+
if(typeof runtimeDialogOptions !== "object") {
|
1964
|
+
runtimeDialogOptions = null;
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
if(stp) {
|
1968
|
+
this._filterDialog.setSortState(stp.getSortOrder(colIndex)); // This is for ELF v3
|
1969
|
+
}
|
1970
|
+
|
1971
|
+
// Setting up dialog configuration
|
1972
|
+
let colData = host.getColumnData(colIndex);
|
1973
|
+
let formatOptions = colData.formatOptions;
|
1974
|
+
let useUTCTime = false;
|
1975
|
+
if(formatOptions){
|
1976
|
+
if(formatOptions.formatType){
|
1977
|
+
useUTCTime = true;
|
1978
|
+
if(formatOptions.useUTCTime != null){
|
1979
|
+
useUTCTime = formatOptions.useUTCTime;
|
1980
|
+
}
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
|
1984
|
+
let dialogConfig = { // default config
|
1985
|
+
sortUI: true,
|
1986
|
+
filterUI: true,
|
1987
|
+
advancedFilter: true,
|
1988
|
+
compactMode: false,
|
1989
|
+
fieldDataType: "",
|
1990
|
+
dateTimeFormat: "dd-MM-yy",
|
1991
|
+
lang: "",
|
1992
|
+
rawDataAccessor: null,
|
1993
|
+
formattedDataAccessor: null,
|
1994
|
+
sortLogic: null,
|
1995
|
+
blankValues: false,
|
1996
|
+
blankValuesChecked: false,
|
1997
|
+
showOnlyFilteredItems: false
|
1998
|
+
};
|
1999
|
+
|
2000
|
+
let columnDialogOptions = null;
|
2001
|
+
let colSettings = this._getUserColumnSettings(colIndex); // colData["rowFiltering"]
|
2002
|
+
if(colSettings.filterDialogOptions) {
|
2003
|
+
columnDialogOptions = colSettings.filterDialogOptions;
|
2004
|
+
}
|
2005
|
+
if(colSettings.fieldDataType){
|
2006
|
+
// TODO: Use data type from Composite Grid (getColumnDataType) or Realtime Grid (getDataType) instead
|
2007
|
+
if(!columnDialogOptions) {
|
2008
|
+
columnDialogOptions = {};
|
2009
|
+
}
|
2010
|
+
columnDialogOptions.fieldDataType = colSettings.fieldDataType;
|
2011
|
+
}
|
2012
|
+
|
2013
|
+
RowFilteringPlugin._overrideConfig(dialogConfig, this._dialogOptions);
|
2014
|
+
RowFilteringPlugin._overrideConfig(dialogConfig, columnDialogOptions);
|
2015
|
+
RowFilteringPlugin._overrideConfig(dialogConfig, runtimeDialogOptions);
|
2016
|
+
|
2017
|
+
// cfo is required for storing unique entries in the dialog, even though no filter is active
|
2018
|
+
// TODO: move rawDataAccessor and other settings to colSettings
|
2019
|
+
let cfo = this._initColumnFilterOption(colIndex); // colData["rowFiltering"]["filterOption"]
|
2020
|
+
cfo._rawDataAccessor = (dialogConfig.rawDataAccessor || null);
|
2021
|
+
cfo._formattedDataAccessor = (dialogConfig.formattedDataAccessor || null);
|
2022
|
+
let sortLogic = dialogConfig.sortLogic || null;
|
2023
|
+
|
2024
|
+
// Populate data for filter dialog based on existing states
|
2025
|
+
let formatter = this._getFormatter(colIndex);
|
2026
|
+
let condition2D = null;
|
2027
|
+
let filterMode = ""; // default
|
2028
|
+
let filterFuncs = null;
|
2029
|
+
let exp = colSettings.expression;
|
2030
|
+
if(exp) {
|
2031
|
+
let userInputs = [];
|
2032
|
+
if(cfo._filters && cfo._filters.length) {
|
2033
|
+
filterFuncs = cfo._filters;
|
2034
|
+
}
|
2035
|
+
if(Array.isArray(exp)) {
|
2036
|
+
if(exp.length) {
|
2037
|
+
condition2D = Array.isArray(exp[0]) ? exp.slice() : [exp]; // Guaranteed condition2D to be a 2D array
|
2038
|
+
let conditionAry = null;
|
2039
|
+
conditionAry = RowFilteringPlugin._formatArrayExpression(condition2D[0], field, formatter);
|
2040
|
+
condition2D[0] = conditionAry;
|
2041
|
+
if(conditionAry) {
|
2042
|
+
_pushRawValue(userInputs, conditionAry.rawValue != null ? conditionAry.rawValue : conditionAry[1]);
|
2043
|
+
}
|
2044
|
+
|
2045
|
+
conditionAry = RowFilteringPlugin._formatArrayExpression(condition2D[1], field, formatter);
|
2046
|
+
condition2D[1] = conditionAry;
|
2047
|
+
if(conditionAry) {
|
2048
|
+
_pushRawValue(userInputs, conditionAry.rawValue != null ? conditionAry.rawValue : conditionAry[1]);
|
2049
|
+
}
|
2050
|
+
|
2051
|
+
filterMode = "advanced";
|
2052
|
+
}
|
2053
|
+
} else if(typeof exp === "function" || typeof exp === "string" || typeof exp === "object") {
|
2054
|
+
if(typeof exp === "object" && !dialogConfig.showOnlyFilteredItems) {
|
2055
|
+
for(let expKey in exp) {
|
2056
|
+
_pushRawValue(userInputs, expKey, exp[expKey]);
|
2057
|
+
}
|
2058
|
+
}
|
2059
|
+
}
|
2060
|
+
dialogConfig.additionalItems = _arrayConcat(dialogConfig.additionalItems, userInputs);
|
2061
|
+
}
|
2062
|
+
|
2063
|
+
let selectedItems = {};
|
2064
|
+
let uniqueValues = cfo.uniqueValues = this._getUniqueValues(
|
2065
|
+
field,
|
2066
|
+
dialogConfig,
|
2067
|
+
formatter,
|
2068
|
+
filterFuncs,
|
2069
|
+
selectedItems
|
2070
|
+
);
|
2071
|
+
|
2072
|
+
if(dialogConfig.blankValues) {
|
2073
|
+
let dunmmySelectItem = {};
|
2074
|
+
let blkVals = ["", null, undefined, NaN]; // eslint-disable-line
|
2075
|
+
let dummyRow = {};
|
2076
|
+
for(let i = 0; i < blkVals.length; i++) {
|
2077
|
+
let blkVal = blkVals[i];
|
2078
|
+
dummyRow[field] = blkVal;
|
2079
|
+
|
2080
|
+
if(_collectSelectedItem(dunmmySelectItem, BLANKS, dummyRow, filterFuncs)) {
|
2081
|
+
dialogConfig.blankValuesChecked = true;
|
2082
|
+
break;
|
2083
|
+
}
|
2084
|
+
}
|
2085
|
+
if(!dialogConfig.blankValuesChecked && !uniqueValues[BLANKS]) {
|
2086
|
+
dialogConfig.blankValues = false; // doesn't display a blank item when the checkbox for it is unchecked and there's no blank value at least one item.
|
2087
|
+
}
|
2088
|
+
}
|
2089
|
+
delete uniqueValues[BLANKS];
|
2090
|
+
|
2091
|
+
let keys = Object.keys(uniqueValues);
|
2092
|
+
if(sortLogic) {
|
2093
|
+
keys.sort(function (a, b) {
|
2094
|
+
let rawValueA = uniqueValues[a][0];
|
2095
|
+
let rawValueB = uniqueValues[b][0];
|
2096
|
+
return sortLogic(rawValueA, rawValueB); // Compare with rawValue
|
2097
|
+
});
|
2098
|
+
}
|
2099
|
+
|
2100
|
+
let items = this._toListScheme({
|
2101
|
+
dialogConfig: dialogConfig,
|
2102
|
+
keys: keys,
|
2103
|
+
selectedItems: selectedItems
|
2104
|
+
});
|
2105
|
+
|
2106
|
+
// Adding inputs from conditions to uniqueValues for mapping back from the dialog
|
2107
|
+
if(condition2D) {
|
2108
|
+
let cond = condition2D[0];
|
2109
|
+
if(cond && cond.formattedValue) {
|
2110
|
+
if(!uniqueValues[cond.formattedValue]) {
|
2111
|
+
uniqueValues[cond.formattedValue] = [cond.rawValue];
|
2112
|
+
}
|
2113
|
+
}
|
2114
|
+
cond = condition2D[1];
|
2115
|
+
if(cond && cond.formattedValue) {
|
2116
|
+
if(!uniqueValues[cond.formattedValue]) {
|
2117
|
+
uniqueValues[cond.formattedValue] = [cond.rawValue];
|
2118
|
+
}
|
2119
|
+
}
|
2120
|
+
}
|
2121
|
+
// Initialize dialog
|
2122
|
+
if(this._filterDialog.init) { // TODO: support initiailization in v1
|
2123
|
+
this._filterDialog.init(dialogConfig);
|
2124
|
+
}
|
2125
|
+
|
2126
|
+
// TODO: Move all settings to configuration object
|
2127
|
+
this._filterDialog.useUTCTime = useUTCTime;
|
2128
|
+
this._filterDialog.target = cell.getElement();
|
2129
|
+
this._filterDialog._colIndex = colIndex;
|
2130
|
+
this._filterDialog.data = items; // TODO: Move all settings to configuration object
|
2131
|
+
this._filterDialog.filterMode = filterMode;
|
2132
|
+
this._filterDialog.conditions = condition2D;
|
2133
|
+
this._filterDialog.show();
|
2134
|
+
};
|
2135
|
+
/** @private
|
2136
|
+
* @function
|
2137
|
+
* @param {Object} config
|
2138
|
+
* @param {RowFilteringPlugin~FilterDialogOptions=} userConfig
|
2139
|
+
*/
|
2140
|
+
RowFilteringPlugin._overrideConfig = function(config, userConfig) {
|
2141
|
+
if(!userConfig) {
|
2142
|
+
return;
|
2143
|
+
}
|
2144
|
+
|
2145
|
+
let sortUI = userConfig["sortUI"];
|
2146
|
+
if(sortUI != null) {
|
2147
|
+
config.sortUI = sortUI;
|
2148
|
+
}
|
2149
|
+
|
2150
|
+
let filterUI = userConfig["filterUI"];
|
2151
|
+
if(filterUI != null) {
|
2152
|
+
config.filterUI = filterUI;
|
2153
|
+
}
|
2154
|
+
|
2155
|
+
let advancedFilter = userConfig["advancedFilter"];
|
2156
|
+
if (advancedFilter != null) {
|
2157
|
+
config.advancedFilter = advancedFilter;
|
2158
|
+
}
|
2159
|
+
|
2160
|
+
let dateTimeFormat = userConfig["dateTimeFormat"];
|
2161
|
+
if (dateTimeFormat != null) {
|
2162
|
+
config.dateTimeFormat = dateTimeFormat;
|
2163
|
+
}
|
2164
|
+
|
2165
|
+
let compactMode = userConfig["compactMode"];
|
2166
|
+
if (compactMode != null) {
|
2167
|
+
config.compactMode = compactMode;
|
2168
|
+
}
|
2169
|
+
|
2170
|
+
let fieldDataType = userConfig["fieldDataType"];
|
2171
|
+
if(fieldDataType != null) {
|
2172
|
+
config.fieldDataType = fieldDataType;
|
2173
|
+
}
|
2174
|
+
|
2175
|
+
let lang = userConfig["lang"];
|
2176
|
+
if(lang != null) {
|
2177
|
+
config.lang = lang;
|
2178
|
+
}
|
2179
|
+
|
2180
|
+
let showOnlyFilteredItems = userConfig["showOnlyFilteredItems"];
|
2181
|
+
if(showOnlyFilteredItems != null) {
|
2182
|
+
config.showOnlyFilteredItems = showOnlyFilteredItems;
|
2183
|
+
}
|
2184
|
+
|
2185
|
+
let rawDataAccessor = userConfig["rawDataAccessor"];
|
2186
|
+
if(typeof rawDataAccessor === "function" || rawDataAccessor === null) { // Allow null value
|
2187
|
+
config.rawDataAccessor = rawDataAccessor;
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
let formattedDataAccessor = userConfig["formattedDataAccessor"];
|
2191
|
+
if(typeof formattedDataAccessor === "function" || formattedDataAccessor === null) { // Allow null value
|
2192
|
+
config.formattedDataAccessor = formattedDataAccessor;
|
2193
|
+
}
|
2194
|
+
|
2195
|
+
let sortLogic = userConfig["sortLogic"];
|
2196
|
+
if(typeof sortLogic === "function" || sortLogic === null) { // Allow null value
|
2197
|
+
config.sortLogic = sortLogic;
|
2198
|
+
}
|
2199
|
+
|
2200
|
+
let groupCriteria = userConfig["groupCriteria"];
|
2201
|
+
if(typeof groupCriteria === "function" || groupCriteria === null) { // Allow null value
|
2202
|
+
config.groupCriteria = groupCriteria;
|
2203
|
+
}
|
2204
|
+
|
2205
|
+
let groupSortLogic = userConfig["groupSortLogic"];
|
2206
|
+
if(typeof groupSortLogic === "function" || groupSortLogic === null) { // Allow null value
|
2207
|
+
config.groupSortLogic = groupSortLogic;
|
2208
|
+
}
|
2209
|
+
|
2210
|
+
let itemList = userConfig["itemList"];
|
2211
|
+
if(itemList != null) {
|
2212
|
+
config.itemList = itemList;
|
2213
|
+
}
|
2214
|
+
|
2215
|
+
let additionalItems = userConfig["additionalItems"];
|
2216
|
+
if(additionalItems != null) {
|
2217
|
+
config.additionalItems = additionalItems;
|
2218
|
+
}
|
2219
|
+
let blankValues = userConfig["blankValues"];
|
2220
|
+
if(blankValues) {
|
2221
|
+
if(typeof blankValues === "string") {
|
2222
|
+
config.blankValues = blankValues;
|
2223
|
+
} else {
|
2224
|
+
config.blankValues = BLANKS;
|
2225
|
+
}
|
2226
|
+
}
|
2227
|
+
};
|
2228
|
+
|
2229
|
+
/** @private
|
2230
|
+
* @param {Object} listObj
|
2231
|
+
* @return {Array<Object>}
|
2232
|
+
*/
|
2233
|
+
RowFilteringPlugin.prototype._toListScheme = function(listObj) {
|
2234
|
+
let dialogConfig = listObj.dialogConfig;
|
2235
|
+
let keys = listObj.keys;
|
2236
|
+
let selectedItems = listObj.selectedItems;
|
2237
|
+
|
2238
|
+
let groupCriteria = dialogConfig.groupCriteria;
|
2239
|
+
let items = keys;
|
2240
|
+
let groupMap = {};
|
2241
|
+
if(groupCriteria) {
|
2242
|
+
for (let idx = 0; idx < items.length; idx++) {
|
2243
|
+
let formattedVal = items[idx];
|
2244
|
+
let item = {
|
2245
|
+
id: idx,
|
2246
|
+
label: formattedVal,
|
2247
|
+
title: formattedVal, // Backward compatibility
|
2248
|
+
nodes: [],
|
2249
|
+
checked: selectedItems[formattedVal] ? true : false,
|
2250
|
+
group: groupCriteria(formattedVal) || null // no group will be null map
|
2251
|
+
};
|
2252
|
+
if(!groupMap[item.group]) {
|
2253
|
+
groupMap[item.group] = [];
|
2254
|
+
}
|
2255
|
+
groupMap[item.group].push(item);
|
2256
|
+
}
|
2257
|
+
let groupOrdered = Object.keys(groupMap);
|
2258
|
+
let groupSortLogic = dialogConfig.groupSortLogic;
|
2259
|
+
if(groupSortLogic) {
|
2260
|
+
groupOrdered = groupOrdered.sort(groupSortLogic);
|
2261
|
+
}
|
2262
|
+
let sortedGroupItems = [];
|
2263
|
+
for (let i = 0; i < groupOrdered.length; i++) {
|
2264
|
+
let groupName = groupOrdered[i];
|
2265
|
+
let groupAry = groupMap[groupName];
|
2266
|
+
let validGroup = groupName != "null" ? true : false;
|
2267
|
+
if(validGroup) {
|
2268
|
+
sortedGroupItems.push({
|
2269
|
+
type: "header",
|
2270
|
+
label: groupName
|
2271
|
+
});
|
2272
|
+
}
|
2273
|
+
sortedGroupItems = sortedGroupItems.concat(groupAry);
|
2274
|
+
if(validGroup) {
|
2275
|
+
sortedGroupItems.push({
|
2276
|
+
type: "divider"
|
2277
|
+
});
|
2278
|
+
}
|
2279
|
+
}
|
2280
|
+
items = sortedGroupItems;
|
2281
|
+
} else {
|
2282
|
+
items = keys.map(function(formattedVal, idx) {
|
2283
|
+
return {
|
2284
|
+
id: idx,
|
2285
|
+
label: formattedVal,
|
2286
|
+
title: formattedVal, // Backward compatibility
|
2287
|
+
nodes: [],
|
2288
|
+
checked: selectedItems[formattedVal] ? true : false
|
2289
|
+
};
|
2290
|
+
});
|
2291
|
+
}
|
2292
|
+
return items;
|
2293
|
+
};
|
2294
|
+
/** @private
|
2295
|
+
* @param {number} colIndex
|
2296
|
+
* @return {Function}
|
2297
|
+
*/
|
2298
|
+
RowFilteringPlugin.prototype._getFormatter = function(colIndex) {
|
2299
|
+
let tfp = this._getPlugin("TextFormattingPlugin");
|
2300
|
+
if(tfp) {
|
2301
|
+
let formatter = tfp.getFormatter(colIndex);
|
2302
|
+
if(formatter) {
|
2303
|
+
return formatter.format || null;
|
2304
|
+
}
|
2305
|
+
}
|
2306
|
+
return null;
|
2307
|
+
};
|
2308
|
+
/** @private
|
2309
|
+
* @return {!FilterBuilder}
|
2310
|
+
*/
|
2311
|
+
RowFilteringPlugin._getFilterBuilder = function() {
|
2312
|
+
if(!RowFilteringPlugin._filterBuilder) {
|
2313
|
+
RowFilteringPlugin._filterBuilder = new FilterBuilder();
|
2314
|
+
}
|
2315
|
+
return RowFilteringPlugin._filterBuilder;
|
2316
|
+
};
|
2317
|
+
/** @private
|
2318
|
+
* @param {Object} e
|
2319
|
+
*/
|
2320
|
+
RowFilteringPlugin.prototype._onDialogClosed = function(e) {
|
2321
|
+
if(this._hosts.length) {
|
2322
|
+
this._hosts[0].focus();
|
2323
|
+
}
|
2324
|
+
};
|
2325
|
+
|
2326
|
+
/** @private
|
2327
|
+
* @param {Object} e
|
2328
|
+
*/
|
2329
|
+
RowFilteringPlugin.prototype._onDialogFilterChanged = function(e) {
|
2330
|
+
let colIndex = this._filterDialog._colIndex;
|
2331
|
+
let cfo = this._getColumnFilterOption(colIndex);
|
2332
|
+
let uniqueValues = null;
|
2333
|
+
let rawDataAccessor = null;
|
2334
|
+
let formattedDataAccessor = null;
|
2335
|
+
let ctx = null;
|
2336
|
+
|
2337
|
+
if(cfo) {
|
2338
|
+
// TODO: Move uniqueValues out from column filter option object
|
2339
|
+
uniqueValues = cfo.uniqueValues; // Unique values have to be stored before the removal of the filter
|
2340
|
+
rawDataAccessor = cfo._rawDataAccessor;
|
2341
|
+
formattedDataAccessor = cfo._formattedDataAccessor;
|
2342
|
+
|
2343
|
+
if(rawDataAccessor || formattedDataAccessor) {
|
2344
|
+
ctx = {
|
2345
|
+
"rawDataAccessor": rawDataAccessor || null,
|
2346
|
+
"formattedDataAccessor": formattedDataAccessor || null
|
2347
|
+
};
|
2348
|
+
}
|
2349
|
+
this.removeColumnFilters(colIndex);
|
2350
|
+
} else {
|
2351
|
+
uniqueValues = e.uniqueValues || {};
|
2352
|
+
}
|
2353
|
+
|
2354
|
+
// Check inputs from advanced filter UIs
|
2355
|
+
let conditions = e.detail.conditions;
|
2356
|
+
if(Array.isArray(conditions)) { // Advanced condition filtering. Expecting 2D-Array
|
2357
|
+
// Ensure rawValue input for number field data type
|
2358
|
+
let condCount = conditions.length;
|
2359
|
+
for(let m = 0; m < condCount; ++m) {
|
2360
|
+
let cond = conditions[m];
|
2361
|
+
let opDef = FilterOperators[cond[0]];
|
2362
|
+
// string type has no need for formatted data or raw data. What is in display is the most important
|
2363
|
+
if(opDef && opDef.type !== "string") {
|
2364
|
+
let inputVal = cond[1]; // inputVal is hardcoded at index 1
|
2365
|
+
let rawValues = uniqueValues[inputVal];
|
2366
|
+
if(rawValues != null) {
|
2367
|
+
cond[1] = rawValues[0];
|
2368
|
+
}
|
2369
|
+
}
|
2370
|
+
}
|
2371
|
+
|
2372
|
+
if(ctx) {
|
2373
|
+
ctx["_autoGenerated"] = true;
|
2374
|
+
}
|
2375
|
+
this.addColumnFilter(colIndex, conditions, ctx);
|
2376
|
+
return;
|
2377
|
+
}
|
2378
|
+
|
2379
|
+
// Check input from free text input
|
2380
|
+
let selVal = e.detail.value;
|
2381
|
+
let selAry = null;
|
2382
|
+
if(selVal) {
|
2383
|
+
if(typeof selVal === "string") { // Custom filter mode (free style text).
|
2384
|
+
// WARNING: Free style text is no longer available anymore from the newer dialog
|
2385
|
+
this.addColumnFilter(colIndex, selVal);
|
2386
|
+
return;
|
2387
|
+
} else {
|
2388
|
+
selAry = /** @type{Array} */(selVal); // Expecting Array of object
|
2389
|
+
}
|
2390
|
+
}
|
2391
|
+
|
2392
|
+
let selCount = selAry ? selAry.length : 0;
|
2393
|
+
if(!selCount) { return; }
|
2394
|
+
|
2395
|
+
// The given input is from simple text filter selector
|
2396
|
+
// Validate if the input is correct and prepare selected items for building filter
|
2397
|
+
let itemMap = {};
|
2398
|
+
let selectedItems = {};
|
2399
|
+
let atLeastOne = false;
|
2400
|
+
for(let i = 0; i < selCount; ++i) {
|
2401
|
+
let formattedVal = selAry[i].label || selAry[i].title; // title is defined by the multi-select element
|
2402
|
+
// let selIdx = selAry[i].index; // index cannot be used due to filtering
|
2403
|
+
if(selAry[i].value === BLANKS) {
|
2404
|
+
if(!ctx) {
|
2405
|
+
ctx = {};
|
2406
|
+
}
|
2407
|
+
ctx.blankValues = true;
|
2408
|
+
atLeastOne = true;
|
2409
|
+
continue;
|
2410
|
+
}
|
2411
|
+
let rawVals = uniqueValues[formattedVal];
|
2412
|
+
if(!rawVals) {
|
2413
|
+
continue;
|
2414
|
+
}
|
2415
|
+
atLeastOne = true;
|
2416
|
+
selectedItems[formattedVal] = true;
|
2417
|
+
|
2418
|
+
let jLen = rawVals.length;
|
2419
|
+
for(let j = 0; j < jLen; ++j) {
|
2420
|
+
let rawVal = rawVals[j];
|
2421
|
+
if(rawVal) {
|
2422
|
+
itemMap[rawVal] = (rawVal instanceof Date) ? rawVal.getTime() : rawVal;
|
2423
|
+
} else if(rawVal === 0) {
|
2424
|
+
itemMap["0"] = true;
|
2425
|
+
} else if(rawVal === false) {
|
2426
|
+
itemMap["false"] = true;
|
2427
|
+
}
|
2428
|
+
}
|
2429
|
+
}
|
2430
|
+
if(atLeastOne) {
|
2431
|
+
this.addColumnFilter(colIndex, itemMap, ctx);
|
2432
|
+
}
|
2433
|
+
this._dispatch("dialogCommitted", {
|
2434
|
+
"value": e.detail.value,
|
2435
|
+
"fieldDataType": e.detail.fieldDataType,
|
2436
|
+
"colIndex": colIndex
|
2437
|
+
});
|
2438
|
+
};
|
2439
|
+
|
2440
|
+
/** @private
|
2441
|
+
* @param {Object} e
|
2442
|
+
*/
|
2443
|
+
RowFilteringPlugin.prototype._onDialogSortChanged = function(e) {
|
2444
|
+
let stp = this._getPlugin("SortableTitlePlugin");
|
2445
|
+
if(stp) {
|
2446
|
+
let colIndex = this._filterDialog._colIndex;
|
2447
|
+
let eDetail = e.detail.value ? e.detail.value : e.detail;
|
2448
|
+
|
2449
|
+
if(stp.getSortOrder(colIndex) === eDetail) {
|
2450
|
+
stp.sortColumn(colIndex, "n", { "isUserAction": true });
|
2451
|
+
} else {
|
2452
|
+
stp.sortColumn(colIndex, eDetail, { "isUserAction": true });
|
2453
|
+
}
|
2454
|
+
this._dispatch("dialogCommitted", {
|
2455
|
+
"sortOrder": e.detail.value,
|
2456
|
+
"colIndex": colIndex
|
2457
|
+
});
|
2458
|
+
}
|
2459
|
+
};
|
2460
|
+
/** @private
|
2461
|
+
* @param {Object} e
|
2462
|
+
*/
|
2463
|
+
RowFilteringPlugin.prototype._onColumnAdded = function(e) {
|
2464
|
+
if(e["context"]) {
|
2465
|
+
let hasFilter = this._setColumnOptions(e["colIndex"], e["context"]);
|
2466
|
+
|
2467
|
+
if(hasFilter) {
|
2468
|
+
this._applyPendingFilter();
|
2469
|
+
}
|
2470
|
+
}
|
2471
|
+
};
|
2472
|
+
/** @private
|
2473
|
+
* @param {Object} e
|
2474
|
+
*/
|
2475
|
+
RowFilteringPlugin.prototype._onColumnRemoved = function(e) {
|
2476
|
+
let colData = /** @type{Object} */(e.columnData);
|
2477
|
+
if(!colData) { return; }
|
2478
|
+
|
2479
|
+
let crf = colData["rowFiltering"];
|
2480
|
+
let cfo = crf["filterOption"];
|
2481
|
+
if(cfo) {
|
2482
|
+
let funcIndex = this._columnFilters.indexOf(cfo);
|
2483
|
+
if(funcIndex >= 0) {
|
2484
|
+
this._columnFilters.splice(funcIndex, 1);
|
2485
|
+
}
|
2486
|
+
|
2487
|
+
this._dispatch("filterChanged", {
|
2488
|
+
"filterType": "column",
|
2489
|
+
"changeType": "remove",
|
2490
|
+
"colIndex": e.colIndex,
|
2491
|
+
"field": cfo._field || ""
|
2492
|
+
});
|
2493
|
+
|
2494
|
+
this._requestFilterRefresh();
|
2495
|
+
}
|
2496
|
+
};
|
2497
|
+
|
2498
|
+
/** the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter. A segment with no child is treated the same way as an empty segment.
|
2499
|
+
* @public
|
2500
|
+
* @param {boolean=} enabled=true
|
2501
|
+
*/
|
2502
|
+
RowFilteringPlugin.prototype.enableEmptySegmentFiltering = function (enabled) {
|
2503
|
+
let host = this._hosts[0];
|
2504
|
+
let dv = host ? host.getDataSource() : null;
|
2505
|
+
if(dv && dv.enableEmptySegmentFiltering) {
|
2506
|
+
dv.enableEmptySegmentFiltering(enabled);
|
2507
|
+
}
|
2508
|
+
};
|
2509
|
+
/** the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter.
|
2510
|
+
* @public
|
2511
|
+
* @param {boolean=} enabled=true
|
2512
|
+
*/
|
2513
|
+
RowFilteringPlugin.prototype.enableSeparatorFiltering = function (enabled) {
|
2514
|
+
let host = this._hosts[0];
|
2515
|
+
let dv = host ? host.getDataSource() : null;
|
2516
|
+
if(dv && dv.enableSeparatorFiltering) {
|
2517
|
+
dv.enableSeparatorFiltering(enabled);
|
2518
|
+
}
|
2519
|
+
};
|
2520
|
+
|
2521
|
+
/**
|
2522
|
+
* @public
|
2523
|
+
* @param {number} colIndex
|
2524
|
+
* @param {boolean=} shown
|
2525
|
+
*/
|
2526
|
+
RowFilteringPlugin.prototype.showColumnFilterIcon = function(colIndex, shown) {
|
2527
|
+
this.hideColumnFilterIcon(colIndex, shown == null ? false : !shown);
|
2528
|
+
};
|
2529
|
+
/**
|
2530
|
+
* @public
|
2531
|
+
* @param {number} colIndex
|
2532
|
+
* @param {boolean=} hidden
|
2533
|
+
*/
|
2534
|
+
RowFilteringPlugin.prototype.hideColumnFilterIcon = function(colIndex, hidden) {
|
2535
|
+
hidden = hidden != null ? !!hidden : true;
|
2536
|
+
let colSettings = this._getUserColumnSettings(colIndex);
|
2537
|
+
if(colSettings.hiddenIcon !== hidden) {
|
2538
|
+
let cssVal = hidden ? "none" : "";
|
2539
|
+
let icons = this.getColumnFilterIcons(colIndex);
|
2540
|
+
for(let i = 0; i < icons.length; i++) {
|
2541
|
+
icons[i].style.display = cssVal;
|
2542
|
+
}
|
2543
|
+
|
2544
|
+
let filterInput = this._getPlugin("FilterInputPlugin", this._hosts[0]);
|
2545
|
+
if(filterInput && filterInput.disableColumnInput) {
|
2546
|
+
filterInput.disableColumnInput(colIndex, hidden);
|
2547
|
+
}
|
2548
|
+
|
2549
|
+
colSettings.hiddenIcon = hidden;
|
2550
|
+
}
|
2551
|
+
};
|
2552
|
+
|
2553
|
+
/** @public
|
2554
|
+
* @ignore
|
2555
|
+
* @return {!Object}
|
2556
|
+
*/
|
2557
|
+
RowFilteringPlugin.prototype._getEventHandlers = function() {
|
2558
|
+
return {
|
2559
|
+
"dialogSortChanged": this._onDialogSortChanged,
|
2560
|
+
"dialogFilterChanged": this._onDialogFilterChanged,
|
2561
|
+
"dialogClosed": this._onDialogClosed
|
2562
|
+
};
|
2563
|
+
};
|
2564
|
+
|
2565
|
+
|
2566
|
+
|
2567
|
+
export default RowFilteringPlugin;
|
2568
|
+
export { RowFilteringPlugin, RowFilteringPlugin as RowFiltering, RowFilteringPlugin as RowFilteringExtension };
|