@refinitiv-ui/efx-grid 6.0.0-next.0
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-format-dialog/index.d.ts +1 -0
- package/lib/column-format-dialog/index.js +1 -0
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +64 -0
- package/lib/column-format-dialog/lib/column-format-dialog.js +2713 -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 +995 -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 +1 -0
- package/lib/column-selection-dialog/index.js +1 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +41 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +1410 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.js +19 -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 +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.js +19 -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 +189 -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 +6 -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 +6 -0
- package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +22 -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 +6 -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 +6 -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 +6 -0
- package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +1 -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 +6 -0
- package/lib/core/dist/core.css +1 -0
- package/lib/core/dist/core.js +28075 -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 +81 -0
- package/lib/core/es6/data/DataCache.js +1317 -0
- package/lib/core/es6/data/DataTable.d.ts +125 -0
- package/lib/core/es6/data/DataTable.js +1655 -0
- package/lib/core/es6/data/DataView.d.ts +280 -0
- package/lib/core/es6/data/DataView.js +3654 -0
- package/lib/core/es6/data/Segment.d.ts +38 -0
- package/lib/core/es6/data/Segment.js +193 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +58 -0
- package/lib/core/es6/data/SegmentCollection.js +431 -0
- package/lib/core/es6/grid/Core.d.ts +387 -0
- package/lib/core/es6/grid/Core.js +4939 -0
- package/lib/core/es6/grid/ILayoutGrid.d.ts +204 -0
- package/lib/core/es6/grid/ILayoutGrid.js +658 -0
- package/lib/core/es6/grid/LayoutGrid.d.ts +23 -0
- package/lib/core/es6/grid/LayoutGrid.js +2602 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +18 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +907 -0
- package/lib/core/es6/grid/components/Cell.d.ts +50 -0
- package/lib/core/es6/grid/components/Cell.js +740 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +19 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.js +123 -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 +38 -0
- package/lib/core/es6/grid/components/CellSpans.js +341 -0
- package/lib/core/es6/grid/components/Column.d.ts +22 -0
- package/lib/core/es6/grid/components/Column.js +612 -0
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +125 -0
- package/lib/core/es6/grid/components/ElementWrapper.js +714 -0
- package/lib/core/es6/grid/components/HScrollbar.d.ts +24 -0
- package/lib/core/es6/grid/components/HScrollbar.js +222 -0
- package/lib/core/es6/grid/components/Scrollbar.d.ts +61 -0
- package/lib/core/es6/grid/components/Scrollbar.js +1374 -0
- package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
- package/lib/core/es6/grid/components/StretchedCells.js +328 -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 +163 -0
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +615 -0
- package/lib/core/es6/grid/plugins/Plugin.d.ts +28 -0
- package/lib/core/es6/grid/plugins/Plugin.js +272 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +127 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1707 -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/ElementFrameWork.d.ts +18 -0
- package/lib/core/es6/grid/util/ElementFrameWork.js +227 -0
- package/lib/core/es6/grid/util/HttpRequest.d.ts +53 -0
- package/lib/core/es6/grid/util/HttpRequest.js +371 -0
- package/lib/core/es6/grid/util/PercentBar.d.ts +43 -0
- package/lib/core/es6/grid/util/PercentBar.js +390 -0
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +41 -0
- package/lib/core/es6/grid/util/PercentBarRenderer.js +316 -0
- package/lib/core/es6/grid/util/RangeBar.d.ts +25 -0
- package/lib/core/es6/grid/util/RangeBar.js +255 -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 +674 -0
- package/lib/core/es6/grid/util/SelectionList.d.ts +50 -0
- package/lib/core/es6/grid/util/SelectionList.js +422 -0
- package/lib/core/es6/grid/util/TrackLayout.d.ts +84 -0
- package/lib/core/es6/grid/util/TrackLayout.js +850 -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 +18 -0
- package/lib/core/es6/grid/util/util.js +450 -0
- package/lib/core/es6/index.d.ts +84 -0
- package/lib/core/es6/index.js +132 -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 +1 -0
- package/lib/filter-dialog/index.js +1 -0
- package/lib/filter-dialog/lib/checkbox-list.d.ts +27 -0
- package/lib/filter-dialog/lib/checkbox-list.js +336 -0
- package/lib/filter-dialog/lib/filter-dialog.d.ts +53 -0
- package/lib/filter-dialog/lib/filter-dialog.js +860 -0
- package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-de.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-en.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-ja.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh.js +37 -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 +37 -0
- package/lib/filter-dialog/themes/base.less +102 -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 +9 -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 +22 -0
- package/lib/formatters/es6/CoralButtonFormatter.js +40 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.js +45 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.js +102 -0
- package/lib/formatters/es6/CoralIconFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralIconFormatter.js +45 -0
- package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralInputFormatter.js +40 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.js +80 -0
- package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralSelectFormatter.js +66 -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 +22 -0
- package/lib/formatters/es6/EFButtonFormatter.js +40 -0
- package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFCheckboxFormatter.js +45 -0
- package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFComboBoxFormatter.js +68 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.js +55 -0
- package/lib/formatters/es6/EFIconFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFIconFormatter.js +45 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.js +40 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.js +80 -0
- package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFSelectFormatter.js +66 -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 +22 -0
- package/lib/formatters/es6/FormatterBuilder.js +334 -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 +25 -0
- package/lib/formatters/es6/SimpleTickerFormatter.js +65 -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 +30 -0
- package/lib/formatters/es6/index.d.ts +43 -0
- package/lib/formatters/es6/index.js +67 -0
- package/lib/grid/index.d.ts +1 -0
- package/lib/grid/index.js +2 -0
- package/lib/grid/lib/efx-grid.d.ts +32 -0
- package/lib/grid/lib/efx-grid.js +469 -0
- package/lib/grid/themes/base.less +134 -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 +92 -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 +102 -0
- package/lib/index.js +102 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +83 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +592 -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 +44672 -0
- package/lib/rt-grid/dist/rt-grid.min.js +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +141 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +1074 -0
- package/lib/rt-grid/es6/DataConnector.d.ts +37 -0
- package/lib/rt-grid/es6/DataConnector.js +266 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +20 -0
- package/lib/rt-grid/es6/FieldDefinition.js +418 -0
- package/lib/rt-grid/es6/Grid.d.ts +261 -0
- package/lib/rt-grid/es6/Grid.js +2893 -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 +38 -0
- package/lib/rt-grid/es6/ReferenceCounter.js +230 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +120 -0
- package/lib/rt-grid/es6/RowDefinition.js +873 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +21 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +252 -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 +67 -0
- package/lib/statistics-row/es6/StatisticsRow.js +786 -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 +45 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +431 -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 +67 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1777 -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 +69 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1476 -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 +1000 -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 +89 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +615 -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 +60 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +913 -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 +1013 -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 +70 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +928 -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 +76 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +1227 -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 +70 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +947 -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 +478 -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 +471 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +133 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +39 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.js +245 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +29 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.js +292 -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 +57 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.js +928 -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 +44 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.js +394 -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 +129 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +1977 -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 +57 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +427 -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 +801 -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 +49 -0
- package/lib/tr-grid-printer/es6/CellWriter.js +226 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +12 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.js +21 -0
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +32 -0
- package/lib/tr-grid-printer/es6/GridPrinter.js +761 -0
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +38 -0
- package/lib/tr-grid-printer/es6/PrintTrait.js +481 -0
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +54 -0
- package/lib/tr-grid-printer/es6/SectionWriter.js +205 -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/RangeBar.d.ts +39 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +353 -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 +53 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +794 -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 +118 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +1884 -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 +109 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1541 -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 +74 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.js +1202 -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 +60 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +611 -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 +77 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +574 -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 +29 -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 +136 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1128 -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 +14 -0
- package/lib/tr-grid-util/es6/Deferred.js +98 -0
- package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
- package/lib/tr-grid-util/es6/Delay.js +85 -0
- package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
- package/lib/tr-grid-util/es6/Dom.js +346 -0
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +10 -0
- package/lib/tr-grid-util/es6/ElementObserver.js +101 -0
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
- package/lib/tr-grid-util/es6/ElementWrapper.js +83 -0
- package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
- package/lib/tr-grid-util/es6/ElfDate.js +163 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +33 -0
- package/lib/tr-grid-util/es6/ElfUtil.js +458 -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 +27 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.js +169 -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 +432 -0
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +48 -0
- package/lib/tr-grid-util/es6/FilterBuilder.js +521 -0
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +41 -0
- package/lib/tr-grid-util/es6/FilterOperators.js +181 -0
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +72 -0
- package/lib/tr-grid-util/es6/GridPlugin.js +747 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
- package/lib/tr-grid-util/es6/Icon.js +61 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.js +237 -0
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +32 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +506 -0
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +83 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +471 -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 +162 -0
- package/lib/tr-grid-util/es6/Popup.d.ts +84 -0
- package/lib/tr-grid-util/es6/Popup.js +818 -0
- package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
- package/lib/tr-grid-util/es6/RangeBar.js +259 -0
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
- package/lib/tr-grid-util/es6/RequestQueue.js +239 -0
- package/lib/tr-grid-util/es6/RowPainter.d.ts +23 -0
- package/lib/tr-grid-util/es6/RowPainter.js +188 -0
- package/lib/tr-grid-util/es6/SubTable.d.ts +74 -0
- package/lib/tr-grid-util/es6/SubTable.js +558 -0
- package/lib/tr-grid-util/es6/Table.d.ts +125 -0
- package/lib/tr-grid-util/es6/Table.js +790 -0
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +18 -0
- package/lib/tr-grid-util/es6/TextHighlighter.js +273 -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 +65 -0
- package/lib/tr-grid-util/es6/Util.js +528 -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 +882 -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 +63 -0
- package/lib/tr-grid-util/es6/index.js +99 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +141 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +114 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +827 -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 +63 -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 +72 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +564 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +8 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.js +43 -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 +131 -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 +45 -0
- package/lib/types/es6/CellSelection.d.ts +67 -0
- package/lib/types/es6/Checkbox.d.ts +69 -0
- package/lib/types/es6/ColumnFitter.d.ts +56 -0
- package/lib/types/es6/ColumnFormatting.d.ts +90 -0
- package/lib/types/es6/ColumnGrouping.d.ts +60 -0
- package/lib/types/es6/ColumnResizing.d.ts +68 -0
- package/lib/types/es6/ColumnSelection.d.ts +70 -0
- package/lib/types/es6/ColumnStack.d.ts +76 -0
- package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +38 -0
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +287 -0
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +22 -0
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +44 -0
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +30 -0
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +42 -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 +70 -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 +22 -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 +23 -0
- package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/types/es6/CoralRadioButtonFormatter.d.ts +22 -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 +81 -0
- package/lib/types/es6/Core/data/DataTable.d.ts +125 -0
- package/lib/types/es6/Core/data/DataView.d.ts +280 -0
- package/lib/types/es6/Core/data/Segment.d.ts +38 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +58 -0
- package/lib/types/es6/Core/grid/Core.d.ts +387 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +204 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +23 -0
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/Cell.d.ts +50 -0
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +19 -0
- package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +38 -0
- package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +125 -0
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +24 -0
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +61 -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/DragAndDropTitlePlugin.d.ts +24 -0
- package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +28 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +127 -0
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +18 -0
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +53 -0
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +43 -0
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +41 -0
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +25 -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 +50 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +84 -0
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
- package/lib/types/es6/Core/grid/util/util.d.ts +18 -0
- package/lib/types/es6/Core/index.d.ts +84 -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 +22 -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 +23 -0
- package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFRadioButtonFormatter.d.ts +22 -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 +52 -0
- package/lib/types/es6/Extensions.d.ts +61 -0
- package/lib/types/es6/FilterInput.d.ts +57 -0
- package/lib/types/es6/FormatterBuilder.d.ts +22 -0
- package/lib/types/es6/GridFormatter.d.ts +63 -0
- package/lib/types/es6/HeatMap.d.ts +44 -0
- package/lib/types/es6/InCellEditing.d.ts +129 -0
- package/lib/types/es6/MenuEventAPI.d.ts +22 -0
- package/lib/types/es6/MenuItem.d.ts +39 -0
- package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/types/es6/Pagination.d.ts +57 -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 +29 -0
- package/lib/types/es6/RangeBar.d.ts +39 -0
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +143 -0
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +37 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +20 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +263 -0
- package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +38 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +120 -0
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +21 -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 +60 -0
- package/lib/types/es6/RowDragging.d.ts +53 -0
- package/lib/types/es6/RowFiltering.d.ts +118 -0
- package/lib/types/es6/RowGrouping.d.ts +109 -0
- package/lib/types/es6/RowSegmenting.d.ts +83 -0
- package/lib/types/es6/RowSelection.d.ts +74 -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 +25 -0
- package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/types/es6/StatisticsRow.d.ts +67 -0
- package/lib/types/es6/TextFormatter.d.ts +12 -0
- package/lib/types/es6/TextFormatting.d.ts +77 -0
- package/lib/types/es6/TitleWrap.d.ts +29 -0
- package/lib/types/es6/Zoom.d.ts +51 -0
- package/lib/types/es6/index.d.ts +76 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/versions.json +36 -0
- package/lib/window-exporter.js +13 -0
- package/lib/zoom/es6/Zoom.d.ts +51 -0
- package/lib/zoom/es6/Zoom.js +419 -0
- package/lib/zoom/es6/index.d.ts +1 -0
- package/lib/zoom/es6/index.js +1 -0
- package/package.json +42 -0
@@ -0,0 +1,1410 @@
|
|
1
|
+
import { customElement } from "@refinitiv-ui/core/decorators/custom-element.js";
|
2
|
+
import { BasicElement, html } from "@refinitiv-ui/core";
|
3
|
+
import "@refinitiv-ui/elements/button";
|
4
|
+
import "@refinitiv-ui/elements/tree";
|
5
|
+
import "@refinitiv-ui/elements/dialog";
|
6
|
+
import "@refinitiv-ui/elements/search-field";
|
7
|
+
import translation from "./locale/translation.js";
|
8
|
+
import ElementObserver from "../../tr-grid-util/es6/ElementObserver.js";
|
9
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @typedef {Object} ColumnSelectionDialog~Config
|
13
|
+
* @property {Array.<Object>} data All possible columns for selection.
|
14
|
+
* @property {Array.<Object>=} visibleItems Column list that is in existing Grid.
|
15
|
+
* @property {Array.<Object>=} defaultItems Column list that is default.
|
16
|
+
* @property {Function=} confirm Confirm event callback.
|
17
|
+
* @property {Function=} cancel Cancel event callback.
|
18
|
+
* @property {number=} excludedColumns Deprecated, Alias wigh excludedLeftColumns.
|
19
|
+
* @property {number=} excludedLeftColumns Number of columns on the left side that should be hidden from Visible Columns.
|
20
|
+
* @property {number=} excludedRightColumns Number of columns on the right side that should be hidden from Visible Columns.
|
21
|
+
* @property {number=} unmovableColumns Number of columns that is unmovable in Visible Columns.
|
22
|
+
* @property {boolean=} descriptionBox Show description box
|
23
|
+
*/
|
24
|
+
|
25
|
+
/** Insert multiple items to the given array. This is an in-place modification.
|
26
|
+
* @private
|
27
|
+
* @function
|
28
|
+
* @param {Array} ary
|
29
|
+
* @param {number} at
|
30
|
+
* @param {Array} items
|
31
|
+
* @return {Array} In-place edited array
|
32
|
+
* @example
|
33
|
+
* insertItems(["a", "b"], 1, ["c", "d"]); // ["a", "c", "d", "b"];
|
34
|
+
*/
|
35
|
+
const insertItems = function (ary, at, items) {
|
36
|
+
ary.splice.apply(ary, [at, 0].concat(items));
|
37
|
+
return ary;
|
38
|
+
};
|
39
|
+
/** Returns negative value if a < b, 0 if a === b, and positive value if a > b
|
40
|
+
* @private
|
41
|
+
* @function
|
42
|
+
* @param {number} a
|
43
|
+
* @param {number} b
|
44
|
+
* @returns {number}
|
45
|
+
*/
|
46
|
+
const numberComparer = function (a, b) {
|
47
|
+
return a - b;
|
48
|
+
};
|
49
|
+
/**
|
50
|
+
* Checks, if the given numbers have continuous number series
|
51
|
+
* @private
|
52
|
+
* @function
|
53
|
+
* @param {Array.<number>} sortedIndexes
|
54
|
+
* @return {boolean}
|
55
|
+
*/
|
56
|
+
const isContinuous = function(sortedIndexes) {
|
57
|
+
var len = sortedIndexes ? sortedIndexes.length : 0;
|
58
|
+
var val = len ? sortedIndexes[0] : 0;
|
59
|
+
for(var i = 1; i < len; ++i) {
|
60
|
+
var nextVal = sortedIndexes[i];
|
61
|
+
if(val + i !== nextVal) {
|
62
|
+
return false;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
return len > 0;
|
66
|
+
};
|
67
|
+
/** Checks if the given object has "selected" property
|
68
|
+
* @private
|
69
|
+
* @function
|
70
|
+
* @param {Object} item
|
71
|
+
* @return {boolean}
|
72
|
+
*/
|
73
|
+
const isSelectedItem = function(item) {
|
74
|
+
return (item && item.selected) ? true : false;
|
75
|
+
};
|
76
|
+
/** Checks if the given object is disabled
|
77
|
+
* @private
|
78
|
+
* @function
|
79
|
+
* @param {Object} item
|
80
|
+
* @return {boolean}
|
81
|
+
*/
|
82
|
+
const isEnabledItem = function (item) {
|
83
|
+
return (item && !item.disabled) ? true : false;
|
84
|
+
};
|
85
|
+
|
86
|
+
/** search item label contain specific text
|
87
|
+
* @private
|
88
|
+
* @function
|
89
|
+
* @param {Array} items
|
90
|
+
* @param {string} keyword keyword in lower case
|
91
|
+
* @return {Array}
|
92
|
+
*/
|
93
|
+
const filterSearch = function (items, keyword) {
|
94
|
+
var c = items.length;
|
95
|
+
if (c === 0 || !keyword) return items;
|
96
|
+
|
97
|
+
var filtered = [];
|
98
|
+
for (var i = 0; i < c; i++) {
|
99
|
+
var item = items[i];
|
100
|
+
if (item.items) {
|
101
|
+
var result = filterSearch(item.items, keyword);
|
102
|
+
if (result.length > 0) {
|
103
|
+
item = Object.assign({}, item); // for header - clone new object to prevent mutate original
|
104
|
+
item.items = result;
|
105
|
+
filtered.push(item);
|
106
|
+
}
|
107
|
+
} else if (item.label.toLowerCase().includes(keyword)) {
|
108
|
+
filtered.push(item);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
return filtered;
|
113
|
+
};
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
/** @private
|
118
|
+
* @function
|
119
|
+
* @param {Object} item
|
120
|
+
*/
|
121
|
+
const selectItem = function(item) {
|
122
|
+
if(item) {
|
123
|
+
item.selected = true;
|
124
|
+
}
|
125
|
+
};
|
126
|
+
/** @private
|
127
|
+
* @function
|
128
|
+
* @param {Object} item
|
129
|
+
*/
|
130
|
+
const deselectItem = function(item) {
|
131
|
+
if(item) {
|
132
|
+
item.selected = false;
|
133
|
+
}
|
134
|
+
};
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Returns sorted and selected item indexes from the given list
|
138
|
+
* @private
|
139
|
+
* @function
|
140
|
+
* @param {Array} list
|
141
|
+
* @param {string} value
|
142
|
+
* @param {string} field
|
143
|
+
* @return {number}
|
144
|
+
*/
|
145
|
+
const getItemIndex = function (list, value, field) {
|
146
|
+
var listCount = list.length;
|
147
|
+
for (var i = 0; i < listCount; ++i) {
|
148
|
+
var item = list[i];
|
149
|
+
if (item && item[field] === value) {
|
150
|
+
return i;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
return -1;
|
154
|
+
};
|
155
|
+
|
156
|
+
/** @private
|
157
|
+
* @function
|
158
|
+
* @param {Element} elem
|
159
|
+
* @return {number}
|
160
|
+
*/
|
161
|
+
const getDomElementIndex = function(elem) {
|
162
|
+
if(elem) {
|
163
|
+
var p = elem.parentNode;
|
164
|
+
if(p) {
|
165
|
+
var chdr = p.children;
|
166
|
+
var childCount = chdr ? chdr.length : 0;
|
167
|
+
for(var i = 0; i < childCount; ++i) {
|
168
|
+
if(elem === p.children[i]) {
|
169
|
+
return i;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
return -1;
|
175
|
+
};
|
176
|
+
/**
|
177
|
+
* Sets scroll to focus on elements
|
178
|
+
* @private
|
179
|
+
* @function
|
180
|
+
* @param {Element} container
|
181
|
+
* @param {number} itemIndex
|
182
|
+
*/
|
183
|
+
const scrollToItem = function(container, itemIndex) {
|
184
|
+
if(!container) {
|
185
|
+
return;
|
186
|
+
}
|
187
|
+
|
188
|
+
var viewHeight = container.clientHeight;
|
189
|
+
var contentHeight = container.scrollHeight;
|
190
|
+
|
191
|
+
if(contentHeight <= viewHeight) {
|
192
|
+
return; // No scrollbar
|
193
|
+
}
|
194
|
+
|
195
|
+
var topView = container.scrollTop;
|
196
|
+
var bottomView = topView + viewHeight;
|
197
|
+
|
198
|
+
var chdr = container.children;
|
199
|
+
var childCount = chdr.length;
|
200
|
+
if(!itemIndex) {
|
201
|
+
itemIndex = 0;
|
202
|
+
} else if(itemIndex < 0 || itemIndex >= childCount) {
|
203
|
+
itemIndex = childCount - 1; // Last item
|
204
|
+
}
|
205
|
+
|
206
|
+
var targetItem = chdr[itemIndex];
|
207
|
+
var itemHeight = targetItem.offsetHeight;
|
208
|
+
// Calculate relative position from item to its parent
|
209
|
+
var topPos = itemIndex * itemHeight; // WARNING: This only works when we have constant height
|
210
|
+
var bottomPos = topPos + itemHeight;
|
211
|
+
if(topPos >= topView && bottomPos <= bottomView) {
|
212
|
+
return; // The item is already in the view
|
213
|
+
}
|
214
|
+
|
215
|
+
var extraSpace = itemHeight * 2; // Add extra space over the target position to make better UX.
|
216
|
+
var targetPos = 0;
|
217
|
+
if(topPos < topView) { // Scroll up
|
218
|
+
targetPos = topPos - extraSpace;
|
219
|
+
if(targetPos < 0) {
|
220
|
+
targetPos = 0;
|
221
|
+
}
|
222
|
+
} else { // Scroll down
|
223
|
+
var maxPos = contentHeight - viewHeight;
|
224
|
+
targetPos = topView + (bottomPos - bottomView) + extraSpace - itemHeight;
|
225
|
+
if(targetPos > maxPos) {
|
226
|
+
targetPos = maxPos;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
if(topView !== targetPos) {
|
231
|
+
container.scrollTop = targetPos;
|
232
|
+
}
|
233
|
+
};
|
234
|
+
|
235
|
+
/**
|
236
|
+
* Returns sorted and selected item indexes from the given list
|
237
|
+
* @private
|
238
|
+
* @function
|
239
|
+
* @param {Array} list
|
240
|
+
* @return {!Array.<number>}
|
241
|
+
*/
|
242
|
+
const _getSelectedItemIndexes = function (list) {
|
243
|
+
var listCount = list ? list.length : null;
|
244
|
+
var indexes = [];
|
245
|
+
for (var i = 0; i < listCount; ++i) {
|
246
|
+
if (isSelectedItem(list[i])) {
|
247
|
+
indexes.push(i);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
return indexes;
|
251
|
+
};
|
252
|
+
|
253
|
+
/** Coral tree item requires label and value. also create nested group
|
254
|
+
* @private
|
255
|
+
* @param {Object} colObj
|
256
|
+
* @return {Object}
|
257
|
+
*/
|
258
|
+
const _toCoralTreeItem = function (colObj) {
|
259
|
+
var label = colObj.label || colObj.title || colObj.name || colObj.field;
|
260
|
+
if (colObj.items) {
|
261
|
+
return {
|
262
|
+
label: label,
|
263
|
+
value: colObj.id,
|
264
|
+
items: colObj.items.map(_toCoralTreeItem),
|
265
|
+
expanded: true,
|
266
|
+
isGroup: true
|
267
|
+
};
|
268
|
+
} else {
|
269
|
+
return {
|
270
|
+
label: label,
|
271
|
+
value: colObj.id,
|
272
|
+
selected: false,
|
273
|
+
disabled: colObj.disabled == true
|
274
|
+
};
|
275
|
+
}
|
276
|
+
};
|
277
|
+
|
278
|
+
/** Coral item requires label and value. So we need to convert column object to coral item
|
279
|
+
* @private
|
280
|
+
* @param {Object} item
|
281
|
+
* @return {Object}
|
282
|
+
*/
|
283
|
+
const _toCoralItem = function(item) {
|
284
|
+
return {
|
285
|
+
label: item.label,
|
286
|
+
value: item.value,
|
287
|
+
selected: false,
|
288
|
+
disabled: item.disabled
|
289
|
+
};
|
290
|
+
};
|
291
|
+
/** Valid item must have an id or a field
|
292
|
+
* @private
|
293
|
+
* @param {Object} item
|
294
|
+
* @return {boolean}
|
295
|
+
*/
|
296
|
+
const _validateItem = function(item) {
|
297
|
+
if (item) {
|
298
|
+
if (item.items) {
|
299
|
+
// group
|
300
|
+
if (!item.id) {
|
301
|
+
var id = item.label || item.title || item.name || item.field;
|
302
|
+
if (id) item.id = 'GROUP_' + id + '_';
|
303
|
+
}
|
304
|
+
if (item.id) {
|
305
|
+
item.items = item.items.filter(_validateItem);
|
306
|
+
return true;
|
307
|
+
}
|
308
|
+
} else {
|
309
|
+
// item
|
310
|
+
if (!item.field) {
|
311
|
+
item.field = item.label || item.value || item.id;
|
312
|
+
}
|
313
|
+
if (item.field) {
|
314
|
+
if (!item.title) {
|
315
|
+
item.title = item.label || item.field;
|
316
|
+
}
|
317
|
+
if (!item.id) {
|
318
|
+
item.id = item.title;
|
319
|
+
}
|
320
|
+
return true;
|
321
|
+
}
|
322
|
+
}
|
323
|
+
}
|
324
|
+
return false;
|
325
|
+
};
|
326
|
+
/** is item autogenerated
|
327
|
+
* @private
|
328
|
+
* @param {Object} item
|
329
|
+
* @return {boolean}
|
330
|
+
*/
|
331
|
+
const _notAutoGeneratedItem = function (item) {
|
332
|
+
if (item.autoGenerated) return false;
|
333
|
+
return true;
|
334
|
+
};
|
335
|
+
/**
|
336
|
+
* @private
|
337
|
+
* @param {*} item
|
338
|
+
* @return {boolean}
|
339
|
+
*/
|
340
|
+
const _ensurePositiveNumber = function(item) {
|
341
|
+
var num;
|
342
|
+
if (typeof item === "string") {
|
343
|
+
num = Number(item);
|
344
|
+
} else if (typeof item === "number") {
|
345
|
+
num = item;
|
346
|
+
}
|
347
|
+
if (num < 0 || item == null) {
|
348
|
+
num = 0;
|
349
|
+
}
|
350
|
+
return num;
|
351
|
+
};
|
352
|
+
/** Filter out any item with duplicate id
|
353
|
+
* @private
|
354
|
+
* @param {Array} ary
|
355
|
+
* @param {Object} idMap
|
356
|
+
* @return {Array} Return new array in case of any duplication, otherwise return the same input array
|
357
|
+
*/
|
358
|
+
const _screenDuplication = function (ary, idMap) {
|
359
|
+
var uniqeList = [];
|
360
|
+
var itemCount = ary ? ary.length : 0;
|
361
|
+
for(var i = 0; i < itemCount; ++i) {
|
362
|
+
var item = ary[i];
|
363
|
+
var itemId = item.id || "";
|
364
|
+
if(itemId && !idMap[itemId]) {
|
365
|
+
uniqeList.push(item);
|
366
|
+
idMap[itemId] = item;
|
367
|
+
}
|
368
|
+
}
|
369
|
+
return uniqeList;
|
370
|
+
};
|
371
|
+
|
372
|
+
/** create object mapping from array
|
373
|
+
* @private
|
374
|
+
* @param {Array} items
|
375
|
+
* @param {string} fieldTobeKey
|
376
|
+
* @param {Object} mappingObj
|
377
|
+
* @return {Object} mapping object
|
378
|
+
*/
|
379
|
+
const _createMapping = function (items, fieldTobeKey, mappingObj) {
|
380
|
+
mappingObj = mappingObj || {};
|
381
|
+
var c = items.length;
|
382
|
+
for (var i = 0; i < c; i++) {
|
383
|
+
var item = items[i];
|
384
|
+
if (item.items) { // group
|
385
|
+
_createMapping(item.items, fieldTobeKey, mappingObj);
|
386
|
+
}
|
387
|
+
|
388
|
+
var value = item[fieldTobeKey];
|
389
|
+
mappingObj[value] = item;
|
390
|
+
}
|
391
|
+
return mappingObj;
|
392
|
+
};
|
393
|
+
|
394
|
+
/**
|
395
|
+
* @private
|
396
|
+
* @param {Array} items
|
397
|
+
* @return {number}
|
398
|
+
*/
|
399
|
+
const _countAutoGenerated = function (items) {
|
400
|
+
var agCount = 0;
|
401
|
+
var c = items.length;
|
402
|
+
for (var i = 0; i < c; i++) {
|
403
|
+
if (items[i].autoGenerated) agCount++;
|
404
|
+
}
|
405
|
+
return agCount;
|
406
|
+
};
|
407
|
+
|
408
|
+
/**
|
409
|
+
* @private
|
410
|
+
* @param {Array} items
|
411
|
+
* @param {Array} visibleList
|
412
|
+
* @return {Array}
|
413
|
+
*/
|
414
|
+
const _getVisibleItems = function (items, visibleList) {
|
415
|
+
visibleList = visibleList || [];
|
416
|
+
var c = items.length;
|
417
|
+
for (let i = 0; i < c; i++) {
|
418
|
+
var item = items[i];
|
419
|
+
if (item.items) {
|
420
|
+
// group
|
421
|
+
_getVisibleItems(item.items, visibleList);
|
422
|
+
} else {
|
423
|
+
// item
|
424
|
+
if (item.visible) {
|
425
|
+
visibleList.push(item);
|
426
|
+
}
|
427
|
+
}
|
428
|
+
}
|
429
|
+
return visibleList;
|
430
|
+
};
|
431
|
+
|
432
|
+
/**
|
433
|
+
* @class
|
434
|
+
* @public
|
435
|
+
*/
|
436
|
+
class ColumnSelectionDialog extends BasicElement {
|
437
|
+
|
438
|
+
static get properties() {
|
439
|
+
return {
|
440
|
+
config: {type: Object},
|
441
|
+
data: {type: Object},
|
442
|
+
visibleItems: {type: Array},
|
443
|
+
isShown: { type: Boolean },
|
444
|
+
lang: { type: String, reflect: true }
|
445
|
+
};
|
446
|
+
}
|
447
|
+
|
448
|
+
constructor() {
|
449
|
+
super();
|
450
|
+
this.lang = 'en';
|
451
|
+
this._lang = 'en';
|
452
|
+
this._translation = translation;
|
453
|
+
|
454
|
+
this.isShown = false;
|
455
|
+
this._descriptionBox = false;
|
456
|
+
this._excludedLeftColumns = 0;
|
457
|
+
this._excludedRightColumns = 0;
|
458
|
+
this._unmovableColumns = 0;
|
459
|
+
this._pendingScroll = false;
|
460
|
+
this._highlightedElem = null; // There can only one highlighted elem
|
461
|
+
this._pendingTreeRefresh = false;
|
462
|
+
this._pendingResetSearchInput = false;
|
463
|
+
|
464
|
+
this._allItemMapping = {};
|
465
|
+
this._filterItemMapping = {};
|
466
|
+
this._initialColumnMap = {};
|
467
|
+
this._allColumnList = []; // For keeping original list
|
468
|
+
this._filteredColumnList = []; // For filtered list
|
469
|
+
this._visibleColumnList = []; // Visible columns that will show in UI
|
470
|
+
this._excludedLeftVisibleColumnList = []; // Visible left columns that is currently excluded from UI (eg. auto-generated column)
|
471
|
+
this._excludedRightVisibleColumnList = []; // Visible right columns that is currently excluded from UI
|
472
|
+
this._selectAllStatus = "";
|
473
|
+
|
474
|
+
this._isMovable = this._isMovable.bind(this);
|
475
|
+
this._treeValueChanged = this._treeValueChanged.bind(this);
|
476
|
+
this._treeExpandedChanged = this._treeExpandedChanged.bind(this);
|
477
|
+
this._removeBtnClicked = this._removeBtnClicked.bind(this);
|
478
|
+
this._onSearchInputChanged = this._onSearchInputChanged.bind(this);
|
479
|
+
this._restoreDefault = this._restoreDefault.bind(this);
|
480
|
+
this._onConfirm = this._onConfirm.bind(this);
|
481
|
+
this._onCancel = this._onCancel.bind(this);
|
482
|
+
this.hide = this.hide.bind(this);
|
483
|
+
this._onUpItem = this._onUpItem.bind(this);
|
484
|
+
this._onDownItem = this._onDownItem.bind(this);
|
485
|
+
this._handleKeydown = this._handleKeydown.bind(this);
|
486
|
+
this._handleMouseover = this._handleMouseover.bind(this);
|
487
|
+
this._handleMouseout = this._handleMouseout.bind(this);
|
488
|
+
this._handleSelectAllHeaderClick = this._handleSelectAllHeaderClick.bind(this);
|
489
|
+
this._handleClick = this._handleClick.bind(this);
|
490
|
+
this._selectAllCheckedChanged = this._selectAllCheckedChanged.bind(this);
|
491
|
+
ElementObserver.addLanguageListener(this);
|
492
|
+
}
|
493
|
+
|
494
|
+
/**
|
495
|
+
* @private
|
496
|
+
* @param {Object} changedProperties
|
497
|
+
*/
|
498
|
+
update(changedProperties) {
|
499
|
+
|
500
|
+
if(changedProperties.has("lang")) {
|
501
|
+
this._lang = ElfUtil.toLangString(this.lang);
|
502
|
+
}
|
503
|
+
|
504
|
+
if(changedProperties.has("config")) {
|
505
|
+
if(!changedProperties.has("data")) {
|
506
|
+
if(Array.isArray(this.config)) {
|
507
|
+
this.data = this.config;
|
508
|
+
this.config = null;
|
509
|
+
} else if(this.config && this.config.data != null) {
|
510
|
+
this.data = this.config.data;
|
511
|
+
}
|
512
|
+
}
|
513
|
+
if(!changedProperties.has("visibleItems")) {
|
514
|
+
var visibleItems = this.config ? this.config.activeItems || this.config.visibleItems : null;
|
515
|
+
if(visibleItems) {
|
516
|
+
this.visibleItems = visibleItems;
|
517
|
+
}
|
518
|
+
}
|
519
|
+
|
520
|
+
if (this.config) {
|
521
|
+
// allow config.lang overides default lang
|
522
|
+
if(this.config.lang) {
|
523
|
+
this._lang = ElfUtil.toLangString(this.config.lang);
|
524
|
+
}
|
525
|
+
|
526
|
+
if (this.config.confirm) {
|
527
|
+
this.addEventListener('confirm', this.config.confirm);
|
528
|
+
}
|
529
|
+
|
530
|
+
if (this.config.cancel) {
|
531
|
+
this.addEventListener('cancel', this.config.cancel);
|
532
|
+
}
|
533
|
+
|
534
|
+
if (this.config.descriptionBox != null) {
|
535
|
+
this._descriptionBox = !!this.config.descriptionBox;
|
536
|
+
}
|
537
|
+
|
538
|
+
this._defaultItems = this.config.defaultItems;
|
539
|
+
}
|
540
|
+
}
|
541
|
+
|
542
|
+
if(changedProperties.has("config") ||
|
543
|
+
changedProperties.has("data") ||
|
544
|
+
changedProperties.has("visibleItems") ||
|
545
|
+
changedProperties.has("isShown")
|
546
|
+
) {
|
547
|
+
this.isShown && this._initData();
|
548
|
+
}
|
549
|
+
|
550
|
+
super.update(changedProperties);
|
551
|
+
}
|
552
|
+
|
553
|
+
/** A `TemplateResult` that will be used to render the updated internal template
|
554
|
+
* @private
|
555
|
+
* @return {*}
|
556
|
+
*/
|
557
|
+
render() {
|
558
|
+
var lang = this._translation[this._lang] ? this._lang : "en";
|
559
|
+
var t = this._translation[lang];
|
560
|
+
|
561
|
+
/* eslint-disable */
|
562
|
+
return html`
|
563
|
+
<ef-dialog header="${t["Column Selection"]}" id="columnDialog" lang="${lang}">
|
564
|
+
<div class="container">
|
565
|
+
<div class="row">
|
566
|
+
<div class="side">
|
567
|
+
<label class="title">${t["Add / Remove Columns"]}</label>
|
568
|
+
</div>
|
569
|
+
<div class="side">
|
570
|
+
</---to keep layout--->
|
571
|
+
</div>
|
572
|
+
</div>
|
573
|
+
<div class="row">
|
574
|
+
<div class="side">
|
575
|
+
<ef-search-field placeholder="${t["Search"]}" id="searchInput"></ef-search-field>
|
576
|
+
</div>
|
577
|
+
<div class="side">
|
578
|
+
<label>${t["Show in this order"]}</label>
|
579
|
+
</div>
|
580
|
+
</div>
|
581
|
+
<div class="row" id='listSection'>
|
582
|
+
<div class="side">
|
583
|
+
<div id="allColumns">
|
584
|
+
<ef-item id="treeNoResult" class="no-results" label="${t["No results found"]}"></ef-item>
|
585
|
+
<ef-header level="1" id="selectAllHeader">
|
586
|
+
<ef-checkbox id="selectAllCheckbox">${t["Select All"]}</ef-checkbox>
|
587
|
+
</ef-header>
|
588
|
+
<ef-tree id="tree" multiple></ef-tree>
|
589
|
+
</div>
|
590
|
+
</div>
|
591
|
+
<div class="side" id="visibleSide">
|
592
|
+
<div id="visibleColumns">
|
593
|
+
${this._visibleColumnList.map(item => html`
|
594
|
+
<ef-item
|
595
|
+
value="${item.value}"
|
596
|
+
?selected="${item.selected}"
|
597
|
+
class="${item.disabled ? 'disabled' : ''}">
|
598
|
+
${item.label}
|
599
|
+
</ef-item>`
|
600
|
+
)}
|
601
|
+
</div>
|
602
|
+
<div id="orderChangePanel">
|
603
|
+
<ef-button icon="up" @click="${this._onUpItem}" id="upItem">${t["Up"]}</ef-button>
|
604
|
+
<ef-button icon="down" @click="${this._onDownItem}" id="downItem">${t["Down"]}</ef-button>
|
605
|
+
<ef-button id="removeFromVisibleColumnsBtn" @click="${this._removeBtnClicked}">${t["Remove"]}</ef-button>
|
606
|
+
</div>
|
607
|
+
</div>
|
608
|
+
</div>
|
609
|
+
<div id="descriptionContainer"></div>
|
610
|
+
</div>
|
611
|
+
<div slot="footer">
|
612
|
+
<div part="custom-buttons" class="footer-left">
|
613
|
+
${this._defaultItems ? html`<ef-button @click="${this._restoreDefault}" tabindex="0">${t["RESTORE DEFAULT"]}</ef-button>` : ''}
|
614
|
+
</div>
|
615
|
+
<div part="default-buttons">
|
616
|
+
<ef-button @click="${this._onConfirm}" tabindex="0" cta>${t["OK"]}</ef-button>
|
617
|
+
<ef-button @click="${this._onCancel}" tabindex="0">${t["CANCEL"]}</ef-button>
|
618
|
+
</div>
|
619
|
+
</div>
|
620
|
+
</ef-dialog>
|
621
|
+
`;
|
622
|
+
/* eslint-enable */
|
623
|
+
}
|
624
|
+
|
625
|
+
/**
|
626
|
+
* @private
|
627
|
+
* @override
|
628
|
+
*/
|
629
|
+
firstUpdated(changedProperties) {
|
630
|
+
var shadowRoot = this.shadowRoot;
|
631
|
+
this._tree = shadowRoot.getElementById('tree');
|
632
|
+
this._selectAllHeader = shadowRoot.getElementById('selectAllHeader');
|
633
|
+
this._selectAllCheckbox = shadowRoot.getElementById('selectAllCheckbox');
|
634
|
+
this._treeNoResult = shadowRoot.getElementById('treeNoResult');
|
635
|
+
this._searchInput = shadowRoot.getElementById('searchInput');
|
636
|
+
this._removeFromVisibleColumnsBtn = shadowRoot.getElementById('removeFromVisibleColumnsBtn');
|
637
|
+
this._columnDialog = shadowRoot.getElementById('columnDialog');
|
638
|
+
this._upItem = shadowRoot.getElementById('upItem');
|
639
|
+
this._downItem = shadowRoot.getElementById('downItem');
|
640
|
+
this._visibleColumnsContainer = this.shadowRoot.getElementById('visibleColumns');
|
641
|
+
this._treeContainer = this.shadowRoot.getElementById('treeContainer');
|
642
|
+
this._descriptionContainer = this.shadowRoot.getElementById('descriptionContainer');
|
643
|
+
|
644
|
+
this._tree.addEventListener('value-changed', this._treeValueChanged);
|
645
|
+
this._tree.addEventListener('expanded-changed', this._treeExpandedChanged);
|
646
|
+
this._searchInput.addEventListener('keyup', this._onSearchInputChanged);
|
647
|
+
this._columnDialog.addEventListener('cancel', this._onCancel);
|
648
|
+
this._selectAllCheckbox.addEventListener('checked-changed', this._selectAllCheckedChanged);
|
649
|
+
this._selectAllHeader.addEventListener('click', this._handleSelectAllHeaderClick);
|
650
|
+
|
651
|
+
// Events for menu Items management
|
652
|
+
this._visibleColumnsContainer.addEventListener('keydown', this._handleKeydown);
|
653
|
+
this._visibleColumnsContainer.addEventListener('mouseover', this._handleMouseover);
|
654
|
+
this._visibleColumnsContainer.addEventListener('mouseout', this._handleMouseout);
|
655
|
+
this._visibleColumnsContainer.addEventListener('click', this._handleClick);
|
656
|
+
this._visibleColumnsContainer.addEventListener('dblclick', this._removeBtnClicked);
|
657
|
+
}
|
658
|
+
|
659
|
+
/**
|
660
|
+
* @private
|
661
|
+
* @override
|
662
|
+
*/
|
663
|
+
updated(changedProperties) {
|
664
|
+
if (changedProperties.has('lang')) {
|
665
|
+
if (this._translation[this._lang]) {
|
666
|
+
this._pendingResetSearchInput = true;
|
667
|
+
}
|
668
|
+
}
|
669
|
+
|
670
|
+
if (changedProperties.has('isShown')) {
|
671
|
+
this._columnDialog.opened = this.isShown;
|
672
|
+
if (!this.isShown) {
|
673
|
+
this.remove();
|
674
|
+
}
|
675
|
+
}
|
676
|
+
|
677
|
+
if (this._pendingResetSearchInput) {
|
678
|
+
this._pendingResetSearchInput = false;
|
679
|
+
this._searchInput.value = '';
|
680
|
+
this._updateSearchResult(this._searchInput.value);
|
681
|
+
}
|
682
|
+
|
683
|
+
if(this._pendingScroll) {
|
684
|
+
this._visibleColumnsContainer.scrollTop = this._visibleColumnsContainer.scrollHeight;
|
685
|
+
this._pendingScroll = false;
|
686
|
+
}
|
687
|
+
|
688
|
+
if (this._pendingTreeRefresh) {
|
689
|
+
this._pendingTreeRefresh = false;
|
690
|
+
this._updateTreeUI();
|
691
|
+
}
|
692
|
+
|
693
|
+
if (this._pendingButtonUpdate) {
|
694
|
+
this._pendingButtonUpdate = false;
|
695
|
+
this._updateControlButton();
|
696
|
+
}
|
697
|
+
|
698
|
+
this._descriptionContainer.toggleAttribute('hide', !this._descriptionBox);
|
699
|
+
}
|
700
|
+
|
701
|
+
/**
|
702
|
+
* @public
|
703
|
+
* @param {ColumnSelectionDialog~Config=} options
|
704
|
+
*/
|
705
|
+
init(options) {
|
706
|
+
this.config = options;
|
707
|
+
}
|
708
|
+
|
709
|
+
/** Transform and prepare user data for actual usage
|
710
|
+
* @private
|
711
|
+
* @param {boolean} toDefault=false set visible column to default list
|
712
|
+
*/
|
713
|
+
_initData(toDefault) {
|
714
|
+
// Retrieve user options
|
715
|
+
var allItems, i, item;
|
716
|
+
var config = this.config || {};
|
717
|
+
var visibleItems = this.visibleItems;
|
718
|
+
var defaultItems = this._defaultItems;
|
719
|
+
|
720
|
+
if (this.data) {
|
721
|
+
allItems = this.data;
|
722
|
+
} else {
|
723
|
+
// if no data provide
|
724
|
+
// then merge availableItems with visibleItems as allItems
|
725
|
+
var availableItems = config.availableItems || [];
|
726
|
+
allItems = Array.from(availableItems);
|
727
|
+
insertItems(allItems, allItems.length, visibleItems);
|
728
|
+
defaultItems && insertItems(allItems, allItems.length, defaultItems);
|
729
|
+
}
|
730
|
+
|
731
|
+
// Ensure that all user given items are valid
|
732
|
+
if(Array.isArray(allItems)) {
|
733
|
+
allItems = allItems.filter(_validateItem).filter(_notAutoGeneratedItem);
|
734
|
+
} else {
|
735
|
+
allItems = [];
|
736
|
+
}
|
737
|
+
|
738
|
+
if (toDefault && defaultItems) { // case reset to default
|
739
|
+
visibleItems = defaultItems;
|
740
|
+
}
|
741
|
+
|
742
|
+
if(Array.isArray(visibleItems)) {
|
743
|
+
visibleItems = visibleItems.filter(_validateItem);
|
744
|
+
} else {
|
745
|
+
visibleItems = [];
|
746
|
+
}
|
747
|
+
|
748
|
+
// find visible item from allItem and append to visibleItems
|
749
|
+
var visible2 = _getVisibleItems(allItems);
|
750
|
+
insertItems(visibleItems, visibleItems.length, visible2);
|
751
|
+
|
752
|
+
// Remove any duplicate entry by checking duplicate id
|
753
|
+
var idMap = {};
|
754
|
+
visibleItems = _screenDuplication(visibleItems, idMap);
|
755
|
+
var itemCount = visibleItems.length;
|
756
|
+
|
757
|
+
var autoGeneratedColumnCount = _countAutoGenerated(visibleItems);
|
758
|
+
|
759
|
+
var excludedLeftColumns = config.excludedLeftColumns;
|
760
|
+
if (excludedLeftColumns == null && config.excludedColumns != null) {
|
761
|
+
excludedLeftColumns = config.excludedColumns; // apply alias
|
762
|
+
}
|
763
|
+
this._excludedLeftColumns = _ensurePositiveNumber(excludedLeftColumns); // auto generated column should always be hidden from UI
|
764
|
+
this._excludedLeftColumns += autoGeneratedColumnCount; // WARNING: If auto-generated is not at most left index, this calculation will be incorrect.
|
765
|
+
this._excludedRightColumns = _ensurePositiveNumber(config.excludedRightColumns);
|
766
|
+
if (this._excludedRightColumns > itemCount - this._excludedLeftColumns) {
|
767
|
+
this._excludedRightColumns = _ensurePositiveNumber(itemCount - this._excludedLeftColumns);
|
768
|
+
}
|
769
|
+
|
770
|
+
this._unmovableColumns = _ensurePositiveNumber(config.unmovableColumns);
|
771
|
+
this._unmovableColumns += autoGeneratedColumnCount - this._excludedLeftColumns;
|
772
|
+
|
773
|
+
this._initialColumnMap = _createMapping(allItems, 'id');
|
774
|
+
this._excludedLeftVisibleColumnList = visibleItems.slice(0, this._excludedLeftColumns);
|
775
|
+
this._excludedRightVisibleColumnList = visibleItems.slice(itemCount - this._excludedRightColumns);
|
776
|
+
|
777
|
+
this._allColumnList = allItems.map(_toCoralTreeItem);
|
778
|
+
this._allItemMapping = _createMapping(this._allColumnList, 'value');
|
779
|
+
|
780
|
+
this._visibleColumnList = [];
|
781
|
+
for (i = 0; i < itemCount; i++) {
|
782
|
+
var id = visibleItems[i].id;
|
783
|
+
item = this._allItemMapping[id];
|
784
|
+
if (!item) continue; // auto generate column will not include in visible list
|
785
|
+
|
786
|
+
item.selected = true;
|
787
|
+
|
788
|
+
if (i < this._excludedLeftColumns || i >= itemCount - this._excludedRightColumns) {
|
789
|
+
// _excludedLeftColumns and _excludedRightColumns no need to add in _visibleColumnList
|
790
|
+
item.disabled = true;
|
791
|
+
} else {
|
792
|
+
this._visibleColumnList.push(_toCoralItem(item));
|
793
|
+
}
|
794
|
+
}
|
795
|
+
|
796
|
+
// clear description text since visibleList changed
|
797
|
+
if (this._descriptionContainer) {
|
798
|
+
this._descriptionContainer.textContent = '';
|
799
|
+
}
|
800
|
+
|
801
|
+
this._pendingTreeRefresh = true;
|
802
|
+
this._pendingButtonUpdate = true;
|
803
|
+
this._pendingResetSearchInput = true;
|
804
|
+
}
|
805
|
+
|
806
|
+
/** Show the dialog
|
807
|
+
* @public
|
808
|
+
*/
|
809
|
+
show() {
|
810
|
+
if (!this.parentNode) {
|
811
|
+
document.body.appendChild(this);
|
812
|
+
}
|
813
|
+
this.isShown = true; // TODO: This is not a correct way of using isShown property
|
814
|
+
}
|
815
|
+
|
816
|
+
/** Hide the dialog
|
817
|
+
* @public
|
818
|
+
*/
|
819
|
+
hide() {
|
820
|
+
this.isShown = false; // TODO: This is not a correct way of using isShown property
|
821
|
+
}
|
822
|
+
|
823
|
+
/** Validate item can move to index
|
824
|
+
* @private
|
825
|
+
* @param {number} itemIndex
|
826
|
+
* @param {boolean} isUp
|
827
|
+
* @return {boolean}
|
828
|
+
*/
|
829
|
+
_canMove(itemIndex, isUp) {
|
830
|
+
var nextIndex = itemIndex + (isUp ? -1 : 1);
|
831
|
+
var nextElem = this._visibleColumnsContainer.children[nextIndex];
|
832
|
+
|
833
|
+
if (!nextElem) { // no nextIndex then ignore
|
834
|
+
return false;
|
835
|
+
} else if (isSelectedItem(this._visibleColumnsContainer.children[nextIndex])) { // next item is selected then ignore
|
836
|
+
return false;
|
837
|
+
} else if (!this._isMovable(nextIndex)) {
|
838
|
+
return false;
|
839
|
+
}
|
840
|
+
|
841
|
+
return true;
|
842
|
+
}
|
843
|
+
/** Validate item that is movable in visible columns
|
844
|
+
* @private
|
845
|
+
* @param {number} itemIndex
|
846
|
+
* @return {boolean}
|
847
|
+
*/
|
848
|
+
_isMovable(itemIndex) {
|
849
|
+
var obj = this._visibleColumnList[itemIndex];
|
850
|
+
if (!obj) {
|
851
|
+
return false;
|
852
|
+
}
|
853
|
+
|
854
|
+
return _ensurePositiveNumber(itemIndex) >= this._unmovableColumns;
|
855
|
+
}
|
856
|
+
|
857
|
+
/** This will also remove focused state set by ef-item
|
858
|
+
* @private
|
859
|
+
*/
|
860
|
+
_unhighlightItems() {
|
861
|
+
if(this._highlightedElem) { // There can be only one highlighted Item
|
862
|
+
this._highlightedElem.highlighted = false;
|
863
|
+
this._highlightedElem.removeAttribute('focused'); // WORKAROUND: Focused and highlighted have the same styles in Halo themes
|
864
|
+
this._highlightedElem = null;
|
865
|
+
}
|
866
|
+
}
|
867
|
+
|
868
|
+
/** @private
|
869
|
+
* @param {number} step if positive highlight will move up, if negative highlight will move down
|
870
|
+
*/
|
871
|
+
_moveHighlightedItems(step) {
|
872
|
+
if (!step) {
|
873
|
+
return;
|
874
|
+
}
|
875
|
+
|
876
|
+
if (!this._highlightedElem) {
|
877
|
+
var selectedIndexes = _getSelectedItemIndexes(this._visibleColumnList);
|
878
|
+
if (!selectedIndexes.length) {
|
879
|
+
return;
|
880
|
+
}
|
881
|
+
|
882
|
+
this._highlightedElem = this._visibleColumnsContainer.children[selectedIndexes[0]];
|
883
|
+
this._highlightedElem.highlighted = true;
|
884
|
+
}
|
885
|
+
|
886
|
+
var pn = this._highlightedElem.parentNode;
|
887
|
+
if(!pn) {
|
888
|
+
return;
|
889
|
+
}
|
890
|
+
|
891
|
+
var chdr = pn.children;
|
892
|
+
var childCount = chdr.length;
|
893
|
+
var i; // highlighted index
|
894
|
+
for(i = 0; i < childCount; ++i) {
|
895
|
+
if(chdr[i] === this._highlightedElem) {
|
896
|
+
break;
|
897
|
+
}
|
898
|
+
}
|
899
|
+
if(i >= childCount) {
|
900
|
+
return;
|
901
|
+
}
|
902
|
+
|
903
|
+
i += step;
|
904
|
+
if (i >= 0 && i < childCount) {
|
905
|
+
this._unhighlightItems();
|
906
|
+
this._highlightedElem = chdr[i];
|
907
|
+
this._highlightedElem.highlighted = true;
|
908
|
+
scrollToItem(pn, i);
|
909
|
+
}
|
910
|
+
}
|
911
|
+
|
912
|
+
/**
|
913
|
+
* @private
|
914
|
+
* @param {Array} fromIndexes
|
915
|
+
* @param {string} movementType
|
916
|
+
*/
|
917
|
+
_moveVisibleColumnsElement(fromIndexes, movementType) {
|
918
|
+
fromIndexes = fromIndexes.filter(this._isMovable);
|
919
|
+
const moveCount = fromIndexes ? fromIndexes.length : 0;
|
920
|
+
if(!moveCount) {
|
921
|
+
return;
|
922
|
+
}
|
923
|
+
const list = this._visibleColumnList;
|
924
|
+
const listCount = list.length;
|
925
|
+
if(!listCount) {
|
926
|
+
return;
|
927
|
+
}
|
928
|
+
|
929
|
+
const sortedIndexes = fromIndexes.sort(numberComparer);
|
930
|
+
const isGrouped = isContinuous(sortedIndexes);
|
931
|
+
const isDown = movementType.indexOf('Down') >= 0;
|
932
|
+
const minIndex = sortedIndexes[0];
|
933
|
+
const maxIndex = sortedIndexes[moveCount - 1];
|
934
|
+
|
935
|
+
let targetIndex = isDown ? maxIndex : minIndex;
|
936
|
+
|
937
|
+
if(isGrouped) {
|
938
|
+
if(isDown) {
|
939
|
+
if(movementType === 'Down') {
|
940
|
+
targetIndex = targetIndex < listCount ? targetIndex + 1 : listCount;
|
941
|
+
} else {
|
942
|
+
targetIndex = listCount;
|
943
|
+
}
|
944
|
+
} else {
|
945
|
+
if(movementType === 'Up') {
|
946
|
+
targetIndex = targetIndex > 0 ? targetIndex - 1 : 0;
|
947
|
+
} else {
|
948
|
+
targetIndex = 0;
|
949
|
+
}
|
950
|
+
}
|
951
|
+
}
|
952
|
+
|
953
|
+
if (!this._isMovable(targetIndex)) {
|
954
|
+
return;
|
955
|
+
}
|
956
|
+
|
957
|
+
// Collect selected itmes
|
958
|
+
const items = new Array(moveCount);
|
959
|
+
for(var i = 0; i < moveCount; ++i) {
|
960
|
+
let idx = sortedIndexes[i];
|
961
|
+
let item = list[idx];
|
962
|
+
items[i] = item;
|
963
|
+
list[idx] = null;
|
964
|
+
item.selected = true; // Ensure that selected item has correct state
|
965
|
+
}
|
966
|
+
// Insert items back
|
967
|
+
if (isDown) {
|
968
|
+
insertItems(list, targetIndex + 1, items);
|
969
|
+
} else {
|
970
|
+
insertItems(list, targetIndex, items);
|
971
|
+
}
|
972
|
+
|
973
|
+
this._visibleColumnList = list.filter(Boolean);
|
974
|
+
scrollToItem(this._visibleColumnsContainer, targetIndex);
|
975
|
+
this._pendingButtonUpdate = true;
|
976
|
+
|
977
|
+
this.requestUpdate();
|
978
|
+
}
|
979
|
+
|
980
|
+
_onUpItem() {
|
981
|
+
this._moveVisibleColumnsElement(_getSelectedItemIndexes(this._visibleColumnList), 'Up');
|
982
|
+
}
|
983
|
+
|
984
|
+
_onDownItem() {
|
985
|
+
this._moveVisibleColumnsElement(_getSelectedItemIndexes(this._visibleColumnList), 'Down');
|
986
|
+
}
|
987
|
+
|
988
|
+
/**
|
989
|
+
* Set filtering result to "searchResult" element
|
990
|
+
* @private
|
991
|
+
* @param {object} e - event object
|
992
|
+
*/
|
993
|
+
_onSearchInputChanged(e) {
|
994
|
+
var firstItem = this._searchInput.data && this._searchInput.data[0];
|
995
|
+
if (firstItem) {
|
996
|
+
this._searchInput.scrollToItem(firstItem);
|
997
|
+
}
|
998
|
+
this._updateSearchResult(e.target.value);
|
999
|
+
}
|
1000
|
+
|
1001
|
+
/**
|
1002
|
+
* @private
|
1003
|
+
* @param {string} value - search query
|
1004
|
+
*/
|
1005
|
+
_updateSearchResult(value) {
|
1006
|
+
if(!value) {
|
1007
|
+
this._filteredColumnList = this._allColumnList;
|
1008
|
+
this._filterItemMapping = this._allItemMapping;
|
1009
|
+
} else {
|
1010
|
+
this._filteredColumnList = filterSearch(this._allColumnList, value.toLocaleLowerCase());
|
1011
|
+
this._filterItemMapping = _createMapping(this._filteredColumnList, 'value');
|
1012
|
+
}
|
1013
|
+
|
1014
|
+
this._pendingTreeRefresh = true;
|
1015
|
+
|
1016
|
+
this.requestUpdate();
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
/**
|
1020
|
+
* @private
|
1021
|
+
*/
|
1022
|
+
_updateTreeUI() {
|
1023
|
+
var isNoResult = this._filteredColumnList.length === 0;
|
1024
|
+
this._tree.toggleAttribute('hide', isNoResult);
|
1025
|
+
this._selectAllHeader.toggleAttribute('hide', isNoResult);
|
1026
|
+
this._treeNoResult.toggleAttribute('hide', !isNoResult); // show no result when search not found
|
1027
|
+
|
1028
|
+
if (!isNoResult) {
|
1029
|
+
this._updateSelectAllStatus();
|
1030
|
+
this._tree.data = null;
|
1031
|
+
this._tree.data = this._filteredColumnList;
|
1032
|
+
}
|
1033
|
+
}
|
1034
|
+
|
1035
|
+
/**
|
1036
|
+
* @private
|
1037
|
+
*/
|
1038
|
+
_updateSelectAllStatus() {
|
1039
|
+
var total = 0;
|
1040
|
+
var checked = 0;
|
1041
|
+
for (var key in this._filterItemMapping) {
|
1042
|
+
var item = this._filterItemMapping[key];
|
1043
|
+
if (item.disabled || item.isGroup) continue; // ignore disabled item and groupItem
|
1044
|
+
|
1045
|
+
total++;
|
1046
|
+
item.selected && checked++;
|
1047
|
+
}
|
1048
|
+
|
1049
|
+
if (total === checked) {
|
1050
|
+
this._selectAllStatus = "checked";
|
1051
|
+
} else if (checked === 0) {
|
1052
|
+
this._selectAllStatus = "";
|
1053
|
+
} else {
|
1054
|
+
this._selectAllStatus = "indeterminate";
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
this._selectAllCheckbox.removeAttribute("indeterminate");
|
1058
|
+
this._selectAllCheckbox.removeAttribute("checked");
|
1059
|
+
this._selectAllStatus && this._selectAllCheckbox.setAttribute(this._selectAllStatus, "");
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
/**
|
1063
|
+
* @private
|
1064
|
+
* @param {Object} e
|
1065
|
+
*/
|
1066
|
+
_handleKeydown(e) {
|
1067
|
+
var handled = false;
|
1068
|
+
switch (e.keyCode) {
|
1069
|
+
case 40: // down
|
1070
|
+
case 9: // tab
|
1071
|
+
this._moveHighlightedItems(1);
|
1072
|
+
handled = true;
|
1073
|
+
break;
|
1074
|
+
case 38: // up
|
1075
|
+
this._moveHighlightedItems(-1);
|
1076
|
+
handled = true;
|
1077
|
+
break;
|
1078
|
+
case 13: // enter
|
1079
|
+
if(this._highlightedElem) {
|
1080
|
+
this._highlightedElem.click();
|
1081
|
+
handled = true;
|
1082
|
+
}
|
1083
|
+
break;
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
if(handled) {
|
1087
|
+
e.preventDefault();
|
1088
|
+
e.stopPropagation();
|
1089
|
+
}
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
/**
|
1093
|
+
* @private
|
1094
|
+
* @param {Object} e
|
1095
|
+
*/
|
1096
|
+
_handleMouseover(e) {
|
1097
|
+
var targetElem = e.target;
|
1098
|
+
if (targetElem.highlightable) {
|
1099
|
+
if (this._highlightedElem) {
|
1100
|
+
if(this._highlightedElem === targetElem) {
|
1101
|
+
return;
|
1102
|
+
}
|
1103
|
+
this._highlightedElem.highlighted = false;
|
1104
|
+
}
|
1105
|
+
this._highlightedElem = targetElem;
|
1106
|
+
this._highlightedElem.highlighted = true;
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
/**
|
1111
|
+
* @private
|
1112
|
+
* @param {Object} e
|
1113
|
+
*/
|
1114
|
+
_handleMouseout(e) {
|
1115
|
+
var targetElem = e.target;
|
1116
|
+
if (targetElem === this._highlightedElem) {
|
1117
|
+
targetElem.highlighted = false;
|
1118
|
+
this._highlightedElem = null;
|
1119
|
+
}
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
/**
|
1123
|
+
* @private
|
1124
|
+
* @param {object} e - event object
|
1125
|
+
*/
|
1126
|
+
_handleSelectAllHeaderClick(e) {
|
1127
|
+
this._selectAllCheckbox.click();
|
1128
|
+
}
|
1129
|
+
|
1130
|
+
/**
|
1131
|
+
* @private
|
1132
|
+
* @param {object} e - event object
|
1133
|
+
*/
|
1134
|
+
_handleClick(e) {
|
1135
|
+
var selectedElement = e.target; // Target should be ef-item
|
1136
|
+
|
1137
|
+
// click to display description
|
1138
|
+
if (this._descriptionBox && this._initialColumnMap[selectedElement.value]) {
|
1139
|
+
this._descriptionContainer.textContent = this._initialColumnMap[selectedElement.value].description;
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
if (!selectedElement.highlightable) {
|
1143
|
+
return;
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
var list = null;
|
1147
|
+
list = this._visibleColumnList;
|
1148
|
+
var selectedIndex = getDomElementIndex(selectedElement);
|
1149
|
+
|
1150
|
+
if(e.metaKey || e.ctrlKey) {
|
1151
|
+
var curSelectedIndexes = _getSelectedItemIndexes(list);
|
1152
|
+
var repeatClickAt = curSelectedIndexes.indexOf(selectedIndex);
|
1153
|
+
if(repeatClickAt >= 0) {
|
1154
|
+
deselectItem(list[selectedIndex]);
|
1155
|
+
} else {
|
1156
|
+
selectItem(list[selectedIndex]);
|
1157
|
+
}
|
1158
|
+
} else {
|
1159
|
+
list.forEach(deselectItem);
|
1160
|
+
selectItem(list[selectedIndex]);
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
this._pendingButtonUpdate = true;
|
1164
|
+
|
1165
|
+
this.requestUpdate();
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
|
1169
|
+
/**
|
1170
|
+
* update up and down button
|
1171
|
+
* @private
|
1172
|
+
*/
|
1173
|
+
_updateControlButton() {
|
1174
|
+
this._upItem.disabled = true;
|
1175
|
+
this._downItem.disabled = true;
|
1176
|
+
this._removeFromVisibleColumnsBtn.disabled = true;
|
1177
|
+
|
1178
|
+
var selectedIndexes = _getSelectedItemIndexes(this._visibleColumnList);
|
1179
|
+
|
1180
|
+
// verify - remove button disabled
|
1181
|
+
c = selectedIndexes.length;
|
1182
|
+
for (i = 0; i < c; i++) {
|
1183
|
+
selectedIndex = selectedIndexes[i];
|
1184
|
+
if (!this._visibleColumnsContainer.children[selectedIndex].classList.contains('disabled')) {
|
1185
|
+
this._removeFromVisibleColumnsBtn.disabled = false;
|
1186
|
+
break;
|
1187
|
+
}
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
var moveableList = selectedIndexes.filter(this._isMovable);
|
1191
|
+
if (moveableList.length === 0) return;
|
1192
|
+
|
1193
|
+
var i, selectedIndex, c = moveableList.length;
|
1194
|
+
|
1195
|
+
// verify - down button disabled
|
1196
|
+
for (i = c - 1; i >= 0; i--) {
|
1197
|
+
selectedIndex = moveableList[i];
|
1198
|
+
if (this._canMove(selectedIndex)) {
|
1199
|
+
this._downItem.disabled = false;
|
1200
|
+
break;
|
1201
|
+
}
|
1202
|
+
}
|
1203
|
+
|
1204
|
+
// verify - up button disabled
|
1205
|
+
for (i = 0; i < c; i++) {
|
1206
|
+
selectedIndex = moveableList[i];
|
1207
|
+
if (this._canMove(selectedIndex, true)) {
|
1208
|
+
this._upItem.disabled = false;
|
1209
|
+
break;
|
1210
|
+
}
|
1211
|
+
}
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
/**
|
1215
|
+
* remove button click event
|
1216
|
+
* @private
|
1217
|
+
*/
|
1218
|
+
_removeBtnClicked() {
|
1219
|
+
let selectedItems = this._visibleColumnList.filter(isSelectedItem);
|
1220
|
+
let movableItems = selectedItems.filter(isEnabledItem);
|
1221
|
+
var movableItemsLength = movableItems.length;
|
1222
|
+
if(!movableItemsLength) {
|
1223
|
+
return;
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
// Deselect any item that is disabled
|
1227
|
+
if(movableItemsLength < selectedItems.length) {
|
1228
|
+
selectedItems.forEach(deselectItem);
|
1229
|
+
movableItems.forEach(selectItem);
|
1230
|
+
}
|
1231
|
+
|
1232
|
+
this._removeFromVisibleColumn(movableItems, true);
|
1233
|
+
|
1234
|
+
this._pendingTreeRefresh = true;
|
1235
|
+
|
1236
|
+
this.requestUpdate();
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
/**
|
1240
|
+
* reset all state
|
1241
|
+
* @private
|
1242
|
+
* @param {Event} e
|
1243
|
+
*/
|
1244
|
+
_restoreDefault(e) {
|
1245
|
+
this._initData(true);
|
1246
|
+
this.requestUpdate();
|
1247
|
+
}
|
1248
|
+
|
1249
|
+
/**
|
1250
|
+
* Dispatch Event when user confirm changes
|
1251
|
+
* @private
|
1252
|
+
* @param {Event} e
|
1253
|
+
*/
|
1254
|
+
_onConfirm(e) {
|
1255
|
+
var visibleItems = this._visibleColumnList.map(item => {
|
1256
|
+
return this._initialColumnMap[item.value];
|
1257
|
+
}); // Return only visible items
|
1258
|
+
visibleItems = this._excludedLeftVisibleColumnList.concat(visibleItems).concat(this._excludedRightVisibleColumnList);
|
1259
|
+
|
1260
|
+
var detail = {
|
1261
|
+
data: visibleItems, // deprecated
|
1262
|
+
value: visibleItems // Standard
|
1263
|
+
};
|
1264
|
+
|
1265
|
+
const beforeEvent = new CustomEvent('beforeConfirm', {
|
1266
|
+
detail: detail
|
1267
|
+
});
|
1268
|
+
this.dispatchEvent(beforeEvent);
|
1269
|
+
|
1270
|
+
if (beforeEvent.cancel) { return; }
|
1271
|
+
|
1272
|
+
const event = new CustomEvent('confirm', {
|
1273
|
+
cancelable: true,
|
1274
|
+
detail: detail
|
1275
|
+
});
|
1276
|
+
this.dispatchEvent(event);
|
1277
|
+
this.hide();
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
/**
|
1281
|
+
* Dispatch Event when user cancel or close dialog
|
1282
|
+
* @private
|
1283
|
+
* @param {Event} e
|
1284
|
+
*/
|
1285
|
+
_onCancel() {
|
1286
|
+
const event = new CustomEvent('cancel');
|
1287
|
+
this.dispatchEvent(event);
|
1288
|
+
this.hide();
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
/**
|
1292
|
+
* @param {Object} e
|
1293
|
+
* @private
|
1294
|
+
*/
|
1295
|
+
_selectAllCheckedChanged(e) {
|
1296
|
+
var selected = e.detail.value;
|
1297
|
+
var items = [];
|
1298
|
+
for (var key in this._filterItemMapping) {
|
1299
|
+
var item = this._filterItemMapping[key];
|
1300
|
+
if (item.disabled || item.isGroup) continue; // ignore disabled item and groupItem
|
1301
|
+
|
1302
|
+
if (item.selected !== selected) {
|
1303
|
+
items.push(this._filterItemMapping[key]);
|
1304
|
+
}
|
1305
|
+
}
|
1306
|
+
|
1307
|
+
if (selected) {
|
1308
|
+
this._addToVisibleColumn(items);
|
1309
|
+
} else {
|
1310
|
+
this._removeFromVisibleColumn(items);
|
1311
|
+
}
|
1312
|
+
|
1313
|
+
this._pendingTreeRefresh = true;
|
1314
|
+
this.requestUpdate();
|
1315
|
+
}
|
1316
|
+
|
1317
|
+
/**
|
1318
|
+
* ef-tree value changed event
|
1319
|
+
* @param {Object} e
|
1320
|
+
* @private
|
1321
|
+
*/
|
1322
|
+
_treeValueChanged(e) {
|
1323
|
+
var selectedMapping = {};
|
1324
|
+
|
1325
|
+
var c = e.currentTarget.values.length;
|
1326
|
+
for (var i = 0; i < c; i++) {
|
1327
|
+
var value = e.currentTarget.values[i];
|
1328
|
+
selectedMapping[value] = true;
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
// clear all selected item on visible column
|
1332
|
+
this._visibleColumnList.forEach(deselectItem);
|
1333
|
+
|
1334
|
+
// update selected state and update UI
|
1335
|
+
var addList = [], removeList = [];
|
1336
|
+
for (var key in this._filterItemMapping) {
|
1337
|
+
var item = this._filterItemMapping[key];
|
1338
|
+
if (!item || item.disabled || item.isGroup) continue; // ignore disabled item and groupItem
|
1339
|
+
|
1340
|
+
if (item.selected) {
|
1341
|
+
if (!selectedMapping[item.value]) {
|
1342
|
+
// case item is unselect, then remove item out of visible list
|
1343
|
+
removeList.push(item);
|
1344
|
+
}
|
1345
|
+
} else {
|
1346
|
+
if (selectedMapping[item.value]) {
|
1347
|
+
// case item is select, then add item to visible list
|
1348
|
+
addList.push(item);
|
1349
|
+
}
|
1350
|
+
}
|
1351
|
+
}
|
1352
|
+
this._removeFromVisibleColumn(removeList);
|
1353
|
+
this._addToVisibleColumn(addList);
|
1354
|
+
this._updateSelectAllStatus();
|
1355
|
+
this.requestUpdate();
|
1356
|
+
}
|
1357
|
+
|
1358
|
+
/**
|
1359
|
+
* ef-tree expanded changed event handler
|
1360
|
+
* @param {Object} e
|
1361
|
+
* @private
|
1362
|
+
*/
|
1363
|
+
_treeExpandedChanged(e) {
|
1364
|
+
var groupItem = e.detail.item;
|
1365
|
+
var isExpanded = e.detail.value;
|
1366
|
+
this._filterItemMapping[groupItem.value].expanded = isExpanded;
|
1367
|
+
this._allItemMapping[groupItem.value].expanded = isExpanded;
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
/**
|
1371
|
+
* @param {Array} items
|
1372
|
+
* @private
|
1373
|
+
*/
|
1374
|
+
_addToVisibleColumn(items) {
|
1375
|
+
var c = items.length;
|
1376
|
+
if (c === 0) return;
|
1377
|
+
for (var i = 0; i < c; i++) {
|
1378
|
+
var item = items[i];
|
1379
|
+
this._allItemMapping[item.value].selected = true;
|
1380
|
+
var coralItem = _toCoralItem(item);
|
1381
|
+
coralItem.selected = true;
|
1382
|
+
this._visibleColumnList.push(coralItem);
|
1383
|
+
}
|
1384
|
+
this._pendingScroll = true;
|
1385
|
+
this._pendingButtonUpdate = true;
|
1386
|
+
}
|
1387
|
+
|
1388
|
+
/**
|
1389
|
+
* @param {Array} items
|
1390
|
+
* @private
|
1391
|
+
*/
|
1392
|
+
_removeFromVisibleColumn(items) {
|
1393
|
+
var c = items.length;
|
1394
|
+
if (c === 0) return;
|
1395
|
+
for (var i = 0; i < c; i++) {
|
1396
|
+
var item = items[i];
|
1397
|
+
this._allItemMapping[item.value].selected = false;
|
1398
|
+
var index = getItemIndex(this._visibleColumnList, item.value, 'value');
|
1399
|
+
if (index >= 0) this._visibleColumnList[index] = null;
|
1400
|
+
}
|
1401
|
+
this._visibleColumnList = this._visibleColumnList.filter(Boolean); // clear null element
|
1402
|
+
this._unhighlightItems();
|
1403
|
+
this._pendingButtonUpdate = true;
|
1404
|
+
}
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
customElement('column-selection-dialog')(ColumnSelectionDialog);
|
1408
|
+
|
1409
|
+
export { ColumnSelectionDialog };
|
1410
|
+
export default ColumnSelectionDialog;
|