@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,890 @@
|
|
1
|
+
import Ext from "../Ext.js";
|
2
|
+
import VariableToken from "./VariableToken.js";
|
3
|
+
import EventDispatcher from "../EventDispatcher.js";
|
4
|
+
|
5
|
+
/** Trigger when data within the realtime formula has been changed
|
6
|
+
* @event Formula#dataCacheChanged
|
7
|
+
*/
|
8
|
+
|
9
|
+
/** @constructor
|
10
|
+
* @extends {EventDispatcher}
|
11
|
+
* @param {string=} expression
|
12
|
+
* @param {Object=} context
|
13
|
+
*/
|
14
|
+
let Formula = function(expression, context) {
|
15
|
+
this._input = expression || "";
|
16
|
+
if(context != null) {
|
17
|
+
this._context = context;
|
18
|
+
if (context["_DATA"]) { // _DATA is an internal context used for getting cached data
|
19
|
+
this["__D"] = context["_DATA"];
|
20
|
+
}
|
21
|
+
}
|
22
|
+
this["__F"] = [];
|
23
|
+
this._fnTokens = [];
|
24
|
+
this._fields = [];
|
25
|
+
this._fieldMap = {};
|
26
|
+
this._dataCache = {};
|
27
|
+
this._intervalServices = {};
|
28
|
+
this._formulaCount = 1; // Initial count
|
29
|
+
// this._addEvent("dataCacheChanged");
|
30
|
+
// this._addEvent("dataRequired");
|
31
|
+
// this._addEvent("formulaChanged");
|
32
|
+
this._onDataCacheChanged = this._onDataCacheChanged.bind(this);
|
33
|
+
this.dispatchDataChanged = this.dispatchDataChanged.bind(this);
|
34
|
+
|
35
|
+
this._parse(this._input);
|
36
|
+
};
|
37
|
+
Ext.inherits(Formula, EventDispatcher);
|
38
|
+
|
39
|
+
/** @type {Object.<string, boolean>}
|
40
|
+
* @const
|
41
|
+
* @public
|
42
|
+
*/
|
43
|
+
Formula._isBoundFormula = {
|
44
|
+
"RECORD": true,
|
45
|
+
"TR": true,
|
46
|
+
"MTXSERIES": true,
|
47
|
+
"NOW": true,
|
48
|
+
"TODAY": true,
|
49
|
+
// Adfin - StylesFunction
|
50
|
+
"ADSTYLEATTRIBUTE": true,
|
51
|
+
// Adfin - BdFunction
|
52
|
+
"ADBONDDERIV": true,
|
53
|
+
"ADBONDYIELD": true,
|
54
|
+
"BDSETTLE": true,
|
55
|
+
"ACCRUED": true,
|
56
|
+
// Adfin - CfFunction
|
57
|
+
"CFYLD": true,
|
58
|
+
// Adfin - DfFunction
|
59
|
+
"DFFORMATDATE": true,
|
60
|
+
"DFADDPERIOD": true,
|
61
|
+
"DFADDWD": true,
|
62
|
+
"DFADDMONTHS": true,
|
63
|
+
"DFADDYEARS": true,
|
64
|
+
"DFADJUSTTOWD": true,
|
65
|
+
"DFLASTWD": true,
|
66
|
+
"DFFINDDATED": true,
|
67
|
+
"DFCOUNTDAYS": true,
|
68
|
+
"DFCOUNTWD": true,
|
69
|
+
// Adfin - FxFunction
|
70
|
+
"ADFXSWPTODEP": true,
|
71
|
+
"FXCALCPERIOD": true,
|
72
|
+
// Adfin - OpFunction
|
73
|
+
"OPCALCDERIV": true,
|
74
|
+
"OPIMPLIEDVOL": true,
|
75
|
+
// Adfin - UtFunction
|
76
|
+
"ADFORMAT": true,
|
77
|
+
"ADHISTORYVALUE": true
|
78
|
+
|
79
|
+
|
80
|
+
};
|
81
|
+
/** @private
|
82
|
+
* @type {string}
|
83
|
+
*/
|
84
|
+
Formula.prototype._input = ""; // Initial user input
|
85
|
+
/** @private
|
86
|
+
* @type {string}
|
87
|
+
*/
|
88
|
+
Formula.prototype._expression = ""; // Evaluated expression
|
89
|
+
/** @private
|
90
|
+
* @type {string}
|
91
|
+
*/
|
92
|
+
Formula.prototype._alias = ""; // Alias name of formula
|
93
|
+
/** @private
|
94
|
+
* @type {Function}
|
95
|
+
*/
|
96
|
+
Formula.prototype._main = null; // Function resulted from resolving an expression
|
97
|
+
|
98
|
+
/** @private
|
99
|
+
* @type {Array.<Function>}
|
100
|
+
*/
|
101
|
+
Formula.prototype["__F"] = null; // Sub-methods that is used by this formula
|
102
|
+
/** @private
|
103
|
+
* @type {Array.<VariableToken>}
|
104
|
+
*/
|
105
|
+
Formula.prototype._fnTokens = null; // Sub-methods meta-data
|
106
|
+
/** @private
|
107
|
+
* @type {Array.<string>}
|
108
|
+
*/
|
109
|
+
Formula.prototype._fields = null; // Required field names from the expression
|
110
|
+
/** @private
|
111
|
+
* @type {Object.<string, boolean>}
|
112
|
+
*/
|
113
|
+
Formula.prototype._fieldMap = null; // Required field names from the expression
|
114
|
+
|
115
|
+
/** @private
|
116
|
+
* @type {string}
|
117
|
+
*/
|
118
|
+
Formula.prototype._reference = "";
|
119
|
+
|
120
|
+
/** @private
|
121
|
+
* @type {Object.<string, Function>}
|
122
|
+
*/
|
123
|
+
Formula.prototype._context = null;
|
124
|
+
|
125
|
+
/** @private
|
126
|
+
* @type {*}
|
127
|
+
*/
|
128
|
+
Formula.prototype._rtService = null;
|
129
|
+
|
130
|
+
/** @private
|
131
|
+
* @type {Object.<string, *>}
|
132
|
+
*/
|
133
|
+
Formula.prototype._intervalServices = null;
|
134
|
+
|
135
|
+
/** @private
|
136
|
+
* @type {Object.<string, *>}
|
137
|
+
*/
|
138
|
+
Formula.prototype._dataCache = null;
|
139
|
+
|
140
|
+
/** @private
|
141
|
+
* @type {string}
|
142
|
+
*/
|
143
|
+
Formula.prototype._dataLastError = "";
|
144
|
+
|
145
|
+
/** @private
|
146
|
+
* @type {string}
|
147
|
+
*/
|
148
|
+
Formula.prototype._inputWithTokenField = "";
|
149
|
+
|
150
|
+
/** @private
|
151
|
+
* @type {number}
|
152
|
+
*/
|
153
|
+
Formula.prototype._formulaCount = 0;
|
154
|
+
|
155
|
+
/** @private
|
156
|
+
* @type {Object.<string, Function>}
|
157
|
+
*/
|
158
|
+
Formula._invalidOps = {
|
159
|
+
"+=": true,
|
160
|
+
"-=": true,
|
161
|
+
"*=": true,
|
162
|
+
"/=": true,
|
163
|
+
"|=": true,
|
164
|
+
"&=": true,
|
165
|
+
"^=": true
|
166
|
+
};
|
167
|
+
|
168
|
+
/** @public
|
169
|
+
*/
|
170
|
+
Formula.prototype.dispose = function() {
|
171
|
+
if(this._rtService) {
|
172
|
+
this._rtService["dispose"]();
|
173
|
+
this._rtService = null;
|
174
|
+
}
|
175
|
+
for(let serviceName in this._intervalServices) {
|
176
|
+
// No need to dispose the static object
|
177
|
+
this._intervalServices[serviceName]["removeEventListener"]("dataChanged", this.dispatchDataChanged);
|
178
|
+
}
|
179
|
+
this._intervalServices = null;
|
180
|
+
this.unlistenAll();
|
181
|
+
};
|
182
|
+
|
183
|
+
/** @public
|
184
|
+
* @param {Object.<string, *>} rowData
|
185
|
+
* @return {*}
|
186
|
+
*/
|
187
|
+
Formula.prototype.calculate = function(rowData) {
|
188
|
+
if (this._main) {
|
189
|
+
this._dataLastError = ""; // Clear last realtime error message
|
190
|
+
let res = this._main(rowData);
|
191
|
+
switch(this._dataLastError) {
|
192
|
+
case "Pending data": // Don't show data if realtime data is still pending
|
193
|
+
res = null;
|
194
|
+
break;
|
195
|
+
case "Pending - no erase":
|
196
|
+
res = "..."; // Data update is pending - do not erase previous value
|
197
|
+
break;
|
198
|
+
}
|
199
|
+
return res;
|
200
|
+
}
|
201
|
+
return null;
|
202
|
+
};
|
203
|
+
|
204
|
+
/** Function resulted from resolving an expression
|
205
|
+
* @public
|
206
|
+
* @return {Function} Returns function that takes an JSON object as a parameter. Return null if function is not valid JavaScript codes.
|
207
|
+
*/
|
208
|
+
Formula.prototype.getFunction = function() { return this._main; };
|
209
|
+
/** @public
|
210
|
+
* @return {Array.<string>}
|
211
|
+
*/
|
212
|
+
Formula.prototype.getFieldNames = function() { return this._fields; };
|
213
|
+
|
214
|
+
/** For internal use only
|
215
|
+
* @public
|
216
|
+
* @ignore
|
217
|
+
* @param {string} str
|
218
|
+
*/
|
219
|
+
Formula.prototype._setReference = function(str) {
|
220
|
+
this._reference = str;
|
221
|
+
};
|
222
|
+
/** @public
|
223
|
+
* @return {string}
|
224
|
+
*/
|
225
|
+
Formula.prototype.getReference = function() {
|
226
|
+
return this._reference;
|
227
|
+
};
|
228
|
+
|
229
|
+
/** Evaluated expression
|
230
|
+
* @public
|
231
|
+
* @return {string}
|
232
|
+
*/
|
233
|
+
Formula.prototype.getExpression = function() {
|
234
|
+
return this._expression;
|
235
|
+
};
|
236
|
+
/** @public
|
237
|
+
* @function
|
238
|
+
* @return {string}
|
239
|
+
*/
|
240
|
+
Formula.prototype.toString = Formula.prototype.getReference;
|
241
|
+
|
242
|
+
/** Initial user input
|
243
|
+
* @public
|
244
|
+
* @return {string}
|
245
|
+
*/
|
246
|
+
Formula.prototype.getInput = function() { return this._input; };
|
247
|
+
|
248
|
+
/** Get alias name of formula. If alias does not exist, user input is returned instead
|
249
|
+
* @public
|
250
|
+
* @return {string}
|
251
|
+
*/
|
252
|
+
Formula.prototype.getAlias = function() { return this._alias || this._input; };
|
253
|
+
/** Set alias name of formula
|
254
|
+
* @public
|
255
|
+
* @param {string} str
|
256
|
+
*/
|
257
|
+
Formula.prototype.setAlias = function(str) {
|
258
|
+
this._alias = str;
|
259
|
+
};
|
260
|
+
/** Add formula count
|
261
|
+
* @public
|
262
|
+
*/
|
263
|
+
Formula.prototype.addFormulaCount = function() {
|
264
|
+
this._formulaCount++;
|
265
|
+
};
|
266
|
+
/** Subtract formula count. Return true if formula count is zero.
|
267
|
+
* @public
|
268
|
+
* @return {boolean}
|
269
|
+
*/
|
270
|
+
Formula.prototype.subtractFormulaCount = function() {
|
271
|
+
return --this._formulaCount === 0;
|
272
|
+
};
|
273
|
+
|
274
|
+
/** @public
|
275
|
+
*/
|
276
|
+
Formula.prototype.updateContext = function() {
|
277
|
+
if(!this._context) { return; }
|
278
|
+
|
279
|
+
let len = this._fnTokens.length;
|
280
|
+
for(let i = 0; i < len; ++i) {
|
281
|
+
let fname = this._fnTokens[i].getFunctionName();
|
282
|
+
this["__F"][i] = this._context[fname] || Formula._emptyFunction;
|
283
|
+
if (Formula._isBoundFormula[fname]) {
|
284
|
+
this["__F"][i] = this["__F"][i].bind(this);
|
285
|
+
}
|
286
|
+
//this.__F[i] = this._logger.bind(this, i);
|
287
|
+
}
|
288
|
+
};
|
289
|
+
|
290
|
+
/** @private
|
291
|
+
* @param {number} index
|
292
|
+
*/
|
293
|
+
Formula.prototype._logger = function(index) {
|
294
|
+
console.log("[" + index + "] " + this._fnTokens[index].getFunctionName() + " is executed" );
|
295
|
+
};
|
296
|
+
/** @private
|
297
|
+
*/
|
298
|
+
Formula._emptyFunction = function() {};
|
299
|
+
|
300
|
+
/** @private
|
301
|
+
* @param {string} str
|
302
|
+
* @return {boolean}
|
303
|
+
*/
|
304
|
+
Formula.prototype._detectCodeInjection = function(str) {
|
305
|
+
let injection = false;
|
306
|
+
|
307
|
+
if(str.match(/\+\+|--/)) { // ++ and -- which modifies current variable is not allowed
|
308
|
+
injection = true;
|
309
|
+
}
|
310
|
+
|
311
|
+
if(!injection) {
|
312
|
+
let matches = str.match(/([^=]=+)/g) || [];
|
313
|
+
for (let i = matches.length; --i >= 0;) {
|
314
|
+
let m = matches[i];
|
315
|
+
let lastTwoChars = m.substring(m.length - 2);
|
316
|
+
if (Formula._invalidOps[lastTwoChars]) {
|
317
|
+
injection = true;
|
318
|
+
break;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
}
|
322
|
+
|
323
|
+
// if(injection) {
|
324
|
+
// console.log("WARNING: Code injection detected");
|
325
|
+
// }
|
326
|
+
|
327
|
+
return injection;
|
328
|
+
};
|
329
|
+
/** Upper case only formula expression. All other cases are ignored
|
330
|
+
* @public
|
331
|
+
* @param {string} exp
|
332
|
+
* @return {string}
|
333
|
+
*/
|
334
|
+
Formula.toUpperCase = function(exp) {
|
335
|
+
if(!exp || exp.charAt(0) !== "=") { //Prevent impacting to UDIP search field
|
336
|
+
return exp || "";
|
337
|
+
}
|
338
|
+
|
339
|
+
let tokens = [];
|
340
|
+
let calcHierarchy = [];
|
341
|
+
|
342
|
+
// Tokenize string constants first because they has enclosure (single quotes and double quotes)
|
343
|
+
exp = Formula.tokenizeQuotes(exp, tokens, calcHierarchy);
|
344
|
+
|
345
|
+
exp = exp.toUpperCase(); // Upper case the remaining
|
346
|
+
|
347
|
+
// May have the new string token from ADC field with parameter
|
348
|
+
// Regex for adc fileds
|
349
|
+
// TR : start with tr
|
350
|
+
// (\.[\w]+)+ : dot follow by any character at least 1
|
351
|
+
// \( : start parentheses
|
352
|
+
// [^\(\)]* : any except parentheses
|
353
|
+
// \) : end parentheses
|
354
|
+
// (\.[a-zA-Z]+)* : dot follow by any character (optional)
|
355
|
+
|
356
|
+
exp = exp.replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g, Formula._encloseWithTR);
|
357
|
+
|
358
|
+
exp = Formula.resolveTokens(exp, tokens, calcHierarchy); // Restore the string
|
359
|
+
|
360
|
+
return exp;
|
361
|
+
};
|
362
|
+
/** @description Wrap TR function to ADC field with parameter e.g.
|
363
|
+
* TR.Revenue(Scale=2)
|
364
|
+
* TR.Revenue(Scale=2).calcdate,
|
365
|
+
* TR.Revenue(Period=FY0,Scale=2)
|
366
|
+
* @private
|
367
|
+
* @param {string} adcField
|
368
|
+
* @return {string}
|
369
|
+
*/
|
370
|
+
Formula._encloseWithTR = function(adcField) {
|
371
|
+
return "TR(\"" + adcField + "\")";
|
372
|
+
};
|
373
|
+
/** @public
|
374
|
+
* @ignore
|
375
|
+
* @param {string} exp
|
376
|
+
* @param {Array.<VariableToken>=} tokens
|
377
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
378
|
+
* @return {string}
|
379
|
+
*/
|
380
|
+
Formula.tokenizeQuotes = function(exp, tokens, calcHierarchy) {
|
381
|
+
if(!tokens) {
|
382
|
+
tokens = [];
|
383
|
+
}
|
384
|
+
if(!calcHierarchy) {
|
385
|
+
calcHierarchy = [];
|
386
|
+
}
|
387
|
+
|
388
|
+
let index;
|
389
|
+
let matched = false;
|
390
|
+
let tokenIndices = [];
|
391
|
+
do {
|
392
|
+
matched = false;
|
393
|
+
exp = exp.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g, function(str) { // eslint-disable-line
|
394
|
+
matched = true;
|
395
|
+
index = tokens.length;
|
396
|
+
tokens.push(new VariableToken(str, index));
|
397
|
+
tokenIndices.push(index);
|
398
|
+
return "♦" + index + "♦";
|
399
|
+
});
|
400
|
+
} while(matched);
|
401
|
+
calcHierarchy.push(tokenIndices);
|
402
|
+
return exp;
|
403
|
+
};
|
404
|
+
/** @public
|
405
|
+
* @ignore
|
406
|
+
* @param {string} exp
|
407
|
+
* @param {Array.<VariableToken>=} tokens
|
408
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
409
|
+
* @return {string}
|
410
|
+
*/
|
411
|
+
Formula.tokenizeAdcWithParams = function(exp, tokens, calcHierarchy) {
|
412
|
+
if(!tokens) {
|
413
|
+
tokens = [];
|
414
|
+
}
|
415
|
+
if(!calcHierarchy) {
|
416
|
+
calcHierarchy = [];
|
417
|
+
}
|
418
|
+
|
419
|
+
let index;
|
420
|
+
let matched = false;
|
421
|
+
let tokenIndices = [];
|
422
|
+
do {
|
423
|
+
matched = false;
|
424
|
+
exp = exp.replace(/TR\.\w+\([^\)]*\)+/g, function(str) { // eslint-disable-line
|
425
|
+
matched = true;
|
426
|
+
index = tokens.length;
|
427
|
+
tokens.push(new VariableToken(str, index));
|
428
|
+
tokenIndices.push(index);
|
429
|
+
return "♦" + index + "♦";
|
430
|
+
});
|
431
|
+
} while(matched);
|
432
|
+
calcHierarchy.push(tokenIndices);
|
433
|
+
return exp;
|
434
|
+
};
|
435
|
+
/** @public
|
436
|
+
* @ignore
|
437
|
+
* @param {string} exp
|
438
|
+
* @param {Array.<VariableToken>=} tokens
|
439
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
440
|
+
* @return {string}
|
441
|
+
*/
|
442
|
+
Formula.replaceUnwantedCharacters = function(exp, tokens, calcHierarchy) {
|
443
|
+
// Replace all double spaces with single space
|
444
|
+
while(exp.indexOf(" ") >= 0) {
|
445
|
+
exp = exp.replace(/ {2}/g, " ");
|
446
|
+
}
|
447
|
+
|
448
|
+
// Remove all dollar signs (e.g. $CF_BID + $CF_ASK)
|
449
|
+
exp = exp.replace(/\$/g, "");
|
450
|
+
|
451
|
+
// Replace single ampersand with plus sign to support string concatenation with ampersand
|
452
|
+
exp = exp.replace(/\&+/g, function(str) {
|
453
|
+
if(str === "&") {
|
454
|
+
return "+";
|
455
|
+
}
|
456
|
+
return str;
|
457
|
+
});
|
458
|
+
|
459
|
+
/**
|
460
|
+
* Replace all assignment operator with equality operator, by using
|
461
|
+
* regular expression for detecting only "=" that is not a starting point of a formula,
|
462
|
+
* so the character "=" is not replaced with "==" during conversion.
|
463
|
+
*
|
464
|
+
* @example
|
465
|
+
* =ABS(COL5+COL6) -> =ABS(COL5+COL6)
|
466
|
+
* =(COL5=COL6) -> =(COL5==COL6)
|
467
|
+
*/
|
468
|
+
exp = exp.replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g, function(m) {
|
469
|
+
if (m === "=") {
|
470
|
+
return "==";
|
471
|
+
}
|
472
|
+
|
473
|
+
return m;
|
474
|
+
});
|
475
|
+
|
476
|
+
return exp;
|
477
|
+
};
|
478
|
+
/** @private
|
479
|
+
* @param {string} exp
|
480
|
+
* @param {Array.<VariableToken>=} tokens
|
481
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
482
|
+
* @return {string}
|
483
|
+
*/
|
484
|
+
Formula.prototype._tokenizeParentheses = function(exp, tokens, calcHierarchy) {
|
485
|
+
if (!tokens) {
|
486
|
+
tokens = [];
|
487
|
+
}
|
488
|
+
|
489
|
+
if(!calcHierarchy) {
|
490
|
+
calcHierarchy = [];
|
491
|
+
}
|
492
|
+
|
493
|
+
let fnStrToIndex = {}; // To avoid duplicate function
|
494
|
+
|
495
|
+
/**
|
496
|
+
* It is better to not duplicate content of regular expressions to avoid any possible typos
|
497
|
+
* or discrepancies.
|
498
|
+
* Therefore we copy existing regular expression and assign new flags to it instead.
|
499
|
+
*/
|
500
|
+
let firstMatchRE = /[\w._]*(?:=|=[\w]*)?\([^()]*\)/;
|
501
|
+
let globalRE = new RegExp(firstMatchRE.source, 'g');
|
502
|
+
|
503
|
+
while (exp.match(firstMatchRE)) {
|
504
|
+
let tokenIndices = [];
|
505
|
+
|
506
|
+
exp = exp.replace(globalRE, function (fnStr, group) { // eslint-disable-line
|
507
|
+
// Remove the first equal sign.
|
508
|
+
if (fnStr.charAt(0) === "=") {
|
509
|
+
fnStr = fnStr.substr(1, fnStr.length);
|
510
|
+
}
|
511
|
+
|
512
|
+
let index = fnStrToIndex[fnStr];
|
513
|
+
|
514
|
+
if (index == null) {
|
515
|
+
index = tokens.length;
|
516
|
+
tokens.push(new VariableToken(fnStr, index));
|
517
|
+
fnStrToIndex[fnStr] = index;
|
518
|
+
}
|
519
|
+
|
520
|
+
tokenIndices.push(index);
|
521
|
+
|
522
|
+
return "♦" + index + "♦";
|
523
|
+
});
|
524
|
+
|
525
|
+
calcHierarchy.push(tokenIndices);
|
526
|
+
}
|
527
|
+
|
528
|
+
return exp;
|
529
|
+
};
|
530
|
+
/** @private
|
531
|
+
* @param {string} exp
|
532
|
+
* @param {Array.<VariableToken>=} tokens
|
533
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
534
|
+
* @return {string}
|
535
|
+
*/
|
536
|
+
Formula.prototype._tokenizeConstants = function(exp, tokens, calcHierarchy) {
|
537
|
+
if(!tokens) {
|
538
|
+
tokens = [];
|
539
|
+
}
|
540
|
+
if(!calcHierarchy) {
|
541
|
+
calcHierarchy = [];
|
542
|
+
}
|
543
|
+
|
544
|
+
let tokenIndices = [];
|
545
|
+
exp = exp.replace(/[\w._♦]+/g, function(varStr) {
|
546
|
+
if (varStr.charAt(0) === "♦") {
|
547
|
+
return varStr;
|
548
|
+
}
|
549
|
+
let index = tokens.length;
|
550
|
+
tokens.push(new VariableToken(varStr, index));
|
551
|
+
tokenIndices.push(index);
|
552
|
+
return "♦" + index + "♦";
|
553
|
+
});
|
554
|
+
calcHierarchy.push(tokenIndices);
|
555
|
+
return exp;
|
556
|
+
};
|
557
|
+
/** @public
|
558
|
+
* @param {string} exp
|
559
|
+
* @param {Array.<VariableToken>} tokens
|
560
|
+
* @param {Array.<Array.<number>>} calcHierarchy
|
561
|
+
* @return {string}
|
562
|
+
*/
|
563
|
+
Formula.resolveTokens = function(exp, tokens, calcHierarchy) {
|
564
|
+
for(let i = calcHierarchy.length; --i >= 0;) { // Must be done in reverse order
|
565
|
+
let indices = calcHierarchy[i];
|
566
|
+
let len = indices.length;
|
567
|
+
for(let j = 0; j < len; ++j) {
|
568
|
+
let index = indices[j];
|
569
|
+
let token = tokens[index];
|
570
|
+
exp = exp.replace(new RegExp("♦" + index + "♦", "g"), function() { // eslint-disable-line
|
571
|
+
return token.getExpression();
|
572
|
+
});
|
573
|
+
}
|
574
|
+
}
|
575
|
+
return exp;
|
576
|
+
};
|
577
|
+
|
578
|
+
/** @private
|
579
|
+
* @param {string} exp
|
580
|
+
* @param {Array.<VariableToken>} tokens
|
581
|
+
* @param {Array.<Array.<number>>} calcHierarchy
|
582
|
+
* @return {string}
|
583
|
+
*/
|
584
|
+
Formula._getInputWithTokenField = function(exp, tokens, calcHierarchy) {
|
585
|
+
for(let i = calcHierarchy.length; --i >= 0;) { // Must be done in reverse order
|
586
|
+
let indices = calcHierarchy[i];
|
587
|
+
let len = indices.length;
|
588
|
+
for(let j = 0; j < len; ++j) {
|
589
|
+
let index = indices[j];
|
590
|
+
let token = tokens[index];
|
591
|
+
exp = exp.replace(new RegExp("♦" + index + "♦", "g"), function() { // eslint-disable-line
|
592
|
+
return token.getInputWithTokenField();
|
593
|
+
});
|
594
|
+
}
|
595
|
+
}
|
596
|
+
return "=" + exp;
|
597
|
+
};
|
598
|
+
|
599
|
+
/** @private
|
600
|
+
* @param {string} exp
|
601
|
+
* @return {Function}
|
602
|
+
*/
|
603
|
+
Formula.prototype._parse = function(exp) {
|
604
|
+
this._expression = "";
|
605
|
+
this._main = null;
|
606
|
+
|
607
|
+
this["__F"].length = 0;
|
608
|
+
this._fnTokens.length = 0;
|
609
|
+
this._fields.length = 0;
|
610
|
+
|
611
|
+
if(!exp) { return null; }
|
612
|
+
|
613
|
+
if(exp.charAt(0) === "=") { // Remove the first equal sign
|
614
|
+
exp = exp.substr(1);
|
615
|
+
}
|
616
|
+
exp = exp.trim();
|
617
|
+
exp = exp.replace(/<>/g, "!=");
|
618
|
+
exp = exp.replace(/‛|‘|’/g, "'"); // Left and right single quote will be converted to simple single quote
|
619
|
+
exp = exp.replace(/‟|“|”/g, '"'); // Left and right double quote will be converted to simple double quote
|
620
|
+
|
621
|
+
if(!exp || this._detectCodeInjection(exp)) { return null; }
|
622
|
+
|
623
|
+
let tokens = [];
|
624
|
+
let calcHierarchy = [];
|
625
|
+
|
626
|
+
exp = Formula.tokenizeQuotes(exp, tokens, calcHierarchy); // Tokenize string constants first because they has enclosure (single quotes and double quotes)
|
627
|
+
|
628
|
+
exp = Formula.tokenizeAdcWithParams(exp, tokens, calcHierarchy);
|
629
|
+
|
630
|
+
exp = Formula.replaceUnwantedCharacters(exp, tokens, calcHierarchy);
|
631
|
+
|
632
|
+
exp = this._tokenizeParentheses(exp, tokens, calcHierarchy); // Tokenize all methods and parenthesis group
|
633
|
+
|
634
|
+
exp = this._tokenizeConstants(exp, tokens, calcHierarchy); // Tokenize the rest of the constants and dynamic values
|
635
|
+
|
636
|
+
// Used for change field name in formula
|
637
|
+
this._inputWithTokenField = Formula._getInputWithTokenField(exp, tokens, calcHierarchy);
|
638
|
+
|
639
|
+
// Resolve each function tokens into valid JavaScript codes
|
640
|
+
exp = Formula.resolveTokens(exp, tokens, calcHierarchy);
|
641
|
+
|
642
|
+
// Re-organize function structure and index, and retrieve field data
|
643
|
+
let fields = {};
|
644
|
+
let len = tokens.length;
|
645
|
+
for(let i = 0; i < len; ++i) {
|
646
|
+
let token = tokens[i];
|
647
|
+
if(token.getFunctionName()) {
|
648
|
+
let fIndex = this._fnTokens.length;
|
649
|
+
exp = exp.replace(new RegExp("this\\.__F\\[" + i + "\\]", "g"), "this.__F[" + fIndex + "]");
|
650
|
+
token.setIndex(fIndex);
|
651
|
+
this._fnTokens.push(token);
|
652
|
+
}
|
653
|
+
token.getFieldNames(fields);
|
654
|
+
}
|
655
|
+
|
656
|
+
this._expression = exp; // The expression has been finalized
|
657
|
+
this.updateContext();
|
658
|
+
|
659
|
+
this._main = this._createFunction(this._expression);
|
660
|
+
if(!this._main) {
|
661
|
+
return null;
|
662
|
+
}
|
663
|
+
|
664
|
+
this._fieldMap = fields;
|
665
|
+
this._fields = Object.keys(fields);
|
666
|
+
return this._main;
|
667
|
+
};
|
668
|
+
|
669
|
+
/** @private
|
670
|
+
* @param {string} expression
|
671
|
+
* @return {Function}
|
672
|
+
*/
|
673
|
+
Formula.prototype._createFunction = function (expression) {
|
674
|
+
let func = null;
|
675
|
+
try {
|
676
|
+
func = new Function("__R", "return " + expression + ";");
|
677
|
+
func = func.bind(this);
|
678
|
+
func({}); // Try to execute the method once to check error
|
679
|
+
} catch(err) {
|
680
|
+
func = null;
|
681
|
+
// window.console.log('Expression: "' + this._input + '" contains the following error: \n' + err.message);
|
682
|
+
}
|
683
|
+
return func;
|
684
|
+
};
|
685
|
+
|
686
|
+
/** @private
|
687
|
+
* @param {string} colName
|
688
|
+
* @param {Object.<string, *>} rowData
|
689
|
+
* @return {*}
|
690
|
+
*/
|
691
|
+
Formula.prototype["__D"] = function (colName, rowData) {
|
692
|
+
return rowData[colName];
|
693
|
+
};
|
694
|
+
/** @public
|
695
|
+
* @param {string} field
|
696
|
+
* @param {string=} opt_src
|
697
|
+
* @returns {boolean}
|
698
|
+
*/
|
699
|
+
Formula.prototype.addField = function(field, opt_src) {
|
700
|
+
if(this._fieldMap[field]) { // Existing in this._fields
|
701
|
+
return false;
|
702
|
+
}
|
703
|
+
if(field.indexOf("undefined") >= 0) { // We can remove this block if the ADC service can ignore the invalid requested field.
|
704
|
+
// REMARK: ADC cannot support the invalid parameter. It will respond with ERROR and do not return any ADC data anymore.
|
705
|
+
return false; // WORKAROUND: Field name must not contain with string 'undefined'
|
706
|
+
}
|
707
|
+
|
708
|
+
this._fields.push(field);
|
709
|
+
this._fieldMap[field] = true;
|
710
|
+
this._dispatch("dataRequired", { "field": field, "src": opt_src || "adc" });
|
711
|
+
return true;
|
712
|
+
};
|
713
|
+
|
714
|
+
/** Change field in formula
|
715
|
+
* @public
|
716
|
+
* @param {string} oldName
|
717
|
+
* @param {string} newName
|
718
|
+
* @return {boolean}
|
719
|
+
*/
|
720
|
+
Formula.prototype.changeField = function (oldName, newName) {
|
721
|
+
let index = this._fields.indexOf(oldName);
|
722
|
+
if (index < 0) {
|
723
|
+
return false;
|
724
|
+
}
|
725
|
+
this._fields.splice(index, 1);
|
726
|
+
if (this._fields.indexOf(newName) < 0) {
|
727
|
+
this._fields.push(newName);
|
728
|
+
}
|
729
|
+
let oldInput = this._input;
|
730
|
+
let oldTokenField = "♠" + oldName + "♥";
|
731
|
+
let newTokenField = "♠" + newName + "♥";
|
732
|
+
this._inputWithTokenField = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) {
|
733
|
+
return (str === oldTokenField) ? newTokenField : str;
|
734
|
+
});
|
735
|
+
this._input = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) {
|
736
|
+
return str.substr(1, str.length - 2); // Remove "♠" and "♥"
|
737
|
+
});
|
738
|
+
this._expression = this._expression.replace(new RegExp('this\\.__D\\("' + oldName + '", __R\\)', "g"), 'this.__D("' + newName + '", __R)');
|
739
|
+
this._main = this._createFunction(this._expression);
|
740
|
+
this._dispatch("formulaChanged", { "oldInput": oldInput, "formula": this });
|
741
|
+
return true;
|
742
|
+
};
|
743
|
+
/** Change multiple field in formula
|
744
|
+
* @public
|
745
|
+
* @param {Array.<string>} oldNames
|
746
|
+
* @param {Array.<string>} newNames
|
747
|
+
* @return {boolean}
|
748
|
+
*/
|
749
|
+
Formula.prototype.changeFields = function (oldNames, newNames) {
|
750
|
+
if(!Array.isArray(oldNames) || !Array.isArray(newNames)) {
|
751
|
+
return false;
|
752
|
+
}
|
753
|
+
if(oldNames.length !== newNames.length) {
|
754
|
+
return false;
|
755
|
+
}
|
756
|
+
|
757
|
+
let oldInput = this._input;
|
758
|
+
for(let i = oldNames.length; --i >= 0;) {
|
759
|
+
let oldName = oldNames[i];
|
760
|
+
let newName = newNames[i];
|
761
|
+
|
762
|
+
let index = this._fields.indexOf(oldName);
|
763
|
+
if (index < 0) {
|
764
|
+
continue;
|
765
|
+
}
|
766
|
+
|
767
|
+
this._fields.splice(index, 1);
|
768
|
+
if (this._fields.indexOf(newName) < 0) {
|
769
|
+
this._fields.push(newName);
|
770
|
+
}
|
771
|
+
|
772
|
+
let oldTokenField = "♠" + oldName + "♥";
|
773
|
+
let newTokenField = "♠" + newName + "♥";
|
774
|
+
|
775
|
+
this._inputWithTokenField = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) { // eslint-disable-line
|
776
|
+
return (str === oldTokenField) ? newTokenField : str;
|
777
|
+
});
|
778
|
+
this._input = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) { // eslint-disable-line
|
779
|
+
return str.substr(1, str.length - 2); // Remove "♠" and "♥"
|
780
|
+
});
|
781
|
+
this._expression = this._expression.replace(new RegExp('this\\.__D\\("' + oldName + '", __R\\)', "g"), 'this.__D("' + newName + '", __R)');
|
782
|
+
}
|
783
|
+
|
784
|
+
this._main = this._createFunction(this._expression);
|
785
|
+
this._dispatch("formulaChanged", { "oldInput": oldInput, "formula": this });
|
786
|
+
return true;
|
787
|
+
};
|
788
|
+
|
789
|
+
//#region Realtime service
|
790
|
+
/** @public
|
791
|
+
* @return {*}
|
792
|
+
*/
|
793
|
+
Formula.prototype.getRealtimeService = function() {
|
794
|
+
return this._rtService;
|
795
|
+
};
|
796
|
+
|
797
|
+
/** @public
|
798
|
+
* @param {Object} rtService
|
799
|
+
*/
|
800
|
+
Formula.prototype.setRealtimeService = function(rtService) {
|
801
|
+
if (this._rtService) {
|
802
|
+
this._rtService["dispose"]();
|
803
|
+
}
|
804
|
+
this._rtService = rtService;
|
805
|
+
this._rtService["addEventListener"]("dataChanged", this._onDataCacheChanged);
|
806
|
+
};
|
807
|
+
//#endregion Realtime service
|
808
|
+
|
809
|
+
//#region Interval service
|
810
|
+
/** @public
|
811
|
+
* @param {string} funcName
|
812
|
+
* @return {*}
|
813
|
+
*/
|
814
|
+
Formula.prototype.getIntervalService = function(funcName) {
|
815
|
+
return this._intervalServices[funcName];
|
816
|
+
};
|
817
|
+
|
818
|
+
/** @public
|
819
|
+
* @param {string} funcName
|
820
|
+
* @param {Object} newService
|
821
|
+
*/
|
822
|
+
Formula.prototype.setIntervalService = function(funcName, newService) {
|
823
|
+
if(!newService) {
|
824
|
+
return;
|
825
|
+
}
|
826
|
+
|
827
|
+
let service = this._intervalServices[funcName];
|
828
|
+
if (service) {
|
829
|
+
service["removeEventListener"]("dataChanged", this.dispatchDataChanged); // Service will stop only if no event listener anymore
|
830
|
+
}
|
831
|
+
this._intervalServices[funcName] = newService;
|
832
|
+
newService["addEventListener"]("dataChanged", this.dispatchDataChanged);
|
833
|
+
};
|
834
|
+
//#endregion Interval service
|
835
|
+
|
836
|
+
//#region formula data cache
|
837
|
+
/** @public
|
838
|
+
* @param {string} symbol
|
839
|
+
* @return {*}
|
840
|
+
*/
|
841
|
+
Formula.prototype.getCachedData = function(symbol) {
|
842
|
+
return this._dataCache[symbol];
|
843
|
+
};
|
844
|
+
|
845
|
+
/** @public
|
846
|
+
* @param {string} symbol
|
847
|
+
* @param {Object.<string,*>} values
|
848
|
+
*/
|
849
|
+
Formula.prototype.setCachedData = function(symbol, values) {
|
850
|
+
this._dataCache[symbol] = values;
|
851
|
+
};
|
852
|
+
|
853
|
+
/** @public
|
854
|
+
* @param {string} msg
|
855
|
+
*/
|
856
|
+
Formula.prototype.setDataError = function(msg) {
|
857
|
+
this._dataLastError = msg;
|
858
|
+
};
|
859
|
+
|
860
|
+
/** @public
|
861
|
+
* @param {Object=} e
|
862
|
+
*/
|
863
|
+
Formula.prototype.dispatchDataChanged = function(e) {
|
864
|
+
// Just dispatch the event. No need to cache any data in formula.
|
865
|
+
this._dispatch("dataCacheChanged", {});
|
866
|
+
};
|
867
|
+
|
868
|
+
/** @public
|
869
|
+
* @param {Object} e
|
870
|
+
*/
|
871
|
+
Formula.prototype._onDataCacheChanged = function(e) {
|
872
|
+
// Cache data for real-time function since real-time function has its own RIC list. Then dispatch the event.
|
873
|
+
let symbol = e['ric'];
|
874
|
+
let values = /** @type{Object.<string, *>} */(e['values']);
|
875
|
+
let data = this._dataCache[symbol];
|
876
|
+
if (data) {
|
877
|
+
for (let field in values) {
|
878
|
+
data[field] = values[field];
|
879
|
+
}
|
880
|
+
} else {
|
881
|
+
this._dataCache[symbol] = values;
|
882
|
+
}
|
883
|
+
this._dispatch("dataCacheChanged", {});
|
884
|
+
};
|
885
|
+
//#endregion formula data cache
|
886
|
+
|
887
|
+
Formula._proto = Formula.prototype;
|
888
|
+
|
889
|
+
export default Formula;
|
890
|
+
export { Formula };
|