@refinitiv-ui/efx-grid 6.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -0
- package/README.md +61 -0
- package/lib/column-format-dialog/index.d.ts +1 -0
- package/lib/column-format-dialog/index.js +1 -0
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +64 -0
- package/lib/column-format-dialog/lib/column-format-dialog.js +2713 -0
- package/lib/column-format-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-de.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-en.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-ja.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-zh-hant.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-format-dialog/lib/locale/translation-zh.js +94 -0
- package/lib/column-format-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/column-format-dialog/lib/locale/translation.js +18 -0
- package/lib/column-format-dialog/lib/preview-table.d.ts +151 -0
- package/lib/column-format-dialog/lib/preview-table.js +995 -0
- package/lib/column-format-dialog/themes/base.less +429 -0
- package/lib/column-format-dialog/themes/elemental/column-format-dialog.less +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/elemental/dark.js +16 -0
- package/lib/column-format-dialog/themes/elemental/defaults.less +1 -0
- package/lib/column-format-dialog/themes/elemental/index.less +5 -0
- package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/elemental/light.js +16 -0
- package/lib/column-format-dialog/themes/halo/column-format-dialog.less +6 -0
- package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/halo/dark.js +16 -0
- package/lib/column-format-dialog/themes/halo/defaults.less +1 -0
- package/lib/column-format-dialog/themes/halo/index.less +5 -0
- package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/halo/light.js +16 -0
- package/lib/column-format-dialog/themes/luna/column-format-dialog.less +1 -0
- package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/luna/default/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/luna/default/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/luna/default/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/luna/default/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/luna/defaults.less +1 -0
- package/lib/column-format-dialog/themes/luna/index.less +5 -0
- package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/solar/charcoal.js +16 -0
- package/lib/column-format-dialog/themes/solar/column-format-dialog.less +6 -0
- package/lib/column-format-dialog/themes/solar/defaults.less +1 -0
- package/lib/column-format-dialog/themes/solar/index.less +5 -0
- package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +4 -0
- package/lib/column-format-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/column-format-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/column-format-dialog/themes/solar/pearl.js +16 -0
- package/lib/column-selection-dialog/index.d.ts +1 -0
- package/lib/column-selection-dialog/index.js +1 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +41 -0
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +1410 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-de.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-en.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-ja.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/column-selection-dialog/lib/locale/translation-zh.js +19 -0
- package/lib/column-selection-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/column-selection-dialog/lib/locale/translation.js +18 -0
- package/lib/column-selection-dialog/themes/base.less +189 -0
- package/lib/column-selection-dialog/themes/elemental/column-selection-dialog.less +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/elemental/dark.js +6 -0
- package/lib/column-selection-dialog/themes/elemental/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/elemental/index.less +5 -0
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/elemental/light.js +6 -0
- package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +22 -0
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/halo/dark.js +6 -0
- package/lib/column-selection-dialog/themes/halo/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/halo/index.less +6 -0
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/halo/light.js +6 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/solar/charcoal.js +6 -0
- package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +1 -0
- package/lib/column-selection-dialog/themes/solar/defaults.less +1 -0
- package/lib/column-selection-dialog/themes/solar/index.less +6 -0
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +4 -0
- package/lib/column-selection-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/column-selection-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/column-selection-dialog/themes/solar/pearl.js +6 -0
- package/lib/core/dist/core.css +1 -0
- package/lib/core/dist/core.js +28075 -0
- package/lib/core/dist/core.min.js +1 -0
- package/lib/core/es6/data/ColumnStats.d.ts +42 -0
- package/lib/core/es6/data/ColumnStats.js +428 -0
- package/lib/core/es6/data/DataCache.d.ts +81 -0
- package/lib/core/es6/data/DataCache.js +1317 -0
- package/lib/core/es6/data/DataTable.d.ts +125 -0
- package/lib/core/es6/data/DataTable.js +1655 -0
- package/lib/core/es6/data/DataView.d.ts +280 -0
- package/lib/core/es6/data/DataView.js +3654 -0
- package/lib/core/es6/data/Segment.d.ts +38 -0
- package/lib/core/es6/data/Segment.js +193 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +58 -0
- package/lib/core/es6/data/SegmentCollection.js +431 -0
- package/lib/core/es6/grid/Core.d.ts +387 -0
- package/lib/core/es6/grid/Core.js +4939 -0
- package/lib/core/es6/grid/ILayoutGrid.d.ts +204 -0
- package/lib/core/es6/grid/ILayoutGrid.js +658 -0
- package/lib/core/es6/grid/LayoutGrid.d.ts +23 -0
- package/lib/core/es6/grid/LayoutGrid.js +2602 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +18 -0
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +907 -0
- package/lib/core/es6/grid/components/Cell.d.ts +50 -0
- package/lib/core/es6/grid/components/Cell.js +740 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +19 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.js +123 -0
- package/lib/core/es6/grid/components/CellSpan.d.ts +18 -0
- package/lib/core/es6/grid/components/CellSpan.js +99 -0
- package/lib/core/es6/grid/components/CellSpans.d.ts +38 -0
- package/lib/core/es6/grid/components/CellSpans.js +341 -0
- package/lib/core/es6/grid/components/Column.d.ts +22 -0
- package/lib/core/es6/grid/components/Column.js +612 -0
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +125 -0
- package/lib/core/es6/grid/components/ElementWrapper.js +714 -0
- package/lib/core/es6/grid/components/HScrollbar.d.ts +24 -0
- package/lib/core/es6/grid/components/HScrollbar.js +222 -0
- package/lib/core/es6/grid/components/Scrollbar.d.ts +61 -0
- package/lib/core/es6/grid/components/Scrollbar.js +1374 -0
- package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
- package/lib/core/es6/grid/components/StretchedCells.js +328 -0
- package/lib/core/es6/grid/components/VScrollbar.d.ts +18 -0
- package/lib/core/es6/grid/components/VScrollbar.js +139 -0
- package/lib/core/es6/grid/components/VirtualItems.d.ts +12 -0
- package/lib/core/es6/grid/components/VirtualItems.js +51 -0
- package/lib/core/es6/grid/event/EventDispatcher.d.ts +16 -0
- package/lib/core/es6/grid/event/EventDispatcher.js +138 -0
- package/lib/core/es6/grid/event/EventListeners.d.ts +34 -0
- package/lib/core/es6/grid/event/EventListeners.js +163 -0
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +615 -0
- package/lib/core/es6/grid/plugins/Plugin.d.ts +28 -0
- package/lib/core/es6/grid/plugins/Plugin.js +272 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +127 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1707 -0
- package/lib/core/es6/grid/util/Conflator.d.ts +32 -0
- package/lib/core/es6/grid/util/Conflator.js +191 -0
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +18 -0
- package/lib/core/es6/grid/util/ElementFrameWork.js +227 -0
- package/lib/core/es6/grid/util/HttpRequest.d.ts +53 -0
- package/lib/core/es6/grid/util/HttpRequest.js +371 -0
- package/lib/core/es6/grid/util/PercentBar.d.ts +43 -0
- package/lib/core/es6/grid/util/PercentBar.js +390 -0
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +41 -0
- package/lib/core/es6/grid/util/PercentBarRenderer.js +316 -0
- package/lib/core/es6/grid/util/RangeBar.d.ts +25 -0
- package/lib/core/es6/grid/util/RangeBar.js +255 -0
- package/lib/core/es6/grid/util/Reverter.d.ts +14 -0
- package/lib/core/es6/grid/util/Reverter.js +79 -0
- package/lib/core/es6/grid/util/SectionSettings.d.ts +79 -0
- package/lib/core/es6/grid/util/SectionSettings.js +674 -0
- package/lib/core/es6/grid/util/SelectionList.d.ts +50 -0
- package/lib/core/es6/grid/util/SelectionList.js +422 -0
- package/lib/core/es6/grid/util/TrackLayout.d.ts +84 -0
- package/lib/core/es6/grid/util/TrackLayout.js +850 -0
- package/lib/core/es6/grid/util/Virtualizer.d.ts +40 -0
- package/lib/core/es6/grid/util/Virtualizer.js +340 -0
- package/lib/core/es6/grid/util/util.d.ts +18 -0
- package/lib/core/es6/grid/util/util.js +450 -0
- package/lib/core/es6/index.d.ts +84 -0
- package/lib/core/es6/index.js +132 -0
- package/lib/core/es6/tr-grid-theme.d.ts +5 -0
- package/lib/core/es6/tr-grid-theme.js +5 -0
- package/lib/filter-dialog/index.d.ts +1 -0
- package/lib/filter-dialog/index.js +1 -0
- package/lib/filter-dialog/lib/checkbox-list.d.ts +27 -0
- package/lib/filter-dialog/lib/checkbox-list.js +336 -0
- package/lib/filter-dialog/lib/filter-dialog.d.ts +53 -0
- package/lib/filter-dialog/lib/filter-dialog.js +860 -0
- package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-de.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-en.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-ja.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh-hant.js +37 -0
- package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
- package/lib/filter-dialog/lib/locale/translation-zh.js +37 -0
- package/lib/filter-dialog/lib/locale/translation.d.ts +11 -0
- package/lib/filter-dialog/lib/locale/translation.js +18 -0
- package/lib/filter-dialog/themes/base-checkbox.less +37 -0
- package/lib/filter-dialog/themes/base.less +102 -0
- package/lib/filter-dialog/themes/elemental/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/elemental/dark/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/elemental/dark.js +11 -0
- package/lib/filter-dialog/themes/elemental/defaults.less +3 -0
- package/lib/filter-dialog/themes/elemental/filter-dialog.less +1 -0
- package/lib/filter-dialog/themes/elemental/index.less +6 -0
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/elemental/light/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/elemental/light/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/light/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/elemental/light/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/elemental/light.js +11 -0
- package/lib/filter-dialog/themes/halo/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/halo/dark/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/dark/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/halo/dark.js +11 -0
- package/lib/filter-dialog/themes/halo/defaults.less +3 -0
- package/lib/filter-dialog/themes/halo/filter-dialog.less +9 -0
- package/lib/filter-dialog/themes/halo/index.less +6 -0
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/halo/light/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/halo/light/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/light/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/halo/light.js +11 -0
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/solar/charcoal.js +11 -0
- package/lib/filter-dialog/themes/solar/checkbox-list.less +3 -0
- package/lib/filter-dialog/themes/solar/defaults.less +3 -0
- package/lib/filter-dialog/themes/solar/filter-dialog.less +5 -0
- package/lib/filter-dialog/themes/solar/index.less +6 -0
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +4 -0
- package/lib/filter-dialog/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +4 -0
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +5 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/all-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/custom-elements.js +2 -0
- package/lib/filter-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/filter-dialog/themes/solar/pearl.js +11 -0
- package/lib/formatters/es6/CoralButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/CoralButtonFormatter.js +40 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralCheckboxFormatter.js +45 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralComboBoxFormatter.js +102 -0
- package/lib/formatters/es6/CoralIconFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralIconFormatter.js +45 -0
- package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralInputFormatter.js +40 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/CoralRadioButtonFormatter.js +80 -0
- package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/CoralSelectFormatter.js +66 -0
- package/lib/formatters/es6/CoralToggleFormatter.d.ts +12 -0
- package/lib/formatters/es6/CoralToggleFormatter.js +47 -0
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +119 -0
- package/lib/formatters/es6/EFButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/EFButtonFormatter.js +40 -0
- package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFCheckboxFormatter.js +45 -0
- package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFComboBoxFormatter.js +68 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EFDateTimePickerFormatter.js +55 -0
- package/lib/formatters/es6/EFIconFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFIconFormatter.js +45 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFNumberFieldFormatter.js +40 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +22 -0
- package/lib/formatters/es6/EFRadioButtonFormatter.js +80 -0
- package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/formatters/es6/EFSelectFormatter.js +66 -0
- package/lib/formatters/es6/EFTextFieldFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFTextFieldFormatter.js +40 -0
- package/lib/formatters/es6/EFToggleFormatter.d.ts +12 -0
- package/lib/formatters/es6/EFToggleFormatter.js +47 -0
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +55 -0
- package/lib/formatters/es6/FormatterBuilder.d.ts +22 -0
- package/lib/formatters/es6/FormatterBuilder.js +334 -0
- package/lib/formatters/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/formatters/es6/NumericInputFormatter.js +64 -0
- package/lib/formatters/es6/PercentBarFormatter.d.ts +25 -0
- package/lib/formatters/es6/PercentBarFormatter.js +62 -0
- package/lib/formatters/es6/SimpleImageFormatter.d.ts +21 -0
- package/lib/formatters/es6/SimpleImageFormatter.js +64 -0
- package/lib/formatters/es6/SimpleInputFormatter.d.ts +12 -0
- package/lib/formatters/es6/SimpleInputFormatter.js +40 -0
- package/lib/formatters/es6/SimpleLinkFormatter.d.ts +21 -0
- package/lib/formatters/es6/SimpleLinkFormatter.js +48 -0
- package/lib/formatters/es6/SimpleTickerFormatter.d.ts +25 -0
- package/lib/formatters/es6/SimpleTickerFormatter.js +65 -0
- package/lib/formatters/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/formatters/es6/SimpleToggleFormatter.js +132 -0
- package/lib/formatters/es6/TextFormatter.d.ts +12 -0
- package/lib/formatters/es6/TextFormatter.js +30 -0
- package/lib/formatters/es6/index.d.ts +43 -0
- package/lib/formatters/es6/index.js +67 -0
- package/lib/grid/index.d.ts +1 -0
- package/lib/grid/index.js +2 -0
- package/lib/grid/lib/efx-grid.d.ts +32 -0
- package/lib/grid/lib/efx-grid.js +469 -0
- package/lib/grid/themes/base.less +134 -0
- package/lib/grid/themes/halo/dark/css/native-elements.css +0 -0
- package/lib/grid/themes/halo/dark/efx-grid.js +4 -0
- package/lib/grid/themes/halo/dark/es5/all-elements.js +2 -0
- package/lib/grid/themes/halo/dark/imports/all-elements.js +1 -0
- package/lib/grid/themes/halo/dark/imports/custom-elements.js +1 -0
- package/lib/grid/themes/halo/dark/imports/native-elements.js +0 -0
- package/lib/grid/themes/halo/dark.js +3 -0
- package/lib/grid/themes/halo/efx-grid.less +92 -0
- package/lib/grid/themes/halo/index.less +3 -0
- package/lib/grid/themes/halo/light/css/native-elements.css +0 -0
- package/lib/grid/themes/halo/light/efx-grid.js +4 -0
- package/lib/grid/themes/halo/light/es5/all-elements.js +2 -0
- package/lib/grid/themes/halo/light/imports/all-elements.js +1 -0
- package/lib/grid/themes/halo/light/imports/custom-elements.js +1 -0
- package/lib/grid/themes/halo/light/imports/native-elements.js +0 -0
- package/lib/grid/themes/halo/light.js +3 -0
- package/lib/grid/themes/solar/charcoal/css/native-elements.css +0 -0
- package/lib/grid/themes/solar/charcoal/efx-grid.js +4 -0
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +2 -0
- package/lib/grid/themes/solar/charcoal/imports/all-elements.js +1 -0
- package/lib/grid/themes/solar/charcoal/imports/custom-elements.js +1 -0
- package/lib/grid/themes/solar/charcoal/imports/native-elements.js +0 -0
- package/lib/grid/themes/solar/charcoal.js +3 -0
- package/lib/grid/themes/solar/efx-grid.less +27 -0
- package/lib/grid/themes/solar/index.less +3 -0
- package/lib/grid/themes/solar/pearl/css/native-elements.css +0 -0
- package/lib/grid/themes/solar/pearl/efx-grid.js +4 -0
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +2 -0
- package/lib/grid/themes/solar/pearl/imports/all-elements.js +1 -0
- package/lib/grid/themes/solar/pearl/imports/custom-elements.js +1 -0
- package/lib/grid/themes/solar/pearl/imports/native-elements.js +0 -0
- package/lib/grid/themes/solar/pearl.js +3 -0
- package/lib/index.d.ts +102 -0
- package/lib/index.js +102 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +83 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +592 -0
- package/lib/row-segmenting/es6/index.d.ts +1 -0
- package/lib/row-segmenting/es6/index.js +1 -0
- package/lib/rt-grid/dist/rt-grid.js +44672 -0
- package/lib/rt-grid/dist/rt-grid.min.js +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +141 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +1074 -0
- package/lib/rt-grid/es6/DataConnector.d.ts +37 -0
- package/lib/rt-grid/es6/DataConnector.js +266 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +20 -0
- package/lib/rt-grid/es6/FieldDefinition.js +418 -0
- package/lib/rt-grid/es6/Grid.d.ts +261 -0
- package/lib/rt-grid/es6/Grid.js +2893 -0
- package/lib/rt-grid/es6/PredefinedFormula.d.ts +16 -0
- package/lib/rt-grid/es6/PredefinedFormula.js +33 -0
- package/lib/rt-grid/es6/ReferenceCounter.d.ts +38 -0
- package/lib/rt-grid/es6/ReferenceCounter.js +230 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +120 -0
- package/lib/rt-grid/es6/RowDefinition.js +873 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +21 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +252 -0
- package/lib/rt-grid/es6/StyleLoader.d.ts +17 -0
- package/lib/rt-grid/es6/StyleLoader.js +47 -0
- package/lib/rt-grid/es6/index.d.ts +8 -0
- package/lib/rt-grid/es6/index.js +43 -0
- package/lib/statistics-row/es6/StatisticsRow.d.ts +67 -0
- package/lib/statistics-row/es6/StatisticsRow.js +786 -0
- package/lib/statistics-row/es6/index.d.ts +1 -0
- package/lib/statistics-row/es6/index.js +1 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.d.ts +45 -0
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +431 -0
- package/lib/tr-grid-auto-tooltip/es6/index.d.ts +1 -0
- package/lib/tr-grid-auto-tooltip/es6/index.js +1 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +67 -0
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1777 -0
- package/lib/tr-grid-cell-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-cell-selection/es6/index.js +1 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +69 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1476 -0
- package/lib/tr-grid-checkbox/es6/index.d.ts +1 -0
- package/lib/tr-grid-checkbox/es6/index.js +1 -0
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +56 -0
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +1000 -0
- package/lib/tr-grid-column-fitter/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-fitter/es6/index.js +1 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +89 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +615 -0
- package/lib/tr-grid-column-formatting/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-formatting/es6/index.js +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +60 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +913 -0
- package/lib/tr-grid-column-grouping/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/index.js +1 -0
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +68 -0
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1013 -0
- package/lib/tr-grid-column-resizing/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-resizing/es6/index.js +1 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +70 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +928 -0
- package/lib/tr-grid-column-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-selection/es6/index.js +1 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +76 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +1227 -0
- package/lib/tr-grid-column-stack/es6/index.d.ts +1 -0
- package/lib/tr-grid-column-stack/es6/index.js +1 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +70 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +947 -0
- package/lib/tr-grid-conditional-coloring/es6/index.d.ts +1 -0
- package/lib/tr-grid-conditional-coloring/es6/index.js +1 -0
- package/lib/tr-grid-content-wrap/es6/ContentWrap.d.ts +43 -0
- package/lib/tr-grid-content-wrap/es6/ContentWrap.js +478 -0
- package/lib/tr-grid-content-wrap/es6/index.d.ts +1 -0
- package/lib/tr-grid-content-wrap/es6/index.js +1 -0
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +83 -0
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +471 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +133 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +39 -0
- package/lib/tr-grid-contextmenu/es6/MenuItem.js +245 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +29 -0
- package/lib/tr-grid-contextmenu/es6/PopupMenu.js +292 -0
- package/lib/tr-grid-contextmenu/es6/index.d.ts +1 -0
- package/lib/tr-grid-contextmenu/es6/index.js +1 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +57 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.js +928 -0
- package/lib/tr-grid-filter-input/es6/index.d.ts +1 -0
- package/lib/tr-grid-filter-input/es6/index.js +1 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +44 -0
- package/lib/tr-grid-heat-map/es6/HeatMap.js +394 -0
- package/lib/tr-grid-heat-map/es6/index.d.ts +1 -0
- package/lib/tr-grid-heat-map/es6/index.js +1 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +129 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +1977 -0
- package/lib/tr-grid-in-cell-editing/es6/index.d.ts +1 -0
- package/lib/tr-grid-in-cell-editing/es6/index.js +1 -0
- package/lib/tr-grid-pagination/es6/Pagination.d.ts +57 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +427 -0
- package/lib/tr-grid-pagination/es6/index.d.ts +1 -0
- package/lib/tr-grid-pagination/es6/index.js +1 -0
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +60 -0
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +801 -0
- package/lib/tr-grid-percent-bar/es6/index.d.ts +1 -0
- package/lib/tr-grid-percent-bar/es6/index.js +1 -0
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +49 -0
- package/lib/tr-grid-printer/es6/CellWriter.js +226 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +12 -0
- package/lib/tr-grid-printer/es6/ColumnWriter.js +21 -0
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +32 -0
- package/lib/tr-grid-printer/es6/GridPrinter.js +761 -0
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +38 -0
- package/lib/tr-grid-printer/es6/PrintTrait.js +481 -0
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +54 -0
- package/lib/tr-grid-printer/es6/SectionWriter.js +205 -0
- package/lib/tr-grid-printer/es6/index.d.ts +1 -0
- package/lib/tr-grid-printer/es6/index.js +1 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +39 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +353 -0
- package/lib/tr-grid-range-bar/es6/index.d.ts +1 -0
- package/lib/tr-grid-range-bar/es6/index.js +1 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +53 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +794 -0
- package/lib/tr-grid-row-dragging/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-dragging/es6/index.js +1 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +118 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +1884 -0
- package/lib/tr-grid-row-filtering/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-filtering/es6/index.js +1 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +109 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1541 -0
- package/lib/tr-grid-row-grouping/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-grouping/es6/index.js +1 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +74 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.js +1202 -0
- package/lib/tr-grid-row-selection/es6/index.d.ts +1 -0
- package/lib/tr-grid-row-selection/es6/index.js +1 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +60 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +611 -0
- package/lib/tr-grid-rowcoloring/es6/index.d.ts +1 -0
- package/lib/tr-grid-rowcoloring/es6/index.js +1 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +77 -0
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +574 -0
- package/lib/tr-grid-textformatting/es6/index.d.ts +1 -0
- package/lib/tr-grid-textformatting/es6/index.js +1 -0
- package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +29 -0
- package/lib/tr-grid-titlewrap/es6/TitleWrap.js +431 -0
- package/lib/tr-grid-titlewrap/es6/index.d.ts +1 -0
- package/lib/tr-grid-titlewrap/es6/index.js +1 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +136 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1128 -0
- package/lib/tr-grid-util/es6/Conflator.d.ts +34 -0
- package/lib/tr-grid-util/es6/Conflator.js +193 -0
- package/lib/tr-grid-util/es6/CoralItems.d.ts +10 -0
- package/lib/tr-grid-util/es6/CoralItems.js +42 -0
- package/lib/tr-grid-util/es6/DateTime.d.ts +57 -0
- package/lib/tr-grid-util/es6/DateTime.js +508 -0
- package/lib/tr-grid-util/es6/Deferred.d.ts +14 -0
- package/lib/tr-grid-util/es6/Deferred.js +98 -0
- package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
- package/lib/tr-grid-util/es6/Delay.js +85 -0
- package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
- package/lib/tr-grid-util/es6/Dom.js +346 -0
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +10 -0
- package/lib/tr-grid-util/es6/ElementObserver.js +101 -0
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
- package/lib/tr-grid-util/es6/ElementWrapper.js +83 -0
- package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
- package/lib/tr-grid-util/es6/ElfDate.js +163 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +33 -0
- package/lib/tr-grid-util/es6/ElfUtil.js +458 -0
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +26 -0
- package/lib/tr-grid-util/es6/EventDispatcher.js +161 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +27 -0
- package/lib/tr-grid-util/es6/ExpanderIcon.js +169 -0
- package/lib/tr-grid-util/es6/Ext.d.ts +10 -0
- package/lib/tr-grid-util/es6/Ext.js +52 -0
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +55 -0
- package/lib/tr-grid-util/es6/FieldFormatter.js +432 -0
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +48 -0
- package/lib/tr-grid-util/es6/FilterBuilder.js +521 -0
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +41 -0
- package/lib/tr-grid-util/es6/FilterOperators.js +181 -0
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +72 -0
- package/lib/tr-grid-util/es6/GridPlugin.js +747 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
- package/lib/tr-grid-util/es6/Icon.js +61 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
- package/lib/tr-grid-util/es6/MouseDownTrait.js +237 -0
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +32 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +506 -0
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +83 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +471 -0
- package/lib/tr-grid-util/es6/PercentBar.d.ts +71 -0
- package/lib/tr-grid-util/es6/PercentBar.js +600 -0
- package/lib/tr-grid-util/es6/Perf.d.ts +32 -0
- package/lib/tr-grid-util/es6/Perf.js +162 -0
- package/lib/tr-grid-util/es6/Popup.d.ts +84 -0
- package/lib/tr-grid-util/es6/Popup.js +818 -0
- package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
- package/lib/tr-grid-util/es6/RangeBar.js +259 -0
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
- package/lib/tr-grid-util/es6/RequestQueue.js +239 -0
- package/lib/tr-grid-util/es6/RowPainter.d.ts +23 -0
- package/lib/tr-grid-util/es6/RowPainter.js +188 -0
- package/lib/tr-grid-util/es6/SubTable.d.ts +74 -0
- package/lib/tr-grid-util/es6/SubTable.js +558 -0
- package/lib/tr-grid-util/es6/Table.d.ts +125 -0
- package/lib/tr-grid-util/es6/Table.js +790 -0
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +18 -0
- package/lib/tr-grid-util/es6/TextHighlighter.js +273 -0
- package/lib/tr-grid-util/es6/TickCodes.d.ts +8 -0
- package/lib/tr-grid-util/es6/TickCodes.js +33 -0
- package/lib/tr-grid-util/es6/Timer.d.ts +16 -0
- package/lib/tr-grid-util/es6/Timer.js +49 -0
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +46 -0
- package/lib/tr-grid-util/es6/TouchProxy.js +212 -0
- package/lib/tr-grid-util/es6/Util.d.ts +65 -0
- package/lib/tr-grid-util/es6/Util.js +528 -0
- package/lib/tr-grid-util/es6/formula/ADCService.d.ts +11 -0
- package/lib/tr-grid-util/es6/formula/ADCService.js +72 -0
- package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +17 -0
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +317 -0
- package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +12 -0
- package/lib/tr-grid-util/es6/formula/AdFinService.js +61 -0
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +19 -0
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +310 -0
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +56 -0
- package/lib/tr-grid-util/es6/formula/Engine.js +592 -0
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +68 -0
- package/lib/tr-grid-util/es6/formula/Formula.js +882 -0
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +16 -0
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +165 -0
- package/lib/tr-grid-util/es6/formula/Realtime.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/Realtime.js +279 -0
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +203 -0
- package/lib/tr-grid-util/es6/formula/TSIService.d.ts +11 -0
- package/lib/tr-grid-util/es6/formula/TSIService.js +51 -0
- package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +1015 -0
- package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +30 -0
- package/lib/tr-grid-util/es6/formula/VariableToken.js +314 -0
- package/lib/tr-grid-util/es6/formula/functions/AdFin.d.ts +9 -0
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +1778 -0
- package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +21 -0
- package/lib/tr-grid-util/es6/formula/functions/Info.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Info.js +192 -0
- package/lib/tr-grid-util/es6/formula/functions/Internal.d.ts +8 -0
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +90 -0
- package/lib/tr-grid-util/es6/formula/functions/Logic.d.ts +12 -0
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +176 -0
- package/lib/tr-grid-util/es6/formula/functions/Math.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/functions/Math.js +1624 -0
- package/lib/tr-grid-util/es6/formula/functions/Statistics.d.ts +18 -0
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +234 -0
- package/lib/tr-grid-util/es6/formula/functions/Text.d.ts +10 -0
- package/lib/tr-grid-util/es6/formula/functions/Text.js +676 -0
- package/lib/tr-grid-util/es6/index.d.ts +63 -0
- package/lib/tr-grid-util/es6/index.js +99 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +141 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +114 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +827 -0
- package/lib/tr-grid-util/es6/jet/DataSet.d.ts +8 -0
- package/lib/tr-grid-util/es6/jet/DataSet.js +392 -0
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +21 -0
- package/lib/tr-grid-util/es6/jet/MockArchive.js +56 -0
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +25 -0
- package/lib/tr-grid-util/es6/jet/MockJET.js +63 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +37 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +199 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +72 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +564 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +8 -0
- package/lib/tr-grid-util/es6/jet/MockRTK.js +43 -0
- package/lib/tr-grid-util/es6/jet/index.d.ts +9 -0
- package/lib/tr-grid-util/es6/jet/index.js +18 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +11 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +131 -0
- package/lib/tr-grid-util/es6/locale/translation-de.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-de.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-en.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-en.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-ja.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-ja.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation-zh.d.ts +7 -0
- package/lib/tr-grid-util/es6/locale/translation-zh.js +51 -0
- package/lib/tr-grid-util/es6/locale/translation.d.ts +11 -0
- package/lib/tr-grid-util/es6/locale/translation.js +18 -0
- package/lib/types/es6/AutoTooltip.d.ts +45 -0
- package/lib/types/es6/CellSelection.d.ts +67 -0
- package/lib/types/es6/Checkbox.d.ts +69 -0
- package/lib/types/es6/ColumnFitter.d.ts +56 -0
- package/lib/types/es6/ColumnFormatting.d.ts +90 -0
- package/lib/types/es6/ColumnGrouping.d.ts +60 -0
- package/lib/types/es6/ColumnResizing.d.ts +68 -0
- package/lib/types/es6/ColumnSelection.d.ts +70 -0
- package/lib/types/es6/ColumnStack.d.ts +76 -0
- package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +38 -0
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +287 -0
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +22 -0
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +44 -0
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +30 -0
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +42 -0
- package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +24 -0
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +46 -0
- package/lib/types/es6/CompositeGrid/index.d.ts +9 -0
- package/lib/types/es6/ConditionalColoring.d.ts +70 -0
- package/lib/types/es6/ContentWrap.d.ts +43 -0
- package/lib/types/es6/ContextMenu.d.ts +83 -0
- package/lib/types/es6/CoralButtonFormatter.d.ts +22 -0
- package/lib/types/es6/CoralCheckboxFormatter.d.ts +12 -0
- package/lib/types/es6/CoralComboBoxFormatter.d.ts +23 -0
- package/lib/types/es6/CoralIconFormatter.d.ts +23 -0
- package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
- package/lib/types/es6/CoralRadioButtonFormatter.d.ts +22 -0
- package/lib/types/es6/CoralSelectFormatter.d.ts +23 -0
- package/lib/types/es6/CoralToggleFormatter.d.ts +12 -0
- package/lib/types/es6/Core/data/ColumnStats.d.ts +42 -0
- package/lib/types/es6/Core/data/DataCache.d.ts +81 -0
- package/lib/types/es6/Core/data/DataTable.d.ts +125 -0
- package/lib/types/es6/Core/data/DataView.d.ts +280 -0
- package/lib/types/es6/Core/data/Segment.d.ts +38 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +58 -0
- package/lib/types/es6/Core/grid/Core.d.ts +387 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +204 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +23 -0
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/Cell.d.ts +50 -0
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +19 -0
- package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +38 -0
- package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +125 -0
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +24 -0
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +61 -0
- package/lib/types/es6/Core/grid/components/StretchedCells.d.ts +17 -0
- package/lib/types/es6/Core/grid/components/VScrollbar.d.ts +18 -0
- package/lib/types/es6/Core/grid/components/VirtualItems.d.ts +12 -0
- package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +16 -0
- package/lib/types/es6/Core/grid/event/EventListeners.d.ts +34 -0
- package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
- package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +28 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +127 -0
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +18 -0
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +53 -0
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +43 -0
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +41 -0
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +25 -0
- package/lib/types/es6/Core/grid/util/Reverter.d.ts +14 -0
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +79 -0
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +50 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +84 -0
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
- package/lib/types/es6/Core/grid/util/util.d.ts +18 -0
- package/lib/types/es6/Core/index.d.ts +84 -0
- package/lib/types/es6/Core/tr-grid-theme.d.ts +5 -0
- package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
- package/lib/types/es6/EFButtonFormatter.d.ts +22 -0
- package/lib/types/es6/EFCheckboxFormatter.d.ts +12 -0
- package/lib/types/es6/EFComboBoxFormatter.d.ts +23 -0
- package/lib/types/es6/EFDateTimePickerFormatter.d.ts +13 -0
- package/lib/types/es6/EFIconFormatter.d.ts +23 -0
- package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFRadioButtonFormatter.d.ts +22 -0
- package/lib/types/es6/EFSelectFormatter.d.ts +23 -0
- package/lib/types/es6/EFTextFieldFormatter.d.ts +12 -0
- package/lib/types/es6/EFToggleFormatter.d.ts +12 -0
- package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
- package/lib/types/es6/ExtensionColumnOptions.d.ts +41 -0
- package/lib/types/es6/ExtensionOptions.d.ts +52 -0
- package/lib/types/es6/Extensions.d.ts +61 -0
- package/lib/types/es6/FilterInput.d.ts +57 -0
- package/lib/types/es6/FormatterBuilder.d.ts +22 -0
- package/lib/types/es6/GridFormatter.d.ts +63 -0
- package/lib/types/es6/HeatMap.d.ts +44 -0
- package/lib/types/es6/InCellEditing.d.ts +129 -0
- package/lib/types/es6/MenuEventAPI.d.ts +22 -0
- package/lib/types/es6/MenuItem.d.ts +39 -0
- package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
- package/lib/types/es6/Pagination.d.ts +57 -0
- package/lib/types/es6/PercentBar.d.ts +60 -0
- package/lib/types/es6/PercentBarFormatter.d.ts +25 -0
- package/lib/types/es6/PopupMenu.d.ts +29 -0
- package/lib/types/es6/RangeBar.d.ts +39 -0
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +143 -0
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +37 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +20 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +263 -0
- package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +38 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +120 -0
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +21 -0
- package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +17 -0
- package/lib/types/es6/RealtimeGrid/index.d.ts +8 -0
- package/lib/types/es6/RowColoring.d.ts +60 -0
- package/lib/types/es6/RowDragging.d.ts +53 -0
- package/lib/types/es6/RowFiltering.d.ts +118 -0
- package/lib/types/es6/RowGrouping.d.ts +109 -0
- package/lib/types/es6/RowSegmenting.d.ts +83 -0
- package/lib/types/es6/RowSelection.d.ts +74 -0
- package/lib/types/es6/SimpleImageFormatter.d.ts +21 -0
- package/lib/types/es6/SimpleInputFormatter.d.ts +12 -0
- package/lib/types/es6/SimpleLinkFormatter.d.ts +21 -0
- package/lib/types/es6/SimpleTickerFormatter.d.ts +25 -0
- package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
- package/lib/types/es6/StatisticsRow.d.ts +67 -0
- package/lib/types/es6/TextFormatter.d.ts +12 -0
- package/lib/types/es6/TextFormatting.d.ts +77 -0
- package/lib/types/es6/TitleWrap.d.ts +29 -0
- package/lib/types/es6/Zoom.d.ts +51 -0
- package/lib/types/es6/index.d.ts +76 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/versions.json +36 -0
- package/lib/window-exporter.js +13 -0
- package/lib/zoom/es6/Zoom.d.ts +51 -0
- package/lib/zoom/es6/Zoom.js +419 -0
- package/lib/zoom/es6/index.d.ts +1 -0
- package/lib/zoom/es6/index.js +1 -0
- package/package.json +42 -0
@@ -0,0 +1,882 @@
|
|
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
|
+
var 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 eval(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(var 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
|
+
var 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 eval(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
|
+
var len = this._fnTokens.length;
|
280
|
+
for(var i = 0; i < len; ++i) {
|
281
|
+
var 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
|
+
var injection = false;
|
306
|
+
|
307
|
+
if(str.match(/\+\+|--/)) { // ++ and -- which modifies current variable is not allowed
|
308
|
+
injection = true;
|
309
|
+
}
|
310
|
+
|
311
|
+
if(!injection) {
|
312
|
+
var matches = str.match(/([^=]=+)/g) || [];
|
313
|
+
for (var i = matches.length; --i >= 0;) {
|
314
|
+
var m = matches[i];
|
315
|
+
var 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
|
+
var tokens = [];
|
340
|
+
var 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
|
+
exp = exp.replace(/TR\.[\w_ ]+\([^\(\)]*\)(\.[a-zA-Z]+)*/g, Formula._encloseWithTR);
|
349
|
+
|
350
|
+
exp = Formula.resolveTokens(exp, tokens, calcHierarchy); // Restore the string
|
351
|
+
|
352
|
+
return exp;
|
353
|
+
};
|
354
|
+
/** @description Wrap TR function to ADC field with parameter e.g.
|
355
|
+
* TR.Revenue(Scale=2)
|
356
|
+
* TR.Revenue(Scale=2).calcdate,
|
357
|
+
* TR.Revenue(Period=FY0,Scale=2)
|
358
|
+
* @private
|
359
|
+
* @param {string} adcField
|
360
|
+
* @return {string}
|
361
|
+
*/
|
362
|
+
Formula._encloseWithTR = function(adcField) {
|
363
|
+
return "TR(\"" + adcField + "\")";
|
364
|
+
};
|
365
|
+
/** @public
|
366
|
+
* @ignore
|
367
|
+
* @param {string} exp
|
368
|
+
* @param {Array.<VariableToken>=} tokens
|
369
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
370
|
+
* @return {string}
|
371
|
+
*/
|
372
|
+
Formula.tokenizeQuotes = function(exp, tokens, calcHierarchy) {
|
373
|
+
if(!tokens) {
|
374
|
+
tokens = [];
|
375
|
+
}
|
376
|
+
if(!calcHierarchy) {
|
377
|
+
calcHierarchy = [];
|
378
|
+
}
|
379
|
+
|
380
|
+
var index;
|
381
|
+
var matched = false;
|
382
|
+
var tokenIndices = [];
|
383
|
+
do {
|
384
|
+
matched = false;
|
385
|
+
exp = exp.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g, function(str) { // eslint-disable-line
|
386
|
+
matched = true;
|
387
|
+
index = tokens.length;
|
388
|
+
tokens.push(new VariableToken(str, index));
|
389
|
+
tokenIndices.push(index);
|
390
|
+
return "♦" + index + "♦";
|
391
|
+
});
|
392
|
+
} while(matched);
|
393
|
+
calcHierarchy.push(tokenIndices);
|
394
|
+
return exp;
|
395
|
+
};
|
396
|
+
/** @public
|
397
|
+
* @ignore
|
398
|
+
* @param {string} exp
|
399
|
+
* @param {Array.<VariableToken>=} tokens
|
400
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
401
|
+
* @return {string}
|
402
|
+
*/
|
403
|
+
Formula.tokenizeAdcWithParams = function(exp, tokens, calcHierarchy) {
|
404
|
+
if(!tokens) {
|
405
|
+
tokens = [];
|
406
|
+
}
|
407
|
+
if(!calcHierarchy) {
|
408
|
+
calcHierarchy = [];
|
409
|
+
}
|
410
|
+
|
411
|
+
var index;
|
412
|
+
var matched = false;
|
413
|
+
var tokenIndices = [];
|
414
|
+
do {
|
415
|
+
matched = false;
|
416
|
+
exp = exp.replace(/TR\.\w+\([^\)]*\)+/g, function(str) { // eslint-disable-line
|
417
|
+
matched = true;
|
418
|
+
index = tokens.length;
|
419
|
+
tokens.push(new VariableToken(str, index));
|
420
|
+
tokenIndices.push(index);
|
421
|
+
return "♦" + index + "♦";
|
422
|
+
});
|
423
|
+
} while(matched);
|
424
|
+
calcHierarchy.push(tokenIndices);
|
425
|
+
return exp;
|
426
|
+
};
|
427
|
+
/** @public
|
428
|
+
* @ignore
|
429
|
+
* @param {string} exp
|
430
|
+
* @param {Array.<VariableToken>=} tokens
|
431
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
432
|
+
* @return {string}
|
433
|
+
*/
|
434
|
+
Formula.replaceUnwantedCharacters = function(exp, tokens, calcHierarchy) {
|
435
|
+
// Replace all double spaces with single space
|
436
|
+
while(exp.indexOf(" ") >= 0) {
|
437
|
+
exp = exp.replace(/ {2}/g, " ");
|
438
|
+
}
|
439
|
+
|
440
|
+
// Remove all dollar signs (e.g. $CF_BID + $CF_ASK)
|
441
|
+
exp = exp.replace(/\$/g, "");
|
442
|
+
|
443
|
+
// Replace single ampersand with plus sign to support string concatenation with ampersand
|
444
|
+
exp = exp.replace(/\&+/g, function(str) {
|
445
|
+
if(str === "&") {
|
446
|
+
return "+";
|
447
|
+
}
|
448
|
+
return str;
|
449
|
+
});
|
450
|
+
|
451
|
+
/**
|
452
|
+
* Replace all assignment operator with equality operator, by using
|
453
|
+
* regular expression for detecting only "=" that is not a starting point of a formula,
|
454
|
+
* so the character "=" is not replaced with "==" during conversion.
|
455
|
+
*
|
456
|
+
* @example
|
457
|
+
* =ABS(COL5+COL6) -> =ABS(COL5+COL6)
|
458
|
+
* =(COL5=COL6) -> =(COL5==COL6)
|
459
|
+
*/
|
460
|
+
exp = exp.replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g, function(m) {
|
461
|
+
if (m === "=") {
|
462
|
+
return "==";
|
463
|
+
}
|
464
|
+
|
465
|
+
return m;
|
466
|
+
});
|
467
|
+
|
468
|
+
return exp;
|
469
|
+
};
|
470
|
+
/** @private
|
471
|
+
* @param {string} exp
|
472
|
+
* @param {Array.<VariableToken>=} tokens
|
473
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
474
|
+
* @return {string}
|
475
|
+
*/
|
476
|
+
Formula.prototype._tokenizeParentheses = function(exp, tokens, calcHierarchy) {
|
477
|
+
if (!tokens) {
|
478
|
+
tokens = [];
|
479
|
+
}
|
480
|
+
|
481
|
+
if(!calcHierarchy) {
|
482
|
+
calcHierarchy = [];
|
483
|
+
}
|
484
|
+
|
485
|
+
var fnStrToIndex = {}; // To avoid duplicate function
|
486
|
+
|
487
|
+
/**
|
488
|
+
* It is better to not duplicate content of regular expressions to avoid any possible typos
|
489
|
+
* or discrepancies.
|
490
|
+
* Therefore we copy existing regular expression and assign new flags to it instead.
|
491
|
+
*/
|
492
|
+
var firstMatchRE = /[\w._]*(?:=|=[\w]*)?\([^()]*\)/;
|
493
|
+
var globalRE = new RegExp(firstMatchRE.source, 'g');
|
494
|
+
|
495
|
+
while (exp.match(firstMatchRE)) {
|
496
|
+
var tokenIndices = [];
|
497
|
+
|
498
|
+
exp = exp.replace(globalRE, function (fnStr, group) { // eslint-disable-line
|
499
|
+
// Remove the first equal sign.
|
500
|
+
if (fnStr.charAt(0) === "=") {
|
501
|
+
fnStr = fnStr.substr(1, fnStr.length);
|
502
|
+
}
|
503
|
+
|
504
|
+
var index = fnStrToIndex[fnStr];
|
505
|
+
|
506
|
+
if (index == null) {
|
507
|
+
index = tokens.length;
|
508
|
+
tokens.push(new VariableToken(fnStr, index));
|
509
|
+
fnStrToIndex[fnStr] = index;
|
510
|
+
}
|
511
|
+
|
512
|
+
tokenIndices.push(index);
|
513
|
+
|
514
|
+
return "♦" + index + "♦";
|
515
|
+
});
|
516
|
+
|
517
|
+
calcHierarchy.push(tokenIndices);
|
518
|
+
}
|
519
|
+
|
520
|
+
return exp;
|
521
|
+
};
|
522
|
+
/** @private
|
523
|
+
* @param {string} exp
|
524
|
+
* @param {Array.<VariableToken>=} tokens
|
525
|
+
* @param {Array.<Array.<number>>=} calcHierarchy
|
526
|
+
* @return {string}
|
527
|
+
*/
|
528
|
+
Formula.prototype._tokenizeConstants = function(exp, tokens, calcHierarchy) {
|
529
|
+
if(!tokens) {
|
530
|
+
tokens = [];
|
531
|
+
}
|
532
|
+
if(!calcHierarchy) {
|
533
|
+
calcHierarchy = [];
|
534
|
+
}
|
535
|
+
|
536
|
+
var tokenIndices = [];
|
537
|
+
exp = exp.replace(/[\w._♦]+/g, function(varStr) {
|
538
|
+
if (varStr.charAt(0) === "♦") {
|
539
|
+
return varStr;
|
540
|
+
}
|
541
|
+
var index = tokens.length;
|
542
|
+
tokens.push(new VariableToken(varStr, index));
|
543
|
+
tokenIndices.push(index);
|
544
|
+
return "♦" + index + "♦";
|
545
|
+
});
|
546
|
+
calcHierarchy.push(tokenIndices);
|
547
|
+
return exp;
|
548
|
+
};
|
549
|
+
/** @public
|
550
|
+
* @param {string} exp
|
551
|
+
* @param {Array.<VariableToken>} tokens
|
552
|
+
* @param {Array.<Array.<number>>} calcHierarchy
|
553
|
+
* @return {string}
|
554
|
+
*/
|
555
|
+
Formula.resolveTokens = function(exp, tokens, calcHierarchy) {
|
556
|
+
for(var i = calcHierarchy.length; --i >= 0;) { // Must be done in reverse order
|
557
|
+
var indices = calcHierarchy[i];
|
558
|
+
var len = indices.length;
|
559
|
+
for(var j = 0; j < len; ++j) {
|
560
|
+
var index = indices[j];
|
561
|
+
var token = tokens[index];
|
562
|
+
exp = exp.replace(new RegExp("♦" + index + "♦", "g"), function() { // eslint-disable-line
|
563
|
+
return token.getExpression();
|
564
|
+
});
|
565
|
+
}
|
566
|
+
}
|
567
|
+
return exp;
|
568
|
+
};
|
569
|
+
|
570
|
+
/** @private
|
571
|
+
* @param {string} exp
|
572
|
+
* @param {Array.<VariableToken>} tokens
|
573
|
+
* @param {Array.<Array.<number>>} calcHierarchy
|
574
|
+
* @return {string}
|
575
|
+
*/
|
576
|
+
Formula._getInputWithTokenField = function(exp, tokens, calcHierarchy) {
|
577
|
+
for(var i = calcHierarchy.length; --i >= 0;) { // Must be done in reverse order
|
578
|
+
var indices = calcHierarchy[i];
|
579
|
+
var len = indices.length;
|
580
|
+
for(var j = 0; j < len; ++j) {
|
581
|
+
var index = indices[j];
|
582
|
+
var token = tokens[index];
|
583
|
+
exp = exp.replace(new RegExp("♦" + index + "♦", "g"), function() { // eslint-disable-line
|
584
|
+
return token.getInputWithTokenField();
|
585
|
+
});
|
586
|
+
}
|
587
|
+
}
|
588
|
+
return "=" + exp;
|
589
|
+
};
|
590
|
+
|
591
|
+
/** @private
|
592
|
+
* @param {string} exp
|
593
|
+
* @return {Function}
|
594
|
+
*/
|
595
|
+
Formula.prototype._parse = function(exp) {
|
596
|
+
this._expression = "";
|
597
|
+
this._main = null;
|
598
|
+
|
599
|
+
this["__F"].length = 0;
|
600
|
+
this._fnTokens.length = 0;
|
601
|
+
this._fields.length = 0;
|
602
|
+
|
603
|
+
if(!exp) { return null; }
|
604
|
+
|
605
|
+
if(exp.charAt(0) === "=") { // Remove the first equal sign
|
606
|
+
exp = exp.substr(1);
|
607
|
+
}
|
608
|
+
exp = exp.replace(/^\s+|\s+$/gm, ""); // Trim white spaces -- equivalent to String.trim(), which is not support in IE8
|
609
|
+
exp = exp.replace(/<>/g, "!=");
|
610
|
+
exp = exp.replace(/‛|‘|’/g, "'"); // Left and right single quote will be converted to simple single quote
|
611
|
+
exp = exp.replace(/‟|“|”/g, '"'); // Left and right double quote will be converted to simple double quote
|
612
|
+
|
613
|
+
if(!exp || this._detectCodeInjection(exp)) { return null; }
|
614
|
+
|
615
|
+
var tokens = [];
|
616
|
+
var calcHierarchy = [];
|
617
|
+
|
618
|
+
exp = Formula.tokenizeQuotes(exp, tokens, calcHierarchy); // Tokenize string constants first because they has enclosure (single quotes and double quotes)
|
619
|
+
|
620
|
+
exp = Formula.tokenizeAdcWithParams(exp, tokens, calcHierarchy);
|
621
|
+
|
622
|
+
exp = Formula.replaceUnwantedCharacters(exp, tokens, calcHierarchy);
|
623
|
+
|
624
|
+
exp = this._tokenizeParentheses(exp, tokens, calcHierarchy); // Tokenize all methods and parenthesis group
|
625
|
+
|
626
|
+
exp = this._tokenizeConstants(exp, tokens, calcHierarchy); // Tokenize the rest of the constants and dynamic values
|
627
|
+
|
628
|
+
// Used for change field name in formula
|
629
|
+
this._inputWithTokenField = Formula._getInputWithTokenField(exp, tokens, calcHierarchy);
|
630
|
+
|
631
|
+
// Resolve each function tokens into valid JavaScript codes
|
632
|
+
exp = Formula.resolveTokens(exp, tokens, calcHierarchy);
|
633
|
+
|
634
|
+
// Re-organize function structure and index, and retrieve field data
|
635
|
+
var fields = {};
|
636
|
+
var len = tokens.length;
|
637
|
+
for(var i = 0; i < len; ++i) {
|
638
|
+
var token = tokens[i];
|
639
|
+
if(token.getFunctionName()) {
|
640
|
+
var fIndex = this._fnTokens.length;
|
641
|
+
exp = exp.replace(new RegExp("this\\.__F\\[" + i + "\\]", "g"), "this.__F[" + fIndex + "]");
|
642
|
+
token.setIndex(fIndex);
|
643
|
+
this._fnTokens.push(token);
|
644
|
+
}
|
645
|
+
token.getFieldNames(fields);
|
646
|
+
}
|
647
|
+
|
648
|
+
this._expression = exp; // The expression has been finalized
|
649
|
+
this.updateContext();
|
650
|
+
|
651
|
+
this._main = this._createFunction(this._expression);
|
652
|
+
if(!this._main) {
|
653
|
+
return null;
|
654
|
+
}
|
655
|
+
|
656
|
+
this._fieldMap = fields;
|
657
|
+
this._fields = Object.keys(fields);
|
658
|
+
return this._main;
|
659
|
+
};
|
660
|
+
|
661
|
+
/** @private
|
662
|
+
* @param {string} expression
|
663
|
+
* @return {Function}
|
664
|
+
*/
|
665
|
+
Formula.prototype._createFunction = function (expression) {
|
666
|
+
var func = null;
|
667
|
+
try {
|
668
|
+
func = /** @type{Function} */(eval("(function (__R) { return " + expression + "; })"));
|
669
|
+
func = func.bind(this);
|
670
|
+
func({}); // Try to execute the method once to check error
|
671
|
+
} catch(err) {
|
672
|
+
func = null;
|
673
|
+
// window.console.log('Expression: "' + this._input + '" contains the following error: \n' + err.message);
|
674
|
+
}
|
675
|
+
return func;
|
676
|
+
};
|
677
|
+
|
678
|
+
/** @private
|
679
|
+
* @param {string} colName
|
680
|
+
* @param {Object.<string, *>} rowData
|
681
|
+
* @return {*}
|
682
|
+
*/
|
683
|
+
Formula.prototype["__D"] = function (colName, rowData) {
|
684
|
+
return rowData[colName];
|
685
|
+
};
|
686
|
+
/** @public
|
687
|
+
* @param {string} field
|
688
|
+
* @param {string=} opt_src
|
689
|
+
* @returns {boolean}
|
690
|
+
*/
|
691
|
+
Formula.prototype.addField = function(field, opt_src) {
|
692
|
+
if(this._fieldMap[field]) { // Existing in this._fields
|
693
|
+
return false;
|
694
|
+
}
|
695
|
+
if(field.indexOf("undefined") >= 0) { // We can remove this block if the ADC service can ignore the invalid requested field.
|
696
|
+
// REMARK: ADC cannot support the invalid parameter. It will respond with ERROR and do not return any ADC data anymore.
|
697
|
+
return false; // WORKAROUND: Field name must not contain with string 'undefined'
|
698
|
+
}
|
699
|
+
|
700
|
+
this._fields.push(field);
|
701
|
+
this._fieldMap[field] = true;
|
702
|
+
this._dispatch("dataRequired", { "field": field, "src": opt_src || "adc" });
|
703
|
+
return true;
|
704
|
+
};
|
705
|
+
|
706
|
+
/** Change field in formula
|
707
|
+
* @public
|
708
|
+
* @param {string} oldName
|
709
|
+
* @param {string} newName
|
710
|
+
* @return {boolean}
|
711
|
+
*/
|
712
|
+
Formula.prototype.changeField = function (oldName, newName) {
|
713
|
+
var index = this._fields.indexOf(oldName);
|
714
|
+
if (index < 0) {
|
715
|
+
return false;
|
716
|
+
}
|
717
|
+
this._fields.splice(index, 1);
|
718
|
+
if (this._fields.indexOf(newName) < 0) {
|
719
|
+
this._fields.push(newName);
|
720
|
+
}
|
721
|
+
var oldInput = this._input;
|
722
|
+
var oldTokenField = "♠" + oldName + "♥";
|
723
|
+
var newTokenField = "♠" + newName + "♥";
|
724
|
+
this._inputWithTokenField = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) {
|
725
|
+
return (str === oldTokenField) ? newTokenField : str;
|
726
|
+
});
|
727
|
+
this._input = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) {
|
728
|
+
return str.substr(1, str.length - 2); // Remove "♠" and "♥"
|
729
|
+
});
|
730
|
+
this._expression = this._expression.replace(new RegExp('this\\.__D\\("' + oldName + '", __R\\)', "g"), 'this.__D("' + newName + '", __R)');
|
731
|
+
this._main = this._createFunction(this._expression);
|
732
|
+
this._dispatch("formulaChanged", { "oldInput": oldInput, "formula": this });
|
733
|
+
return true;
|
734
|
+
};
|
735
|
+
/** Change multiple field in formula
|
736
|
+
* @public
|
737
|
+
* @param {Array.<string>} oldNames
|
738
|
+
* @param {Array.<string>} newNames
|
739
|
+
* @return {boolean}
|
740
|
+
*/
|
741
|
+
Formula.prototype.changeFields = function (oldNames, newNames) {
|
742
|
+
if(!Array.isArray(oldNames) || !Array.isArray(newNames)) {
|
743
|
+
return false;
|
744
|
+
}
|
745
|
+
if(oldNames.length !== newNames.length) {
|
746
|
+
return false;
|
747
|
+
}
|
748
|
+
|
749
|
+
var oldInput = this._input;
|
750
|
+
for(var i = oldNames.length; --i >= 0;) {
|
751
|
+
var oldName = oldNames[i];
|
752
|
+
var newName = newNames[i];
|
753
|
+
|
754
|
+
var index = this._fields.indexOf(oldName);
|
755
|
+
if (index < 0) {
|
756
|
+
continue;
|
757
|
+
}
|
758
|
+
|
759
|
+
this._fields.splice(index, 1);
|
760
|
+
if (this._fields.indexOf(newName) < 0) {
|
761
|
+
this._fields.push(newName);
|
762
|
+
}
|
763
|
+
|
764
|
+
var oldTokenField = "♠" + oldName + "♥";
|
765
|
+
var newTokenField = "♠" + newName + "♥";
|
766
|
+
|
767
|
+
this._inputWithTokenField = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) { // eslint-disable-line
|
768
|
+
return (str === oldTokenField) ? newTokenField : str;
|
769
|
+
});
|
770
|
+
this._input = this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥", "g"), function(str) { // eslint-disable-line
|
771
|
+
return str.substr(1, str.length - 2); // Remove "♠" and "♥"
|
772
|
+
});
|
773
|
+
this._expression = this._expression.replace(new RegExp('this\\.__D\\("' + oldName + '", __R\\)', "g"), 'this.__D("' + newName + '", __R)');
|
774
|
+
}
|
775
|
+
|
776
|
+
this._main = this._createFunction(this._expression);
|
777
|
+
this._dispatch("formulaChanged", { "oldInput": oldInput, "formula": this });
|
778
|
+
return true;
|
779
|
+
};
|
780
|
+
|
781
|
+
//#region Realtime service
|
782
|
+
/** @public
|
783
|
+
* @return {*}
|
784
|
+
*/
|
785
|
+
Formula.prototype.getRealtimeService = function() {
|
786
|
+
return this._rtService;
|
787
|
+
};
|
788
|
+
|
789
|
+
/** @public
|
790
|
+
* @param {Object} rtService
|
791
|
+
*/
|
792
|
+
Formula.prototype.setRealtimeService = function(rtService) {
|
793
|
+
if (this._rtService) {
|
794
|
+
this._rtService["dispose"]();
|
795
|
+
}
|
796
|
+
this._rtService = rtService;
|
797
|
+
this._rtService["addEventListener"]("dataChanged", this._onDataCacheChanged);
|
798
|
+
};
|
799
|
+
//#endregion Realtime service
|
800
|
+
|
801
|
+
//#region Interval service
|
802
|
+
/** @public
|
803
|
+
* @param {string} funcName
|
804
|
+
* @return {*}
|
805
|
+
*/
|
806
|
+
Formula.prototype.getIntervalService = function(funcName) {
|
807
|
+
return this._intervalServices[funcName];
|
808
|
+
};
|
809
|
+
|
810
|
+
/** @public
|
811
|
+
* @param {string} funcName
|
812
|
+
* @param {Object} newService
|
813
|
+
*/
|
814
|
+
Formula.prototype.setIntervalService = function(funcName, newService) {
|
815
|
+
if(!newService) {
|
816
|
+
return;
|
817
|
+
}
|
818
|
+
|
819
|
+
var service = this._intervalServices[funcName];
|
820
|
+
if (service) {
|
821
|
+
service["removeEventListener"]("dataChanged", this.dispatchDataChanged); // Service will stop only if no event listener anymore
|
822
|
+
}
|
823
|
+
this._intervalServices[funcName] = newService;
|
824
|
+
newService["addEventListener"]("dataChanged", this.dispatchDataChanged);
|
825
|
+
};
|
826
|
+
//#endregion Interval service
|
827
|
+
|
828
|
+
//#region formula data cache
|
829
|
+
/** @public
|
830
|
+
* @param {string} symbol
|
831
|
+
* @return {*}
|
832
|
+
*/
|
833
|
+
Formula.prototype.getCachedData = function(symbol) {
|
834
|
+
return this._dataCache[symbol];
|
835
|
+
};
|
836
|
+
|
837
|
+
/** @public
|
838
|
+
* @param {string} symbol
|
839
|
+
* @param {Object.<string,*>} values
|
840
|
+
*/
|
841
|
+
Formula.prototype.setCachedData = function(symbol, values) {
|
842
|
+
this._dataCache[symbol] = values;
|
843
|
+
};
|
844
|
+
|
845
|
+
/** @public
|
846
|
+
* @param {string} msg
|
847
|
+
*/
|
848
|
+
Formula.prototype.setDataError = function(msg) {
|
849
|
+
this._dataLastError = msg;
|
850
|
+
};
|
851
|
+
|
852
|
+
/** @public
|
853
|
+
* @param {Object=} e
|
854
|
+
*/
|
855
|
+
Formula.prototype.dispatchDataChanged = function(e) {
|
856
|
+
// Just dispatch the event. No need to cache any data in formula.
|
857
|
+
this._dispatch("dataCacheChanged", {});
|
858
|
+
};
|
859
|
+
|
860
|
+
/** @public
|
861
|
+
* @param {Object} e
|
862
|
+
*/
|
863
|
+
Formula.prototype._onDataCacheChanged = function(e) {
|
864
|
+
// Cache data for real-time function since real-time function has its own RIC list. Then dispatch the event.
|
865
|
+
var symbol = e['ric'];
|
866
|
+
var values = /** @type{Object.<string, *>} */(e['values']);
|
867
|
+
var data = this._dataCache[symbol];
|
868
|
+
if (data) {
|
869
|
+
for (var field in values) {
|
870
|
+
data[field] = values[field];
|
871
|
+
}
|
872
|
+
} else {
|
873
|
+
this._dataCache[symbol] = values;
|
874
|
+
}
|
875
|
+
this._dispatch("dataCacheChanged", {});
|
876
|
+
};
|
877
|
+
//#endregion formula data cache
|
878
|
+
|
879
|
+
Formula._proto = Formula.prototype;
|
880
|
+
|
881
|
+
export default Formula;
|
882
|
+
export { Formula };
|