@refinitiv-ui/efx-grid 0.0.0-dev.12023565035.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -0
- package/README.md +61 -0
- package/lib/column-dragging/es6/ColumnDragging.d.ts +51 -0
- package/lib/column-dragging/es6/ColumnDragging.js +968 -0
- package/lib/column-dragging/es6/index.d.ts +1 -0
- package/lib/column-dragging/es6/index.js +1 -0
- package/lib/column-format-dialog/index.d.ts +2 -0
- package/lib/column-format-dialog/index.js +2 -0
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +77 -0
- package/lib/column-format-dialog/lib/column-format-dialog.js +2688 -0
- package/lib/column-format-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-de.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-en.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-ja.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-zh-hant.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-zh.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/column-format-dialog/lib/locale/translation.js +18 -0
- package/lib/column-format-dialog/lib/preview-table.d.ts +151 -0
- package/lib/column-format-dialog/lib/preview-table.js +982 -0
- package/lib/column-format-dialog/themes/base.less +429 -0
- package/lib/column-format-dialog/themes/elemental/column-format-dialog.less +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/elemental/dark.js +16 -0
- package/lib/column-format-dialog/themes/elemental/defaults.less +1 -0
- package/lib/column-format-dialog/themes/elemental/index.less +5 -0
- package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/elemental/light.js +16 -0
- package/lib/column-format-dialog/themes/halo/column-format-dialog.less +6 -0
- package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/halo/dark.js +16 -0
- package/lib/column-format-dialog/themes/halo/defaults.less +1 -0
- package/lib/column-format-dialog/themes/halo/index.less +5 -0
- package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/halo/light.js +16 -0
- package/lib/column-format-dialog/themes/luna/column-format-dialog.less +1 -0
- package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/luna/default/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/luna/default/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/luna/default/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/luna/default/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/luna/defaults.less +1 -0
- package/lib/column-format-dialog/themes/luna/index.less +5 -0
- package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/solar/charcoal.js +16 -0
- package/lib/column-format-dialog/themes/solar/column-format-dialog.less +6 -0
- package/lib/column-format-dialog/themes/solar/defaults.less +1 -0
- package/lib/column-format-dialog/themes/solar/index.less +5 -0
- package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/solar/pearl.js +16 -0
- package/lib/column-selection-dialog/index.d.ts +2 -0
- package/lib/column-selection-dialog/index.js +2 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +66 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +2034 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.js +20 -0
- package/lib/column-selection-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/column-selection-dialog/lib/locale/translation.js +18 -0
- package/lib/column-selection-dialog/themes/base.less +258 -0
- package/lib/column-selection-dialog/themes/elemental/column-selection-dialog.less +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/elemental/dark.js +8 -0
- package/lib/column-selection-dialog/themes/elemental/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/elemental/index.less +5 -0
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/elemental/light.js +8 -0
- package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +25 -0
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/halo/dark.js +8 -0
- package/lib/column-selection-dialog/themes/halo/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/halo/index.less +6 -0
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/halo/light.js +8 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/solar/charcoal.js +8 -0
- package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +5 -0
- package/lib/column-selection-dialog/themes/solar/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/solar/index.less +6 -0
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/solar/pearl.js +8 -0
- package/lib/core/dist/core.css +1 -0
- package/lib/core/dist/core.js +33910 -0
- package/lib/core/dist/core.min.js +1 -0
- package/lib/core/es6/data/ColumnStats.d.ts +42 -0
- package/lib/core/es6/data/ColumnStats.js +428 -0
- package/lib/core/es6/data/DataCache.d.ts +43 -0
- package/lib/core/es6/data/DataCache.js +597 -0
- package/lib/core/es6/data/DataTable.d.ts +156 -0
- package/lib/core/es6/data/DataTable.js +2206 -0
- package/lib/core/es6/data/DataView.d.ts +332 -0
- package/lib/core/es6/data/DataView.js +4144 -0
- package/lib/core/es6/data/Segment.d.ts +91 -0
- package/lib/core/es6/data/Segment.js +1001 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +84 -0
- package/lib/core/es6/data/SegmentCollection.js +713 -0
- package/lib/core/es6/data/WrappedView.d.ts +290 -0
- package/lib/core/es6/data/WrappedView.js +1320 -0
- package/lib/core/es6/grid/Core.d.ts +455 -0
- package/lib/core/es6/grid/Core.js +6196 -0
- package/lib/core/es6/grid/ILayoutGrid.d.ts +212 -0
- package/lib/core/es6/grid/ILayoutGrid.js +706 -0
- package/lib/core/es6/grid/LayoutGrid.d.ts +37 -0
- package/lib/core/es6/grid/LayoutGrid.js +2975 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +28 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +1241 -0
- package/lib/core/es6/grid/components/Cell.d.ts +52 -0
- package/lib/core/es6/grid/components/Cell.js +826 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +21 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.js +130 -0
- package/lib/core/es6/grid/components/CellSpan.d.ts +18 -0
- package/lib/core/es6/grid/components/CellSpan.js +99 -0
- package/lib/core/es6/grid/components/CellSpans.d.ts +40 -0
- package/lib/core/es6/grid/components/CellSpans.js +368 -0
- package/lib/core/es6/grid/components/Column.d.ts +22 -0
- package/lib/core/es6/grid/components/Column.js +618 -0
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +127 -0
- package/lib/core/es6/grid/components/ElementWrapper.js +718 -0
- package/lib/core/es6/grid/components/HScrollbar.d.ts +28 -0
- package/lib/core/es6/grid/components/HScrollbar.js +241 -0
- package/lib/core/es6/grid/components/Scrollbar.d.ts +63 -0
- package/lib/core/es6/grid/components/Scrollbar.js +1413 -0
- package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
- package/lib/core/es6/grid/components/StretchedCells.js +342 -0
- package/lib/core/es6/grid/components/VScrollbar.d.ts +18 -0
- package/lib/core/es6/grid/components/VScrollbar.js +139 -0
- package/lib/core/es6/grid/components/VirtualItems.d.ts +12 -0
- package/lib/core/es6/grid/components/VirtualItems.js +51 -0
- package/lib/core/es6/grid/event/EventDispatcher.d.ts +16 -0
- package/lib/core/es6/grid/event/EventDispatcher.js +138 -0
- package/lib/core/es6/grid/event/EventListeners.d.ts +34 -0
- package/lib/core/es6/grid/event/EventListeners.js +166 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +155 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1977 -0
- package/lib/core/es6/grid/util/CellBoundPainter.d.ts +16 -0
- package/lib/core/es6/grid/util/CellBoundPainter.js +171 -0
- package/lib/core/es6/grid/util/Conflator.d.ts +32 -0
- package/lib/core/es6/grid/util/Conflator.js +191 -0
- package/lib/core/es6/grid/util/Reverter.d.ts +14 -0
- package/lib/core/es6/grid/util/Reverter.js +79 -0
- package/lib/core/es6/grid/util/SectionSettings.d.ts +79 -0
- package/lib/core/es6/grid/util/SectionSettings.js +679 -0
- package/lib/core/es6/grid/util/SelectionList.d.ts +54 -0
- package/lib/core/es6/grid/util/SelectionList.js +491 -0
- package/lib/core/es6/grid/util/TrackLayout.d.ts +92 -0
- package/lib/core/es6/grid/util/TrackLayout.js +902 -0
- package/lib/core/es6/grid/util/Virtualizer.d.ts +40 -0
- package/lib/core/es6/grid/util/Virtualizer.js +340 -0
- package/lib/core/es6/grid/util/util.d.ts +20 -0
- package/lib/core/es6/grid/util/util.js +391 -0
- package/lib/core/es6/index.d.ts +79 -0
- package/lib/core/es6/index.js +125 -0
- package/lib/core/es6/tr-grid-theme.d.ts +5 -0
- package/lib/core/es6/tr-grid-theme.js +5 -0
- package/lib/filter-dialog/index.d.ts +2 -0
- package/lib/filter-dialog/index.js +2 -0
- package/lib/filter-dialog/lib/checkbox-list.d.ts +52 -0
- package/lib/filter-dialog/lib/checkbox-list.js +444 -0
- package/lib/filter-dialog/lib/filter-dialog.d.ts +75 -0
- package/lib/filter-dialog/lib/filter-dialog.js +1160 -0
- package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-de.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-en.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-ja.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.js +40 -0
- package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh.js +40 -0
- package/lib/filter-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/filter-dialog/lib/locale/translation.js +18 -0
- package/lib/filter-dialog/themes/base-checkbox.less +42 -0
- package/lib/filter-dialog/themes/base.less +191 -0
- package/lib/filter-dialog/themes/elemental/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/elemental/dark.js +11 -0
- package/lib/filter-dialog/themes/elemental/defaults.less +3 -0
- package/lib/filter-dialog/themes/elemental/filter-dialog.less +1 -0
- package/lib/filter-dialog/themes/elemental/index.less +6 -0
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/elemental/light/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/light/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/elemental/light.js +11 -0
- package/lib/filter-dialog/themes/halo/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/halo/dark/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/dark/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/halo/dark.js +11 -0
- package/lib/filter-dialog/themes/halo/defaults.less +3 -0
- package/lib/filter-dialog/themes/halo/filter-dialog.less +15 -0
- package/lib/filter-dialog/themes/halo/index.less +6 -0
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/halo/light/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/light/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/halo/light.js +11 -0
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/solar/charcoal.js +11 -0
- package/lib/filter-dialog/themes/solar/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/solar/defaults.less +3 -0
- package/lib/filter-dialog/themes/solar/filter-dialog.less +5 -0
- package/lib/filter-dialog/themes/solar/index.less +6 -0
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/solar/pearl.js +11 -0
- package/lib/formatters/es6/CoralButtonFormatter.d.ts +20 -0
- package/lib/formatters/es6/CoralButtonFormatter.js +45 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.js +50 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.js +103 -0
- package/lib/formatters/es6/CoralIconFormatter.d.ts +21 -0
- package/lib/formatters/es6/CoralIconFormatter.js +50 -0
- package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralInputFormatter.js +45 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +20 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.js +85 -0
- package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralSelectFormatter.js +71 -0
- package/lib/formatters/es6/CoralToggleFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralToggleFormatter.js +47 -0
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +119 -0
- package/lib/formatters/es6/EFButtonFormatter.d.ts +20 -0
- package/lib/formatters/es6/EFButtonFormatter.js +45 -0
- package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFCheckboxFormatter.js +50 -0
- package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFComboBoxFormatter.js +78 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.js +60 -0
- package/lib/formatters/es6/EFIconFormatter.d.ts +21 -0
- package/lib/formatters/es6/EFIconFormatter.js +50 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.js +45 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +20 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.js +132 -0
- package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFSelectFormatter.js +76 -0
- package/lib/formatters/es6/EFTextFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFTextFieldFormatter.js +40 -0
- package/lib/formatters/es6/EFToggleFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFToggleFormatter.js +47 -0
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +55 -0
- package/lib/formatters/es6/FormatterBuilder.d.ts +26 -0
- package/lib/formatters/es6/FormatterBuilder.js +493 -0
- package/lib/formatters/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/formatters/es6/NumericInputFormatter.js +64 -0
- package/lib/formatters/es6/PercentBarFormatter.d.ts +25 -0
- package/lib/formatters/es6/PercentBarFormatter.js +62 -0
- package/lib/formatters/es6/SimpleImageFormatter.d.ts +21 -0
- package/lib/formatters/es6/SimpleImageFormatter.js +64 -0
- package/lib/formatters/es6/SimpleInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/SimpleInputFormatter.js +40 -0
- package/lib/formatters/es6/SimpleLinkFormatter.d.ts +21 -0
- package/lib/formatters/es6/SimpleLinkFormatter.js +48 -0
- package/lib/formatters/es6/SimpleTickerFormatter.d.ts +23 -0
- package/lib/formatters/es6/SimpleTickerFormatter.js +66 -0
- package/lib/formatters/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/formatters/es6/SimpleToggleFormatter.js +132 -0
- package/lib/formatters/es6/TextFormatter.d.ts +12 -0
- package/lib/formatters/es6/TextFormatter.js +35 -0
- package/lib/formatters/es6/index.d.ts +64 -0
- package/lib/formatters/es6/index.js +88 -0
- package/lib/grid/index.d.ts +2 -0
- package/lib/grid/index.js +3 -0
- package/lib/grid/lib/efx-grid.d.ts +53 -0
- package/lib/grid/lib/efx-grid.js +444 -0
- package/lib/grid/themes/base.less +137 -0
- package/lib/grid/themes/ds/dark/css/native-elements.css +0 -0
- package/lib/grid/themes/ds/dark/efx-grid.js +4 -0
- package/lib/grid/themes/ds/dark/es5/all-elements.js +2 -0
- package/lib/grid/themes/ds/dark/imports/all-elements.js +1 -0
- package/lib/grid/themes/ds/dark/imports/custom-elements.js +1 -0
- package/lib/grid/themes/ds/dark/imports/native-elements.js +0 -0
- package/lib/grid/themes/ds/dark.js +3 -0
- package/lib/grid/themes/ds/efx-grid.less +207 -0
- package/lib/grid/themes/ds/index.less +3 -0
- package/lib/grid/themes/ds/light/css/native-elements.css +0 -0
- package/lib/grid/themes/ds/light/efx-grid.js +4 -0
- package/lib/grid/themes/ds/light/es5/all-elements.js +2 -0
- package/lib/grid/themes/ds/light/imports/all-elements.js +1 -0
- package/lib/grid/themes/ds/light/imports/custom-elements.js +1 -0
- package/lib/grid/themes/ds/light/imports/native-elements.js +0 -0
- package/lib/grid/themes/ds/light.js +3 -0
- package/lib/grid/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/grid/themes/halo/dark/efx-grid.js +4 -0
- package/lib/grid/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/grid/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/grid/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/grid/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/grid/themes/halo/dark.js +3 -0
- package/lib/grid/themes/halo/efx-grid.less +127 -0
- package/lib/grid/themes/halo/index.less +3 -0
- package/lib/grid/themes/halo/light/css/native-elements.css +0 -0
- package/lib/grid/themes/halo/light/efx-grid.js +4 -0
- package/lib/grid/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/grid/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/grid/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/grid/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/grid/themes/halo/light.js +3 -0
- package/lib/grid/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/grid/themes/solar/charcoal/efx-grid.js +4 -0
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/grid/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/grid/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/grid/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/grid/themes/solar/charcoal.js +3 -0
- package/lib/grid/themes/solar/efx-grid.less +27 -0
- package/lib/grid/themes/solar/index.less +3 -0
- package/lib/grid/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/grid/themes/solar/pearl/efx-grid.js +4 -0
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/grid/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/grid/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/grid/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/grid/themes/solar/pearl.js +3 -0
- package/lib/index.d.ts +100 -0
- package/lib/index.js +100 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +115 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +1182 -0
- package/lib/row-segmenting/es6/index.d.ts +1 -0
- package/lib/row-segmenting/es6/index.js +1 -0
- package/lib/rt-grid/dist/rt-grid.js +54547 -0
- package/lib/rt-grid/dist/rt-grid.min.js +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +174 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +1203 -0
- package/lib/rt-grid/es6/DataConnector.d.ts +43 -0
- package/lib/rt-grid/es6/DataConnector.js +290 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +40 -0
- package/lib/rt-grid/es6/FieldDefinition.js +560 -0
- package/lib/rt-grid/es6/Grid.d.ts +376 -0
- package/lib/rt-grid/es6/Grid.js +4653 -0
- package/lib/rt-grid/es6/PredefinedFormula.d.ts +16 -0
- package/lib/rt-grid/es6/PredefinedFormula.js +33 -0
- package/lib/rt-grid/es6/ReferenceCounter.d.ts +40 -0
- package/lib/rt-grid/es6/ReferenceCounter.js +251 -0
- package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
- package/lib/rt-grid/es6/RowDefSorter.js +231 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +156 -0
- package/lib/rt-grid/es6/RowDefinition.js +1478 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +36 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +537 -0
- package/lib/rt-grid/es6/StyleLoader.d.ts +17 -0
- package/lib/rt-grid/es6/StyleLoader.js +47 -0
- package/lib/rt-grid/es6/index.d.ts +8 -0
- package/lib/rt-grid/es6/index.js +43 -0
- package/lib/statistics-row/es6/StatisticsRow.d.ts +68 -0
- package/lib/statistics-row/es6/StatisticsRow.js +807 -0
- package/lib/statistics-row/es6/index.d.ts +1 -0
- package/lib/statistics-row/es6/index.js +1 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.d.ts +46 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +617 -0
- package/lib/tr-grid-auto-tooltip/es6/index.d.ts +1 -0
- package/lib/tr-grid-auto-tooltip/es6/index.js +1 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +70 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1695 -0
- package/lib/tr-grid-cell-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-cell-selection/es6/index.js +1 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +82 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1704 -0
- package/lib/tr-grid-checkbox/es6/index.d.ts +1 -0
- package/lib/tr-grid-checkbox/es6/index.js +1 -0
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +56 -0
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +817 -0
- package/lib/tr-grid-column-fitter/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-fitter/es6/index.js +1 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +91 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +617 -0
- package/lib/tr-grid-column-formatting/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-formatting/es6/index.js +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +110 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +2028 -0
- package/lib/tr-grid-column-grouping/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/index.js +1 -0
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +68 -0
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1010 -0
- package/lib/tr-grid-column-resizing/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-resizing/es6/index.js +1 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +77 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +1405 -0
- package/lib/tr-grid-column-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-selection/es6/index.js +1 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +160 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +2155 -0
- package/lib/tr-grid-column-stack/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-stack/es6/index.js +1 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +100 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1513 -0
- package/lib/tr-grid-conditional-coloring/es6/index.d.ts +1 -0
- package/lib/tr-grid-conditional-coloring/es6/index.js +1 -0
- package/lib/tr-grid-content-wrap/es6/ContentWrap.d.ts +43 -0
- package/lib/tr-grid-content-wrap/es6/ContentWrap.js +519 -0
- package/lib/tr-grid-content-wrap/es6/index.d.ts +1 -0
- package/lib/tr-grid-content-wrap/es6/index.js +1 -0
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +83 -0
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +453 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +138 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +41 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.js +285 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +33 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.js +303 -0
- package/lib/tr-grid-contextmenu/es6/index.d.ts +1 -0
- package/lib/tr-grid-contextmenu/es6/index.js +1 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +64 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.js +1027 -0
- package/lib/tr-grid-filter-input/es6/index.d.ts +1 -0
- package/lib/tr-grid-filter-input/es6/index.js +1 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +45 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.js +401 -0
- package/lib/tr-grid-heat-map/es6/index.d.ts +1 -0
- package/lib/tr-grid-heat-map/es6/index.js +1 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +148 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +2671 -0
- package/lib/tr-grid-in-cell-editing/es6/index.d.ts +1 -0
- package/lib/tr-grid-in-cell-editing/es6/index.js +1 -0
- package/lib/tr-grid-pagination/es6/Pagination.d.ts +58 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +433 -0
- package/lib/tr-grid-pagination/es6/index.d.ts +1 -0
- package/lib/tr-grid-pagination/es6/index.js +1 -0
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +60 -0
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +804 -0
- package/lib/tr-grid-percent-bar/es6/index.d.ts +1 -0
- package/lib/tr-grid-percent-bar/es6/index.js +1 -0
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +50 -0
- package/lib/tr-grid-printer/es6/CellWriter.js +234 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +13 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.js +23 -0
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +33 -0
- package/lib/tr-grid-printer/es6/GridPrinter.js +794 -0
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +39 -0
- package/lib/tr-grid-printer/es6/PrintTrait.js +494 -0
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +57 -0
- package/lib/tr-grid-printer/es6/SectionWriter.js +238 -0
- package/lib/tr-grid-printer/es6/index.d.ts +1 -0
- package/lib/tr-grid-printer/es6/index.js +1 -0
- package/lib/tr-grid-range-bar/es6/LEDGuage.d.ts +39 -0
- package/lib/tr-grid-range-bar/es6/LEDGuage.js +261 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +56 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +514 -0
- package/lib/tr-grid-range-bar/es6/index.d.ts +1 -0
- package/lib/tr-grid-range-bar/es6/index.js +1 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +81 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +1479 -0
- package/lib/tr-grid-row-dragging/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-dragging/es6/index.js +1 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +159 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +2568 -0
- package/lib/tr-grid-row-filtering/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-filtering/es6/index.js +1 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +123 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1728 -0
- package/lib/tr-grid-row-grouping/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-grouping/es6/index.js +1 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +75 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.js +1447 -0
- package/lib/tr-grid-row-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-selection/es6/index.js +1 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +64 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +615 -0
- package/lib/tr-grid-rowcoloring/es6/index.d.ts +1 -0
- package/lib/tr-grid-rowcoloring/es6/index.js +1 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +72 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +543 -0
- package/lib/tr-grid-textformatting/es6/index.d.ts +1 -0
- package/lib/tr-grid-textformatting/es6/index.js +1 -0
- package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +27 -0
- package/lib/tr-grid-titlewrap/es6/TitleWrap.js +431 -0
- package/lib/tr-grid-titlewrap/es6/index.d.ts +1 -0
- package/lib/tr-grid-titlewrap/es6/index.js +1 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +142 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1183 -0
- package/lib/tr-grid-util/es6/Color.d.ts +40 -0
- package/lib/tr-grid-util/es6/Color.js +210 -0
- package/lib/tr-grid-util/es6/Conflator.d.ts +34 -0
- package/lib/tr-grid-util/es6/Conflator.js +193 -0
- package/lib/tr-grid-util/es6/CoralItems.d.ts +10 -0
- package/lib/tr-grid-util/es6/CoralItems.js +42 -0
- package/lib/tr-grid-util/es6/DateTime.d.ts +57 -0
- package/lib/tr-grid-util/es6/DateTime.js +508 -0
- package/lib/tr-grid-util/es6/Deferred.d.ts +16 -0
- package/lib/tr-grid-util/es6/Deferred.js +108 -0
- package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
- package/lib/tr-grid-util/es6/Delay.js +96 -0
- package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
- package/lib/tr-grid-util/es6/Dom.js +350 -0
- package/lib/tr-grid-util/es6/DragUI.d.ts +20 -0
- package/lib/tr-grid-util/es6/DragUI.js +263 -0
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +12 -0
- package/lib/tr-grid-util/es6/ElementObserver.js +134 -0
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
- package/lib/tr-grid-util/es6/ElementWrapper.js +84 -0
- package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
- package/lib/tr-grid-util/es6/ElfDate.js +164 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +46 -0
- package/lib/tr-grid-util/es6/ElfUtil.js +637 -0
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +26 -0
- package/lib/tr-grid-util/es6/EventDispatcher.js +161 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +24 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.js +120 -0
- package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
- package/lib/tr-grid-util/es6/ExpressionParser.js +408 -0
- package/lib/tr-grid-util/es6/Ext.d.ts +10 -0
- package/lib/tr-grid-util/es6/Ext.js +52 -0
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +55 -0
- package/lib/tr-grid-util/es6/FieldFormatter.js +440 -0
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +54 -0
- package/lib/tr-grid-util/es6/FilterBuilder.js +580 -0
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +56 -0
- package/lib/tr-grid-util/es6/FilterOperators.js +255 -0
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +86 -0
- package/lib/tr-grid-util/es6/GridPlugin.js +1055 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +74 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.js +642 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
- package/lib/tr-grid-util/es6/Icon.js +62 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.js +250 -0
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +40 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +611 -0
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +85 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +528 -0
- package/lib/tr-grid-util/es6/PercentBar.d.ts +71 -0
- package/lib/tr-grid-util/es6/PercentBar.js +600 -0
- package/lib/tr-grid-util/es6/Perf.d.ts +32 -0
- package/lib/tr-grid-util/es6/Perf.js +163 -0
- package/lib/tr-grid-util/es6/Popup.d.ts +98 -0
- package/lib/tr-grid-util/es6/Popup.js +991 -0
- package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
- package/lib/tr-grid-util/es6/RangeBar.js +260 -0
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
- package/lib/tr-grid-util/es6/RequestQueue.js +228 -0
- package/lib/tr-grid-util/es6/RowPainter.d.ts +60 -0
- package/lib/tr-grid-util/es6/RowPainter.js +448 -0
- package/lib/tr-grid-util/es6/SubTable.d.ts +78 -0
- package/lib/tr-grid-util/es6/SubTable.js +642 -0
- package/lib/tr-grid-util/es6/Table.d.ts +146 -0
- package/lib/tr-grid-util/es6/Table.js +832 -0
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +16 -0
- package/lib/tr-grid-util/es6/TextHighlighter.js +268 -0
- package/lib/tr-grid-util/es6/TickCodes.d.ts +8 -0
- package/lib/tr-grid-util/es6/TickCodes.js +33 -0
- package/lib/tr-grid-util/es6/Timer.d.ts +16 -0
- package/lib/tr-grid-util/es6/Timer.js +49 -0
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +46 -0
- package/lib/tr-grid-util/es6/TouchProxy.js +212 -0
- package/lib/tr-grid-util/es6/Util.d.ts +66 -0
- package/lib/tr-grid-util/es6/Util.js +508 -0
- package/lib/tr-grid-util/es6/formula/ADCService.d.ts +11 -0
- package/lib/tr-grid-util/es6/formula/ADCService.js +72 -0
- package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +17 -0
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +317 -0
- package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +12 -0
- package/lib/tr-grid-util/es6/formula/AdFinService.js +61 -0
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +19 -0
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +310 -0
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +56 -0
- package/lib/tr-grid-util/es6/formula/Engine.js +592 -0
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +68 -0
- package/lib/tr-grid-util/es6/formula/Formula.js +890 -0
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +16 -0
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +165 -0
- package/lib/tr-grid-util/es6/formula/Realtime.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/Realtime.js +279 -0
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +203 -0
- package/lib/tr-grid-util/es6/formula/TSIService.d.ts +11 -0
- package/lib/tr-grid-util/es6/formula/TSIService.js +51 -0
- package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +1015 -0
- package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +30 -0
- package/lib/tr-grid-util/es6/formula/VariableToken.js +314 -0
- package/lib/tr-grid-util/es6/formula/functions/AdFin.d.ts +9 -0
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +1778 -0
- package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +21 -0
- package/lib/tr-grid-util/es6/formula/functions/Info.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Info.js +192 -0
- package/lib/tr-grid-util/es6/formula/functions/Internal.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +90 -0
- package/lib/tr-grid-util/es6/formula/functions/Logic.d.ts +12 -0
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +176 -0
- package/lib/tr-grid-util/es6/formula/functions/Math.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/functions/Math.js +1624 -0
- package/lib/tr-grid-util/es6/formula/functions/Statistics.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +234 -0
- package/lib/tr-grid-util/es6/formula/functions/Text.d.ts +10 -0
- package/lib/tr-grid-util/es6/formula/functions/Text.js +676 -0
- package/lib/tr-grid-util/es6/index.d.ts +65 -0
- package/lib/tr-grid-util/es6/index.js +102 -0
- package/lib/tr-grid-util/es6/jet/Adc.d.ts +9 -0
- package/lib/tr-grid-util/es6/jet/Adc.js +268 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +151 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +136 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +860 -0
- package/lib/tr-grid-util/es6/jet/DataSet.d.ts +8 -0
- package/lib/tr-grid-util/es6/jet/DataSet.js +392 -0
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +21 -0
- package/lib/tr-grid-util/es6/jet/MockArchive.js +56 -0
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +25 -0
- package/lib/tr-grid-util/es6/jet/MockJET.js +71 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +37 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +199 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +82 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +890 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +48 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.js +82 -0
- package/lib/tr-grid-util/es6/jet/MockUtil.d.ts +7 -0
- package/lib/tr-grid-util/es6/jet/MockUtil.js +25 -0
- package/lib/tr-grid-util/es6/jet/index.d.ts +9 -0
- package/lib/tr-grid-util/es6/jet/index.js +18 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +11 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +111 -0
- package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
- package/lib/tr-grid-util/es6/locale/translation-de.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-de.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-en.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-en.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-ja.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-ja.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-zh.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-zh.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation.d.ts +11 -0
- package/lib/tr-grid-util/es6/locale/translation.js +18 -0
- package/lib/types/es6/AutoTooltip.d.ts +46 -0
- package/lib/types/es6/CellSelection.d.ts +70 -0
- package/lib/types/es6/Checkbox.d.ts +82 -0
- package/lib/types/es6/ColumnDragging.d.ts +51 -0
- package/lib/types/es6/ColumnFitter.d.ts +56 -0
- package/lib/types/es6/ColumnFormatting.d.ts +92 -0
- package/lib/types/es6/ColumnGrouping.d.ts +107 -0
- package/lib/types/es6/ColumnResizing.d.ts +68 -0
- package/lib/types/es6/ColumnSelection.d.ts +77 -0
- package/lib/types/es6/ColumnStack.d.ts +160 -0
- package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +41 -0
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +289 -0
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +23 -0
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +41 -0
- package/lib/types/es6/CompositeGrid/Plugin.d.ts +30 -0
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +32 -0
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +44 -0
- package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +24 -0
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +46 -0
- package/lib/types/es6/CompositeGrid/index.d.ts +9 -0
- package/lib/types/es6/ConditionalColoring.d.ts +100 -0
- package/lib/types/es6/ContentWrap.d.ts +43 -0
- package/lib/types/es6/ContextMenu.d.ts +83 -0
- package/lib/types/es6/CoralButtonFormatter.d.ts +20 -0
- package/lib/types/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/types/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/types/es6/CoralIconFormatter.d.ts +21 -0
- package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/types/es6/CoralRadioButtonFormatter.d.ts +20 -0
- package/lib/types/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/types/es6/CoralToggleFormatter.d.ts +12 -0
- package/lib/types/es6/Core/data/ColumnStats.d.ts +42 -0
- package/lib/types/es6/Core/data/DataCache.d.ts +43 -0
- package/lib/types/es6/Core/data/DataTable.d.ts +156 -0
- package/lib/types/es6/Core/data/DataView.d.ts +332 -0
- package/lib/types/es6/Core/data/Segment.d.ts +91 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +84 -0
- package/lib/types/es6/Core/data/WrappedView.d.ts +290 -0
- package/lib/types/es6/Core/grid/Core.d.ts +455 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +212 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +37 -0
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +28 -0
- package/lib/types/es6/Core/grid/components/Cell.d.ts +52 -0
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +21 -0
- package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +40 -0
- package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +127 -0
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +28 -0
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +63 -0
- package/lib/types/es6/Core/grid/components/StretchedCells.d.ts +17 -0
- package/lib/types/es6/Core/grid/components/VScrollbar.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/VirtualItems.d.ts +12 -0
- package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +16 -0
- package/lib/types/es6/Core/grid/event/EventListeners.d.ts +34 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +155 -0
- package/lib/types/es6/Core/grid/util/CellBoundPainter.d.ts +16 -0
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
- package/lib/types/es6/Core/grid/util/Reverter.d.ts +14 -0
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +79 -0
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +54 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +92 -0
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
- package/lib/types/es6/Core/grid/util/util.d.ts +20 -0
- package/lib/types/es6/Core/index.d.ts +79 -0
- package/lib/types/es6/Core/tr-grid-theme.d.ts +5 -0
- package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
- package/lib/types/es6/EFButtonFormatter.d.ts +20 -0
- package/lib/types/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/types/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/types/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/types/es6/EFIconFormatter.d.ts +21 -0
- package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFRadioButtonFormatter.d.ts +20 -0
- package/lib/types/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/types/es6/EFTextFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFToggleFormatter.d.ts +12 -0
- package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
- package/lib/types/es6/ExtensionColumnOptions.d.ts +41 -0
- package/lib/types/es6/ExtensionOptions.d.ts +58 -0
- package/lib/types/es6/Extensions.d.ts +63 -0
- package/lib/types/es6/FilterInput.d.ts +64 -0
- package/lib/types/es6/FormatterBuilder.d.ts +26 -0
- package/lib/types/es6/GridFormatter.d.ts +63 -0
- package/lib/types/es6/HeatMap.d.ts +45 -0
- package/lib/types/es6/InCellEditing.d.ts +148 -0
- package/lib/types/es6/MenuEventAPI.d.ts +22 -0
- package/lib/types/es6/MenuItem.d.ts +41 -0
- package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/types/es6/Pagination.d.ts +58 -0
- package/lib/types/es6/PercentBar.d.ts +60 -0
- package/lib/types/es6/PercentBarFormatter.d.ts +25 -0
- package/lib/types/es6/PopupMenu.d.ts +33 -0
- package/lib/types/es6/RangeBar.d.ts +39 -0
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +176 -0
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +43 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +40 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +413 -0
- package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +40 -0
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +156 -0
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +36 -0
- package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +17 -0
- package/lib/types/es6/RealtimeGrid/index.d.ts +8 -0
- package/lib/types/es6/RowColoring.d.ts +64 -0
- package/lib/types/es6/RowDragging.d.ts +81 -0
- package/lib/types/es6/RowFiltering.d.ts +159 -0
- package/lib/types/es6/RowGrouping.d.ts +123 -0
- package/lib/types/es6/RowSegmenting.d.ts +109 -0
- package/lib/types/es6/RowSelection.d.ts +75 -0
- package/lib/types/es6/SimpleImageFormatter.d.ts +21 -0
- package/lib/types/es6/SimpleInputFormatter.d.ts +12 -0
- package/lib/types/es6/SimpleLinkFormatter.d.ts +21 -0
- package/lib/types/es6/SimpleTickerFormatter.d.ts +23 -0
- package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/types/es6/StatisticsRow.d.ts +68 -0
- package/lib/types/es6/TextFormatter.d.ts +12 -0
- package/lib/types/es6/TextFormatting.d.ts +72 -0
- package/lib/types/es6/TitleWrap.d.ts +27 -0
- package/lib/types/es6/Zoom.d.ts +52 -0
- package/lib/types/es6/index.d.ts +80 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +7 -0
- package/lib/versions.json +37 -0
- package/lib/window-exporter.js +18 -0
- package/lib/zoom/es6/Zoom.d.ts +52 -0
- package/lib/zoom/es6/Zoom.js +438 -0
- package/lib/zoom/es6/index.d.ts +1 -0
- package/lib/zoom/es6/index.js +1 -0
- package/package.json +69 -0
@@ -0,0 +1,2671 @@
|
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
4
|
+
import { Popup } from "../../tr-grid-util/es6/Popup.js";
|
5
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
6
|
+
import { isTouchDevice, injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
|
+
import { ElfDate } from "../../tr-grid-util/es6/ElfDate.js";
|
8
|
+
import { CoralItems } from "../../tr-grid-util/es6/CoralItems.js";
|
9
|
+
import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
10
|
+
|
11
|
+
/** @typedef {Object} InCellEditingPlugin~Options
|
12
|
+
* @description InCellEditingPlugin options that can be specified from `inCellEditing` property of the main grid's options
|
13
|
+
* @property {boolean=} balloonMode=false Show editor in a balloon. This is useful when there is not much space in the cell
|
14
|
+
* @property {boolean=} editableTitle=false If enabled, all column headers can be edited by double click
|
15
|
+
* @property {boolean=} editableContent=false If enabled, all content cells can be edited by double click. This can be overridden individual column configuration.
|
16
|
+
* @property {boolean=} autoCommitText=false If enabled, the text will be committed even if user leaving editor midway
|
17
|
+
* @property {boolean=} dataBinding=true If disabled, text will not be updated in the grid's data table
|
18
|
+
* @property {Element=} popupElement=null Element to be attached under the editor
|
19
|
+
* @property {boolean=} doubleClick=true If disabled, double click will not trigger editor
|
20
|
+
* @property {boolean=} tabToMove=false If enabled, pressing tab key while editor is active will open editor on the next editable cell.
|
21
|
+
* @property {string=} contentSource="textContent" By default, the text in the editor will be populated with textContent of the target cell. Use "field" to populated data from grid's data model. Use "empty" to shows empty editor.
|
22
|
+
* @property {boolean=} inlineStyling=false force inline styles regardless of elf version.
|
23
|
+
* @property {boolean=} disablingScroll=false Scrollbar will be frozen when editor opened. Deprecated in favor of uiBlocking
|
24
|
+
* @property {boolean=} uiBlocking=false append transparent overlay to block ui interaction
|
25
|
+
* @property {Function=} preEditorOpening=null Handler before editor is opened
|
26
|
+
* @property {Function=} editorOpened=null Handler after editor is opened
|
27
|
+
* @property {Function=} beforeCommit=null Handler before data binding, allowing data type conversion
|
28
|
+
* @property {Function=} editorClosed=null Handler after editor is closed
|
29
|
+
* @property {Function=} keyUp=null Handler for each keyup of the input text box
|
30
|
+
* @property {Function=} beforeRowCommit=null Handler before committing from all editors in the row
|
31
|
+
* @property {Function=} rowEditorClosed=null Handler after closing of all editors
|
32
|
+
* @property {Element=} autoSuggest=null Element of ef-autosuggest or atlas-autosuggest for handled with input cell
|
33
|
+
* @property {boolean=} closingOnScroll=true If disabled, the editor will not be automatically closed when scrolling grid.
|
34
|
+
* @property {boolean=} autoHiding=true If disabled, the editor will not be automatically closed when losing its focus.
|
35
|
+
* @property {boolean=} readonly=false If disabled, the editor will not be able to open, this property overwrite `editableContent` and `editableTitle`
|
36
|
+
* @property {(string|boolean)=} starterText=false if enable it, it will be show placeholder when no ric in grid, given string to overwrite wording
|
37
|
+
*/
|
38
|
+
|
39
|
+
/** @typedef {Object} InCellEditingPlugin~Cache
|
40
|
+
* @description Stored all important object relate to column that need to use in this plugin.
|
41
|
+
* @property {Element} editor Container element of input.
|
42
|
+
* @property {Element} balloonPopup balloon popup. It contains balloon element inside.
|
43
|
+
* @property {Element} inputElement Input element such as text input, numeric stepper, date-time picker.
|
44
|
+
*/
|
45
|
+
|
46
|
+
/** @typedef {Object} InCellEditingPlugin~EditorOptions
|
47
|
+
* @description Editor options specified through `inCellEditing` property on the column configuration object
|
48
|
+
* @property {string=} type="text" Specify type of the editor. Available types are text, number, dropdown, date, checkbox, and combobox.
|
49
|
+
* @property {Array=} entries=null Specify list of items available in the dropdown box
|
50
|
+
* @property {Object=} attributes=null Specify attribute of input element
|
51
|
+
*/
|
52
|
+
|
53
|
+
/** @typedef {Object} InCellEditingPlugin~ColumnOptions
|
54
|
+
* @description Column options that can be specified on each individual grid's column option:
|
55
|
+
* @property {boolean=} editableContent=false Make the column editable by double click
|
56
|
+
* @property {InCellEditingPlugin~EditorOptions=} inCellEditing Editor options give more refinements, such as "type" for specific editor type or "entries" for dropdown box
|
57
|
+
*/
|
58
|
+
|
59
|
+
/** @event InCellEditingPlugin#preEditorOpening
|
60
|
+
* @description Fired before the opening of text editor. This allows user to disable the editor on case by case basis
|
61
|
+
* @type {Object}
|
62
|
+
* @property {boolean=} cancel Set to true to cancel the openning operation.
|
63
|
+
* @example
|
64
|
+
* let cep = new InCellEditingPlugin();
|
65
|
+
* cep.listen("preEditorOpening", function(e) {
|
66
|
+
* e["cancel"] = true; // Cancel the editing process
|
67
|
+
* });
|
68
|
+
*/
|
69
|
+
|
70
|
+
/** @event InCellEditingPlugin#editorOpened
|
71
|
+
* @description Fired after the opening of text editor. Any visual customization can be done at this stage, including the text shown in the editor.
|
72
|
+
* @type {Object}
|
73
|
+
* @property {Object} dataSource DataView
|
74
|
+
* @property {number} rowIndex
|
75
|
+
* @property {string} field
|
76
|
+
* @property {Element} inputElement
|
77
|
+
* @property {Element} autoSuggest ef-autosuggest or atlas-autosuggest
|
78
|
+
* @example
|
79
|
+
* let cep = new InCellEditingPlugin();
|
80
|
+
* cep.listen("editorOpened", function(e) {
|
81
|
+
* let data = e.dataSource.getDataAt(e.rowIndex, e.field);
|
82
|
+
* e.inputElement.value = data + " aaa";
|
83
|
+
* });
|
84
|
+
*/
|
85
|
+
|
86
|
+
/** @event InCellEditingPlugin#editorClosed
|
87
|
+
* @description Fired after the text editor has been closed and all operations are done. This is useful to clean up left over resource and get result text entered.
|
88
|
+
* @type {Object}
|
89
|
+
* @property {*=} text Converted value from the text that user has entered. The value is used for the commit.
|
90
|
+
* @property {string=} enteredText Text that user has entered. The text is not used for the commit. The text will be undefined, if the text has not been changed from the initial text at the opening.
|
91
|
+
* @property {boolean=} groupHeader This value is set to true if the editing row is a group header.
|
92
|
+
* @property {boolean=} segmentSeparator This value is set to true if the editing row is a segment separator.
|
93
|
+
* @property {Object} suggestionDetail Suggestion detail for auto suggest "item-select" event
|
94
|
+
* @property {boolean} cancelled Readonly flag. Indicates whether the commit operation has been cancelled
|
95
|
+
* @property {boolean} committed Readonly flag. The opposite of `cancelled` flag
|
96
|
+
*/
|
97
|
+
|
98
|
+
/** @event InCellEditingPlugin#beforeCommit
|
99
|
+
* @description Fired before the actual text commit (i.e. after user press enter). This is used for validating or modifying user input, and canceling the operation
|
100
|
+
* @type {Object}
|
101
|
+
* @property {*=} text Converted value (with appropriate data type) from the text that user has entered. The value will be committed or stored on Grid.
|
102
|
+
* @property {string=} enteredText Text that user has entered. The text will NOT be committed or stored on Grid. The text will be undefined, if the text has not been changed from the initial text at the opening.
|
103
|
+
* @property {boolean=} cancel Set to true to cancel the commit operation.
|
104
|
+
* @property {boolean=} groupHeader This value is set to true if the editing row is a group header.
|
105
|
+
* @property {boolean=} segmentSeparator This value is set to true if the editing row is a segment separator.
|
106
|
+
* @property {Object} suggestionDetail Suggestion detail for auto suggest "item-select" event
|
107
|
+
* @example
|
108
|
+
* let cep = new InCellEditingPlugin();
|
109
|
+
* cep.listen("beforeCommit", function(e) {
|
110
|
+
* let num = +e.text; // Cast input type to number
|
111
|
+
* if(num === num) { // Check if string can be converted to number
|
112
|
+
* e.text = num; // Modify user input and continue commit operation (i.e. set data back to grid model)
|
113
|
+
* } else { // User entered something other than number
|
114
|
+
* e.cancel = true; // Cancel the commiting process
|
115
|
+
* }
|
116
|
+
* });
|
117
|
+
*/
|
118
|
+
|
119
|
+
/** @event InCellEditingPlugin#beforeRowCommit
|
120
|
+
* @description Fired before the actual text in row editor commit (i.e. after call api closeRowEditor(isCommit: true)). This is used for validating or modifying user input, and canceling the operation
|
121
|
+
* @type {Object}
|
122
|
+
* @property {Object} grid core grid instance
|
123
|
+
* @property {number} rowIndex row index that editor placed.
|
124
|
+
* @property {number} rowId row id, It's better to use row id as a reference to collect data.
|
125
|
+
* @property {Object} fieldValues Object that contains text in each field
|
126
|
+
* @property {Object} fieldValue Alias to fieldValues
|
127
|
+
* @property {boolean=} cancel Set to true to cancel the commit operation.
|
128
|
+
* @example
|
129
|
+
* let cep = new InCellEditingPlugin();
|
130
|
+
* cep.listen("beforeRowCommit", function(e) {
|
131
|
+
* let fieldValues = e.fieldValues;
|
132
|
+
* for(let field in fieldValues) {
|
133
|
+
* if(!fieldValues.hasOwnProperty(field)) continue;
|
134
|
+
* let value = fieldValues[field];
|
135
|
+
* if(checkValid(value)) { // check value is valid
|
136
|
+
* fieldValues[field] = value + "foo bar"; // modify text
|
137
|
+
* } else {
|
138
|
+
* e.cancel = true; // if not valid maybe cancel commit
|
139
|
+
* break;
|
140
|
+
* }
|
141
|
+
* }
|
142
|
+
* });
|
143
|
+
*/
|
144
|
+
|
145
|
+
/** @event InCellEditingPlugin#rowEditorOpened
|
146
|
+
* @description Fired after the opening of text editor in row editing mode
|
147
|
+
* @type {Object}
|
148
|
+
* @property {number} rowIndex
|
149
|
+
* @property {string} rowId
|
150
|
+
* @property {Object} grid Core grid instance
|
151
|
+
* @property {Array.<string>} fields
|
152
|
+
* @property {Array} cells Array of Cell instances
|
153
|
+
* @property {Array.<Element>} inputs Array of input elements
|
154
|
+
* @property {Array} initialValues Array of data retrieved from Grid corresponding to the cells/inputs
|
155
|
+
* @property {Object} fieldValues Object that contains text in each field
|
156
|
+
*/
|
157
|
+
/** @event InCellEditingPlugin#rowEditorClosed
|
158
|
+
* @description Fired after the text editor has been closed and all operations are done. This is useful to clean up left over resource and get result text entered.
|
159
|
+
* @type {Object}
|
160
|
+
* @property {number} rowIndex
|
161
|
+
* @property {string} rowId
|
162
|
+
* @property {Object} grid Core grid instance
|
163
|
+
* @property {Array.<string>} fields
|
164
|
+
* @property {Array} cells Array of Cell instances
|
165
|
+
* @property {Array.<Element>} inputs Array of input elements
|
166
|
+
* @property {Object} fieldValues Object that contains text in each field
|
167
|
+
* @property {Object} fieldValue Alias to fieldValues
|
168
|
+
* @property {boolean} committed Indicates whether the commit operation has been done or not.
|
169
|
+
*/
|
170
|
+
|
171
|
+
/** @event InCellEditingPlugin#keyUp
|
172
|
+
* @description Fired after user key some letter to editior. This is useful to listen every text chnage.
|
173
|
+
*/
|
174
|
+
|
175
|
+
/** Double-click to activate editing mode
|
176
|
+
* @constructor
|
177
|
+
* @param {InCellEditingPlugin~Options=} options
|
178
|
+
* @extends {GridPlugin}
|
179
|
+
*/
|
180
|
+
let InCellEditingPlugin = function (options) {
|
181
|
+
let t = this;
|
182
|
+
t._onDoubleClick = t._onDoubleClick.bind(t);
|
183
|
+
t._onPopupHide = t._onPopupHide.bind(t);
|
184
|
+
t._onScroll = t._onScroll.bind(t);
|
185
|
+
t._onTextKeyDown = t._onTextKeyDown.bind(t);
|
186
|
+
t._onTextKeyUp = t._onTextKeyUp.bind(t);
|
187
|
+
t._onTouchStart = t._onTouchStart.bind(t);
|
188
|
+
t._onTouchEnd = t._onTouchEnd.bind(t);
|
189
|
+
t._onTouchTimer = t._onTouchTimer.bind(t);
|
190
|
+
t._createContentEditor = t._createContentEditor.bind(t);
|
191
|
+
t._createTitleEditor = t._createTitleEditor.bind(t);
|
192
|
+
t._onColumnAdded = t._onColumnAdded.bind(t);
|
193
|
+
t._onValueChanged = t._onValueChanged.bind(t);
|
194
|
+
t._onMultiSelectionValueChanged = t._onMultiSelectionValueChanged.bind(t);
|
195
|
+
t._onMultiSelectionEditorChanged = t._onMultiSelectionEditorChanged.bind(t);
|
196
|
+
t._onAutoSuggestItemSelected = t._onAutoSuggestItemSelected.bind(t);
|
197
|
+
t._firstRendered = t._firstRendered.bind(t);
|
198
|
+
t._onGridKeyDown = t._onGridKeyDown.bind(t);
|
199
|
+
t._onRicAdded = t._onRicAdded.bind(t);
|
200
|
+
t._onRicRemoved = t._onRicRemoved.bind(t);
|
201
|
+
t._onColumnChanged = t._onColumnChanged.bind(t);
|
202
|
+
t._onRowCountChanged = t._onRowCountChanged.bind(t);
|
203
|
+
t._requestUpdateStarterText = t._requestUpdateStarterText.bind(t);
|
204
|
+
t._updateStarterTextConflator = new Conflator(100, this._requestUpdateStarterText);
|
205
|
+
t._hosts = [];
|
206
|
+
|
207
|
+
if(options) {
|
208
|
+
this.config({"inCellEditing": options});
|
209
|
+
}
|
210
|
+
};
|
211
|
+
Ext.inherits(InCellEditingPlugin, GridPlugin);
|
212
|
+
|
213
|
+
/** @type {Object}
|
214
|
+
* @private
|
215
|
+
* @static
|
216
|
+
*/
|
217
|
+
InCellEditingPlugin._uiElementTypesMap = {
|
218
|
+
"input": "input",
|
219
|
+
"text": "input",
|
220
|
+
"number": "ef-number-field",
|
221
|
+
"select": "ef-select",
|
222
|
+
"dropdown": "ef-select",
|
223
|
+
"date": "ef-datetime-picker",
|
224
|
+
"checkbox": "ef-checkbox",
|
225
|
+
"boolean": "ef-checkbox",
|
226
|
+
"combobox": "ef-combo-box"
|
227
|
+
};
|
228
|
+
|
229
|
+
/** @type {boolean}
|
230
|
+
* @private
|
231
|
+
*/
|
232
|
+
InCellEditingPlugin.prototype._editableTitle = false;
|
233
|
+
/** @type {boolean}
|
234
|
+
* @private
|
235
|
+
*/
|
236
|
+
InCellEditingPlugin.prototype._editableContent = false;
|
237
|
+
|
238
|
+
/** Position of text editor is active.
|
239
|
+
* @type {Object}
|
240
|
+
* @private
|
241
|
+
*/
|
242
|
+
InCellEditingPlugin.prototype._activePos = null;
|
243
|
+
|
244
|
+
/** Where the cell was user double-cliked.
|
245
|
+
* @type {Object}
|
246
|
+
* @private
|
247
|
+
*/
|
248
|
+
InCellEditingPlugin.prototype._activeCell = null;
|
249
|
+
|
250
|
+
/** row id that editor placed
|
251
|
+
* @type {string}
|
252
|
+
* @private
|
253
|
+
*/
|
254
|
+
InCellEditingPlugin.prototype._activeRowId = "";
|
255
|
+
|
256
|
+
/** Previous core grid object that editor open.
|
257
|
+
* @type {Object}
|
258
|
+
* @private
|
259
|
+
*/
|
260
|
+
InCellEditingPlugin.prototype._lastActiveGrid = null;
|
261
|
+
|
262
|
+
/** Previous content cell before user editited, use to rollback when user cancelled.
|
263
|
+
* @type {*}
|
264
|
+
* @private
|
265
|
+
*/
|
266
|
+
InCellEditingPlugin.prototype._prevContent = null;
|
267
|
+
|
268
|
+
/** @type {string}
|
269
|
+
* @private
|
270
|
+
*/
|
271
|
+
InCellEditingPlugin.prototype._initialText = "";
|
272
|
+
|
273
|
+
/** @type {!InCellEditingPlugin~Cache}
|
274
|
+
* @private
|
275
|
+
*/
|
276
|
+
InCellEditingPlugin.prototype._headerInCellCache = null;
|
277
|
+
|
278
|
+
/** @type {!InCellEditingPlugin~Cache}
|
279
|
+
* @private
|
280
|
+
*/
|
281
|
+
InCellEditingPlugin.prototype._activeInCellCache = null;
|
282
|
+
|
283
|
+
/** @type {boolean}
|
284
|
+
* @private
|
285
|
+
*/
|
286
|
+
InCellEditingPlugin.prototype._usingBalloon = false;
|
287
|
+
|
288
|
+
/** @type {boolean}
|
289
|
+
* @private
|
290
|
+
*/
|
291
|
+
InCellEditingPlugin.prototype._balloonMode = false;
|
292
|
+
|
293
|
+
/** @type {boolean}
|
294
|
+
* @private
|
295
|
+
*/
|
296
|
+
InCellEditingPlugin.prototype._dataBinding = true;
|
297
|
+
|
298
|
+
/** @type {boolean}
|
299
|
+
* @private
|
300
|
+
*/
|
301
|
+
InCellEditingPlugin.prototype._dblClick = true;
|
302
|
+
|
303
|
+
/** @type {boolean}
|
304
|
+
* @private
|
305
|
+
*/
|
306
|
+
InCellEditingPlugin.prototype._autoCommitText = false;
|
307
|
+
|
308
|
+
/** @type {number}
|
309
|
+
* @private
|
310
|
+
*/
|
311
|
+
InCellEditingPlugin.prototype._touchTimerId = 0;
|
312
|
+
|
313
|
+
/** @type {number}
|
314
|
+
* @private
|
315
|
+
*/
|
316
|
+
InCellEditingPlugin.prototype._longPressTime = 1000; // For touch screen
|
317
|
+
|
318
|
+
/** @type {boolean}
|
319
|
+
* @private
|
320
|
+
*/
|
321
|
+
InCellEditingPlugin.prototype._editing = false;
|
322
|
+
|
323
|
+
/** Where other element stored.
|
324
|
+
* @type {Element}
|
325
|
+
* @private
|
326
|
+
*/
|
327
|
+
InCellEditingPlugin.prototype._customElement = null;
|
328
|
+
|
329
|
+
/** Popup element where custom element stored.
|
330
|
+
* @type {Popup}
|
331
|
+
* @private
|
332
|
+
*/
|
333
|
+
InCellEditingPlugin.prototype._customElementPopup = null;
|
334
|
+
/** @type {Number}
|
335
|
+
* @private
|
336
|
+
*/
|
337
|
+
InCellEditingPlugin.prototype._tabToMove = false;
|
338
|
+
/** @type {string}
|
339
|
+
* @private
|
340
|
+
*/
|
341
|
+
InCellEditingPlugin.prototype._contentSource = "textContent";
|
342
|
+
/** @type {boolean}
|
343
|
+
* @private
|
344
|
+
*/
|
345
|
+
InCellEditingPlugin.prototype._inlineStyling = false;
|
346
|
+
/** @type {boolean}
|
347
|
+
* @private
|
348
|
+
*/
|
349
|
+
InCellEditingPlugin.prototype._disablingScroll = false;
|
350
|
+
/** @type {boolean}
|
351
|
+
* @private
|
352
|
+
*/
|
353
|
+
InCellEditingPlugin.prototype._uiBlocking = false;
|
354
|
+
/** @type {Element}
|
355
|
+
* @private
|
356
|
+
*/
|
357
|
+
InCellEditingPlugin.prototype._autoSuggest = null;
|
358
|
+
/** @type {string}
|
359
|
+
* @private
|
360
|
+
*/
|
361
|
+
InCellEditingPlugin.prototype._defaultTag = "input";
|
362
|
+
/** status to show that row is closing
|
363
|
+
* @type {boolean}
|
364
|
+
* @private
|
365
|
+
*/
|
366
|
+
InCellEditingPlugin.prototype._rowClosing = false;
|
367
|
+
/** @type {boolean}
|
368
|
+
* @private
|
369
|
+
*/
|
370
|
+
InCellEditingPlugin.prototype._closingOnScroll = true;
|
371
|
+
/** @type {boolean}
|
372
|
+
* @private
|
373
|
+
*/
|
374
|
+
InCellEditingPlugin.prototype._autoHiding = true;
|
375
|
+
/** @type {boolean}
|
376
|
+
* @private
|
377
|
+
*/
|
378
|
+
InCellEditingPlugin.prototype._readonly = false;
|
379
|
+
/** @type {string}
|
380
|
+
* @private
|
381
|
+
*/
|
382
|
+
InCellEditingPlugin.prototype._starterText = "";
|
383
|
+
/** @type {Object}
|
384
|
+
* @private
|
385
|
+
*/
|
386
|
+
InCellEditingPlugin.prototype._starterTextPopup = null;
|
387
|
+
/** @type {number}
|
388
|
+
* @private
|
389
|
+
*/
|
390
|
+
InCellEditingPlugin.prototype._editorTimerId = 0;
|
391
|
+
/** @type {Object}
|
392
|
+
* @private
|
393
|
+
*/
|
394
|
+
InCellEditingPlugin.prototype._rowSelectionPlugin = null;
|
395
|
+
/** @type {boolean}
|
396
|
+
* @private
|
397
|
+
*/
|
398
|
+
InCellEditingPlugin._scrolling = false;
|
399
|
+
|
400
|
+
|
401
|
+
/** @type {number}
|
402
|
+
* @private
|
403
|
+
*/
|
404
|
+
InCellEditingPlugin.prototype._elfVersion = 0;
|
405
|
+
/** @type {string}
|
406
|
+
* @private
|
407
|
+
*/
|
408
|
+
InCellEditingPlugin._primaryColor = "";
|
409
|
+
|
410
|
+
/** @type {string}
|
411
|
+
* @private
|
412
|
+
*/
|
413
|
+
InCellEditingPlugin._styles = prettifyCss([
|
414
|
+
":host .cell.editing input[type=text]", [
|
415
|
+
"border-style: solid;"
|
416
|
+
],
|
417
|
+
":host .cell.editing", [
|
418
|
+
"z-index: 2;"
|
419
|
+
],
|
420
|
+
":host .starter-text", [
|
421
|
+
"padding: var(--grid-cell-padding,0 8px 0 8px);",
|
422
|
+
"pointer-events: none;"
|
423
|
+
]
|
424
|
+
]);
|
425
|
+
|
426
|
+
/** @private
|
427
|
+
*/
|
428
|
+
InCellEditingPlugin._onThemeLoaded = function () {
|
429
|
+
let colors = ElfUtil.getColors();
|
430
|
+
InCellEditingPlugin._primaryColor = colors.primary;
|
431
|
+
};
|
432
|
+
|
433
|
+
/** @private
|
434
|
+
* @param {string} tag element tag
|
435
|
+
* @param {Object=} attributes attribute of input element
|
436
|
+
* @return {Element} input element
|
437
|
+
*/
|
438
|
+
InCellEditingPlugin.prototype._createInputElement = function (tag, attributes) {
|
439
|
+
let t = this;
|
440
|
+
let elem = document.createElement(tag);
|
441
|
+
for(let attribute in attributes) {
|
442
|
+
elem.setAttribute(attribute, attributes[attribute]);
|
443
|
+
}
|
444
|
+
|
445
|
+
let typeMap = InCellEditingPlugin._uiElementTypesMap;
|
446
|
+
// Resolve elf theme style
|
447
|
+
elem.style.width = "100%";
|
448
|
+
elem.style.height = "100%";
|
449
|
+
elem.style.margin = "0";
|
450
|
+
elem.style.borderColor = InCellEditingPlugin._primaryColor || "#ee7600";
|
451
|
+
elem.style.maxHeight = "unset";
|
452
|
+
|
453
|
+
if(tag === typeMap.checkbox) {
|
454
|
+
elem.style.borderStyle = "solid";
|
455
|
+
elem.style.borderWidth = "1px";
|
456
|
+
elem.style.boxSizing = "border-box";
|
457
|
+
elem.style.display = "flex";
|
458
|
+
elem.style.justifyContent = "center";
|
459
|
+
elem.addEventListener("keydown", function (e) {
|
460
|
+
if(e.keyCode === 13) {
|
461
|
+
e.preventDefault();
|
462
|
+
}
|
463
|
+
});
|
464
|
+
} else if(
|
465
|
+
tag === typeMap.select ||
|
466
|
+
tag === typeMap.combobox ||
|
467
|
+
tag === typeMap.date) {
|
468
|
+
|
469
|
+
if(tag === typeMap.combobox && attributes && attributes["multiple"]){
|
470
|
+
elem.addEventListener("value-changed", t._onMultiSelectionValueChanged);
|
471
|
+
elem.addEventListener("opened-changed", t._onMultiSelectionEditorChanged);
|
472
|
+
} else {
|
473
|
+
elem.addEventListener("value-changed", t._onValueChanged);
|
474
|
+
}
|
475
|
+
} else if(tag === "ef-input") {
|
476
|
+
elem.setAttribute("type", "number");
|
477
|
+
} else if(tag === typeMap.input) {
|
478
|
+
elem.setAttribute("type", "text");
|
479
|
+
}
|
480
|
+
if(this._autoSuggest) {
|
481
|
+
this._autoSuggest.addEventListener("item-select", t._onAutoSuggestItemSelected);
|
482
|
+
this._autoSuggest.addEventListener("wheel", t._stopPropagation, false);
|
483
|
+
}
|
484
|
+
|
485
|
+
elem.addEventListener("keydown", t._onTextKeyDown, false);
|
486
|
+
elem.addEventListener("keyup", t._onTextKeyUp, false);
|
487
|
+
elem.addEventListener("mousedown", t._stopPropagation, false);
|
488
|
+
elem.addEventListener("mouseup", t._stopPropagation, false);
|
489
|
+
elem.addEventListener("click", t._stopPropagation, false);
|
490
|
+
elem.addEventListener("copy", t._stopPropagation, false);
|
491
|
+
elem.addEventListener("cut", t._stopPropagation, false);
|
492
|
+
elem.addEventListener("paste", t._stopPropagation, false);
|
493
|
+
return elem;
|
494
|
+
};
|
495
|
+
|
496
|
+
/** @private
|
497
|
+
* @return {Element}
|
498
|
+
*/
|
499
|
+
InCellEditingPlugin.prototype._createEditor = function () {
|
500
|
+
let editor = document.createElement("div");
|
501
|
+
editor.className = "cell editing";
|
502
|
+
editor.style.position = "absolute";
|
503
|
+
return editor;
|
504
|
+
};
|
505
|
+
|
506
|
+
/** @private
|
507
|
+
* @param {Element} editor
|
508
|
+
* @return {Popup} popup instance
|
509
|
+
*/
|
510
|
+
InCellEditingPlugin.prototype._createBalloonPopup = function (editor) {
|
511
|
+
let popup = new Popup(editor, { positioning: "over" });
|
512
|
+
return popup;
|
513
|
+
};
|
514
|
+
|
515
|
+
/** @private
|
516
|
+
* @param {Object} grid core grid object
|
517
|
+
* @param {string} elemTag
|
518
|
+
* @param {Object=} attributes of element
|
519
|
+
* @return {object} inCellCache
|
520
|
+
*/
|
521
|
+
InCellEditingPlugin.prototype._createInCellCache = function (grid, elemTag, attributes) {
|
522
|
+
let t = this;
|
523
|
+
|
524
|
+
let editor = t._createEditor();
|
525
|
+
let inputElement = t._createInputElement(elemTag, attributes);
|
526
|
+
let balloonPopup = new Popup(editor, { positioning: "over" });
|
527
|
+
editor.appendChild(inputElement);
|
528
|
+
|
529
|
+
return {
|
530
|
+
grid: grid,
|
531
|
+
inputElement: inputElement,
|
532
|
+
editor: editor,
|
533
|
+
balloonPopup: balloonPopup
|
534
|
+
};
|
535
|
+
};
|
536
|
+
|
537
|
+
/** @private
|
538
|
+
* @param {Object} grid core grid object
|
539
|
+
* @return {object} inCellCache
|
540
|
+
*/
|
541
|
+
InCellEditingPlugin.prototype._createTitleEditor = function (grid) {
|
542
|
+
let t = this;
|
543
|
+
if(!t._headerInCellCache) {
|
544
|
+
t._headerInCellCache = t._createInCellCache(grid, "input");
|
545
|
+
}
|
546
|
+
|
547
|
+
return t._headerInCellCache;
|
548
|
+
};
|
549
|
+
|
550
|
+
/** @private
|
551
|
+
* @param {number} columnIndex
|
552
|
+
* @param {Object} grid core grid object
|
553
|
+
* @return {object} inCellCache
|
554
|
+
*/
|
555
|
+
InCellEditingPlugin.prototype._createContentEditor = function (columnIndex, grid) {
|
556
|
+
let t = this;
|
557
|
+
let typeMap = InCellEditingPlugin._uiElementTypesMap;
|
558
|
+
let columnData = t._getColumnData(columnIndex, grid);
|
559
|
+
let inCellColumnConfig = columnData["inCellEditing"];
|
560
|
+
let elemTag = typeMap[inCellColumnConfig && inCellColumnConfig.type] || t._defaultTag;
|
561
|
+
|
562
|
+
if(!columnData["inCellCache"]) {
|
563
|
+
let attributes = inCellColumnConfig ? inCellColumnConfig.attributes : null;
|
564
|
+
columnData["inCellCache"] = t._createInCellCache(grid, elemTag, attributes);
|
565
|
+
}
|
566
|
+
let inCellCache = columnData["inCellCache"];
|
567
|
+
|
568
|
+
// Setup initial value for the editor
|
569
|
+
if(elemTag === typeMap.select || elemTag === typeMap.combobox) {
|
570
|
+
inCellCache["inputElement"].data = inCellColumnConfig && inCellColumnConfig.entries;
|
571
|
+
}
|
572
|
+
|
573
|
+
return inCellCache;
|
574
|
+
};
|
575
|
+
/** @override
|
576
|
+
* @return {string}
|
577
|
+
*/
|
578
|
+
InCellEditingPlugin.prototype.getName = function () {
|
579
|
+
return "InCellEditingPlugin";
|
580
|
+
};
|
581
|
+
|
582
|
+
/** @private
|
583
|
+
* @param {Event|Element} e
|
584
|
+
*/
|
585
|
+
InCellEditingPlugin.prototype._onColumnAdded = function(e) {
|
586
|
+
if(e.context && e.colIndex != null) {
|
587
|
+
// e.context is a columnOption;
|
588
|
+
this._retrieveColumnOption(e.context, e.colIndex);
|
589
|
+
}
|
590
|
+
};
|
591
|
+
|
592
|
+
/** @private
|
593
|
+
* @param {Event} e
|
594
|
+
*/
|
595
|
+
InCellEditingPlugin.prototype._onRicAdded = function(e) {
|
596
|
+
this._requestUpdateStarterText(false);
|
597
|
+
};
|
598
|
+
|
599
|
+
/** @private
|
600
|
+
* @param {Event} e
|
601
|
+
*/
|
602
|
+
InCellEditingPlugin.prototype._onRicRemoved = function(e) {
|
603
|
+
if(this._realTimeGrid && !this._realTimeGrid.hasRic()) {
|
604
|
+
this._requestUpdateStarterText();
|
605
|
+
}
|
606
|
+
};
|
607
|
+
|
608
|
+
/** @private
|
609
|
+
* @param {Event} e
|
610
|
+
*/
|
611
|
+
InCellEditingPlugin.prototype._onColumnChanged = function(e) {
|
612
|
+
this._requestUpdateStarterText();
|
613
|
+
};
|
614
|
+
|
615
|
+
|
616
|
+
/** @private
|
617
|
+
* @param {Event} e
|
618
|
+
*/
|
619
|
+
InCellEditingPlugin.prototype._onRowCountChanged = function(e) {
|
620
|
+
this._requestUpdateStarterText();
|
621
|
+
};
|
622
|
+
|
623
|
+
/** Called by grid system when initial plugins.
|
624
|
+
* @public
|
625
|
+
* @param {Object} host core grid object
|
626
|
+
* @param {Object} options
|
627
|
+
*/
|
628
|
+
InCellEditingPlugin.prototype.initialize = function (host, options) {
|
629
|
+
if(this._hosts.indexOf(host) >= 0) { return; }
|
630
|
+
|
631
|
+
if(!this._hosts.length) {
|
632
|
+
window.addEventListener("scroll", this._onScroll);
|
633
|
+
}
|
634
|
+
|
635
|
+
host.listen("columnAdded", this._onColumnAdded);
|
636
|
+
host.listen("firstRendered", this._firstRendered);
|
637
|
+
host.listen("keydown", this._onGridKeyDown);
|
638
|
+
host.listen("columnAdded", this._onColumnChanged);
|
639
|
+
host.listen("columnRemoved", this._onColumnChanged);
|
640
|
+
host.listen("rowAdded", this._onRowCountChanged);
|
641
|
+
host.listen("rowRemoved", this._onRowCountChanged);
|
642
|
+
|
643
|
+
host.getVScrollbar().listen("scroll", this._onScroll);
|
644
|
+
host.getHScrollbar().listen("scroll", this._onScroll);
|
645
|
+
|
646
|
+
if(this._dblClick) {
|
647
|
+
host.listen("dblclick", this._onDoubleClick);
|
648
|
+
|
649
|
+
// Make a comparable functionality for touchscreen
|
650
|
+
if(isTouchDevice()) {
|
651
|
+
host.listen("touchstart", this._onTouchStart);
|
652
|
+
host.listen("touchend", this._onTouchEnd);
|
653
|
+
host.listen("touchcancel", this._onTouchEnd);
|
654
|
+
}
|
655
|
+
}
|
656
|
+
|
657
|
+
this._hosts.push(host);
|
658
|
+
|
659
|
+
let elemMap = InCellEditingPlugin._uiElementTypesMap;
|
660
|
+
if(ElfUtil.getElfVersion() < 4) {
|
661
|
+
// ef-input available in elf version < 4
|
662
|
+
elemMap["number"] = "ef-input";
|
663
|
+
}
|
664
|
+
if(ElfUtil.getElfVersion() >= 6) {
|
665
|
+
elemMap["number"] = "ef-number-field";
|
666
|
+
elemMap["select"] = "ef-select";
|
667
|
+
elemMap["dropdown"] = "ef-select";
|
668
|
+
elemMap["date"] = "ef-datetime-picker";
|
669
|
+
elemMap["checkbox"] = "ef-checkbox";
|
670
|
+
elemMap["boolean"] = "ef-checkbox";
|
671
|
+
elemMap["combobox"] = "ef-combo-box";
|
672
|
+
}
|
673
|
+
|
674
|
+
if(ElfUtil.isHaloTheme()) {
|
675
|
+
if(!host._inCellEditingStyles) {
|
676
|
+
host._inCellEditingStyles = true;
|
677
|
+
injectCss(InCellEditingPlugin._styles, host.getElement());
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
this.config(options);
|
682
|
+
|
683
|
+
if(!InCellEditingPlugin._primaryColor) {
|
684
|
+
ElfUtil.getThemeColors().then(InCellEditingPlugin._onThemeLoaded).catch(InCellEditingPlugin._onThemeLoaded);
|
685
|
+
}
|
686
|
+
};
|
687
|
+
/** Remove redundant built-in composite-grid feature
|
688
|
+
* @public
|
689
|
+
* @param {string} optionName
|
690
|
+
* @param {*} optionVal
|
691
|
+
* @return {*} The transformed value of the option
|
692
|
+
*/
|
693
|
+
InCellEditingPlugin.prototype.beforeProcessOption = function (optionName, optionVal) {
|
694
|
+
if(optionName == "cellEditing") {
|
695
|
+
return null; // eslint-disable-line
|
696
|
+
}
|
697
|
+
return; // eslint-disable-line
|
698
|
+
};
|
699
|
+
/** @private
|
700
|
+
* @override
|
701
|
+
*/
|
702
|
+
InCellEditingPlugin.prototype._afterInit = function () {
|
703
|
+
this._elfVersion = ElfUtil.getElfVersion();
|
704
|
+
if(this._realTimeGrid) {
|
705
|
+
this._realTimeGrid.listen("ricAdded", this._onRicAdded);
|
706
|
+
this._realTimeGrid.listen("ricRemoved", this._onRicRemoved);
|
707
|
+
}
|
708
|
+
};
|
709
|
+
|
710
|
+
/** @private
|
711
|
+
*/
|
712
|
+
InCellEditingPlugin.prototype._firstRendered = function () {
|
713
|
+
if(!this._readonly && this._starterText) {
|
714
|
+
this._requestUpdateStarterText();
|
715
|
+
}
|
716
|
+
};
|
717
|
+
|
718
|
+
/** @public
|
719
|
+
* @param {Object=} options
|
720
|
+
*/
|
721
|
+
InCellEditingPlugin.prototype.config = function(options) {
|
722
|
+
if(!options) {
|
723
|
+
return;
|
724
|
+
}
|
725
|
+
let t = this;
|
726
|
+
|
727
|
+
// config column
|
728
|
+
let columns = options["columns"];
|
729
|
+
if(columns) {
|
730
|
+
let len = columns.length;
|
731
|
+
for(let c = 0; c < len; ++c) {
|
732
|
+
t._retrieveColumnOption(columns[c], c);
|
733
|
+
}
|
734
|
+
}
|
735
|
+
|
736
|
+
let pluginOption = options["inCellEditing"];
|
737
|
+
if(!pluginOption) return;
|
738
|
+
|
739
|
+
// options
|
740
|
+
if(pluginOption["type"])
|
741
|
+
t._defaultTag = InCellEditingPlugin._uiElementTypesMap[pluginOption["type"]];
|
742
|
+
|
743
|
+
if(pluginOption["balloonMode"])
|
744
|
+
t.enableBalloonMode(pluginOption["balloonMode"]);
|
745
|
+
|
746
|
+
if(pluginOption["editableTitle"])
|
747
|
+
t.enableTitleEditing(pluginOption["editableTitle"]);
|
748
|
+
|
749
|
+
if(pluginOption["editableContent"])
|
750
|
+
t._editableContent = true;
|
751
|
+
|
752
|
+
if(pluginOption["tabToMove"])
|
753
|
+
t._tabToMove = true;
|
754
|
+
|
755
|
+
if(pluginOption["autoCommitText"])
|
756
|
+
t.enableAutoCommitText(pluginOption["autoCommitText"]);
|
757
|
+
|
758
|
+
if(pluginOption["dataBinding"] != null)
|
759
|
+
t.disableDataBinding(!pluginOption["dataBinding"]);
|
760
|
+
|
761
|
+
if(pluginOption["contentSource"] != null)
|
762
|
+
t._contentSource = pluginOption["contentSource"];
|
763
|
+
|
764
|
+
if(pluginOption["popupElement"]){
|
765
|
+
t.setPopupElement(pluginOption["popupElement"]);
|
766
|
+
}
|
767
|
+
|
768
|
+
if(pluginOption["doubleClick"] != null)
|
769
|
+
t.disableDblClick(!pluginOption["doubleClick"]);
|
770
|
+
|
771
|
+
if(pluginOption["inlineStyling"]) {
|
772
|
+
t._inlineStyling = true;
|
773
|
+
}
|
774
|
+
|
775
|
+
if(pluginOption["disablingScroll"]) {
|
776
|
+
t._disablingScroll = true;
|
777
|
+
}
|
778
|
+
|
779
|
+
if(pluginOption["uiBlocking"]) {
|
780
|
+
t._uiBlocking = true;
|
781
|
+
}
|
782
|
+
|
783
|
+
if(pluginOption["autoSuggest"]) {
|
784
|
+
t._autoSuggest = pluginOption["autoSuggest"];
|
785
|
+
}
|
786
|
+
|
787
|
+
if(pluginOption["closingOnScroll"] == false) {
|
788
|
+
t._closingOnScroll = false;
|
789
|
+
}
|
790
|
+
if(pluginOption["autoHiding"] == false) {
|
791
|
+
t._autoHiding = false;
|
792
|
+
}
|
793
|
+
if(pluginOption["readonly"] == true) {
|
794
|
+
t._readonly = true;
|
795
|
+
}
|
796
|
+
if(pluginOption["starterText"] !== null) {
|
797
|
+
if(typeof pluginOption["starterText"] === "string") {
|
798
|
+
t._starterText = pluginOption["starterText"];
|
799
|
+
} else {
|
800
|
+
t._starterText = pluginOption["starterText"] ? "Type to add" : false;
|
801
|
+
}
|
802
|
+
}
|
803
|
+
|
804
|
+
// event callback
|
805
|
+
t.addListener(pluginOption, "preEditorOpening");
|
806
|
+
t.addListener(pluginOption, "editorOpened");
|
807
|
+
t.addListener(pluginOption, "beforeCommit");
|
808
|
+
t.addListener(pluginOption, "editorClosed");
|
809
|
+
t.addListener(pluginOption, "keyUp");
|
810
|
+
t.addListener(pluginOption, "rowEditorOpened");
|
811
|
+
t.addListener(pluginOption, "beforeRowCommit");
|
812
|
+
t.addListener(pluginOption, "rowEditorClosed");
|
813
|
+
};
|
814
|
+
|
815
|
+
/** @private
|
816
|
+
* @param {Object} obj
|
817
|
+
* @param {string} propName
|
818
|
+
* @param {boolean} propValue
|
819
|
+
* @param {boolean} defaultValue
|
820
|
+
* @returns {number} dirty
|
821
|
+
*/
|
822
|
+
let _setBooleanOption = function(obj, propName, propValue, defaultValue) {
|
823
|
+
if(defaultValue) {
|
824
|
+
if(!propValue) {
|
825
|
+
obj[propName] = false;
|
826
|
+
return true;
|
827
|
+
}
|
828
|
+
} else if(propValue) {
|
829
|
+
obj[propName] = true;
|
830
|
+
return true;
|
831
|
+
}
|
832
|
+
return false;
|
833
|
+
};
|
834
|
+
/** Get a current state of grid and extension config
|
835
|
+
* @public
|
836
|
+
* @param {Object=} out_obj
|
837
|
+
* @returns {!Object}
|
838
|
+
*/
|
839
|
+
InCellEditingPlugin.prototype.getConfigObject = function (out_obj) {
|
840
|
+
let obj = out_obj || {};
|
841
|
+
|
842
|
+
let columns = obj.columns;
|
843
|
+
if(!columns) {
|
844
|
+
columns = obj.columns = [];
|
845
|
+
}
|
846
|
+
|
847
|
+
let len = this.getColumnCount();
|
848
|
+
let val, opt;
|
849
|
+
for(let i = 0; i < len; ++i) {
|
850
|
+
let col = columns[i];
|
851
|
+
if(!col) {
|
852
|
+
col = columns[i] = {};
|
853
|
+
}
|
854
|
+
|
855
|
+
opt = this._getColumnData(i);
|
856
|
+
|
857
|
+
if(!opt) { continue; }
|
858
|
+
if(opt.editableContent != null) {
|
859
|
+
col.editableContent = opt.editableContent;
|
860
|
+
}
|
861
|
+
if(opt.inCellEditing != null) {
|
862
|
+
col.inCellEditing = {};
|
863
|
+
|
864
|
+
val = opt.inCellEditing["type"];
|
865
|
+
if(val != null) {
|
866
|
+
col.inCellEditing["type"] = val;
|
867
|
+
}
|
868
|
+
|
869
|
+
val = opt.inCellEditing["entries"];
|
870
|
+
if(val != null) {
|
871
|
+
col.inCellEditing["entries"] = val;
|
872
|
+
}
|
873
|
+
|
874
|
+
val = opt.inCellEditing["attributes"];
|
875
|
+
if(val != null) {
|
876
|
+
col.inCellEditing["attributes"] = val;
|
877
|
+
}
|
878
|
+
}
|
879
|
+
}
|
880
|
+
|
881
|
+
let extOptions = obj.inCellEditing;
|
882
|
+
let dirty = 0;
|
883
|
+
if(!extOptions) {
|
884
|
+
extOptions = {};
|
885
|
+
}
|
886
|
+
dirty |= _setBooleanOption(extOptions, "balloonMode", this._balloonMode, false);
|
887
|
+
dirty |= _setBooleanOption(extOptions, "editableTitle", this._editableTitle, false);
|
888
|
+
dirty |= _setBooleanOption(extOptions, "editableContent", this._editableContent, false);
|
889
|
+
dirty |= _setBooleanOption(extOptions, "tabToMove", this._tabToMove, false);
|
890
|
+
dirty |= _setBooleanOption(extOptions, "autoCommitText", this._autoCommitText, false);
|
891
|
+
dirty |= _setBooleanOption(extOptions, "dataBinding", this._dataBinding, true);
|
892
|
+
dirty |= _setBooleanOption(extOptions, "doubleClick", this._dblClick, true);
|
893
|
+
dirty |= _setBooleanOption(extOptions, "inlineStyling", this._inlineStyling, false);
|
894
|
+
dirty |= _setBooleanOption(extOptions, "disablingScroll", this._disablingScroll, false);
|
895
|
+
dirty |= _setBooleanOption(extOptions, "uiBlocking", this._uiBlocking, false);
|
896
|
+
dirty |= _setBooleanOption(extOptions, "closingOnScroll", this._closingOnScroll, true);
|
897
|
+
dirty |= _setBooleanOption(extOptions, "autoHiding", this._autoHiding, true);
|
898
|
+
dirty |= _setBooleanOption(extOptions, "readonly", this._readonly, false);
|
899
|
+
|
900
|
+
if(this._starterText) {
|
901
|
+
if(this._starterText === "Type to add") {
|
902
|
+
extOptions["starterText"] = true;
|
903
|
+
} else {
|
904
|
+
extOptions["starterText"] = this._starterText;
|
905
|
+
}
|
906
|
+
}
|
907
|
+
|
908
|
+
if(this._contentSource !== "textContent") {
|
909
|
+
dirty = 1;
|
910
|
+
extOptions.contentSource = this._contentSource;
|
911
|
+
}
|
912
|
+
|
913
|
+
if(dirty) {
|
914
|
+
obj.inCellEditing = extOptions;
|
915
|
+
}
|
916
|
+
|
917
|
+
return obj;
|
918
|
+
};
|
919
|
+
|
920
|
+
/** @private
|
921
|
+
* @param {Object} columnOption
|
922
|
+
* @param {number} colIndex
|
923
|
+
*/
|
924
|
+
InCellEditingPlugin.prototype._retrieveColumnOption = function (columnOption, colIndex) {
|
925
|
+
let pluginOptions = columnOption["inCellEditing"];
|
926
|
+
let editableContent = columnOption["editableContent"];
|
927
|
+
|
928
|
+
if(pluginOptions != null || editableContent != null) {
|
929
|
+
let colData = this._newColumnData(colIndex);
|
930
|
+
if(pluginOptions != null) {
|
931
|
+
colData["inCellEditing"] = pluginOptions;
|
932
|
+
pluginOptions.entries = CoralItems.create(pluginOptions.entries); // Create entries for coral select and combobox
|
933
|
+
}
|
934
|
+
if(editableContent != null) {
|
935
|
+
colData["editableContent"] = editableContent;
|
936
|
+
}
|
937
|
+
}
|
938
|
+
};
|
939
|
+
|
940
|
+
/** @override */
|
941
|
+
InCellEditingPlugin.prototype.unload = function (host) {
|
942
|
+
let at = this._hosts.indexOf(host);
|
943
|
+
if(at < 0) { return; }
|
944
|
+
this._hosts.splice(at, 1);
|
945
|
+
|
946
|
+
host.unlisten("columnAdded", this._onColumnAdded);
|
947
|
+
host.unlisten("firstRendered", this._firstRendered);
|
948
|
+
host.unlisten("keydown", this._onGridKeyDown);
|
949
|
+
host.unlisten("columnAdded", this._onColumnChanged);
|
950
|
+
host.unlisten("columnRemoved", this._onColumnChanged);
|
951
|
+
host.unlisten("rowAdded", this._onRowCountChanged);
|
952
|
+
host.unlisten("rowRemoved", this._onRowCountChanged);
|
953
|
+
host.getVScrollbar().unlisten("scroll", this._onScroll);
|
954
|
+
host.getHScrollbar().unlisten("scroll", this._onScroll);
|
955
|
+
|
956
|
+
host.unlisten("dblclick", this._onDoubleClick);
|
957
|
+
host.unlisten("touchstart", this._onTouchStart);
|
958
|
+
host.unlisten("touchend", this._onTouchEnd);
|
959
|
+
host.unlisten("touchcancel", this._onTouchEnd);
|
960
|
+
|
961
|
+
if(!this._hosts.length) {
|
962
|
+
if(this._touchTimerId) {
|
963
|
+
clearTimeout(this._touchTimerId);
|
964
|
+
}
|
965
|
+
if(this._editorTimerId) {
|
966
|
+
clearTimeout(this._editorTimerId);
|
967
|
+
}
|
968
|
+
window.removeEventListener("scroll", this._onScroll);
|
969
|
+
if(this._starterTextPopup) {
|
970
|
+
this._starterTextPopup.dispose();
|
971
|
+
}
|
972
|
+
if(this._realTimeGrid && this._starterText) {
|
973
|
+
this._realTimeGrid.removeEventListener("ricAdded", this._onRicAdded);
|
974
|
+
this._realTimeGrid.removeEventListener("ricRemoved", this._onRicRemoved);
|
975
|
+
}
|
976
|
+
this._updateStarterTextConflator.reset();
|
977
|
+
}
|
978
|
+
if(this.isEditing()) {
|
979
|
+
this.closeRowEditor(false);
|
980
|
+
this.closeCellEditor(false);
|
981
|
+
}
|
982
|
+
this._dispose();
|
983
|
+
};
|
984
|
+
|
985
|
+
/** @public
|
986
|
+
* @param {number} colIndex
|
987
|
+
* @param {number} rowIndex
|
988
|
+
* @param {Object=} sectionRef grid SectionReference object
|
989
|
+
* @param {Object=} grid core grid object
|
990
|
+
* @fires InCellEditingPlugin#editorOpened
|
991
|
+
*/
|
992
|
+
InCellEditingPlugin.prototype.openEditor = function (colIndex, rowIndex, sectionRef, grid) {
|
993
|
+
if(!grid) {
|
994
|
+
grid = this._hosts[0];
|
995
|
+
if(!grid) {
|
996
|
+
return;
|
997
|
+
}
|
998
|
+
}
|
999
|
+
if(this._readonly) {
|
1000
|
+
return;
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
let sectionSettings = grid.getSectionSettings(sectionRef || "content");
|
1004
|
+
let activePos = this._activePos;
|
1005
|
+
if(activePos) {
|
1006
|
+
let sectionName = sectionSettings ? sectionSettings.getType() : "";
|
1007
|
+
|
1008
|
+
if(activePos["colIndex"] === colIndex &&
|
1009
|
+
activePos["rowIndex"] === rowIndex &&
|
1010
|
+
activePos["sectionName"] === sectionName &&
|
1011
|
+
activePos["grid"] === grid
|
1012
|
+
) {
|
1013
|
+
return; // The same cell is open twice
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
this.closeCellEditor(); // Close previously opened cell editor
|
1017
|
+
}
|
1018
|
+
let section = sectionSettings ? sectionSettings.getSection() : null;
|
1019
|
+
let cell = section ? section.getCell(colIndex, rowIndex) : null;
|
1020
|
+
if(!cell) {
|
1021
|
+
return; // Some input is invalid
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
grid.scrollToColumn(colIndex);
|
1025
|
+
grid.scrollToRow(null, rowIndex); // TODO: Fix this workaround
|
1026
|
+
|
1027
|
+
setTimeout(this._openEditor.bind(this, cell, grid), 100);
|
1028
|
+
};
|
1029
|
+
|
1030
|
+
/** @public
|
1031
|
+
* @param {boolean=} opt_forceCommit
|
1032
|
+
* @fires InCellEditingPlugin#cancelled
|
1033
|
+
*/
|
1034
|
+
InCellEditingPlugin.prototype.closeCellEditor = function (opt_forceCommit) {
|
1035
|
+
this._commitText(opt_forceCommit || this._autoCommitText);
|
1036
|
+
};
|
1037
|
+
|
1038
|
+
/** @public
|
1039
|
+
* @param {boolean=} opt_enabled
|
1040
|
+
*/
|
1041
|
+
InCellEditingPlugin.prototype.enableBalloonMode = function (opt_enabled) {
|
1042
|
+
this._balloonMode = opt_enabled !== false;
|
1043
|
+
};
|
1044
|
+
|
1045
|
+
/** @public
|
1046
|
+
* @param {boolean=} opt_enabled
|
1047
|
+
*/
|
1048
|
+
InCellEditingPlugin.prototype.enableTitleEditing = function (opt_enabled) {
|
1049
|
+
this._editableTitle = opt_enabled !== false;
|
1050
|
+
};
|
1051
|
+
|
1052
|
+
/** Disable editing on all title sections
|
1053
|
+
* @public
|
1054
|
+
* @param {boolean=} opt_disabled
|
1055
|
+
*/
|
1056
|
+
InCellEditingPlugin.prototype.disableTitleEditing = function (opt_disabled) {
|
1057
|
+
this._editableTitle = opt_disabled === false;
|
1058
|
+
};
|
1059
|
+
|
1060
|
+
/** Disable editing on a per cell basis
|
1061
|
+
* @public
|
1062
|
+
* @param {Object} cell Grid cell object
|
1063
|
+
* @param {boolean=} opt_disabled
|
1064
|
+
*/
|
1065
|
+
InCellEditingPlugin.prototype.disableCellEditing = function (cell, opt_disabled) {
|
1066
|
+
if(cell) {
|
1067
|
+
cell.enableClass("no-editing", opt_disabled !== false);
|
1068
|
+
}
|
1069
|
+
};
|
1070
|
+
|
1071
|
+
/** @public
|
1072
|
+
* @param {boolean=} opt_disabled
|
1073
|
+
*/
|
1074
|
+
InCellEditingPlugin.prototype.disableDataBinding = function (opt_disabled) {
|
1075
|
+
this._dataBinding = (opt_disabled === false);
|
1076
|
+
};
|
1077
|
+
|
1078
|
+
/** @public
|
1079
|
+
* @param {boolean=} opt_disabled
|
1080
|
+
*/
|
1081
|
+
InCellEditingPlugin.prototype.disableDblClick = function (opt_disabled) {
|
1082
|
+
let dblClick = (opt_disabled === false);
|
1083
|
+
if(this._dblClick !== dblClick) {
|
1084
|
+
this._dblClick = dblClick;
|
1085
|
+
for(let i = this._hosts.length; --i >= 0;) {
|
1086
|
+
this._listenForTriggering(this._hosts[i], dblClick);
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
};
|
1090
|
+
|
1091
|
+
/** @private
|
1092
|
+
* @param {Object} e
|
1093
|
+
*/
|
1094
|
+
InCellEditingPlugin.prototype._onGridKeyDown = function (e) {
|
1095
|
+
if (e.key.length !== 1) { // Special character
|
1096
|
+
return;
|
1097
|
+
}
|
1098
|
+
if(this._starterText && this._starterTextPopup.isShown()) {
|
1099
|
+
let rsp = this._getPlugin("RowSelectionPlugin");
|
1100
|
+
if(rsp && rsp.getSelectedRowCount() > 0) {
|
1101
|
+
return;
|
1102
|
+
}
|
1103
|
+
let grid = this._hosts[0];
|
1104
|
+
grid.scrollToRow("content", 0, true);
|
1105
|
+
if(!this.isEditing()) {
|
1106
|
+
let firstEditableCol = this._getFirstEditableColumnIndex();
|
1107
|
+
if(firstEditableCol === 0) {
|
1108
|
+
return;
|
1109
|
+
}
|
1110
|
+
let cell = grid.getCell("content", firstEditableCol, 0);
|
1111
|
+
this._openEditor(cell, grid);
|
1112
|
+
}
|
1113
|
+
}
|
1114
|
+
};
|
1115
|
+
|
1116
|
+
/**
|
1117
|
+
* @description Show starter text when the grid has no ric
|
1118
|
+
* @public
|
1119
|
+
* @param {boolean=} shown
|
1120
|
+
*/
|
1121
|
+
InCellEditingPlugin.prototype.showStarterText = function (shown) {
|
1122
|
+
this.updateStarterText(shown !== false);
|
1123
|
+
};
|
1124
|
+
/**
|
1125
|
+
* @description Request to show starter text
|
1126
|
+
* @public
|
1127
|
+
*/
|
1128
|
+
InCellEditingPlugin.prototype._requestUpdateStarterText = function () {
|
1129
|
+
if(!this._realTimeGrid || !this._starterText) {
|
1130
|
+
return;
|
1131
|
+
}
|
1132
|
+
if(this._updateStarterTextConflator.conflate()){
|
1133
|
+
return;
|
1134
|
+
}
|
1135
|
+
this.updateStarterText();
|
1136
|
+
};
|
1137
|
+
|
1138
|
+
/**
|
1139
|
+
* @public
|
1140
|
+
* @description Updates the starter text to either show or hide it.
|
1141
|
+
* @param {boolean=} shown Forces the display of the starter text if "true", if "false" it hides the starter text. If not given as a parameter, it automates updating the display of the starter text
|
1142
|
+
*/
|
1143
|
+
InCellEditingPlugin.prototype.updateStarterText = function (shown) {
|
1144
|
+
if(!this._realTimeGrid || !this._starterText) {
|
1145
|
+
return;
|
1146
|
+
}
|
1147
|
+
// TODO: handled grid have ric but no one rows.
|
1148
|
+
let popup;
|
1149
|
+
if(!this._starterTextPopup) {
|
1150
|
+
popup = this._starterTextPopup = this._createStarterTextElement();
|
1151
|
+
} else {
|
1152
|
+
popup = this._starterTextPopup;
|
1153
|
+
}
|
1154
|
+
if(shown === false || this._realTimeGrid.hasRic()) {
|
1155
|
+
popup.hide();
|
1156
|
+
return;
|
1157
|
+
}
|
1158
|
+
let grid = this._hosts[0];
|
1159
|
+
|
1160
|
+
let contentSection = grid.getSection("content");
|
1161
|
+
if(!contentSection || contentSection.getRowCount() <= 0) { // WARNING: Core grid is include title section but realtime grid not include
|
1162
|
+
popup.hide();
|
1163
|
+
return;
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
let editableColIndex = this._getFirstEditableColumnIndex();
|
1167
|
+
if(editableColIndex < 0) { // not editable
|
1168
|
+
popup.hide();
|
1169
|
+
return;
|
1170
|
+
}
|
1171
|
+
if(grid.getScrollTop()) {
|
1172
|
+
grid.setScrollTop(0);
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
let editableCell = contentSection.getCell(editableColIndex, 0);
|
1176
|
+
let pos = grid.getRelativePosition(editableCell);
|
1177
|
+
if(pos) {
|
1178
|
+
let popupElem = popup.getElement();
|
1179
|
+
popupElem.style.top = pos.y + "px";
|
1180
|
+
popupElem.style.left = pos.x + "px";
|
1181
|
+
popupElem.style.lineHeight = editableCell.getHeight() + "px";
|
1182
|
+
}
|
1183
|
+
popup.show(shown, grid.getParent());
|
1184
|
+
};
|
1185
|
+
|
1186
|
+
/** @private
|
1187
|
+
* @return {number}
|
1188
|
+
*/
|
1189
|
+
InCellEditingPlugin.prototype._getFirstEditableColumnIndex = function () {
|
1190
|
+
if(this._readonly) {
|
1191
|
+
return -1;
|
1192
|
+
}
|
1193
|
+
let grid = this._hosts[0];
|
1194
|
+
if(!grid) {
|
1195
|
+
return -1;
|
1196
|
+
}
|
1197
|
+
let colCount = this.getColumnCount();
|
1198
|
+
let editableCol = -1;
|
1199
|
+
for (let i = 0; i < colCount; i++) {
|
1200
|
+
if(grid.isColumnVisible(i) && this.isColumnEditable(i)) { // this._editableContent already check in this method
|
1201
|
+
editableCol = i;
|
1202
|
+
break;
|
1203
|
+
}
|
1204
|
+
}
|
1205
|
+
return editableCol;
|
1206
|
+
};
|
1207
|
+
|
1208
|
+
/** @private
|
1209
|
+
* @return {Object}
|
1210
|
+
*/
|
1211
|
+
InCellEditingPlugin.prototype._createStarterTextElement = function () {
|
1212
|
+
let container = document.createElement("div");
|
1213
|
+
container.textContent = this._starterText;
|
1214
|
+
container.className = "starter-text";
|
1215
|
+
let popup = window.popup = new Popup(container, {
|
1216
|
+
positioning: "custom",
|
1217
|
+
autoHiding: false,
|
1218
|
+
autoRepositioning: false,
|
1219
|
+
hideOnScroll: false
|
1220
|
+
});
|
1221
|
+
let popupElement = popup.getElement();
|
1222
|
+
popupElement.style.position = "absolute";
|
1223
|
+
return popup;
|
1224
|
+
};
|
1225
|
+
|
1226
|
+
/** @public
|
1227
|
+
* @description This is for testing purpose to compare element
|
1228
|
+
* @ignore
|
1229
|
+
* @return {Object}
|
1230
|
+
*/
|
1231
|
+
InCellEditingPlugin.prototype.getStarterTextelement = function () {
|
1232
|
+
return this._starterTextPopup;
|
1233
|
+
};
|
1234
|
+
/** Checking Editing is in process.
|
1235
|
+
* @public
|
1236
|
+
* @return {boolean}
|
1237
|
+
*/
|
1238
|
+
InCellEditingPlugin.prototype.isEditing = function () {
|
1239
|
+
return this._editing;
|
1240
|
+
};
|
1241
|
+
|
1242
|
+
/**
|
1243
|
+
* @public
|
1244
|
+
* @param {number=} columnIndex column index of editor, used in row editing mode
|
1245
|
+
* @param {Object=} grid grid instance, used in row editing mode
|
1246
|
+
* @return {Element} editor element or null
|
1247
|
+
* @description Get input element of opened editor where text is stored.
|
1248
|
+
* for row editing mode, specific column index and grid instance is need.
|
1249
|
+
* for cell editing mode. function not require param since only one editor can be opened at a time.
|
1250
|
+
*/
|
1251
|
+
InCellEditingPlugin.prototype.getTextBox = function (columnIndex, grid) {
|
1252
|
+
if(this._activeRowId) { // for row editing mode
|
1253
|
+
// get rowEditor that's stored in column data
|
1254
|
+
grid = grid || this._hosts[0];
|
1255
|
+
if(grid) {
|
1256
|
+
let columnData = this._getColumnData(columnIndex, grid);
|
1257
|
+
let inCellCache = columnData["inCellCache"];
|
1258
|
+
if(inCellCache) {
|
1259
|
+
return inCellCache["inputElement"];
|
1260
|
+
}
|
1261
|
+
}
|
1262
|
+
} else if(this._activeInCellCache) { // for cell editing mode
|
1263
|
+
return this._activeInCellCache["inputElement"];
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
return null; // no editor open
|
1267
|
+
};
|
1268
|
+
|
1269
|
+
/** @public
|
1270
|
+
* @return {string}
|
1271
|
+
*/
|
1272
|
+
InCellEditingPlugin.prototype.getInitialText = function () {
|
1273
|
+
return this._initialText;
|
1274
|
+
};
|
1275
|
+
|
1276
|
+
/** @private
|
1277
|
+
* @param {Object} dataSource DataView
|
1278
|
+
* @param {number} rowIndex
|
1279
|
+
* @param {string} field
|
1280
|
+
* @param {Element=} content element that get from cell.getContent
|
1281
|
+
* @param {string} sectionType
|
1282
|
+
* @return {*}
|
1283
|
+
*/
|
1284
|
+
InCellEditingPlugin.prototype._getSourceContent = function (dataSource, rowIndex, field, content, sectionType) {
|
1285
|
+
if(this._contentSource == "field" && sectionType !== "title") {
|
1286
|
+
return this._getData(dataSource, rowIndex, field);
|
1287
|
+
} else {
|
1288
|
+
let textNode, str;
|
1289
|
+
if(content) {
|
1290
|
+
let len = content.childNodes.length;
|
1291
|
+
for(let i = 0; i < len; ++i) {
|
1292
|
+
if(content.childNodes[i].nodeType === 3) {
|
1293
|
+
textNode = content.childNodes[i]; // To preserve current content structure
|
1294
|
+
break;
|
1295
|
+
}
|
1296
|
+
}
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
if(textNode) {
|
1300
|
+
str = textNode.textContent;
|
1301
|
+
} else if(content) {
|
1302
|
+
str = content.textContent;
|
1303
|
+
}
|
1304
|
+
return str;
|
1305
|
+
}
|
1306
|
+
};
|
1307
|
+
|
1308
|
+
/**
|
1309
|
+
* @public
|
1310
|
+
* @param {string} rowId
|
1311
|
+
* @return {!number} row index will return -1 if not found
|
1312
|
+
*/
|
1313
|
+
InCellEditingPlugin.prototype._getRowIndex = function (rowId) {
|
1314
|
+
if(rowId && this._lastActiveGrid) {
|
1315
|
+
let dv = this._lastActiveGrid.getDataSource();
|
1316
|
+
if(dv) return dv.getRowIndex(rowId);
|
1317
|
+
}
|
1318
|
+
return -1;
|
1319
|
+
};
|
1320
|
+
|
1321
|
+
/**
|
1322
|
+
* @private
|
1323
|
+
* @param {number} rowIndex
|
1324
|
+
* @return {!string} return empty string if not found
|
1325
|
+
*/
|
1326
|
+
InCellEditingPlugin.prototype._getRowId = function (rowIndex) {
|
1327
|
+
if(rowIndex != null && this._lastActiveGrid) {
|
1328
|
+
let dv = this._lastActiveGrid.getDataSource();
|
1329
|
+
if(dv) return dv.getRowId(rowIndex);
|
1330
|
+
}
|
1331
|
+
return "";
|
1332
|
+
};
|
1333
|
+
|
1334
|
+
/** @private
|
1335
|
+
* @return {Object|null} core grid object
|
1336
|
+
*/
|
1337
|
+
InCellEditingPlugin.prototype.getActiveGrid = function () {
|
1338
|
+
return this._activePos ? this._activePos["grid"] : null;
|
1339
|
+
};
|
1340
|
+
|
1341
|
+
/** get active column index that editor had opended. Function can work only in cell editing mode.
|
1342
|
+
* @public
|
1343
|
+
* @return {number} column index will return -1 if not found
|
1344
|
+
*/
|
1345
|
+
InCellEditingPlugin.prototype.getActiveColIndex = function () {
|
1346
|
+
if(this._activePos) {
|
1347
|
+
let colIndex = this._activePos["colIndex"];
|
1348
|
+
if(colIndex != null) return colIndex;
|
1349
|
+
}
|
1350
|
+
return -1;
|
1351
|
+
};
|
1352
|
+
|
1353
|
+
/** get active row index that editor had opended. Function Can work in both cell/row editing modes.
|
1354
|
+
* @public
|
1355
|
+
* @return {number} row index will return -1 if not found
|
1356
|
+
*/
|
1357
|
+
InCellEditingPlugin.prototype.getActiveRowIndex = function () {
|
1358
|
+
if(this._activeRowId) { // row editing mode
|
1359
|
+
return this._getRowIndex(this._activeRowId);
|
1360
|
+
} else if(this._activePos) { // cell editing mode
|
1361
|
+
let rowIndex = this._activePos["rowIndex"];
|
1362
|
+
if(rowIndex != null) return rowIndex;
|
1363
|
+
}
|
1364
|
+
return -1;
|
1365
|
+
};
|
1366
|
+
|
1367
|
+
/** @public
|
1368
|
+
* @return {Object}
|
1369
|
+
*/
|
1370
|
+
InCellEditingPlugin.prototype.getInputElementPosition = function () {
|
1371
|
+
return this._activePos || null;
|
1372
|
+
};
|
1373
|
+
|
1374
|
+
/** @public
|
1375
|
+
* @param {boolean=} opt_enable
|
1376
|
+
*/
|
1377
|
+
InCellEditingPlugin.prototype.enableAutoCommitText = function (opt_enable) {
|
1378
|
+
this._autoCommitText = (opt_enable !== false);
|
1379
|
+
};
|
1380
|
+
|
1381
|
+
/** Check if the column can be edited by double click
|
1382
|
+
* @public
|
1383
|
+
* @param {number} colIndex
|
1384
|
+
* @return {boolean}
|
1385
|
+
*/
|
1386
|
+
InCellEditingPlugin.prototype.isColumnEditable = function (colIndex) {
|
1387
|
+
if(this._readonly) {
|
1388
|
+
return false;
|
1389
|
+
}
|
1390
|
+
let val = this._getColumnOption(colIndex, "editableContent");
|
1391
|
+
return val == null ? this._editableContent : val;
|
1392
|
+
};
|
1393
|
+
/** Change editability of the specified column at runtime
|
1394
|
+
* @public
|
1395
|
+
* @param {number} colIndex
|
1396
|
+
* @param {(boolean|null)=} bool If null or undefined value is specified, the editability will be decided by other extension settings
|
1397
|
+
*/
|
1398
|
+
InCellEditingPlugin.prototype.setColumnEditability = function (colIndex, bool) {
|
1399
|
+
let colData = this._newColumnData(colIndex);
|
1400
|
+
colData["editableContent"] = (bool != null) ? bool : null;
|
1401
|
+
};
|
1402
|
+
|
1403
|
+
/**
|
1404
|
+
* @public
|
1405
|
+
* @param {boolean=} enabled
|
1406
|
+
*/
|
1407
|
+
InCellEditingPlugin.prototype.enableReadonly = function (enabled) {
|
1408
|
+
this._readonly = enabled !== false;
|
1409
|
+
if(this._readonly) {
|
1410
|
+
this.updateStarterText(false);
|
1411
|
+
} else {
|
1412
|
+
this.updateStarterText();
|
1413
|
+
}
|
1414
|
+
};
|
1415
|
+
/**
|
1416
|
+
* @public
|
1417
|
+
* @param {boolean=} disabled
|
1418
|
+
*/
|
1419
|
+
InCellEditingPlugin.prototype.disableReadonly = function (disabled) {
|
1420
|
+
this.enableReadonly(disabled === false);
|
1421
|
+
};
|
1422
|
+
/** @public
|
1423
|
+
* @description Supply an keyboard input. This is for testing purpose.
|
1424
|
+
* @ignore
|
1425
|
+
* @param {string} keyName
|
1426
|
+
* @param {Object=} context
|
1427
|
+
*/
|
1428
|
+
InCellEditingPlugin.prototype.supplyKey = function(keyName, context) {
|
1429
|
+
let eventObj = this._mockKeyboardEvent(keyName, context);
|
1430
|
+
this._onTextKeyDown(eventObj);
|
1431
|
+
this._onTextKeyUp(eventObj);
|
1432
|
+
};
|
1433
|
+
/** @public
|
1434
|
+
* @description Supply an keyboard input. This is for testing purpose.
|
1435
|
+
* @ignore
|
1436
|
+
* @param {string} keyName
|
1437
|
+
* @param {Object=} context
|
1438
|
+
*/
|
1439
|
+
InCellEditingPlugin.prototype.supplyGridKeydown = function(keyName, context) {
|
1440
|
+
let eventObj = this._mockKeyboardEvent(keyName, context);
|
1441
|
+
this._onGridKeyDown(eventObj);
|
1442
|
+
};
|
1443
|
+
/** @public
|
1444
|
+
* @description Supply an double click event. This is for testing purpose.
|
1445
|
+
* @ignore
|
1446
|
+
* @param {number} colIndex
|
1447
|
+
* @param {number} rowIndex
|
1448
|
+
* @param {Object=} context
|
1449
|
+
*/
|
1450
|
+
InCellEditingPlugin.prototype.mockDoubleClick = function(colIndex, rowIndex, context) {
|
1451
|
+
let eventObj = this._mockMouseEvent(colIndex, rowIndex, context);
|
1452
|
+
this._onDoubleClick(eventObj);
|
1453
|
+
};
|
1454
|
+
/** @private
|
1455
|
+
* @param {Event|Element} e
|
1456
|
+
* @param {Object=} opt_host core grid object
|
1457
|
+
* @fires InCellEditingPlugin#editorOpened
|
1458
|
+
*/
|
1459
|
+
InCellEditingPlugin.prototype._onDoubleClick = function (e, opt_host) {
|
1460
|
+
let t = this;
|
1461
|
+
if(t._readonly) {
|
1462
|
+
return;
|
1463
|
+
}
|
1464
|
+
let host = opt_host || t.getRelativeGrid(e);
|
1465
|
+
if(t.isEditing() || !host) { return; }
|
1466
|
+
|
1467
|
+
let arg = host.getRelativePosition(e);
|
1468
|
+
let sectionType = arg["sectionType"];
|
1469
|
+
|
1470
|
+
if(sectionType === "content" && !t.isColumnEditable(arg["colIndex"])) {
|
1471
|
+
return;
|
1472
|
+
} else if(sectionType === "title" && !t._editableTitle) {
|
1473
|
+
return;
|
1474
|
+
} else if(sectionType === "header") {
|
1475
|
+
return;
|
1476
|
+
}
|
1477
|
+
|
1478
|
+
let dataSource = arg["dataSource"];
|
1479
|
+
if(dataSource != null) {
|
1480
|
+
let rowId = dataSource.getRowId(arg["rowIndex"]);
|
1481
|
+
if(dataSource.getGroupByRowId(rowId)) {
|
1482
|
+
return;
|
1483
|
+
}
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
// Initialize internal states
|
1487
|
+
if(e["preventDefault"]) {
|
1488
|
+
Dom.preventDefault(e);
|
1489
|
+
}
|
1490
|
+
t.openEditor(arg.colIndex, arg.rowIndex, arg.section, host);
|
1491
|
+
};
|
1492
|
+
|
1493
|
+
/** @private
|
1494
|
+
* @param {Object} section Section (LayoutGrid) object
|
1495
|
+
* @returns {string} bgColor
|
1496
|
+
*/
|
1497
|
+
InCellEditingPlugin.prototype._getSectionBGColor = function (section) {
|
1498
|
+
if(this._elfVersion || this._inlineStyling) {
|
1499
|
+
let computedStyle = section.getComputedStyle();
|
1500
|
+
if(computedStyle) {
|
1501
|
+
return computedStyle.backgroundColor;
|
1502
|
+
}
|
1503
|
+
}
|
1504
|
+
return "";
|
1505
|
+
};
|
1506
|
+
|
1507
|
+
/** @private
|
1508
|
+
* @param {Element} e
|
1509
|
+
* @param {Object} host core grid object
|
1510
|
+
* @param {Object=} arg
|
1511
|
+
*/
|
1512
|
+
InCellEditingPlugin.prototype._openEditor = function (e, host, arg) {
|
1513
|
+
let t = this;
|
1514
|
+
if(!host.getElement() || this._hosts.indexOf(host) < 0) { // Check validity due to asyncronous call
|
1515
|
+
return;
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
if(!arg) {
|
1519
|
+
arg = host.getRelativePosition(e);
|
1520
|
+
}
|
1521
|
+
|
1522
|
+
if(!arg["hit"]) { // The specified cell could be gone during the asyncronous process
|
1523
|
+
return;
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
t._dispatch("preEditorOpening", arg);
|
1527
|
+
|
1528
|
+
if(arg["cancel"]) {
|
1529
|
+
return;
|
1530
|
+
}
|
1531
|
+
|
1532
|
+
let colIndex = arg["colIndex"];
|
1533
|
+
let rowIndex = arg["rowIndex"];
|
1534
|
+
let section = arg["section"];
|
1535
|
+
let cell = section.getCell(colIndex, rowIndex);
|
1536
|
+
let rowSpan = 1;
|
1537
|
+
let stretchedCell = section.getStretchedCell(cell, rowIndex);
|
1538
|
+
if(stretchedCell){
|
1539
|
+
cell = stretchedCell;
|
1540
|
+
} else {
|
1541
|
+
rowSpan = section.getCellRowSpan(colIndex, rowIndex);
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
if(!cell || cell.hasClass("no-editing")) {
|
1545
|
+
return;
|
1546
|
+
}
|
1547
|
+
// Everything has been verified at this point. We can start the opening process.
|
1548
|
+
|
1549
|
+
// close row editor first
|
1550
|
+
t.closeRowEditor(false, host);
|
1551
|
+
|
1552
|
+
section.addClass("edit-mode");
|
1553
|
+
t._lastActiveGrid = host;
|
1554
|
+
t._activePos = arg;
|
1555
|
+
arg["cell"] = t._activeCell = cell;
|
1556
|
+
arg["content"] = t._prevContent = cell.getContent();
|
1557
|
+
arg["field"] = t._getField(colIndex);
|
1558
|
+
|
1559
|
+
let dataSource = arg["dataSource"];
|
1560
|
+
if(dataSource != null) {
|
1561
|
+
let rowId = arg["rowId"] = this._getRowId(arg["rowIndex"]);
|
1562
|
+
arg["segmentSeparator"] = dataSource.isSegmentSeparator(rowId);
|
1563
|
+
arg["groupHeader"] = dataSource.getGroupByRowId(rowId);
|
1564
|
+
arg["rowData"] = this._getRow(dataSource, rowId);
|
1565
|
+
|
1566
|
+
if(dataSource["stall"]) {
|
1567
|
+
dataSource["stall"](true);
|
1568
|
+
}
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
// Initialize UIs
|
1572
|
+
if(arg["sectionType"] === "title") {
|
1573
|
+
t._activeInCellCache = t._createTitleEditor(host);
|
1574
|
+
} else {
|
1575
|
+
t._activeInCellCache = t._createContentEditor(colIndex, host);
|
1576
|
+
}
|
1577
|
+
|
1578
|
+
let inputElement = arg["inputElement"] = t._activeInCellCache["inputElement"];
|
1579
|
+
let editor = arg["editor"] = t._activeInCellCache["editor"];
|
1580
|
+
let balloonPopup = t._activeInCellCache["balloonPopup"];
|
1581
|
+
let sourceContent = arg ? t._getSourceContent(arg["dataSource"], arg["rowIndex"], arg["field"], arg["content"], arg["sectionType"]) : "";
|
1582
|
+
|
1583
|
+
if(rowIndex + 1 >= section.getRowCount()) {
|
1584
|
+
inputElement.classList.add("bottom");
|
1585
|
+
} else {
|
1586
|
+
inputElement.classList.remove("bottom");
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
// Initialize Balloon
|
1590
|
+
t._usingBalloon = t._isBalloonMode(cell);
|
1591
|
+
if(t._usingBalloon) {
|
1592
|
+
editor.classList.add("balloon");
|
1593
|
+
} else {
|
1594
|
+
editor.classList.remove("balloon");
|
1595
|
+
}
|
1596
|
+
|
1597
|
+
let editorStyle = editor.style;
|
1598
|
+
editorStyle.backgroundColor = this._getSectionBGColor(section);
|
1599
|
+
let rowH = section.getRowHeight(rowIndex);
|
1600
|
+
let width = cell.getWidth();
|
1601
|
+
if(!host.isPinnedColumn(colIndex)) {
|
1602
|
+
let hScrollbar = host.getHScrollbar();
|
1603
|
+
if(hScrollbar.isActive()) {
|
1604
|
+
let paneSize = hScrollbar.getPaneSize();
|
1605
|
+
if(width > paneSize) {
|
1606
|
+
width = paneSize;
|
1607
|
+
}
|
1608
|
+
}
|
1609
|
+
}
|
1610
|
+
if(!t._usingBalloon || width > 208) {
|
1611
|
+
editorStyle.width = width + "px";
|
1612
|
+
} else {
|
1613
|
+
editorStyle.width = "";
|
1614
|
+
}
|
1615
|
+
|
1616
|
+
if(rowSpan > 1) {
|
1617
|
+
editorStyle.height = cell.getHeight() + "px";
|
1618
|
+
} else {
|
1619
|
+
editorStyle.height = rowH + "px";
|
1620
|
+
}
|
1621
|
+
|
1622
|
+
// Attach our popup (balloon element)
|
1623
|
+
let parentElement = document.body;
|
1624
|
+
if(t._compositeGrid || t._realTimeGrid) {
|
1625
|
+
let activeGrid = t.getActiveGrid();
|
1626
|
+
if(activeGrid) {
|
1627
|
+
parentElement = activeGrid.getElement().parentElement;
|
1628
|
+
}
|
1629
|
+
}
|
1630
|
+
|
1631
|
+
balloonPopup.enableUIBlocking(t._uiBlocking);
|
1632
|
+
balloonPopup.addEventListener("hidden", t._onPopupHide);
|
1633
|
+
balloonPopup.disableAutoHiding(!t._autoHiding);
|
1634
|
+
balloonPopup.disableHideOnScroll(true);
|
1635
|
+
balloonPopup.attachTo(cell.getElement());
|
1636
|
+
balloonPopup.show(true, parentElement);
|
1637
|
+
|
1638
|
+
this._updateEditorPopup(t._activeInCellCache, cell, host);
|
1639
|
+
|
1640
|
+
// Attach user element
|
1641
|
+
if(t._customElement) {
|
1642
|
+
t._customElementPopup.attachTo(editor);
|
1643
|
+
t._customElementPopup.show(true, parentElement);
|
1644
|
+
t._customElementPopup.disableAutoHiding(false);
|
1645
|
+
arg["popupElement"] = t._customElement;
|
1646
|
+
}
|
1647
|
+
|
1648
|
+
// WARNING: value-changed event from ELF v3 component may NOT be triggered due to their design flaw
|
1649
|
+
t._setText(sourceContent, inputElement);
|
1650
|
+
arg["initialText"] = t._initialText = sourceContent;
|
1651
|
+
|
1652
|
+
if(t._disablingScroll) {
|
1653
|
+
t._freezeScrolling(host, true);
|
1654
|
+
}
|
1655
|
+
|
1656
|
+
arg["autoSuggest"] = t._autoSuggest;
|
1657
|
+
if(t._autoSuggest) {
|
1658
|
+
if(t._autoSuggest.attach === inputElement) {
|
1659
|
+
t._autoSuggest.attach = null; // WORKAROUND: reset attach for re-attach target
|
1660
|
+
}
|
1661
|
+
|
1662
|
+
if(t._autoSuggest.parentNode !== editor ) { // if we appendChild all time when open editor, events won't work
|
1663
|
+
editor.appendChild(t._autoSuggest);
|
1664
|
+
}
|
1665
|
+
t._autoSuggest.attach = inputElement;
|
1666
|
+
t._autoSuggest.positionTarget = inputElement; // for re-position of autosuggest
|
1667
|
+
}
|
1668
|
+
|
1669
|
+
// Dispatch an event for user to setup stuff
|
1670
|
+
t._dispatch("editorOpened", arg); // User may modify the editor
|
1671
|
+
t.updateStarterText(false); // Currently Starter text open doesn't have the ric, it needs to be forcefully hide
|
1672
|
+
|
1673
|
+
inputElement.focus();
|
1674
|
+
if(typeof inputElement.select === "function") {
|
1675
|
+
inputElement.select();
|
1676
|
+
}
|
1677
|
+
|
1678
|
+
arg["initialText"] = t._initialText = t.getText(); // After all modifications, cache the string for text change event
|
1679
|
+
t._editing = true; // Editing state cannot be false until a text has been committed or cancelled
|
1680
|
+
};
|
1681
|
+
|
1682
|
+
/** Open the row editor on the specified row
|
1683
|
+
* @public
|
1684
|
+
* @param {number} rowIndex Row index of a row to be opened.
|
1685
|
+
* @param {Object=} grid Core grid object used mainly for multi-table configuration. No need to supply this parameter for default single grid configuration.
|
1686
|
+
* @fires InCellEditingPlugin#rowEditorOpened
|
1687
|
+
*/
|
1688
|
+
InCellEditingPlugin.prototype.openRowEditor = function (rowIndex, grid) {
|
1689
|
+
let t = this;
|
1690
|
+
grid = grid || t._hosts[0];
|
1691
|
+
|
1692
|
+
if(t._getRowIndex(t._activeRowId) === rowIndex || !grid || t._readonly) {
|
1693
|
+
return;
|
1694
|
+
}
|
1695
|
+
if(grid.isDisposed()) {
|
1696
|
+
return;
|
1697
|
+
}
|
1698
|
+
|
1699
|
+
t.closeRowEditor(false, grid);
|
1700
|
+
t._commitText(false);
|
1701
|
+
|
1702
|
+
let firstInput, firstPopup;
|
1703
|
+
let sectionType = "content";
|
1704
|
+
let section = grid.getSection(sectionType);
|
1705
|
+
let dataSource = grid.getDataSource();
|
1706
|
+
let colCount = section.getColumnCount();
|
1707
|
+
let isBottom = (rowIndex + 1) >= section.getRowCount();
|
1708
|
+
let sectionBGColor = this._getSectionBGColor(section);
|
1709
|
+
let rowH = section.getRowHeight(rowIndex);
|
1710
|
+
|
1711
|
+
// if normally parent popup will be document.body
|
1712
|
+
let parentElement = document.body;
|
1713
|
+
|
1714
|
+
// but if grid is _compositeGrid or _realTimeGrid then
|
1715
|
+
// then we will use grid parent instead
|
1716
|
+
if(t._compositeGrid || t._realTimeGrid) {
|
1717
|
+
parentElement = grid.getElement().parentElement;
|
1718
|
+
}
|
1719
|
+
|
1720
|
+
let arg = {
|
1721
|
+
"rowIndex": rowIndex,
|
1722
|
+
"rowId": "",
|
1723
|
+
"grid": grid,
|
1724
|
+
"fields": [],
|
1725
|
+
"cells": [],
|
1726
|
+
"inputs": [],
|
1727
|
+
"initialValues": [],
|
1728
|
+
"fieldValues": {}
|
1729
|
+
};
|
1730
|
+
for(let colIndex = 0; colIndex < colCount; colIndex++) {
|
1731
|
+
if(!t.isColumnEditable(colIndex)) {
|
1732
|
+
continue;
|
1733
|
+
}
|
1734
|
+
let cell = section.getCell(colIndex, rowIndex);
|
1735
|
+
if(!cell || cell.hasClass("no-editing")) {
|
1736
|
+
continue;
|
1737
|
+
}
|
1738
|
+
|
1739
|
+
arg["cells"][colIndex] = cell;
|
1740
|
+
let field = t._getField(colIndex);
|
1741
|
+
arg["fields"][colIndex] = field;
|
1742
|
+
|
1743
|
+
let inCellCache = t._createContentEditor(colIndex, grid);
|
1744
|
+
inCellCache.field = field; // The field may be changed at runtime
|
1745
|
+
|
1746
|
+
let inputElement = inCellCache["inputElement"];
|
1747
|
+
let balloonPopup = inCellCache["balloonPopup"];
|
1748
|
+
|
1749
|
+
arg["inputs"][colIndex] = inputElement;
|
1750
|
+
if(!firstInput) {
|
1751
|
+
firstInput = inputElement;
|
1752
|
+
firstPopup = balloonPopup;
|
1753
|
+
balloonPopup.enableUIBlocking(t._uiBlocking);
|
1754
|
+
} else {
|
1755
|
+
balloonPopup.enableUIBlocking(false);
|
1756
|
+
}
|
1757
|
+
|
1758
|
+
let content = cell.getContent();
|
1759
|
+
let sourceContent = t._getSourceContent(dataSource, rowIndex, field, content, sectionType);
|
1760
|
+
arg["initialValues"][colIndex] = sourceContent;
|
1761
|
+
arg["fieldValues"][field] = sourceContent;
|
1762
|
+
t._setText(sourceContent, inputElement); // WARNING: value-changed event from ELF v3 component may be triggered due to their design flaw
|
1763
|
+
|
1764
|
+
if(isBottom) {
|
1765
|
+
inputElement.classList.add("bottom");
|
1766
|
+
} else {
|
1767
|
+
inputElement.classList.remove("bottom");
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
let editor = inCellCache["editor"];
|
1771
|
+
let editorStyle = editor.style;
|
1772
|
+
editorStyle.backgroundColor = sectionBGColor;
|
1773
|
+
editorStyle.height = rowH + "px";
|
1774
|
+
|
1775
|
+
// row editing mode does not support balloon mode
|
1776
|
+
let width = section.getCellWidth(colIndex, rowIndex);
|
1777
|
+
editorStyle.width = width + "px";
|
1778
|
+
editor.classList.remove("balloon");
|
1779
|
+
|
1780
|
+
balloonPopup.disableAutoHiding(true);
|
1781
|
+
balloonPopup.disableHideOnScroll(true);
|
1782
|
+
balloonPopup.attachTo(cell.getElement());
|
1783
|
+
balloonPopup.show(true, parentElement);
|
1784
|
+
|
1785
|
+
this._updateEditorPopup(inCellCache, cell, grid);
|
1786
|
+
}
|
1787
|
+
|
1788
|
+
if(firstInput) {
|
1789
|
+
// At least one cell is valid for editing
|
1790
|
+
firstPopup.addEventListener("hidden", t._onPopupHide);
|
1791
|
+
t._lastActiveGrid = grid;
|
1792
|
+
t._editing = true; // Editing state cannot be false until a text has been committed or cancelled
|
1793
|
+
t._activeRowId = this._getRowId(rowIndex);
|
1794
|
+
firstInput.focus();
|
1795
|
+
section.addClass("edit-mode");
|
1796
|
+
if(t._disablingScroll) {
|
1797
|
+
t._freezeScrolling(grid, true);
|
1798
|
+
}
|
1799
|
+
|
1800
|
+
arg["rowId"] = t._activeRowId;
|
1801
|
+
t._dispatch("rowEditorOpened", arg);
|
1802
|
+
}
|
1803
|
+
};
|
1804
|
+
|
1805
|
+
/** Using to close row editor.
|
1806
|
+
* @public
|
1807
|
+
* @param {boolean=} isCommit=true Default is true, to save change that user made to datasource
|
1808
|
+
* @fires InCellEditingPlugin#beforeRowCommit
|
1809
|
+
* @fires InCellEditingPlugin#rowEditorClosed
|
1810
|
+
*/
|
1811
|
+
InCellEditingPlugin.prototype.closeRowEditor = function (isCommit) {
|
1812
|
+
let t = this;
|
1813
|
+
let grid = t._lastActiveGrid;
|
1814
|
+
if(!t._activeRowId || !grid) { return; }
|
1815
|
+
|
1816
|
+
let rowId = t._activeRowId;
|
1817
|
+
let rowIndex = t._getRowIndex(rowId);
|
1818
|
+
if(rowIndex <= -1) {
|
1819
|
+
isCommit = false; // rowIndex -1 mean row is not found or already disposed
|
1820
|
+
} else {
|
1821
|
+
isCommit = isCommit !== false; // default is true
|
1822
|
+
}
|
1823
|
+
|
1824
|
+
let section = grid.getSection("content");
|
1825
|
+
let colCount = grid.getColumnCount();
|
1826
|
+
let fieldValues = {};
|
1827
|
+
let inCellCaches = [];
|
1828
|
+
let inCellCache;
|
1829
|
+
let arg = {
|
1830
|
+
"rowIndex": rowIndex,
|
1831
|
+
"rowId": t._activeRowId,
|
1832
|
+
"grid": grid,
|
1833
|
+
"fields": [],
|
1834
|
+
"cells": [],
|
1835
|
+
"inputs": [],
|
1836
|
+
// "initialValues": [],
|
1837
|
+
"fieldValues": fieldValues,
|
1838
|
+
"fieldValue": fieldValues, // Add alias for backward compatability
|
1839
|
+
"cancel": false
|
1840
|
+
};
|
1841
|
+
|
1842
|
+
for(let colIndex = 0; colIndex < colCount; colIndex++) {
|
1843
|
+
let columnData = t._getColumnData(colIndex, grid);
|
1844
|
+
inCellCache = columnData && columnData["inCellCache"];
|
1845
|
+
|
1846
|
+
if(inCellCache) {
|
1847
|
+
inCellCache.columnIndex = colIndex;
|
1848
|
+
inCellCaches.push(inCellCache);
|
1849
|
+
|
1850
|
+
arg["fields"][colIndex] = inCellCache.field;
|
1851
|
+
arg["cells"][colIndex] = section.getCell(colIndex, rowIndex);
|
1852
|
+
arg["inputs"][colIndex] = inCellCache["inputElement"];
|
1853
|
+
|
1854
|
+
if(isCommit) {
|
1855
|
+
fieldValues[inCellCache.field] = this._getValue(inCellCache["inputElement"]);
|
1856
|
+
}
|
1857
|
+
}
|
1858
|
+
}
|
1859
|
+
|
1860
|
+
if(isCommit) {
|
1861
|
+
t._dispatch("beforeRowCommit", arg);
|
1862
|
+
// arg.cancel = true mean user want to cancel closeRowEditor operation
|
1863
|
+
isCommit = !arg.cancel;
|
1864
|
+
}
|
1865
|
+
|
1866
|
+
let i;
|
1867
|
+
let editorCount = inCellCaches.length;
|
1868
|
+
if(isCommit) {
|
1869
|
+
let dataSource = grid.getDataSource();
|
1870
|
+
for(i = 0; i < editorCount; i++) {
|
1871
|
+
inCellCache = inCellCaches[i];
|
1872
|
+
let value = fieldValues[inCellCache.field];
|
1873
|
+
// set data to datasource
|
1874
|
+
if(dataSource) {
|
1875
|
+
// Only use value from fieldValues because fieldValues maybe mutate from beforeRowCommit event
|
1876
|
+
t._setData(dataSource, rowIndex, inCellCache.field, value);
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
// set value to ui if content is a build in text
|
1880
|
+
let cell = arg["cells"][inCellCache.columnIndex];
|
1881
|
+
let content = cell.getContent();
|
1882
|
+
if(content && content.classList.contains("text")) {
|
1883
|
+
cell.setContent(value);
|
1884
|
+
}
|
1885
|
+
}
|
1886
|
+
}
|
1887
|
+
|
1888
|
+
arg["committed"] = isCommit;
|
1889
|
+
t._dispatch("rowEditorClosed", arg);
|
1890
|
+
|
1891
|
+
// hide editor by remove popup from dom
|
1892
|
+
for(i = 0; i < editorCount; i++) {
|
1893
|
+
let popup = inCellCaches[i].balloonPopup;
|
1894
|
+
popup.removeEventListener("hidden", t._onPopupHide); // remove event every popup to make sure nothing left
|
1895
|
+
popup.hide();
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
t._freezeScrolling(grid, false);
|
1899
|
+
|
1900
|
+
// reset status and resource
|
1901
|
+
section.removeClass("edit-mode");
|
1902
|
+
t._editing = false;
|
1903
|
+
t._activeRowId = "";
|
1904
|
+
t._lastActiveGrid = null;
|
1905
|
+
grid.focus();
|
1906
|
+
};
|
1907
|
+
|
1908
|
+
/** open row editor if no any row editor opened, and close row editor if it already opened
|
1909
|
+
* @public
|
1910
|
+
* @param {number} rowIndex
|
1911
|
+
* @param {boolean=} isCommit=true Default is true, save change that user made to datasource
|
1912
|
+
* @param {Object=} grid grid instance
|
1913
|
+
* @fires InCellEditingPlugin#beforeRowCommit
|
1914
|
+
* @fires InCellEditingPlugin#rowEditorClosed
|
1915
|
+
*/
|
1916
|
+
InCellEditingPlugin.prototype.toggleRowEditor = function (rowIndex, isCommit, grid) {
|
1917
|
+
if(this._getRowIndex(this._activeRowId) === rowIndex) {
|
1918
|
+
this.closeRowEditor(isCommit, grid);
|
1919
|
+
} else if(this._activeRowId) {
|
1920
|
+
this.closeRowEditor(isCommit, grid);
|
1921
|
+
this.openRowEditor(rowIndex, grid);
|
1922
|
+
} else {
|
1923
|
+
this.openRowEditor(rowIndex, grid);
|
1924
|
+
}
|
1925
|
+
};
|
1926
|
+
|
1927
|
+
/** handle grid scrolling not window scroll
|
1928
|
+
* @private
|
1929
|
+
* @param {Object} e
|
1930
|
+
*/
|
1931
|
+
InCellEditingPlugin.prototype._onScroll = function (e) {
|
1932
|
+
this._scrolling = true;
|
1933
|
+
if(!this._closingOnScroll && this._editing){
|
1934
|
+
if(this._activeInCellCache){
|
1935
|
+
let popup = this._activeInCellCache.balloonPopup;
|
1936
|
+
popup.hide();
|
1937
|
+
}
|
1938
|
+
else if(this._activeRowId){
|
1939
|
+
let grid = this.getActiveGrid() || this._lastActiveGrid;
|
1940
|
+
let section = grid.getSection("content");
|
1941
|
+
let lastIndex = (section.getColumnCount() || 0) - 1;
|
1942
|
+
for(let columnIndex = 0; columnIndex <= lastIndex; columnIndex++) {
|
1943
|
+
let columnData = this._getColumnData(columnIndex, grid);
|
1944
|
+
let inCellCache = columnData["inCellCache"];
|
1945
|
+
if(!inCellCache){
|
1946
|
+
continue;
|
1947
|
+
}
|
1948
|
+
let popupCache = inCellCache["balloonPopup"];
|
1949
|
+
if(popupCache) {
|
1950
|
+
popupCache.hide();
|
1951
|
+
}
|
1952
|
+
}
|
1953
|
+
}
|
1954
|
+
}
|
1955
|
+
this._onPopupHide();
|
1956
|
+
this._scrolling = false;
|
1957
|
+
};
|
1958
|
+
|
1959
|
+
/** handle popup hidden event
|
1960
|
+
* @private
|
1961
|
+
* @param {Object} e
|
1962
|
+
*/
|
1963
|
+
InCellEditingPlugin.prototype._onPopupHide = function (e) {
|
1964
|
+
if(!this._closingOnScroll){
|
1965
|
+
if(this._scrolling){
|
1966
|
+
this.requestShowEditorPopup();
|
1967
|
+
return;
|
1968
|
+
}
|
1969
|
+
}
|
1970
|
+
// in cell editing mode, when popup hide for any reason
|
1971
|
+
// cell editing will be close and make a commit. (depend on _autoCommitText flag)
|
1972
|
+
// WARNING: when user scroll outside grid. it will call _onPopupHide as well
|
1973
|
+
this._commitText(this._autoCommitText);
|
1974
|
+
|
1975
|
+
// for row editing mode if editor hide by any reason
|
1976
|
+
// we will call close closeRowEditor to reset all internal flag status
|
1977
|
+
// row editing mode not care about _autoCommitText. (for the time being)
|
1978
|
+
this.closeRowEditor(false);
|
1979
|
+
};
|
1980
|
+
|
1981
|
+
/** @private
|
1982
|
+
* @param {Object} event
|
1983
|
+
*/
|
1984
|
+
InCellEditingPlugin.prototype._onAutoSuggestItemSelected = function(event) {
|
1985
|
+
let eventDetail = event.detail;
|
1986
|
+
if(!eventDetail) {
|
1987
|
+
return;
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
let targetSelected = eventDetail.target;
|
1991
|
+
|
1992
|
+
if(!targetSelected) {
|
1993
|
+
return;
|
1994
|
+
}
|
1995
|
+
|
1996
|
+
let suggestionMethod = eventDetail.method;
|
1997
|
+
// Need to check the details of the methods, another method like a navigation, reset, clear shouldn't commit text
|
1998
|
+
// TODO: We need to handled tab to move. Currently, the property suggestionDetail in 'beforeCommit' event doesn't handlded when we use autosuggest with tab to move.
|
1999
|
+
if(suggestionMethod === "click" || suggestionMethod === "enter") {
|
2000
|
+
this.setText(targetSelected.value);
|
2001
|
+
this._commitText(true, eventDetail.suggestion);
|
2002
|
+
}
|
2003
|
+
};
|
2004
|
+
|
2005
|
+
/** @private
|
2006
|
+
* @param {Object} e
|
2007
|
+
*/
|
2008
|
+
InCellEditingPlugin.prototype._onValueChanged = function (e) {
|
2009
|
+
if(this._activeRowId) { return; } // do nothing in rowEditMode
|
2010
|
+
|
2011
|
+
this._commitText(true);
|
2012
|
+
};
|
2013
|
+
/** @private
|
2014
|
+
* @param {Object} e
|
2015
|
+
*/
|
2016
|
+
InCellEditingPlugin.prototype._onMultiSelectionValueChanged = function (e) {
|
2017
|
+
e.currentTarget.dirty = true;
|
2018
|
+
};
|
2019
|
+
/** @private
|
2020
|
+
* @param {Object} e
|
2021
|
+
*/
|
2022
|
+
InCellEditingPlugin.prototype._onMultiSelectionEditorChanged = function (e) {
|
2023
|
+
if(e.detail && e.detail.value === false){
|
2024
|
+
if(this._activePos){
|
2025
|
+
let inputElement = this._activePos["inputElement"];
|
2026
|
+
if(inputElement.dirty){
|
2027
|
+
this._onValueChanged(e);
|
2028
|
+
inputElement.dirty = false;
|
2029
|
+
}
|
2030
|
+
}
|
2031
|
+
}
|
2032
|
+
};
|
2033
|
+
|
2034
|
+
/** @private
|
2035
|
+
* @param {Object} e
|
2036
|
+
*/
|
2037
|
+
InCellEditingPlugin.prototype._onTextKeyDown = function (e) {
|
2038
|
+
e.stopPropagation();
|
2039
|
+
|
2040
|
+
if(this._activeRowId) { return; } // do nothing in rowEditMode
|
2041
|
+
|
2042
|
+
// KeyCodes.ESC = 27
|
2043
|
+
if(e.keyCode === 27) {
|
2044
|
+
this._commitText(this._autoCommitText);
|
2045
|
+
}
|
2046
|
+
// KeyCodes.TAB = 9
|
2047
|
+
if(e.keyCode === 9) {
|
2048
|
+
// For check press tab key when user tab on auto suggest list
|
2049
|
+
// When user tab on auto suggest, the focus should be in input and data doesn't commit
|
2050
|
+
if(this._autoSuggest && this._autoSuggest.suggestions.length > 0) {
|
2051
|
+
this._activeInCellCache.inputElement.focus();
|
2052
|
+
}
|
2053
|
+
e.preventDefault(); // stop losing focus
|
2054
|
+
}
|
2055
|
+
};
|
2056
|
+
|
2057
|
+
/** @private
|
2058
|
+
* @param {Object} e
|
2059
|
+
*/
|
2060
|
+
InCellEditingPlugin.prototype._onTextKeyUp = function (e) {
|
2061
|
+
e.stopPropagation();
|
2062
|
+
|
2063
|
+
if(this._activeRowId) { return; } // do nothing in rowEditMode
|
2064
|
+
|
2065
|
+
if(this.hasListener("keyUp")) {
|
2066
|
+
this._activePos["text"] = this._activePos["enteredText"] = this._activeInCellCache["inputElement"].value;
|
2067
|
+
this._dispatch("keyUp", this._activePos);
|
2068
|
+
}
|
2069
|
+
|
2070
|
+
// KeyCodes.ENTER = 13 && KeyCodes.TAB = 9
|
2071
|
+
let tabKey = e.keyCode === 9;
|
2072
|
+
if(tabKey || e.keyCode === 13) {
|
2073
|
+
let text = this.getText();
|
2074
|
+
let cellInfo = this._activePos;
|
2075
|
+
|
2076
|
+
if(this._initialText !== text) {
|
2077
|
+
e.preventDefault(); // TODO: Check if this is needed
|
2078
|
+
// Clear auto suggest and doesn't commit when user tab on auto suggest item
|
2079
|
+
if(this._autoSuggest && this._autoSuggest.suggestions.length > 0) {
|
2080
|
+
this._activeInCellCache.inputElement.focus();
|
2081
|
+
this._autoSuggest.suggestions = [];
|
2082
|
+
return; // when use tabToMove with auto suggest, it shouldn't be effect when doesn't commit text
|
2083
|
+
} else {
|
2084
|
+
this._commitText(true);
|
2085
|
+
}
|
2086
|
+
} else {
|
2087
|
+
this._commitText(false);
|
2088
|
+
}
|
2089
|
+
|
2090
|
+
if(tabKey && this._tabToMove && !e.altKey && !e.ctrlKey) {
|
2091
|
+
let host = cellInfo ? cellInfo["grid"] : null;
|
2092
|
+
if(host && host["getCellInfo"]) {
|
2093
|
+
let dv = host.getDataSource();
|
2094
|
+
while (cellInfo) {
|
2095
|
+
cellInfo = (e.shiftKey) ? host.getPrevCell(cellInfo) : host.getNextCell(cellInfo);
|
2096
|
+
if(cellInfo && cellInfo["cell"]) {
|
2097
|
+
if(dv.getRowDataAt(cellInfo["rowIndex"])) { // Check group header row
|
2098
|
+
if(this.isColumnEditable(cellInfo["colIndex"])) {
|
2099
|
+
this.openEditor(
|
2100
|
+
cellInfo["colIndex"],
|
2101
|
+
cellInfo["rowIndex"],
|
2102
|
+
cellInfo["sectionName"],
|
2103
|
+
cellInfo["grid"]
|
2104
|
+
);
|
2105
|
+
break;
|
2106
|
+
}
|
2107
|
+
}
|
2108
|
+
} else {
|
2109
|
+
cellInfo = null;
|
2110
|
+
}
|
2111
|
+
}
|
2112
|
+
}
|
2113
|
+
}
|
2114
|
+
}
|
2115
|
+
};
|
2116
|
+
/** Commit text from editor to cell.
|
2117
|
+
* @private
|
2118
|
+
* @param {boolean} committed
|
2119
|
+
* @param {Object} suggestionDetail suggestion detail for auto suggest element
|
2120
|
+
*/
|
2121
|
+
InCellEditingPlugin.prototype._commitText = function (committed, suggestionDetail) {
|
2122
|
+
let t = this;
|
2123
|
+
let arg = t._activePos;
|
2124
|
+
if(!t.isEditing() || !arg) {
|
2125
|
+
return;
|
2126
|
+
}
|
2127
|
+
|
2128
|
+
arg["section"].removeClass("edit-mode");
|
2129
|
+
t._editing = false;
|
2130
|
+
|
2131
|
+
let enteredValue = arg["text"] = t.getValue();
|
2132
|
+
let enteredText = t.getText();
|
2133
|
+
if(enteredText !== t._initialText) {
|
2134
|
+
arg["enteredText"] = enteredText;
|
2135
|
+
}
|
2136
|
+
let groupHeader = arg["groupHeader"] || false;
|
2137
|
+
|
2138
|
+
if(committed){
|
2139
|
+
if(suggestionDetail) { // This property is only available when the user commits text from the 'item-select' event of the auto suggest.
|
2140
|
+
arg["suggestionDetail"] = suggestionDetail;
|
2141
|
+
}
|
2142
|
+
if(t.hasListener("beforeCommit")) {
|
2143
|
+
t._dispatch("beforeCommit", arg);
|
2144
|
+
committed = !arg["cancel"];
|
2145
|
+
enteredValue = arg["text"];
|
2146
|
+
}
|
2147
|
+
|
2148
|
+
if(committed && t._dataBinding && !groupHeader) {
|
2149
|
+
let sectionSettings = arg["sectionSettings"];
|
2150
|
+
let sectionType = sectionSettings.getType();
|
2151
|
+
// case edit content
|
2152
|
+
if("content" === sectionType) {
|
2153
|
+
if(t._realTimeGrid && arg["field"] === "X_RIC_NAME") {
|
2154
|
+
let ricOpt = null;
|
2155
|
+
if(suggestionDetail) {
|
2156
|
+
let suggestionVal = suggestionDetail["value"];
|
2157
|
+
if(suggestionVal["p"]) {
|
2158
|
+
let permId = suggestionVal["p"]["PermId"];
|
2159
|
+
if(permId) {
|
2160
|
+
ricOpt = { permId: permId };
|
2161
|
+
}
|
2162
|
+
}
|
2163
|
+
}
|
2164
|
+
|
2165
|
+
t._realTimeGrid.setRic(arg["rowId"], enteredValue, ricOpt);
|
2166
|
+
} else {
|
2167
|
+
let dv = sectionSettings.getDataSource();
|
2168
|
+
if(dv) {
|
2169
|
+
if(t._realTimeGrid) {
|
2170
|
+
t._setStaticData(dv, arg["rowIndex"], arg["field"], enteredValue);
|
2171
|
+
} else {
|
2172
|
+
t._setData(dv, arg["rowIndex"], arg["field"], enteredValue);
|
2173
|
+
}
|
2174
|
+
}
|
2175
|
+
}
|
2176
|
+
|
2177
|
+
if(!t._prevContent || t._prevContent.classList.contains("text")) { // Bind data only if previous content is a build in text
|
2178
|
+
t._activeCell.setContent(enteredValue);
|
2179
|
+
}
|
2180
|
+
} else if("title" === sectionType) {
|
2181
|
+
let gridApi = t.getGridApi();
|
2182
|
+
if(gridApi) {
|
2183
|
+
gridApi.setColumnName(arg["colIndex"], enteredValue);
|
2184
|
+
}
|
2185
|
+
} else {
|
2186
|
+
t._activeCell.setContent(enteredValue);
|
2187
|
+
}
|
2188
|
+
}
|
2189
|
+
}
|
2190
|
+
|
2191
|
+
if(t.hasListener("editorClosed")) {
|
2192
|
+
arg["canceled"] = arg["cancelled"] = !committed;
|
2193
|
+
arg["committed"] = committed;
|
2194
|
+
t._dispatch("editorClosed", arg);
|
2195
|
+
}
|
2196
|
+
|
2197
|
+
if(t._activeInCellCache && t._activeInCellCache.balloonPopup) {
|
2198
|
+
t._activeInCellCache.balloonPopup.removeEventListener("hidden", t._onPopupHide);
|
2199
|
+
t._activeInCellCache.balloonPopup.hide();
|
2200
|
+
}
|
2201
|
+
Dom.removeParent(t._customElement);
|
2202
|
+
|
2203
|
+
let grid = arg["grid"];
|
2204
|
+
t._requestUpdateStarterText(); // Need to updaate starter text when text commit
|
2205
|
+
if(grid) {
|
2206
|
+
t._freezeScrolling(grid, false);
|
2207
|
+
grid.focus();
|
2208
|
+
}
|
2209
|
+
let dataSource = arg["dataSource"];
|
2210
|
+
if(dataSource) {
|
2211
|
+
if(dataSource["stall"]) {
|
2212
|
+
dataSource["stall"](false);
|
2213
|
+
}
|
2214
|
+
}
|
2215
|
+
|
2216
|
+
t._activePos = t._activeCell = t._prevContent = t._lastActiveGrid = t._activeInCellCache = null;
|
2217
|
+
};
|
2218
|
+
|
2219
|
+
/** @private
|
2220
|
+
* @param {Event} e
|
2221
|
+
*/
|
2222
|
+
InCellEditingPlugin.prototype._stopPropagation = function (e) {
|
2223
|
+
e.stopPropagation();
|
2224
|
+
};
|
2225
|
+
|
2226
|
+
/** Using for Check balloon mode is turn on/off.
|
2227
|
+
* @private
|
2228
|
+
* @param {Object} cell Grid cell object
|
2229
|
+
* @return {boolean}
|
2230
|
+
*/
|
2231
|
+
InCellEditingPlugin.prototype._isBalloonMode = function (cell) {
|
2232
|
+
let cellElem = cell.getElement();
|
2233
|
+
let compStyles = (cellElem) ? window.getComputedStyle(cellElem) : {};
|
2234
|
+
|
2235
|
+
return (this._balloonMode || compStyles.display === "none" || compStyles.visibility === "hidden");
|
2236
|
+
};
|
2237
|
+
|
2238
|
+
/** @private
|
2239
|
+
* @param {Object} host core grid object
|
2240
|
+
* @param {boolean} bool
|
2241
|
+
*/
|
2242
|
+
InCellEditingPlugin.prototype._listenForTriggering = function (host, bool) {
|
2243
|
+
if(bool) {
|
2244
|
+
host.listen("dblclick", this._onDoubleClick);
|
2245
|
+
|
2246
|
+
// Make a comparable functionality for touchscreen
|
2247
|
+
if(isTouchDevice()) {
|
2248
|
+
host.listen("touchstart", this._onTouchStart);
|
2249
|
+
host.listen("touchend", this._onTouchEnd);
|
2250
|
+
host.listen("touchcancel", this._onTouchEnd);
|
2251
|
+
}
|
2252
|
+
} else {
|
2253
|
+
host.unlisten("dblclick", this._onDoubleClick);
|
2254
|
+
host.unlisten("touchstart", this._onTouchStart);
|
2255
|
+
host.unlisten("touchend", this._onTouchEnd);
|
2256
|
+
host.unlisten("touchcancel", this._onTouchEnd);
|
2257
|
+
}
|
2258
|
+
};
|
2259
|
+
|
2260
|
+
|
2261
|
+
/** Use only On-Touch-Start event on mobile devices.
|
2262
|
+
* @private
|
2263
|
+
* @param {Object} e
|
2264
|
+
*/
|
2265
|
+
InCellEditingPlugin.prototype._onTouchStart = function (e) {
|
2266
|
+
this._resetTouchTimer();
|
2267
|
+
this._touchTimerId = setTimeout(this._onTouchTimer, this._longPressTime);
|
2268
|
+
};
|
2269
|
+
|
2270
|
+
/** Use only press time on mobile devices.
|
2271
|
+
* @private
|
2272
|
+
* @param {Object} e
|
2273
|
+
*/
|
2274
|
+
InCellEditingPlugin.prototype._onTouchTimer = function (e) {
|
2275
|
+
this._touchTimerId = 0;
|
2276
|
+
};
|
2277
|
+
|
2278
|
+
/** Use only On-Touch-End event on mobile devices.
|
2279
|
+
* @private
|
2280
|
+
* @param {Event} e
|
2281
|
+
*/
|
2282
|
+
InCellEditingPlugin.prototype._onTouchEnd = function (e) {
|
2283
|
+
if(!this._resetTouchTimer()) {
|
2284
|
+
this._onDoubleClick(e); // Trigger cell editor
|
2285
|
+
}
|
2286
|
+
};
|
2287
|
+
|
2288
|
+
/** Use only to reset timer on mobile devices.
|
2289
|
+
* @private
|
2290
|
+
* @return {boolean}
|
2291
|
+
*/
|
2292
|
+
InCellEditingPlugin.prototype._resetTouchTimer = function () {
|
2293
|
+
if(this._touchTimerId) {
|
2294
|
+
clearTimeout(this._touchTimerId);
|
2295
|
+
this._touchTimerId = 0;
|
2296
|
+
return true;
|
2297
|
+
}
|
2298
|
+
return false;
|
2299
|
+
};
|
2300
|
+
|
2301
|
+
/** Set other elements to using like popup when editing cell.
|
2302
|
+
* @public
|
2303
|
+
* @param {Element} elm
|
2304
|
+
*/
|
2305
|
+
InCellEditingPlugin.prototype.setPopupElement = function (elm) {
|
2306
|
+
let balloonPopup = this._activeInCellCache && this._activeInCellCache["balloonPopup"];
|
2307
|
+
if(this._customElement) {
|
2308
|
+
balloonPopup && balloonPopup.removeFocusElement(this._customElement);
|
2309
|
+
this._customElementPopup.dispose();
|
2310
|
+
this._customElementPopup = null;
|
2311
|
+
}
|
2312
|
+
|
2313
|
+
this._customElement = elm;
|
2314
|
+
|
2315
|
+
if(this._customElement) {
|
2316
|
+
this._customElementPopup = new Popup(this._customElement);
|
2317
|
+
balloonPopup && balloonPopup.addFocusElement(this._customElement);
|
2318
|
+
}
|
2319
|
+
};
|
2320
|
+
|
2321
|
+
/** Set content to the editor but do not commit anything to internal storage.
|
2322
|
+
* @public
|
2323
|
+
* @param {*} content
|
2324
|
+
*/
|
2325
|
+
InCellEditingPlugin.prototype.setText = function (content) {
|
2326
|
+
// TODO: since we have inputElement per each column
|
2327
|
+
// we should receive column index to set value in specific column
|
2328
|
+
this._activeInCellCache && this._setText(content, this._activeInCellCache["inputElement"]);
|
2329
|
+
};
|
2330
|
+
|
2331
|
+
/** @private
|
2332
|
+
* @param {*} content
|
2333
|
+
* @param {Element} inputElement editor element
|
2334
|
+
*/
|
2335
|
+
InCellEditingPlugin.prototype._setText = function (content, inputElement) {
|
2336
|
+
inputElement._origValue = content;
|
2337
|
+
|
2338
|
+
let inputTag = inputElement.tagName.toLowerCase();
|
2339
|
+
let typeMap = InCellEditingPlugin._uiElementTypesMap;
|
2340
|
+
if(inputTag === typeMap.checkbox) {
|
2341
|
+
let checked = (content) ? !(content === "f" || content === "false") : false;
|
2342
|
+
if(checked) {
|
2343
|
+
inputElement.setAttribute("checked", "true");
|
2344
|
+
} else {
|
2345
|
+
inputElement.removeAttribute("checked");
|
2346
|
+
}
|
2347
|
+
} else if(inputTag === typeMap.combobox) {
|
2348
|
+
let isMultiple = inputElement.getAttribute("multiple");
|
2349
|
+
|
2350
|
+
if(isMultiple){
|
2351
|
+
inputElement.values = content.split(/, */);
|
2352
|
+
} else if(this._elfVersion <= 3) {
|
2353
|
+
inputElement.value = "";
|
2354
|
+
inputElement.value = { value: content, label: content };
|
2355
|
+
} else {
|
2356
|
+
inputElement.value = content;
|
2357
|
+
}
|
2358
|
+
} else if(inputTag === typeMap.date) {
|
2359
|
+
ElfDate.setDate(inputElement, content);
|
2360
|
+
} else {
|
2361
|
+
let txt = "";
|
2362
|
+
if(content != null) {
|
2363
|
+
if(typeof content === "string") {
|
2364
|
+
txt = content;
|
2365
|
+
} else { // content could be false, 0, NaN or etc.
|
2366
|
+
txt = content + "";
|
2367
|
+
}
|
2368
|
+
}
|
2369
|
+
inputElement.value = txt;
|
2370
|
+
}
|
2371
|
+
};
|
2372
|
+
|
2373
|
+
/** Get current text from the editor
|
2374
|
+
* @public
|
2375
|
+
* @return {string}
|
2376
|
+
* @see {@link InCellEditingPlugin#getValue}
|
2377
|
+
*/
|
2378
|
+
InCellEditingPlugin.prototype.getText = function () {
|
2379
|
+
// TODO: since we have inputElement per each column
|
2380
|
+
// we should receive column index to return text of inputElement in specific column
|
2381
|
+
if(this._activeInCellCache)
|
2382
|
+
return this._getText(this._activeInCellCache["inputElement"]);
|
2383
|
+
else
|
2384
|
+
return "";
|
2385
|
+
};
|
2386
|
+
|
2387
|
+
/** @private
|
2388
|
+
* @param {Element} inputElement editor element
|
2389
|
+
* @return {string}
|
2390
|
+
*/
|
2391
|
+
InCellEditingPlugin.prototype._getText = function (inputElement) {
|
2392
|
+
let inputTag = inputElement.tagName.toLowerCase();
|
2393
|
+
let typeMap = InCellEditingPlugin._uiElementTypesMap;
|
2394
|
+
if(inputTag === typeMap.checkbox) {
|
2395
|
+
return inputElement.checked + "";
|
2396
|
+
} else if(inputTag === typeMap.combobox) {
|
2397
|
+
if(this._elfVersion <= 3) {
|
2398
|
+
return inputElement.value ? inputElement.value.value : "";
|
2399
|
+
}
|
2400
|
+
} else if(inputTag === typeMap.date) {
|
2401
|
+
return inputElement.value + "";
|
2402
|
+
}
|
2403
|
+
return inputElement.value;
|
2404
|
+
};
|
2405
|
+
|
2406
|
+
/** Convert current text from the editor to value corresponding to the type of the editor
|
2407
|
+
* @public
|
2408
|
+
* @return {*} Returned type is based on the type of the editor
|
2409
|
+
* @see {@link InCellEditingPlugin#getText}
|
2410
|
+
*/
|
2411
|
+
InCellEditingPlugin.prototype.getValue = function () {
|
2412
|
+
// TODO: since we have inputElement per each column
|
2413
|
+
// we should receive column index to return value of inputElement in specific column
|
2414
|
+
return this._activeInCellCache ? this._getValue(this._activeInCellCache["inputElement"]) : null;
|
2415
|
+
};
|
2416
|
+
|
2417
|
+
/** @private
|
2418
|
+
* @param {Element} inputElement editor element
|
2419
|
+
* @return {*} Returned type is based on the type of the editor
|
2420
|
+
*/
|
2421
|
+
InCellEditingPlugin.prototype._getValue = function (inputElement) {
|
2422
|
+
let inputTag = inputElement.tagName.toLowerCase();
|
2423
|
+
let typeMap = InCellEditingPlugin._uiElementTypesMap;
|
2424
|
+
if(inputTag === typeMap.checkbox) {
|
2425
|
+
return inputElement.checked ? true : false;
|
2426
|
+
} else if(inputTag === typeMap.date) {
|
2427
|
+
return ElfDate.getDate(inputElement);
|
2428
|
+
} else if(
|
2429
|
+
inputTag === typeMap.number ||
|
2430
|
+
typeof inputElement._origValue === "number" // Smart data conversion based orignal value
|
2431
|
+
) {
|
2432
|
+
return +inputElement.value;
|
2433
|
+
} else if(inputTag === typeMap.combobox && inputElement.getAttribute("multiple")) {
|
2434
|
+
return inputElement.values.join(", ");
|
2435
|
+
}
|
2436
|
+
|
2437
|
+
return this._getText(inputElement);
|
2438
|
+
};
|
2439
|
+
|
2440
|
+
/** Use to clear text in text editor.
|
2441
|
+
* @public
|
2442
|
+
*/
|
2443
|
+
InCellEditingPlugin.prototype.clearText = function () {
|
2444
|
+
this.setText("");
|
2445
|
+
};
|
2446
|
+
|
2447
|
+
/** Use to append text in text editor. WARNING: Only works with the text type editor
|
2448
|
+
* @public
|
2449
|
+
* @param {string} word
|
2450
|
+
*/
|
2451
|
+
InCellEditingPlugin.prototype.appendText = function (word) {
|
2452
|
+
// TODO: since we have inputElement per each column
|
2453
|
+
// we should receive column index to return append text in specific column
|
2454
|
+
if(word && this._activeInCellCache) {
|
2455
|
+
this._activeInCellCache["inputElement"].value += word;
|
2456
|
+
}
|
2457
|
+
};
|
2458
|
+
|
2459
|
+
/** Commit text will set text and commit to cell.
|
2460
|
+
* @public
|
2461
|
+
* @param {string=} word
|
2462
|
+
*/
|
2463
|
+
InCellEditingPlugin.prototype.commitText = function (word) {
|
2464
|
+
if(word) {
|
2465
|
+
this.setText(word);
|
2466
|
+
}
|
2467
|
+
this._commitText(true);
|
2468
|
+
};
|
2469
|
+
|
2470
|
+
/** Get Balloon Popup Element to access any API provided.
|
2471
|
+
* @public
|
2472
|
+
* @return {Popup|null}
|
2473
|
+
*/
|
2474
|
+
InCellEditingPlugin.prototype.getBalloonPopup = function () {
|
2475
|
+
// TODO: since we have balloonPopup per each column
|
2476
|
+
// we should receive column index to return balloonPopup in specific column
|
2477
|
+
return this._activeInCellCache ? this._activeInCellCache["balloonPopup"] : null;
|
2478
|
+
};
|
2479
|
+
|
2480
|
+
/** Get ef-autosuggest or atlas-autosuggest
|
2481
|
+
* @public
|
2482
|
+
* @return {Element}
|
2483
|
+
*/
|
2484
|
+
InCellEditingPlugin.prototype.getAutoSuggest = function () {
|
2485
|
+
return this._autoSuggest;
|
2486
|
+
};
|
2487
|
+
|
2488
|
+
/**
|
2489
|
+
* @public
|
2490
|
+
* @param {boolean=} disabled
|
2491
|
+
* @return {boolean} previous disablingScroll status
|
2492
|
+
*/
|
2493
|
+
InCellEditingPlugin.prototype.setDisablingScroll = function (disabled) {
|
2494
|
+
let prev = disabled;
|
2495
|
+
this._disablingScroll = disabled;
|
2496
|
+
return prev;
|
2497
|
+
};
|
2498
|
+
|
2499
|
+
/** stop scrolling to move to prevent editor close
|
2500
|
+
* @private
|
2501
|
+
* @param {Object} grid grid instance
|
2502
|
+
* @param {boolean=} frozen
|
2503
|
+
*/
|
2504
|
+
InCellEditingPlugin.prototype._freezeScrolling = function (grid, frozen) {
|
2505
|
+
if(!grid) return;
|
2506
|
+
|
2507
|
+
let vs = grid.getVScrollbar();
|
2508
|
+
let hs = grid.getHScrollbar();
|
2509
|
+
vs && vs.freezeScrolling(frozen);
|
2510
|
+
hs && hs.freezeScrolling(frozen);
|
2511
|
+
};
|
2512
|
+
|
2513
|
+
/** Set a timer to call onUpdateEditorPopup only once to avoid performance issue
|
2514
|
+
* @public
|
2515
|
+
*/
|
2516
|
+
InCellEditingPlugin.prototype.requestShowEditorPopup = function() {
|
2517
|
+
if(!this._editorTimerId) {
|
2518
|
+
this._editorTimerId = setTimeout(this._onUpdateEditorPopup.bind(this), 100);
|
2519
|
+
}
|
2520
|
+
};
|
2521
|
+
|
2522
|
+
/** @private */
|
2523
|
+
InCellEditingPlugin.prototype._onUpdateEditorPopup = function() {
|
2524
|
+
this._editorTimerId = 0;
|
2525
|
+
let grid = this.getActiveGrid() || this._lastActiveGrid;
|
2526
|
+
if(!grid){
|
2527
|
+
return;
|
2528
|
+
}
|
2529
|
+
let parentElement = document.body;
|
2530
|
+
if(this._compositeGrid || this._realTimeGrid) {
|
2531
|
+
parentElement = grid.getElement().parentElement;
|
2532
|
+
}
|
2533
|
+
|
2534
|
+
let rowIndex, colIndex;
|
2535
|
+
|
2536
|
+
if(this._activeInCellCache){
|
2537
|
+
let activePos = this._activePos;
|
2538
|
+
if(activePos){
|
2539
|
+
rowIndex = activePos["rowIndex"];
|
2540
|
+
colIndex = activePos["colIndex"];
|
2541
|
+
let section = grid.getSection(activePos["sectionType"]);
|
2542
|
+
let cell = section.getCell(colIndex, rowIndex);
|
2543
|
+
let stretchedCell = section.getStretchedCell(cell, rowIndex);
|
2544
|
+
if(stretchedCell){
|
2545
|
+
cell = stretchedCell;
|
2546
|
+
}
|
2547
|
+
if(cell){
|
2548
|
+
let popup = this._activeInCellCache["balloonPopup"];
|
2549
|
+
popup.attachTo(cell.getElement());
|
2550
|
+
popup.show(true, parentElement);
|
2551
|
+
|
2552
|
+
this._updateEditorPopup(this._activeInCellCache, cell, grid);
|
2553
|
+
}
|
2554
|
+
}
|
2555
|
+
}
|
2556
|
+
else if(this._activeRowId){
|
2557
|
+
let sectionContent = grid.getSection("content");
|
2558
|
+
rowIndex = this._getRowIndex(this._activeRowId);
|
2559
|
+
if(sectionContent.isRowVisible(rowIndex)){
|
2560
|
+
let lastIndex = (sectionContent.getColumnCount() || 0) - 1;
|
2561
|
+
for(let columnIndex = 0; columnIndex <= lastIndex; columnIndex++) {
|
2562
|
+
let columnData = this._getColumnData(columnIndex, grid);
|
2563
|
+
let inCellCache = columnData["inCellCache"];
|
2564
|
+
let cellContent = sectionContent.getCell(columnIndex, rowIndex);
|
2565
|
+
if(!inCellCache || !cellContent){
|
2566
|
+
continue;
|
2567
|
+
}
|
2568
|
+
let popupCache = inCellCache["balloonPopup"];
|
2569
|
+
popupCache.attachTo(cellContent.getElement());
|
2570
|
+
popupCache.show(true, parentElement);
|
2571
|
+
|
2572
|
+
this._updateEditorPopup(inCellCache, cellContent, grid);
|
2573
|
+
}
|
2574
|
+
}
|
2575
|
+
}
|
2576
|
+
};
|
2577
|
+
/** Update editor popup position and styles
|
2578
|
+
* @private
|
2579
|
+
* @param {Object} contentEditor
|
2580
|
+
* @param {Object} cell
|
2581
|
+
* @param {Object} grid grid instance
|
2582
|
+
*/
|
2583
|
+
InCellEditingPlugin.prototype._updateEditorPopup = function(contentEditor, cell, grid) {
|
2584
|
+
let popup = contentEditor["balloonPopup"];
|
2585
|
+
let editor = contentEditor["editor"];
|
2586
|
+
let inputElement = contentEditor["inputElement"];
|
2587
|
+
let popupElem = popup.getElement();
|
2588
|
+
let pos = grid.getRelativePosition(cell);
|
2589
|
+
let width = cell.getWidth();
|
2590
|
+
let height = cell.getHeight();
|
2591
|
+
let colRect = grid.getColumnRect(0, grid.getColumnCount());
|
2592
|
+
let rowRect = grid.getRowRect(0, grid.getRowCount());
|
2593
|
+
let offsetWidth = colRect.scrollViewSize;
|
2594
|
+
let offsetHeight = rowRect.scrollViewSize;
|
2595
|
+
let offsetLeft = 0;
|
2596
|
+
let offsetTop = pos["sectionType"] == "content" ? rowRect.scrollViewTop : 0;
|
2597
|
+
|
2598
|
+
let newHeight = height;
|
2599
|
+
let newWidth = width;
|
2600
|
+
let displayStyle = "inline-block";
|
2601
|
+
let marginLeft = 0;
|
2602
|
+
let marginTop = 0;
|
2603
|
+
|
2604
|
+
if(colRect.leftPinnedIndex != -1){
|
2605
|
+
let diff = 0;
|
2606
|
+
if(grid.getVScrollbar().isActive()){
|
2607
|
+
diff -= 8; // If column is left pinned, scrollbar width need to be subtracted
|
2608
|
+
}
|
2609
|
+
diff += colRect.width - colRect.scrollViewSize;
|
2610
|
+
offsetWidth += diff;
|
2611
|
+
offsetLeft += diff;
|
2612
|
+
}
|
2613
|
+
|
2614
|
+
if(editor.classList.contains("balloon") && !this._activeRowId){
|
2615
|
+
popupElem.style.display = "";
|
2616
|
+
editor.style.width = "";
|
2617
|
+
editor.style.marginLeft = "";
|
2618
|
+
editor.style.marginTop = "";
|
2619
|
+
marginLeft = -4;
|
2620
|
+
marginTop = -4;
|
2621
|
+
|
2622
|
+
newWidth = popup.getElement().offsetWidth;
|
2623
|
+
}
|
2624
|
+
|
2625
|
+
if(!pos["hit"]){
|
2626
|
+
displayStyle = "none";
|
2627
|
+
} else {
|
2628
|
+
let acquiredWidth = pos["x"] + newWidth;
|
2629
|
+
let acquiredHeight = pos["y"] - offsetTop + newHeight;
|
2630
|
+
|
2631
|
+
let isPinned = grid.isPinnedColumn(pos["colIndex"]);
|
2632
|
+
// if column is pinned, doesn't need to calculate left overflow
|
2633
|
+
if(!isPinned) {
|
2634
|
+
// Left overflow
|
2635
|
+
if(pos["x"] < offsetLeft){
|
2636
|
+
newWidth = (newWidth - (offsetLeft - pos["x"]));
|
2637
|
+
marginLeft = marginLeft + Math.abs(pos["x"] - offsetLeft);
|
2638
|
+
}
|
2639
|
+
}
|
2640
|
+
|
2641
|
+
// Right overflow
|
2642
|
+
if(acquiredWidth > offsetWidth){
|
2643
|
+
newWidth = newWidth - (acquiredWidth - offsetWidth);
|
2644
|
+
}
|
2645
|
+
// Top overflow
|
2646
|
+
if(pos["y"] < offsetTop){
|
2647
|
+
newHeight = (newHeight + pos["y"] - offsetTop);
|
2648
|
+
marginTop = marginTop + Math.abs(pos["y"] - offsetTop);
|
2649
|
+
}
|
2650
|
+
// Bottom overflow
|
2651
|
+
if(acquiredHeight > offsetHeight){
|
2652
|
+
newHeight = newHeight - (acquiredHeight - offsetHeight);
|
2653
|
+
}
|
2654
|
+
|
2655
|
+
if((newWidth < 48 && newWidth != width) || (newHeight < 16 && newHeight != height)){
|
2656
|
+
displayStyle = "none";
|
2657
|
+
}
|
2658
|
+
}
|
2659
|
+
|
2660
|
+
popupElem.style.display = displayStyle;
|
2661
|
+
editor.style.width = newWidth ? newWidth + "px" : "";
|
2662
|
+
editor.style.height = newHeight ? newHeight + "px" : "";
|
2663
|
+
editor.style.marginLeft = marginLeft ? marginLeft + "px" : 0;
|
2664
|
+
editor.style.marginTop = marginTop ? marginTop + "px" : 0;
|
2665
|
+
inputElement.focus();
|
2666
|
+
};
|
2667
|
+
|
2668
|
+
|
2669
|
+
|
2670
|
+
export default InCellEditingPlugin;
|
2671
|
+
export { InCellEditingPlugin, InCellEditingPlugin as InCellEditing, InCellEditingPlugin as InCellEditingExtension };
|