From f68ef1cc9e23d9ec8f7429a8c58143ba46a0123b Mon Sep 17 00:00:00 2001 From: heswell Date: Wed, 18 Oct 2023 12:03:47 +0100 Subject: [PATCH] Tidy package and type issues (#914) * fix package references, type issues * add typescript config for correct auto import resolution --- vuu-ui/global.d.ts | 3 + vuu-ui/packages/vuu-codemirror/tsconfig.json | 6 + .../packages/vuu-data-ag-grid/tsconfig.json | 6 + vuu-ui/packages/vuu-data-react/tsconfig.json | 6 + vuu-ui/packages/vuu-data-types/tsconfig.json | 6 + vuu-ui/packages/vuu-data/tsconfig.json | 6 + .../packages/vuu-datagrid-types/tsconfig.json | 6 + .../vuu-datagrid/src/ColumnBearer.tsx | 4 +- .../src/cell-renderers/progress-cell.tsx | 2 +- .../build-context-menu-descriptors.ts | 2 +- .../src/grid-cells/HeaderCell.tsx | 2 +- .../src/grid-cells/filter-indicator.tsx | 2 +- .../vuu-datagrid/src/grid-context.tsx | 2 +- .../src/grid-hooks/use-data-source.ts | 2 +- .../src/grid-hooks/useGridActionDispatcher.ts | 2 +- vuu-ui/packages/vuu-datagrid/tsconfig.json | 6 + .../src/json-table/JsonTable.tsx | 6 +- vuu-ui/packages/vuu-datatable/tsconfig.json | 6 + .../packages/vuu-filter-parser/tsconfig.json | 6 + .../packages/vuu-filter-types/tsconfig.json | 6 + .../vuu-filters/src/filter-bar/useFilters.ts | 2 +- .../filter-builder-menu/FilterBuilderMenu.tsx | 2 +- .../filter-clause/useFilterClauseEditor.ts | 2 +- .../src/filter-pill/FilterPill.tsx | 2 +- vuu-ui/packages/vuu-filters/tsconfig.json | 6 + vuu-ui/packages/vuu-layout/tsconfig.json | 6 + vuu-ui/packages/vuu-popups/tsconfig.json | 6 + .../packages/vuu-protocol-types/tsconfig.json | 6 + vuu-ui/packages/vuu-shell/tsconfig.json | 6 + .../useColumnExpression.ts | 2 +- .../NumericFormattingSettings.tsx | 2 +- .../src/column-list/ColumnList.tsx | 2 +- .../packages/vuu-table-extras/tsconfig.json | 6 + .../column-header-pill/ColumnHeaderPill.tsx | 2 +- .../column-header-pill/GroupColumnPill.tsx | 2 +- .../src/table-next/table-cell/TableCell.tsx | 2 +- vuu-ui/packages/vuu-table/tsconfig.json | 6 + .../src/drag-drop/useDragDisplacers.ts | 6 +- .../src/dropdown/dropdownTypes.ts | 2 +- .../src/instrument-picker/useDataSource.ts | 2 +- .../src/instrument-search/useDataSource.ts | 2 +- .../vuu-ui-controls/src/tabstrip/Tab.tsx | 2 +- .../src/tabstrip/TabMenuOptions.ts | 2 +- .../vuu-ui-controls/src/tabstrip/TabsTypes.ts | 2 +- vuu-ui/packages/vuu-ui-controls/tsconfig.json | 6 + vuu-ui/packages/vuu-utils/tsconfig.json | 6 + .../sample-apps/app-vuu-example/src/App.tsx | 2 +- .../src/basket-selector/BasketSelector.tsx | 1 - .../src/basket-toolbar/BasketToolbar.tsx | 2 +- .../src/VuuFilterTableFeature.tsx | 9 -- .../src/VuuInstrumentTilesFeature.tsx | 4 +- .../src/useDataSource.ts | 2 +- .../DataTable/FilterTable.examples.tsx | 2 +- .../FilterBar/FilterClause.examples.tsx | 9 +- .../Layout/LayoutsBrowser.examples.tsx | 14 ++- .../Performance/Performance.examples.tsx | 2 +- .../Shell/SessionTableEditing.examples.tsx | 3 +- .../examples/Shell/ThemeProvider.examples.tsx | 2 +- .../ShowcaseControls/Tree.examples.tsx | 2 +- .../Table/TableArrayData.examples.tsx | 97 +------------- .../src/examples/Table/TableList.examples.tsx | 2 +- .../ColumnExpressionInput.examples.tsx | 2 +- .../ColumnExpressionPanel.examples.tsx | 2 +- .../ColumnSettings.examples.tsx | 6 +- .../TableSettings/TableSettings.examples.tsx | 2 + .../src/examples/UiControls/List.examples.tsx | 2 +- .../VuuFeatures/BasketToolbar.examples.tsx | 4 +- .../src/examples/html/HtmlTable.examples.tsx | 12 +- .../html/LayoutExperiments.examples.tsx | 1 - ...hTranslateInlineScrollbarsCssVariables.tsx | 1 + .../vuu-table/VuuTable.tsx | 13 +- .../vuu-table/useTable.ts | 20 +-- .../src/examples/utils/UpdateGenerator.ts | 6 +- .../data-generators/generate-data-utils.ts | 119 +++++++++--------- .../showcase/src/examples/utils/rowUpdates.ts | 2 +- vuu-ui/showcase/src/index.tsx | 1 + vuu-ui/tsconfig.json | 25 +++- 77 files changed, 286 insertions(+), 264 deletions(-) create mode 100644 vuu-ui/global.d.ts create mode 100644 vuu-ui/packages/vuu-codemirror/tsconfig.json create mode 100644 vuu-ui/packages/vuu-data-ag-grid/tsconfig.json create mode 100644 vuu-ui/packages/vuu-data-react/tsconfig.json create mode 100644 vuu-ui/packages/vuu-data-types/tsconfig.json create mode 100644 vuu-ui/packages/vuu-data/tsconfig.json create mode 100644 vuu-ui/packages/vuu-datagrid-types/tsconfig.json create mode 100644 vuu-ui/packages/vuu-datagrid/tsconfig.json create mode 100644 vuu-ui/packages/vuu-datatable/tsconfig.json create mode 100644 vuu-ui/packages/vuu-filter-parser/tsconfig.json create mode 100644 vuu-ui/packages/vuu-filter-types/tsconfig.json create mode 100644 vuu-ui/packages/vuu-filters/tsconfig.json create mode 100644 vuu-ui/packages/vuu-layout/tsconfig.json create mode 100644 vuu-ui/packages/vuu-popups/tsconfig.json create mode 100644 vuu-ui/packages/vuu-protocol-types/tsconfig.json create mode 100644 vuu-ui/packages/vuu-shell/tsconfig.json create mode 100644 vuu-ui/packages/vuu-table-extras/tsconfig.json create mode 100644 vuu-ui/packages/vuu-table/tsconfig.json create mode 100644 vuu-ui/packages/vuu-ui-controls/tsconfig.json create mode 100644 vuu-ui/packages/vuu-utils/tsconfig.json diff --git a/vuu-ui/global.d.ts b/vuu-ui/global.d.ts new file mode 100644 index 000000000..a19d27bfe --- /dev/null +++ b/vuu-ui/global.d.ts @@ -0,0 +1,3 @@ +declare module "@thomaschaplin/isin-generator" { + export const isinGenerator = () => undefined; +} diff --git a/vuu-ui/packages/vuu-codemirror/tsconfig.json b/vuu-ui/packages/vuu-codemirror/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-codemirror/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-data-ag-grid/tsconfig.json b/vuu-ui/packages/vuu-data-ag-grid/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-data-ag-grid/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-data-react/tsconfig.json b/vuu-ui/packages/vuu-data-react/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-data-react/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-data-types/tsconfig.json b/vuu-ui/packages/vuu-data-types/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-data-types/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-data/tsconfig.json b/vuu-ui/packages/vuu-data/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-data/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-datagrid-types/tsconfig.json b/vuu-ui/packages/vuu-datagrid-types/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-datagrid-types/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-datagrid/src/ColumnBearer.tsx b/vuu-ui/packages/vuu-datagrid/src/ColumnBearer.tsx index 30aa5c68a..a41f5a104 100644 --- a/vuu-ui/packages/vuu-datagrid/src/ColumnBearer.tsx +++ b/vuu-ui/packages/vuu-datagrid/src/ColumnBearer.tsx @@ -17,8 +17,8 @@ import "./column-bearer.css"; import { GridModelType } from "./grid-model"; import { ColumnDragState, dragPhase } from "./gridTypes"; import { buildColumnMap } from "@finos/vuu-utils"; -import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types"; -import { DataSourceRow } from "packages/vuu-data-types"; +import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types"; +import { DataSourceRow } from "@finos/vuu-data-types"; const LEFT = "left"; const RIGHT = "right"; diff --git a/vuu-ui/packages/vuu-datagrid/src/cell-renderers/progress-cell.tsx b/vuu-ui/packages/vuu-datagrid/src/cell-renderers/progress-cell.tsx index cab062d9c..863b9cd12 100644 --- a/vuu-ui/packages/vuu-datagrid/src/cell-renderers/progress-cell.tsx +++ b/vuu-ui/packages/vuu-datagrid/src/cell-renderers/progress-cell.tsx @@ -5,7 +5,7 @@ import React from "react"; import { isTypeDescriptor } from "@finos/vuu-utils"; import { GridCellProps } from "../grid-cells"; import "./progress-cell.css"; -import { ColumnTypeRenderer } from "packages/vuu-datagrid-types"; +import { ColumnTypeRenderer } from "@finos/vuu-datagrid-types"; const ProgressCell = React.memo(function ProgressCell({ column, diff --git a/vuu-ui/packages/vuu-datagrid/src/context-menu/build-context-menu-descriptors.ts b/vuu-ui/packages/vuu-datagrid/src/context-menu/build-context-menu-descriptors.ts index 26a15ed81..b581ae1de 100644 --- a/vuu-ui/packages/vuu-datagrid/src/context-menu/build-context-menu-descriptors.ts +++ b/vuu-ui/packages/vuu-datagrid/src/context-menu/build-context-menu-descriptors.ts @@ -4,7 +4,7 @@ import { ContextMenuGroupItemDescriptor, ContextMenuItemDescriptor, MenuBuilder, -} from "packages/vuu-data-types"; +} from "@finos/vuu-data-types"; import { VuuAggregation, VuuGroupBy, diff --git a/vuu-ui/packages/vuu-datagrid/src/grid-cells/HeaderCell.tsx b/vuu-ui/packages/vuu-datagrid/src/grid-cells/HeaderCell.tsx index 75971e900..956020dc8 100644 --- a/vuu-ui/packages/vuu-datagrid/src/grid-cells/HeaderCell.tsx +++ b/vuu-ui/packages/vuu-datagrid/src/grid-cells/HeaderCell.tsx @@ -14,7 +14,7 @@ import { SortIndicator, sortStatus } from "./sort-indicator"; import { useCellResize } from "./useCellResize"; import "./HeaderCell.css"; -import { DataSourceFilter } from "packages/vuu-data-types"; +import { DataSourceFilter } from "@finos/vuu-data-types"; const classBase = "hwHeaderCell"; const NO_AGGREGATION = { aggType: -1 }; diff --git a/vuu-ui/packages/vuu-datagrid/src/grid-cells/filter-indicator.tsx b/vuu-ui/packages/vuu-datagrid/src/grid-cells/filter-indicator.tsx index 1bfbc2a1f..886ef56a6 100644 --- a/vuu-ui/packages/vuu-datagrid/src/grid-cells/filter-indicator.tsx +++ b/vuu-ui/packages/vuu-datagrid/src/grid-cells/filter-indicator.tsx @@ -5,7 +5,7 @@ import cx from "classnames"; import { HTMLAttributes, useCallback, useMemo } from "react"; import "./filter-indicator.css"; -import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types"; +import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types"; export const Direction = { ASC: "asc", diff --git a/vuu-ui/packages/vuu-datagrid/src/grid-context.tsx b/vuu-ui/packages/vuu-datagrid/src/grid-context.tsx index 4ba6f7c18..87e908643 100644 --- a/vuu-ui/packages/vuu-datagrid/src/grid-context.tsx +++ b/vuu-ui/packages/vuu-datagrid/src/grid-context.tsx @@ -14,7 +14,7 @@ import { GridAction, KeyedColumnDescriptor, } from "@finos/vuu-datagrid-types"; -import { DataSourceFilter } from "packages/vuu-data-types"; +import { DataSourceFilter } from "@finos/vuu-data-types"; export interface GridActionGroup { type: "group"; diff --git a/vuu-ui/packages/vuu-datagrid/src/grid-hooks/use-data-source.ts b/vuu-ui/packages/vuu-datagrid/src/grid-hooks/use-data-source.ts index 01515f741..4f5bfd144 100644 --- a/vuu-ui/packages/vuu-datagrid/src/grid-hooks/use-data-source.ts +++ b/vuu-ui/packages/vuu-datagrid/src/grid-hooks/use-data-source.ts @@ -7,7 +7,7 @@ import { toColumnDescriptor, WindowRange, } from "@finos/vuu-utils"; -import { DataSourceRow } from "packages/vuu-data-types"; +import { DataSourceRow } from "@finos/vuu-data-types"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useGridContext } from "../grid-context"; import { GridModelType } from "../grid-model/gridModelTypes"; diff --git a/vuu-ui/packages/vuu-datagrid/src/grid-hooks/useGridActionDispatcher.ts b/vuu-ui/packages/vuu-datagrid/src/grid-hooks/useGridActionDispatcher.ts index f23b7641c..945c29065 100644 --- a/vuu-ui/packages/vuu-datagrid/src/grid-hooks/useGridActionDispatcher.ts +++ b/vuu-ui/packages/vuu-datagrid/src/grid-hooks/useGridActionDispatcher.ts @@ -3,7 +3,7 @@ import { DataSourceAction, GridAction, ScrollAction, -} from "packages/vuu-datagrid-types"; +} from "@finos/vuu-datagrid-types"; import { useCallback } from "react"; import { GridActionSelection, GridModelDispatch } from "../grid-context"; diff --git a/vuu-ui/packages/vuu-datagrid/tsconfig.json b/vuu-ui/packages/vuu-datagrid/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-datagrid/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-datatable/src/json-table/JsonTable.tsx b/vuu-ui/packages/vuu-datatable/src/json-table/JsonTable.tsx index 990c3acad..373b1459a 100644 --- a/vuu-ui/packages/vuu-datatable/src/json-table/JsonTable.tsx +++ b/vuu-ui/packages/vuu-datatable/src/json-table/JsonTable.tsx @@ -7,9 +7,9 @@ import { TableConfig } from "@finos/vuu-datagrid-types"; export interface JsonTableProps extends Omit { - config: Pick< + config?: Pick< TableConfig, - "columns" | "columnSeparators" | "rowSeparators" | "zebraStripes" + "columnSeparators" | "rowSeparators" | "zebraStripes" >; source: JsonData | undefined; } @@ -20,7 +20,7 @@ export const JsonTable = ({ ...tableProps }: JsonTableProps) => { const [dataSource, tableConfig] = useMemo< - [JsonDataSource, JsonTableProps["config"]] + [JsonDataSource, TableConfig] >(() => { const ds = new JsonDataSource({ data: source, diff --git a/vuu-ui/packages/vuu-datatable/tsconfig.json b/vuu-ui/packages/vuu-datatable/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-datatable/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-filter-parser/tsconfig.json b/vuu-ui/packages/vuu-filter-parser/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-filter-parser/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-filter-types/tsconfig.json b/vuu-ui/packages/vuu-filter-types/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-filter-types/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-filters/src/filter-bar/useFilters.ts b/vuu-ui/packages/vuu-filters/src/filter-bar/useFilters.ts index a5c26933e..86b5d2f9f 100644 --- a/vuu-ui/packages/vuu-filters/src/filter-bar/useFilters.ts +++ b/vuu-ui/packages/vuu-filters/src/filter-bar/useFilters.ts @@ -1,5 +1,5 @@ import { useControlled } from "@finos/vuu-ui-controls"; -import { Filter } from "packages/vuu-filter-types"; +import { Filter } from "@finos/vuu-filter-types"; import { useCallback } from "react"; export interface FiltersHookProps { diff --git a/vuu-ui/packages/vuu-filters/src/filter-builder-menu/FilterBuilderMenu.tsx b/vuu-ui/packages/vuu-filters/src/filter-builder-menu/FilterBuilderMenu.tsx index 5311cc38b..c1c211e31 100644 --- a/vuu-ui/packages/vuu-filters/src/filter-builder-menu/FilterBuilderMenu.tsx +++ b/vuu-ui/packages/vuu-filters/src/filter-builder-menu/FilterBuilderMenu.tsx @@ -1,5 +1,5 @@ import { ContextMenuProps } from "@finos/vuu-popups"; -import { MenuActionHandler } from "packages/vuu-data-types"; +import { MenuActionHandler } from "@finos/vuu-data-types"; import { ReactElement, useCallback, useRef } from "react"; import { PopupComponent as Popup, Portal } from "@finos/vuu-popups"; import { List, ListItem } from "@finos/vuu-ui-controls"; diff --git a/vuu-ui/packages/vuu-filters/src/filter-clause/useFilterClauseEditor.ts b/vuu-ui/packages/vuu-filters/src/filter-clause/useFilterClauseEditor.ts index 558d98afe..880f2d916 100644 --- a/vuu-ui/packages/vuu-filters/src/filter-clause/useFilterClauseEditor.ts +++ b/vuu-ui/packages/vuu-filters/src/filter-clause/useFilterClauseEditor.ts @@ -15,7 +15,7 @@ import { useRef, useState, } from "react"; -import { SingleSelectionHandler } from "packages/vuu-ui-controls/src"; +import { SingleSelectionHandler } from "@finos/vuu-ui-controls/src"; const cursorAtTextStart = (input: HTMLInputElement) => input.selectionStart === 0; diff --git a/vuu-ui/packages/vuu-filters/src/filter-pill/FilterPill.tsx b/vuu-ui/packages/vuu-filters/src/filter-pill/FilterPill.tsx index ebd949df5..a8c5d9fe1 100644 --- a/vuu-ui/packages/vuu-filters/src/filter-pill/FilterPill.tsx +++ b/vuu-ui/packages/vuu-filters/src/filter-pill/FilterPill.tsx @@ -3,7 +3,7 @@ import { Filter } from "@finos/vuu-filter-types"; import { EditableLabel, EditableLabelProps } from "@finos/vuu-ui-controls"; import { filterAsQuery, isMultiClauseFilter } from "@finos/vuu-utils"; import cx from "classnames"; -import { PopupCloseCallback } from "packages/vuu-popups/src"; +import { PopupCloseCallback } from "@finos/vuu-popups/src"; import { HTMLAttributes, useCallback, useRef } from "react"; import { FilterPillMenu } from "../filter-pill-menu"; import { filterClauses } from "../filter-utils"; diff --git a/vuu-ui/packages/vuu-filters/tsconfig.json b/vuu-ui/packages/vuu-filters/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-filters/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-layout/tsconfig.json b/vuu-ui/packages/vuu-layout/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-layout/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-popups/tsconfig.json b/vuu-ui/packages/vuu-popups/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-popups/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-protocol-types/tsconfig.json b/vuu-ui/packages/vuu-protocol-types/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-protocol-types/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-shell/tsconfig.json b/vuu-ui/packages/vuu-shell/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-shell/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-table-extras/src/column-expression-panel/useColumnExpression.ts b/vuu-ui/packages/vuu-table-extras/src/column-expression-panel/useColumnExpression.ts index 5b76fa4d6..66853a6cd 100644 --- a/vuu-ui/packages/vuu-table-extras/src/column-expression-panel/useColumnExpression.ts +++ b/vuu-ui/packages/vuu-table-extras/src/column-expression-panel/useColumnExpression.ts @@ -1,4 +1,4 @@ -import { ColumnDescriptor } from "packages/vuu-datagrid-types"; +import { ColumnDescriptor } from "@finos/vuu-datagrid-types"; import { getCalculatedColumnDetails, setCalculatedColumnExpression, diff --git a/vuu-ui/packages/vuu-table-extras/src/column-formatting-settings/NumericFormattingSettings.tsx b/vuu-ui/packages/vuu-table-extras/src/column-formatting-settings/NumericFormattingSettings.tsx index d74b812fe..83a83be47 100644 --- a/vuu-ui/packages/vuu-table-extras/src/column-formatting-settings/NumericFormattingSettings.tsx +++ b/vuu-ui/packages/vuu-table-extras/src/column-formatting-settings/NumericFormattingSettings.tsx @@ -1,6 +1,6 @@ import { FormField, FormFieldLabel, Input } from "@salt-ds/core"; import { Switch } from "@salt-ds/lab"; -import { ColumnDescriptor, TypeFormatting } from "packages/vuu-datagrid-types"; +import { ColumnDescriptor, TypeFormatting } from "@finos/vuu-datagrid-types"; import { getTypeSettingsFromColumn } from "@finos/vuu-utils"; import { ChangeEvent, diff --git a/vuu-ui/packages/vuu-table-extras/src/column-list/ColumnList.tsx b/vuu-ui/packages/vuu-table-extras/src/column-list/ColumnList.tsx index 2e4df2c9d..e76725906 100644 --- a/vuu-ui/packages/vuu-table-extras/src/column-list/ColumnList.tsx +++ b/vuu-ui/packages/vuu-table-extras/src/column-list/ColumnList.tsx @@ -7,7 +7,7 @@ import { import { Checkbox } from "@salt-ds/core"; import { Switch } from "@salt-ds/lab"; import cx from "classnames"; -import { ColumnDescriptor } from "packages/vuu-datagrid-types"; +import { ColumnDescriptor } from "@finos/vuu-datagrid-types"; import { HTMLAttributes, SyntheticEvent, useCallback } from "react"; import { ColumnItem } from "../table-settings"; diff --git a/vuu-ui/packages/vuu-table-extras/tsconfig.json b/vuu-ui/packages/vuu-table-extras/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-table-extras/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/ColumnHeaderPill.tsx b/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/ColumnHeaderPill.tsx index 7e7ce6772..6300731f3 100644 --- a/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/ColumnHeaderPill.tsx +++ b/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/ColumnHeaderPill.tsx @@ -1,5 +1,5 @@ import cx from "classnames"; -import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types"; +import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types"; import { HTMLAttributes, MouseEvent, useCallback } from "react"; import "./ColumnHeaderPill.css"; diff --git a/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/GroupColumnPill.tsx b/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/GroupColumnPill.tsx index 8113c6a3b..8629eb857 100644 --- a/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/GroupColumnPill.tsx +++ b/vuu-ui/packages/vuu-table/src/table-next/column-header-pill/GroupColumnPill.tsx @@ -1,4 +1,4 @@ -import { KeyedColumnDescriptor } from "packages/vuu-datagrid-types"; +import { KeyedColumnDescriptor } from "@finos/vuu-datagrid-types"; import { ColumnHeaderPill, ColumnHeaderPillProps } from "./ColumnHeaderPill"; import "./GroupColumnPill.css"; diff --git a/vuu-ui/packages/vuu-table/src/table-next/table-cell/TableCell.tsx b/vuu-ui/packages/vuu-table/src/table-next/table-cell/TableCell.tsx index 9f4a62724..cac32bd63 100644 --- a/vuu-ui/packages/vuu-table/src/table-next/table-cell/TableCell.tsx +++ b/vuu-ui/packages/vuu-table/src/table-next/table-cell/TableCell.tsx @@ -1,6 +1,6 @@ import { TableCellProps } from "@finos/vuu-datagrid-types"; import { metadataKeys } from "@finos/vuu-utils"; -import { VuuColumnDataType } from "packages/vuu-protocol-types"; +import { VuuColumnDataType } from "@finos/vuu-protocol-types"; import { MouseEventHandler, useCallback } from "react"; import { useCell } from "../useCell"; diff --git a/vuu-ui/packages/vuu-table/tsconfig.json b/vuu-ui/packages/vuu-table/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-table/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-ui-controls/src/drag-drop/useDragDisplacers.ts b/vuu-ui/packages/vuu-ui-controls/src/drag-drop/useDragDisplacers.ts index 9bea71262..5a7ab37a4 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/drag-drop/useDragDisplacers.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/drag-drop/useDragDisplacers.ts @@ -1,11 +1,11 @@ +import type { orientationType } from "@finos/vuu-utils"; import { useCallback, useMemo, useRef } from "react"; +import { Direction } from "./dragDropTypesNext"; +import { createDragSpacer as createDragDisplacer } from "./Draggable"; import { MeasuredDropTarget, mutateDropTargetsSwitchDropTargetPosition, } from "./drop-target-utils"; -import { createDragSpacer as createDragDisplacer } from "./Draggable"; -import { Direction } from "./dragDropTypesNext"; -import { orientationType } from "packages/vuu-utils/src"; export type DragDisplacersHookResult = { displaceItem: ( diff --git a/vuu-ui/packages/vuu-ui-controls/src/dropdown/dropdownTypes.ts b/vuu-ui/packages/vuu-ui-controls/src/dropdown/dropdownTypes.ts index 53594a329..ad862944c 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/dropdown/dropdownTypes.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/dropdown/dropdownTypes.ts @@ -1,4 +1,4 @@ -import { PopupComponentProps, PopupPlacement } from "packages/vuu-popups/src"; +import type { PopupComponentProps, PopupPlacement } from "@finos/vuu-popups"; import { HTMLAttributes, KeyboardEvent, diff --git a/vuu-ui/packages/vuu-ui-controls/src/instrument-picker/useDataSource.ts b/vuu-ui/packages/vuu-ui-controls/src/instrument-picker/useDataSource.ts index 2dd2dbec2..4fe080729 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/instrument-picker/useDataSource.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/instrument-picker/useDataSource.ts @@ -1,7 +1,7 @@ //TODO stansardise this import { DataSource, SubscribeCallback } from "@finos/vuu-data"; -import { DataSourceRow } from "packages/vuu-data-types"; +import { DataSourceRow } from "@finos/vuu-data-types"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { MovingWindow } from "./moving-window"; export interface DataSourceHookProps { diff --git a/vuu-ui/packages/vuu-ui-controls/src/instrument-search/useDataSource.ts b/vuu-ui/packages/vuu-ui-controls/src/instrument-search/useDataSource.ts index 2dd2dbec2..4fe080729 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/instrument-search/useDataSource.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/instrument-search/useDataSource.ts @@ -1,7 +1,7 @@ //TODO stansardise this import { DataSource, SubscribeCallback } from "@finos/vuu-data"; -import { DataSourceRow } from "packages/vuu-data-types"; +import { DataSourceRow } from "@finos/vuu-data-types"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { MovingWindow } from "./moving-window"; export interface DataSourceHookProps { diff --git a/vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tab.tsx b/vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tab.tsx index 285e99263..e0c1279c2 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tab.tsx +++ b/vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tab.tsx @@ -1,7 +1,7 @@ // TODO close button needs to be a button. Hence tab needs to include 2 buttons import { useForkRef } from "@salt-ds/core"; import cx from "classnames"; -import { MenuActionHandler } from "packages/vuu-data-types"; +import { MenuActionHandler } from "@finos/vuu-data-types"; import { FocusEvent, ForwardedRef, diff --git a/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabMenuOptions.ts b/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabMenuOptions.ts index 67fef719b..4733e0da4 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabMenuOptions.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabMenuOptions.ts @@ -1,4 +1,4 @@ -import { ContextMenuItemDescriptor } from "packages/vuu-data-types"; +import { ContextMenuItemDescriptor } from "@finos/vuu-data-types"; export type MenuOptions = { [key: string]: unknown }; diff --git a/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabsTypes.ts b/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabsTypes.ts index 043f4fb6f..c8fb3d70b 100644 --- a/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabsTypes.ts +++ b/vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabsTypes.ts @@ -8,7 +8,7 @@ import type { import { orientationType } from "@finos/vuu-utils"; import type { EditableLabelProps } from "../editable-label"; -import type { MenuActionHandler } from "packages/vuu-data-types"; +import type { MenuActionHandler } from "@finos/vuu-data-types"; export type ExitEditModeHandler = ( originalValue: string, diff --git a/vuu-ui/packages/vuu-ui-controls/tsconfig.json b/vuu-ui/packages/vuu-ui-controls/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-ui-controls/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/packages/vuu-utils/tsconfig.json b/vuu-ui/packages/vuu-utils/tsconfig.json new file mode 100644 index 000000000..db9582a16 --- /dev/null +++ b/vuu-ui/packages/vuu-utils/tsconfig.json @@ -0,0 +1,6 @@ +{ +"extends": "../../tsconfig.json", +"compilerOptions":{ + "composite": true +}, +} diff --git a/vuu-ui/sample-apps/app-vuu-example/src/App.tsx b/vuu-ui/sample-apps/app-vuu-example/src/App.tsx index 6bd1c3c64..e90bf6e87 100644 --- a/vuu-ui/sample-apps/app-vuu-example/src/App.tsx +++ b/vuu-ui/sample-apps/app-vuu-example/src/App.tsx @@ -19,7 +19,7 @@ import { getFormConfig } from "./session-editing"; import "./App.css"; // Because we do not render the AppSidePanel directly, the css will not be included in bundle. import "./app-sidepanel/AppSidePanel.css"; -import { VuuTable } from "packages/vuu-protocol-types"; +import { VuuTable } from "@finos/vuu-protocol-types"; const defaultWebsocketUrl = `wss://${location.hostname}:8090/websocket`; const { websocketUrl: serverUrl = defaultWebsocketUrl, features } = diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/basket-selector/BasketSelector.tsx b/vuu-ui/sample-apps/feature-basket-trading/src/basket-selector/BasketSelector.tsx index cbf053aef..f027468c1 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/basket-selector/BasketSelector.tsx +++ b/vuu-ui/sample-apps/feature-basket-trading/src/basket-selector/BasketSelector.tsx @@ -1,6 +1,5 @@ import { PriceTicker } from "@finos/vuu-ui-controls"; import { Button } from "@salt-ds/core"; -// import { VuuDataRow } from "packages/vuu-protocol-types"; import { DataSource, SubscribeCallback } from "@finos/vuu-data"; import { useId } from "@finos/vuu-layout"; import { PopupComponent as Popup, Portal } from "@finos/vuu-popups"; diff --git a/vuu-ui/sample-apps/feature-basket-trading/src/basket-toolbar/BasketToolbar.tsx b/vuu-ui/sample-apps/feature-basket-trading/src/basket-toolbar/BasketToolbar.tsx index ffe8a858a..ec675809a 100644 --- a/vuu-ui/sample-apps/feature-basket-trading/src/basket-toolbar/BasketToolbar.tsx +++ b/vuu-ui/sample-apps/feature-basket-trading/src/basket-toolbar/BasketToolbar.tsx @@ -6,7 +6,7 @@ import { BasketStatus } from "../VuuBasketTradingFeature"; import { BasketMenu } from "./BasketMenu"; import "./BasketToolbar.css"; -import { MenuActionHandler } from "packages/vuu-data-types"; +import { MenuActionHandler } from "@finos/vuu-data-types"; const classBase = "vuuBasketToolbar"; diff --git a/vuu-ui/sample-apps/feature-filter-table/src/VuuFilterTableFeature.tsx b/vuu-ui/sample-apps/feature-filter-table/src/VuuFilterTableFeature.tsx index 7753c90f8..4891b1372 100644 --- a/vuu-ui/sample-apps/feature-filter-table/src/VuuFilterTableFeature.tsx +++ b/vuu-ui/sample-apps/feature-filter-table/src/VuuFilterTableFeature.tsx @@ -83,14 +83,6 @@ const VuuFilterTableFeature = ({ tableSchema }: FilterTableFeatureProps) => { filterbarConfigFromState?.filters ?? [] ); - const handleActiveChange = useCallback( - (activeFilterIndex: number[]) => { - activeRef.current = activeFilterIndex; - save?.({ filters, activeFilterIndex }, "filterbar-config"); - }, - [filters, save] - ); - const handleFiltersChanged = useCallback( (filters: Filter[]) => { save?.( @@ -257,7 +249,6 @@ const VuuFilterTableFeature = ({ tableSchema }: FilterTableFeatureProps) => { activeFilterIndex: filterbarConfigFromState?.activeFilterIndex, filters, onApplyFilter: handleApplyFilter, - onActiveChange: handleActiveChange, onFiltersChanged: handleFiltersChanged, tableSchema, }; diff --git a/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx b/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx index 0e6abda02..df4488fd9 100644 --- a/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx +++ b/vuu-ui/sample-apps/feature-instrument-tiles/src/VuuInstrumentTilesFeature.tsx @@ -17,7 +17,7 @@ import "./VuuInstrumentTilesFeature.css"; const classBase = "VuuInstrumentTilesFeature"; -export interface FilterTableFeatureProps { +export interface InstrumentTilesFeatureProps { tableSchema: TableSchema; } @@ -25,7 +25,7 @@ const { KEY } = metadataKeys; const VuuInstrumentTilesFeature = ({ tableSchema, -}: FilterTableFeatureProps) => { +}: InstrumentTilesFeatureProps) => { const { id, save, loadSession, saveSession, title } = useViewContext(); const instrumentKeys = useMemo( diff --git a/vuu-ui/sample-apps/feature-instrument-tiles/src/useDataSource.ts b/vuu-ui/sample-apps/feature-instrument-tiles/src/useDataSource.ts index e6eff45ab..4275b2a67 100644 --- a/vuu-ui/sample-apps/feature-instrument-tiles/src/useDataSource.ts +++ b/vuu-ui/sample-apps/feature-instrument-tiles/src/useDataSource.ts @@ -1,5 +1,5 @@ import { DataSource, SubscribeCallback } from "@finos/vuu-data"; -import { DataSourceRow } from "packages/vuu-data-types"; +import { DataSourceRow } from "@finos/vuu-data-types"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { MovingWindow } from "./moving-window"; export interface DataSourceHookProps { diff --git a/vuu-ui/showcase/src/examples/DataTable/FilterTable.examples.tsx b/vuu-ui/showcase/src/examples/DataTable/FilterTable.examples.tsx index 68249ab1b..9785d73a6 100644 --- a/vuu-ui/showcase/src/examples/DataTable/FilterTable.examples.tsx +++ b/vuu-ui/showcase/src/examples/DataTable/FilterTable.examples.tsx @@ -3,7 +3,7 @@ import { TableConfig } from "@finos/vuu-datagrid-types"; import { Filter } from "@finos/vuu-filter-types"; import { useCallback, useState } from "react"; import { useSchemas, useTestDataSource } from "../utils"; -import { DataSourceFilter } from "packages/vuu-data-types"; +import { DataSourceFilter } from "@finos/vuu-data-types"; let displaySequence = 1; diff --git a/vuu-ui/showcase/src/examples/Filters/FilterBar/FilterClause.examples.tsx b/vuu-ui/showcase/src/examples/Filters/FilterBar/FilterClause.examples.tsx index 5f189a3f7..570be2805 100644 --- a/vuu-ui/showcase/src/examples/Filters/FilterBar/FilterClause.examples.tsx +++ b/vuu-ui/showcase/src/examples/Filters/FilterBar/FilterClause.examples.tsx @@ -10,7 +10,6 @@ import { MultiSelectionHandler, SingleSelectionHandler, } from "@finos/vuu-ui-controls"; -import { SelectionChangeHandler } from "@salt-ds/lab"; import { ColumnDescriptor } from "@finos/vuu-datagrid-types"; import { ChangeEvent, useCallback, useMemo, useState } from "react"; import { @@ -103,7 +102,7 @@ export const DataBoundTextInputEmpty = () => { op: "=", }); - const handleValueChange = useCallback((value: string | number) => { + const handleInputComplete = useCallback((value: string | string[]) => { setValue(String(value)); }, []); @@ -111,7 +110,7 @@ export const DataBoundTextInputEmpty = () => { { value: "EUR", }); - const handleValueChange = useCallback((value: string | number) => { + const handleInputComplete = useCallback((value: string | string[]) => { setValue(String(value)); }, []); @@ -149,7 +148,7 @@ export const DataBoundTextInputLoaded = () => { { - return ( - - - - ); + return ( + + + + ); }; - +LayoutsBrowser.displaySequence = displaySequence++; diff --git a/vuu-ui/showcase/src/examples/Performance/Performance.examples.tsx b/vuu-ui/showcase/src/examples/Performance/Performance.examples.tsx index de7c09d07..b6d0cc6ea 100644 --- a/vuu-ui/showcase/src/examples/Performance/Performance.examples.tsx +++ b/vuu-ui/showcase/src/examples/Performance/Performance.examples.tsx @@ -5,7 +5,7 @@ import { Button } from "@salt-ds/core"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useAutoLoginToVuuServer } from "../utils/useAutoLoginToVuuServer"; import { metadataKeys } from "@finos/vuu-utils"; -import { DataSourceRow } from "packages/vuu-data-types"; +import { DataSourceRow } from "@finos/vuu-data-types"; import "./Performance.examples.css"; diff --git a/vuu-ui/showcase/src/examples/Shell/SessionTableEditing.examples.tsx b/vuu-ui/showcase/src/examples/Shell/SessionTableEditing.examples.tsx index 8c096e38a..6c2e3063e 100644 --- a/vuu-ui/showcase/src/examples/Shell/SessionTableEditing.examples.tsx +++ b/vuu-ui/showcase/src/examples/Shell/SessionTableEditing.examples.tsx @@ -2,7 +2,6 @@ import { ContextMenuProvider, Dialog, MenuActionClosePopup, - PopupCloseReason, useContextMenu, } from "@finos/vuu-popups"; import { VuuColumnDataType } from "@finos/vuu-protocol-types"; @@ -14,7 +13,7 @@ import { ContextMenuItemDescriptor, MenuActionHandler, MenuBuilder, -} from "packages/vuu-data-types"; +} from "@finos/vuu-data-types"; let displaySequence = 0; diff --git a/vuu-ui/showcase/src/examples/Shell/ThemeProvider.examples.tsx b/vuu-ui/showcase/src/examples/Shell/ThemeProvider.examples.tsx index 14218b57b..4057e08c9 100644 --- a/vuu-ui/showcase/src/examples/Shell/ThemeProvider.examples.tsx +++ b/vuu-ui/showcase/src/examples/Shell/ThemeProvider.examples.tsx @@ -1,5 +1,5 @@ import { ContextMenuProvider } from "@finos/vuu-popups"; -import { MenuActionHandler } from "packages/vuu-data-types"; +import { MenuActionHandler } from "@finos/vuu-data-types"; import { ThemedPanel } from "./components/ThemedPanel"; import "./ThemeProvider.examples.css"; diff --git a/vuu-ui/showcase/src/examples/ShowcaseControls/Tree.examples.tsx b/vuu-ui/showcase/src/examples/ShowcaseControls/Tree.examples.tsx index f2477660a..19426b4e3 100644 --- a/vuu-ui/showcase/src/examples/ShowcaseControls/Tree.examples.tsx +++ b/vuu-ui/showcase/src/examples/ShowcaseControls/Tree.examples.tsx @@ -1,6 +1,6 @@ import { SyntheticEvent } from "react"; -import { Tree, TreeSourceNode, useItemsWithIds } from "@finos/vuu-ui-controls"; +import { Tree, useItemsWithIds } from "@finos/vuu-ui-controls"; import { groupByInitialLetter, usa_states_cities } from "./List/List.data"; import { folderData } from "./Tree.data"; diff --git a/vuu-ui/showcase/src/examples/Table/TableArrayData.examples.tsx b/vuu-ui/showcase/src/examples/Table/TableArrayData.examples.tsx index 27a591e8e..226c92893 100644 --- a/vuu-ui/showcase/src/examples/Table/TableArrayData.examples.tsx +++ b/vuu-ui/showcase/src/examples/Table/TableArrayData.examples.tsx @@ -1,18 +1,9 @@ -import { ArrayDataSource, WithFullConfig } from "@finos/vuu-data"; -import { parseFilter } from "@finos/vuu-filter-parser"; import { Flexbox, View } from "@finos/vuu-layout"; import { Table } from "@finos/vuu-table"; import { DragVisualizer } from "@finos/vuu-table/src/table/DragVisualizer"; import { Checkbox, ToggleButton } from "@salt-ds/core"; -import { - ChangeEvent, - CSSProperties, - useCallback, - useMemo, - useState, -} from "react"; +import { ChangeEvent, CSSProperties, useCallback, useState } from "react"; import { useSchemas, useTableConfig, useTestDataSource } from "../utils"; -import { createArray } from "../utils/data-generators/generate-data-utils"; let displaySequence = 1; @@ -37,7 +28,6 @@ export const DefaultTable = () => { renderBufferSize={100} rowHeight={20} width={700} - zebraStripes={zebraStripes} />
{ ); }; FlexLayoutTables.displaySequence = displaySequence++; - -const columns = [ - { name: "row number", width: 150 }, - { name: "name", width: 100 }, - { name: "currency", width: 100 }, - { name: "price", width: 100, serverDataType: "double" }, - { name: "lot size", width: 100, serverDataType: "double" }, - { name: "order size", width: 100, serverDataType: "double" }, - { name: "order type", width: 100 }, - { name: "order description", width: 100 }, - { name: "order date", width: 100 }, - { name: "account name", width: 100 }, - { name: "account number", width: 100 }, - { name: "department", width: 100 }, - { name: "industry", width: 100 }, - { name: "PE ratio", width: 100, serverDataType: "double" }, - { name: "EPS", width: 100, serverDataType: "double" }, - { name: "market cap", width: 100, serverDataType: "double" }, - { name: "volume", width: 100, serverDataType: "double" }, - { name: "beta", width: 100 }, - { name: "dividend", width: 100, serverDataType: "double" }, - { name: "yield", width: 100, serverDataType: "double" }, - { name: "return on equity", width: 100, serverDataType: "double" }, -]; - -const numofrows = 100000; - -const newArray = createArray(numofrows, columns.length); - -const config = { columns }; -const data = newArray; - -export const SmaTable = () => { - const [inputValue, setInputValue] = useState(""); - const [dataSourceConfig, setDataSourceConfig] = useState({ - groupBy: [], - aggregations: [], - columns: [], - filter: { filter: "" }, - sort: { sortDefs: [] }, - }); - - const dataSource: ArrayDataSource = useMemo(() => { - try { - const dataSource = new ArrayDataSource({ - columnDescriptors: columns, - data, - }); - dataSource.addListener("config", (config, ...rest) => {}); - return dataSource; - //return new ArrayDataSource({ columnDescriptors: columns, data }); - } catch (error) { - return new ArrayDataSource({ columnDescriptors: columns, data }); - } - }, []); - - const handleInputChange = useCallback((event) => { - setInputValue(event.target.value); - }, []); - - const handleOnClickFilter = useCallback(() => { - const filter = inputValue; //'industry = "Bike"' - const filterStruct = parseFilter(filter); - - dataSource.filter = { filter, filterStruct }; - }, [inputValue, dataSource]); - - return ( - <> - - - - - - ); -}; -SmaTable.displaySequence = displaySequence++; diff --git a/vuu-ui/showcase/src/examples/Table/TableList.examples.tsx b/vuu-ui/showcase/src/examples/Table/TableList.examples.tsx index 06d6b0915..de86154c0 100644 --- a/vuu-ui/showcase/src/examples/Table/TableList.examples.tsx +++ b/vuu-ui/showcase/src/examples/Table/TableList.examples.tsx @@ -1,7 +1,7 @@ import { TableNext } from "@finos/vuu-table"; import { ArrayDataSource } from "@finos/vuu-data"; import { useMemo } from "react"; -import { ColumnDescriptor } from "packages/vuu-datagrid-types"; +import { ColumnDescriptor } from "@finos/vuu-datagrid-types"; let displaySequence = 1; diff --git a/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionInput.examples.tsx b/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionInput.examples.tsx index a16f945d6..a26033ef6 100644 --- a/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionInput.examples.tsx +++ b/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionInput.examples.tsx @@ -54,7 +54,7 @@ export const DefaultColumnExpressionInput = () => { }, []); const handleChange: ColumnExpressionInputProps["onChange"] = useCallback( - (source: string, expression: Expression | undefined) => { + (source: string) => { console.log(`source ${source}, expression ${expression}`); // const isValidExpression = isCompleteExpression(source); // console.log(`is valid ${isValidExpression}`); diff --git a/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionPanel.examples.tsx b/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionPanel.examples.tsx index 9c145d67f..27c1a1182 100644 --- a/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionPanel.examples.tsx +++ b/vuu-ui/showcase/src/examples/TableExtras/ColumnExpressionPanel.examples.tsx @@ -1,5 +1,5 @@ import { ColumnExpressionPanel } from "@finos/vuu-table-extras"; -import { ColumnDescriptor } from "packages/vuu-datagrid-types"; +import { ColumnDescriptor } from "@finos/vuu-datagrid-types"; import { useCallback } from "react"; import { useTableConfig } from "../utils"; diff --git a/vuu-ui/showcase/src/examples/TableExtras/ColumnSettings/ColumnSettings.examples.tsx b/vuu-ui/showcase/src/examples/TableExtras/ColumnSettings/ColumnSettings.examples.tsx index 15267e2bc..347934a5f 100644 --- a/vuu-ui/showcase/src/examples/TableExtras/ColumnSettings/ColumnSettings.examples.tsx +++ b/vuu-ui/showcase/src/examples/TableExtras/ColumnSettings/ColumnSettings.examples.tsx @@ -1,7 +1,7 @@ -import { ColumnFormattingPanel } from "@finos/vuu-table-extras"; import { ColumnDescriptor } from "@finos/vuu-datagrid-types"; +import { ColumnFormattingPanel } from "@finos/vuu-table-extras"; +import { CellRendererDescriptor } from "@finos/vuu-utils"; import { useMemo } from "react"; -import { CellRendererDescriptor } from "packages/vuu-utils/src"; let displaySequence = 1; @@ -29,6 +29,8 @@ export const ColumnFormattingPanelDouble = () => { console.log("onChangeFormatting")} + onChangeRenderer={() => console.log("onChangeRenderer")} selectedCellRenderer={availableRenderers[0]} style={{ border: "solid 1px lightgray", diff --git a/vuu-ui/showcase/src/examples/TableExtras/TableSettings/TableSettings.examples.tsx b/vuu-ui/showcase/src/examples/TableExtras/TableSettings/TableSettings.examples.tsx index ecc6157cf..f076b5141 100644 --- a/vuu-ui/showcase/src/examples/TableExtras/TableSettings/TableSettings.examples.tsx +++ b/vuu-ui/showcase/src/examples/TableExtras/TableSettings/TableSettings.examples.tsx @@ -159,7 +159,9 @@ export const DefaultSettingsPanel = () => { return ( console.log("add calculated column")} onConfigChange={handleConfigChange} + onDataSourceConfigChange={() => console.log("data source congig change")} style={{ width: 252 }} tableConfig={tableConfig} /> diff --git a/vuu-ui/showcase/src/examples/UiControls/List.examples.tsx b/vuu-ui/showcase/src/examples/UiControls/List.examples.tsx index 62c1fd919..69b69c7dc 100644 --- a/vuu-ui/showcase/src/examples/UiControls/List.examples.tsx +++ b/vuu-ui/showcase/src/examples/UiControls/List.examples.tsx @@ -418,4 +418,4 @@ export const DefaultSelectedWithinViewport = () => { ); }; -DefaultList.displaySequence = displaySequence++; +DefaultSelectedWithinViewport.displaySequence = displaySequence++; diff --git a/vuu-ui/showcase/src/examples/VuuFeatures/BasketToolbar.examples.tsx b/vuu-ui/showcase/src/examples/VuuFeatures/BasketToolbar.examples.tsx index ea7f20506..7c2d3d370 100644 --- a/vuu-ui/showcase/src/examples/VuuFeatures/BasketToolbar.examples.tsx +++ b/vuu-ui/showcase/src/examples/VuuFeatures/BasketToolbar.examples.tsx @@ -1,5 +1,5 @@ import { BasketToolbar } from "feature-basket-trading"; -import { useCallback, useMemo, useState } from "react"; +import { useMemo, useState } from "react"; import { BasketSelectorProps } from "sample-apps/feature-basket-trading/src/basket-selector"; import { BasketStatus } from "sample-apps/feature-basket-trading/src/VuuBasketTradingFeature"; import { useSchema, useTableConfig } from "../utils"; @@ -31,6 +31,7 @@ export const BasketToolbarDesign = () => { basketId: "001", dataSourceBasket, dataSourceBasketSearch, + onClickAddBasket: () => console.log("Add Basket"), }), [dataSourceBasket, dataSourceBasketSearch] ); @@ -71,6 +72,7 @@ export const BasketToolbarOnMarket = () => { basketId: "001", dataSourceBasket, dataSourceBasketSearch, + onClickAddBasket: () => console.log("Add Basket"), }), [dataSourceBasket, dataSourceBasketSearch] ); diff --git a/vuu-ui/showcase/src/examples/html/HtmlTable.examples.tsx b/vuu-ui/showcase/src/examples/html/HtmlTable.examples.tsx index b8ce86195..adaf20f31 100644 --- a/vuu-ui/showcase/src/examples/html/HtmlTable.examples.tsx +++ b/vuu-ui/showcase/src/examples/html/HtmlTable.examples.tsx @@ -3,7 +3,7 @@ import { Flexbox, useLayoutProviderDispatch } from "@finos/vuu-layout"; import { SetPropsAction } from "@finos/vuu-layout/src/layout-reducer"; import { TableNext } from "@finos/vuu-table"; import { ToggleButton, ToggleButtonGroup } from "@salt-ds/core"; -import { RowProps } from "packages/vuu-table/src/table/TableRow"; +import { RowProps } from "@finos/vuu-table"; import { SyntheticEvent, useCallback, useMemo, useState } from "react"; import { useTableConfig } from "../utils"; import { @@ -366,15 +366,7 @@ export const VuuTableTwentyColumns = () => { rangeChangeRowset: "full", }); - return ( - - ); + return ; }; VuuTableTwentyColumns.displaySequence = displaySequence++; diff --git a/vuu-ui/showcase/src/examples/html/LayoutExperiments.examples.tsx b/vuu-ui/showcase/src/examples/html/LayoutExperiments.examples.tsx index e8ba05f2b..dee955d12 100644 --- a/vuu-ui/showcase/src/examples/html/LayoutExperiments.examples.tsx +++ b/vuu-ui/showcase/src/examples/html/LayoutExperiments.examples.tsx @@ -87,7 +87,6 @@ export const DockLayoutWithTable = () => { data-dock="content" renderBufferSize={100} rowHeight={20} - zebraStripes />
{ const id = useIdMemo(idProp); @@ -124,12 +122,7 @@ export const VuuTable = ({ className={`${classBase}-contentContainer`} ref={scrollProps.contentContainerRef} > -
+
{columns.map((column, i) => { diff --git a/vuu-ui/showcase/src/examples/html/html-table-components/vuu-table/useTable.ts b/vuu-ui/showcase/src/examples/html/html-table-components/vuu-table/useTable.ts index 8d0e9756b..01e078728 100644 --- a/vuu-ui/showcase/src/examples/html/html-table-components/vuu-table/useTable.ts +++ b/vuu-ui/showcase/src/examples/html/html-table-components/vuu-table/useTable.ts @@ -3,13 +3,17 @@ import { VuuFeatureInvocationMessage, VuuFeatureMessage, } from "@finos/vuu-data"; +import { DataSourceRow } from "@finos/vuu-data-types"; import { GridConfig, KeyedColumnDescriptor, SelectionChangeHandler, TableSelectionModel, } from "@finos/vuu-datagrid-types"; +import { useContextMenu as usePopupContextMenu } from "@finos/vuu-popups"; +import { VuuRange, VuuSortType } from "@finos/vuu-protocol-types"; import { + buildContextMenuDescriptors, MeasuredProps, TableColumnResizeHandler, useMeasuredContainer, @@ -18,7 +22,11 @@ import { useTableModel, useTableViewport, } from "@finos/vuu-table"; -import { useContextMenu as usePopupContextMenu } from "@finos/vuu-popups"; +import { + isShowColumnSettings, + isShowTableSettings, + PersistentColumnAction, +} from "@finos/vuu-table/src/table/useTableModel"; import { applySort, buildColumnMap, @@ -29,17 +37,9 @@ import { } from "@finos/vuu-utils"; import { MouseEvent, useCallback, useEffect, useMemo, useState } from "react"; import { useDataSource } from "./useDataSource"; -import { useTableScroll } from "./useTableScroll"; -import { VuuRange, VuuSortType } from "@finos/vuu-protocol-types"; -import { - isShowColumnSettings, - isShowTableSettings, - PersistentColumnAction, -} from "@finos/vuu-table/src/table/useTableModel"; import { useInitialValue } from "./useInitialValue"; +import { useTableScroll } from "./useTableScroll"; import { useVirtualViewport } from "./useVirtualViewport"; -import { buildContextMenuDescriptors } from "@finos/vuu-table"; -import { DataSourceRow } from "packages/vuu-data-types"; const { KEY, IS_EXPANDED } = metadataKeys; diff --git a/vuu-ui/showcase/src/examples/utils/UpdateGenerator.ts b/vuu-ui/showcase/src/examples/utils/UpdateGenerator.ts index 97a95e9c8..cacdc6eb1 100644 --- a/vuu-ui/showcase/src/examples/utils/UpdateGenerator.ts +++ b/vuu-ui/showcase/src/examples/utils/UpdateGenerator.ts @@ -1,7 +1,7 @@ -import { VuuRange } from "packages/vuu-protocol-types"; -import { RowUpdates, UpdateGenerator, UpdateHandler } from "./rowUpdates"; +import { ArrayDataSource } from "@finos/vuu-data"; +import { VuuRange } from "@finos/vuu-protocol-types"; import { random } from "./reference-data"; -import { ArrayDataSource, DataSource } from "@finos/vuu-data"; +import { RowUpdates, UpdateGenerator, UpdateHandler } from "./rowUpdates"; const getNewValue = (value: number) => { const multiplier = random(0, 100) / 1000; diff --git a/vuu-ui/showcase/src/examples/utils/data-generators/generate-data-utils.ts b/vuu-ui/showcase/src/examples/utils/data-generators/generate-data-utils.ts index dbf332474..0cf067d08 100644 --- a/vuu-ui/showcase/src/examples/utils/data-generators/generate-data-utils.ts +++ b/vuu-ui/showcase/src/examples/utils/data-generators/generate-data-utils.ts @@ -1,63 +1,60 @@ import { faker } from "@faker-js/faker"; -import { VuuRowDataItemType } from "packages/vuu-protocol-types"; +import { VuuRowDataItemType } from "@finos/vuu-protocol-types"; -export function createArray( - numofrows: number, - numofcolumns: number - ): VuuRowDataItemType[][] { - const result = []; - - for (let i = 0; i < numofrows; i++) { - let FakerDataGenerator = [ - faker.company.name(), - faker.finance.currencyCode(), - Number(faker.finance.amount({ min: 5, max: 10, dec: 2 })), - faker.finance.amount({ min: 100, max: 2000, dec: 0 }), - faker.finance.transactionType(), - faker.finance.transactionDescription(), - faker.date.anytime().getMilliseconds(), - faker.finance.accountName(), - faker.finance.accountNumber(), - faker.commerce.department(), - faker.commerce.product(), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - faker.finance.amount({ min: 5, max: 10, dec: 2 }), - ]; - result.push([ - i + 1, - FakerDataGenerator[0], - FakerDataGenerator[1], - Number(FakerDataGenerator[2]), - FakerDataGenerator[3] as number, - Number( - Math.floor( - Number(FakerDataGenerator[2]) * Number(FakerDataGenerator[3]) - ) - ), - FakerDataGenerator[4], - FakerDataGenerator[5], - FakerDataGenerator[6], - FakerDataGenerator[7], - FakerDataGenerator[8], - FakerDataGenerator[9], - FakerDataGenerator[10], - FakerDataGenerator[11], - FakerDataGenerator[12], - FakerDataGenerator[13], - FakerDataGenerator[14], - FakerDataGenerator[15], - FakerDataGenerator[16], - FakerDataGenerator[17], - Number(FakerDataGenerator[18]), - ]); - } - - return result; - } \ No newline at end of file +export function createArray(numofrows: number): VuuRowDataItemType[][] { + const result = []; + + for (let i = 0; i < numofrows; i++) { + const FakerDataGenerator = [ + faker.company.name(), + faker.finance.currencyCode(), + Number(faker.finance.amount({ min: 5, max: 10, dec: 2 })), + faker.finance.amount({ min: 100, max: 2000, dec: 0 }), + faker.finance.transactionType(), + faker.finance.transactionDescription(), + faker.date.anytime().getMilliseconds(), + faker.finance.accountName(), + faker.finance.accountNumber(), + faker.commerce.department(), + faker.commerce.product(), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + faker.finance.amount({ min: 5, max: 10, dec: 2 }), + ]; + result.push([ + i + 1, + FakerDataGenerator[0], + FakerDataGenerator[1], + Number(FakerDataGenerator[2]), + FakerDataGenerator[3] as number, + Number( + Math.floor( + Number(FakerDataGenerator[2]) * Number(FakerDataGenerator[3]) + ) + ), + FakerDataGenerator[4], + FakerDataGenerator[5], + FakerDataGenerator[6], + FakerDataGenerator[7], + FakerDataGenerator[8], + FakerDataGenerator[9], + FakerDataGenerator[10], + FakerDataGenerator[11], + FakerDataGenerator[12], + FakerDataGenerator[13], + FakerDataGenerator[14], + FakerDataGenerator[15], + FakerDataGenerator[16], + FakerDataGenerator[17], + Number(FakerDataGenerator[18]), + ]); + } + + return result; +} diff --git a/vuu-ui/showcase/src/examples/utils/rowUpdates.ts b/vuu-ui/showcase/src/examples/utils/rowUpdates.ts index 836ca9c23..d430b0e86 100644 --- a/vuu-ui/showcase/src/examples/utils/rowUpdates.ts +++ b/vuu-ui/showcase/src/examples/utils/rowUpdates.ts @@ -1,5 +1,5 @@ import { VuuRange, VuuRowDataItemType } from "@finos/vuu-protocol-types"; -import { ArrayDataSource } from "packages/vuu-data/src"; +import { ArrayDataSource } from "@finos/vuu-data"; export interface UpdateGenerator { setDataSource: (dataSource: ArrayDataSource) => void; diff --git a/vuu-ui/showcase/src/index.tsx b/vuu-ui/showcase/src/index.tsx index 7bf7af431..6c20866c6 100644 --- a/vuu-ui/showcase/src/index.tsx +++ b/vuu-ui/showcase/src/index.tsx @@ -120,6 +120,7 @@ if (hasUrlParameter("standalone")) { } } else { import("./examples/index") + // A type error will appear here if any story is exported that does not assign displaySequence .then((stories: ExamplesModule) => { import("./AppRoutes") .then(({ AppRoutes }) => { diff --git a/vuu-ui/tsconfig.json b/vuu-ui/tsconfig.json index a1c89ec51..273ea3a6c 100644 --- a/vuu-ui/tsconfig.json +++ b/vuu-ui/tsconfig.json @@ -24,7 +24,28 @@ "sample-apps/*/src", "showcase/src", "sample-apps/*/index.ts", - "sample-apps/*/src" + "sample-apps/*/src", + "global.d.ts" ], - "exclude": ["**/*.cy.*", "**/*.test.*"] + "exclude": ["**/*.cy.*", "**/*.test.*"], + "references": [ + {"path" : "packages/vuu-codemirror"}, + {"path" : "packages/vuu-data"}, + {"path" : "packages/vuu-data-ag-grid"}, + {"path" : "packages/vuu-data-react"}, + {"path" : "packages/vuu-data-types"}, + {"path" : "packages/vuu-datagrid"}, + {"path" : "packages/vuu-datatable"}, + {"path" : "packages/vuu-filter-parser"}, + {"path" : "packages/vuu-filter-types"}, + {"path" : "packages/vuu-filters"}, + {"path" : "packages/vuu-layout"}, + {"path" : "packages/vuu-popups"}, + {"path" : "packages/vuu-protocol-types"}, + {"path" : "packages/vuu-shell"}, + {"path" : "packages/vuu-table"}, + {"path" : "packages/vuu-table-extras"}, + {"path" : "packages/vuu-ui-controls"}, + {"path" : "packages/vuu-utils"} + ] }