Skip to content

Commit 75332d6

Browse files
authored
rename DialogProvider to ModalProvider, bump ui version (#1701)
1 parent cd997ca commit 75332d6

File tree

63 files changed

+933
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+933
-757
lines changed

vuu-ui/package-lock.json

Lines changed: 214 additions & 214 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vuu-ui/packages/grid-layout/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@heswell/grid-layout",
3-
"version": "0.13.32",
3+
"version": "0.13.33",
44
"description": "VUU Layout Components",
55
"main": "src/index.ts",
66
"author": "heswell",
@@ -12,7 +12,7 @@
1212
},
1313
"types": "src/index.ts",
1414
"dependencies": {
15-
"@vuu-ui/vuu-utils": "0.13.32",
15+
"@vuu-ui/vuu-utils": "0.13.33",
1616
"@salt-ds/core": "1.43.0",
1717
"@salt-ds/lab": "1.0.0-alpha.64",
1818
"@salt-ds/styles": "0.2.1",

vuu-ui/packages/vuu-codemirror/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-codemirror",
3-
"version": "0.13.32",
3+
"version": "0.13.33",
44
"author": "heswell",
55
"main": "src/index.ts",
66
"license": "Apache-2.0",
@@ -11,15 +11,15 @@
1111
"lezer-generate:column": "lezer-generator --output ./src/column-expression-input/column-language-parser/generated/column-parser.js ./src/column-expression-input/column-language-parser/grammar/column.grammar"
1212
},
1313
"devDependencies": {
14-
"@vuu-ui/vuu-table-types": "0.13.32"
14+
"@vuu-ui/vuu-table-types": "0.13.33"
1515
},
1616
"dependencies": {
1717
"@codemirror/autocomplete": "^6.4.2",
1818
"@codemirror/commands": "^6.2.1",
1919
"@codemirror/language": "^6.6.0",
2020
"@codemirror/state": "^6.2.0",
2121
"@codemirror/view": "^6.9.3",
22-
"@vuu-ui/vuu-utils": "0.13.32",
22+
"@vuu-ui/vuu-utils": "0.13.33",
2323
"@lezer/common": "1.2.3",
2424
"@lezer/highlight": "^1.1.3"
2525
},

vuu-ui/packages/vuu-context-menu/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-context-menu",
3-
"version": "0.13.32",
3+
"version": "0.13.33",
44
"author": "heswell",
55
"main": "src/index.ts",
66
"license": "Apache-2.0",
@@ -10,12 +10,12 @@
1010
"type-defs": "node ../../scripts/build-type-defs.mjs"
1111
},
1212
"devDependencies": {
13-
"@vuu-ui/vuu-data-types": "0.13.32",
14-
"@vuu-ui/vuu-protocol-types": "0.13.32",
15-
"@vuu-ui/vuu-table-types": "0.13.32"
13+
"@vuu-ui/vuu-data-types": "0.13.33",
14+
"@vuu-ui/vuu-protocol-types": "0.13.33",
15+
"@vuu-ui/vuu-table-types": "0.13.33"
1616
},
1717
"dependencies": {
18-
"@vuu-ui/vuu-utils": "0.13.32",
18+
"@vuu-ui/vuu-utils": "0.13.33",
1919
"@salt-ds/core": "1.43.0",
2020
"@salt-ds/styles": "0.2.1",
2121
"@salt-ds/window": "0.1.1"
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-data-local",
3-
"version": "0.13.32",
3+
"version": "0.13.33",
44
"main": "src/index.ts",
55
"author": "heswell",
66
"license": "Apache-2.0",
@@ -11,14 +11,14 @@
1111
"type-defs": "node ../../scripts/build-type-defs.mjs"
1212
},
1313
"devDependencies": {
14-
"@vuu-ui/vuu-data-types": "0.13.32",
15-
"@vuu-ui/vuu-table-types": "0.13.32",
16-
"@vuu-ui/vuu-filter-types": "0.13.32",
17-
"@vuu-ui/vuu-protocol-types": "0.13.32"
14+
"@vuu-ui/vuu-data-types": "0.13.33",
15+
"@vuu-ui/vuu-table-types": "0.13.33",
16+
"@vuu-ui/vuu-filter-types": "0.13.33",
17+
"@vuu-ui/vuu-protocol-types": "0.13.33"
1818
},
1919
"dependencies": {
20-
"@vuu-ui/vuu-filter-parser": "0.13.32",
21-
"@vuu-ui/vuu-utils": "0.13.32"
20+
"@vuu-ui/vuu-filter-parser": "0.13.33",
21+
"@vuu-ui/vuu-utils": "0.13.33"
2222
},
2323
"sideEffects": false
2424
}

vuu-ui/packages/vuu-data-react/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-data-react",
3-
"version": "0.13.32",
3+
"version": "0.13.33",
44
"main": "src/index.ts",
55
"author": "heswell",
66
"license": "Apache-2.0",
@@ -11,21 +11,21 @@
1111
"type-defs": "node ../../scripts/build-type-defs.mjs"
1212
},
1313
"devDependencies": {
14-
"@vuu-ui/vuu-data-types": "0.13.32",
15-
"@vuu-ui/vuu-filter-types": "0.13.32",
16-
"@vuu-ui/vuu-popups": "0.13.32",
17-
"@vuu-ui/vuu-protocol-types": "0.13.32",
18-
"@vuu-ui/vuu-table-types": "0.13.32"
14+
"@vuu-ui/vuu-data-types": "0.13.33",
15+
"@vuu-ui/vuu-filter-types": "0.13.33",
16+
"@vuu-ui/vuu-popups": "0.13.33",
17+
"@vuu-ui/vuu-protocol-types": "0.13.33",
18+
"@vuu-ui/vuu-table-types": "0.13.33"
1919
},
2020
"dependencies": {
21-
"@vuu-ui/vuu-context-menu": "0.13.32",
22-
"@vuu-ui/vuu-data-remote": "0.13.32",
23-
"@vuu-ui/vuu-filter-parser": "0.13.32",
24-
"@vuu-ui/vuu-layout": "0.13.32",
25-
"@vuu-ui/vuu-popups": "0.13.32",
26-
"@vuu-ui/vuu-ui-controls": "0.13.32",
27-
"@vuu-ui/vuu-utils": "0.13.32",
28-
"@vuu-ui/vuu-table": "0.13.32",
21+
"@vuu-ui/vuu-context-menu": "0.13.33",
22+
"@vuu-ui/vuu-data-remote": "0.13.33",
23+
"@vuu-ui/vuu-filter-parser": "0.13.33",
24+
"@vuu-ui/vuu-layout": "0.13.33",
25+
"@vuu-ui/vuu-popups": "0.13.33",
26+
"@vuu-ui/vuu-ui-controls": "0.13.33",
27+
"@vuu-ui/vuu-utils": "0.13.33",
28+
"@vuu-ui/vuu-table": "0.13.33",
2929
"@salt-ds/core": "1.43.0",
3030
"@salt-ds/styles": "0.2.1",
3131
"@salt-ds/window": "0.1.1"

vuu-ui/packages/vuu-data-react/src/data-editing/useEditForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { DataSource, DataValueDescriptor } from "@vuu-ui/vuu-data-types";
2-
import { useDialogContext } from "@vuu-ui/vuu-popups";
32
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
43
import {
54
CommitHandler,
@@ -29,6 +28,7 @@ import {
2928
FormEditState,
3029
buildFormEditState,
3130
} from "./form-edit-state";
31+
import { useModal } from "@vuu-ui/vuu-ui-controls";
3232

3333
export interface EditFormHookProps {
3434
dataSource?: DataSource;
@@ -118,7 +118,7 @@ export const useEditForm = ({
118118
formFieldDescriptors,
119119
onSubmit,
120120
}: EditFormHookProps) => {
121-
const { showDialog, closeDialog } = useDialogContext();
121+
const { showDialog, closeDialog } = useModal();
122122

123123
const currentDataSource = useRef<DataSource>(undefined);
124124
const formFieldsContainerRef = useRef<HTMLDivElement>(null);

vuu-ui/packages/vuu-data-react/src/hooks/useVuuMenuActions.tsx

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TableSchema,
1414
} from "@vuu-ui/vuu-data-types";
1515
import { getFilterPredicate } from "@vuu-ui/vuu-filter-parser";
16-
import { useDialogContext, useNotifications } from "@vuu-ui/vuu-popups";
16+
import { useNotifications } from "@vuu-ui/vuu-popups";
1717
import type {
1818
ClientToServerMenuCellRPC,
1919
ClientToServerMenuRowRPC,
@@ -39,8 +39,10 @@ import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
3939
import {
4040
ColumnMap,
4141
dataSourceRowToDataRowDto,
42+
getLayoutComponent,
4243
hasShowNotificationAction,
4344
isActionMessage,
45+
isCustomComponentActionMessage,
4446
isOpenBulkEditResponse,
4547
isSessionTableActionMessage,
4648
metadataKeys,
@@ -53,6 +55,7 @@ import {
5355
FormFieldDescriptor,
5456
SessionEditingForm,
5557
} from "../session-editing-form";
58+
import { useModal } from "@vuu-ui/vuu-ui-controls";
5659

5760
export interface VuuMenuActionHookResult {
5861
menuBuilder: MenuBuilder<TableMenuLocation, TableContextMenuOptions>;
@@ -349,7 +352,7 @@ export const useVuuMenuActions = ({
349352
[dataSource],
350353
);
351354

352-
const { showDialog, closeDialog } = useDialogContext();
355+
const { showDialog, closeDialog, showPrompt } = useModal();
353356
const showNotification = useNotifications();
354357

355358
const showBulkEditDialog = useCallback(
@@ -380,6 +383,29 @@ export const useVuuMenuActions = ({
380383
[VuuDataSource, closeDialog, showDialog],
381384
);
382385

386+
const showCustomComponentInDialog = useCallback(
387+
(componentId: string, ds: DataSource, table: VuuTable) => {
388+
const sessionDs = new VuuDataSource({
389+
columns: ds.columns,
390+
table,
391+
viewport: table.table,
392+
});
393+
394+
const handleOpenChangePrompt = (open: boolean) => {
395+
if (!open) {
396+
ds.unsubscribe();
397+
}
398+
};
399+
400+
const Component = getLayoutComponent(componentId);
401+
showPrompt(<Component dataSource={sessionDs} />, {
402+
title: "Confirm operation on selected rows",
403+
onOpenChange: handleOpenChangePrompt,
404+
});
405+
},
406+
[VuuDataSource, showPrompt],
407+
);
408+
383409
const showSessionEditingForm = useCallback(
384410
(
385411
ds: DataSource,
@@ -495,6 +521,12 @@ export const useVuuMenuActions = ({
495521
);
496522
} else if (isSessionTableActionMessage(rpcResponse)) {
497523
showSessionEditingForm(dataSource, rpcResponse.action);
524+
} else if (isCustomComponentActionMessage(rpcResponse)) {
525+
showCustomComponentInDialog(
526+
rpcResponse.action.renderComponent,
527+
dataSource,
528+
rpcResponse.action.table,
529+
);
498530
}
499531
}
500532
}
@@ -518,6 +550,7 @@ export const useVuuMenuActions = ({
518550
dataSource,
519551
onRpcResponse,
520552
showBulkEditDialog,
553+
showCustomComponentInDialog,
521554
showNotification,
522555
showSessionEditingForm,
523556
],
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuu-ui/vuu-data-remote",
3-
"version": "0.13.32",
3+
"version": "0.13.33",
44
"main": "src/index.ts",
55
"author": "heswell",
66
"license": "Apache-2.0",
@@ -12,13 +12,13 @@
1212
"type-defs": "node ../../scripts/build-type-defs.mjs"
1313
},
1414
"devDependencies": {
15-
"@vuu-ui/vuu-data-types": "0.13.32",
16-
"@vuu-ui/vuu-table-types": "0.13.32",
17-
"@vuu-ui/vuu-filter-types": "0.13.32",
18-
"@vuu-ui/vuu-protocol-types": "0.13.32"
15+
"@vuu-ui/vuu-data-types": "0.13.33",
16+
"@vuu-ui/vuu-table-types": "0.13.33",
17+
"@vuu-ui/vuu-filter-types": "0.13.33",
18+
"@vuu-ui/vuu-protocol-types": "0.13.33"
1919
},
2020
"dependencies": {
21-
"@vuu-ui/vuu-filter-parser": "0.13.32",
22-
"@vuu-ui/vuu-utils": "0.13.32"
21+
"@vuu-ui/vuu-filter-parser": "0.13.33",
22+
"@vuu-ui/vuu-utils": "0.13.33"
2323
}
2424
}

vuu-ui/packages/vuu-data-remote/src/WebSocketConnection.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { WebSocketProtocol } from "@vuu-ui/vuu-data-types";
22
import { VuuClientMessage, VuuServerMessage } from "@vuu-ui/vuu-protocol-types";
3-
import { DeferredPromise, EventEmitter } from "@vuu-ui/vuu-utils";
3+
import { DeferredPromise, EventEmitter, logger } from "@vuu-ui/vuu-utils";
44

55
export type ConnectingStatus = "connecting" | "reconnecting";
66
export type ConnectedStatus = "connected" | "reconnected";
@@ -27,6 +27,8 @@ export interface WebSocketConnectionState<
2727
connectionStatus: T;
2828
}
2929

30+
const { info } = logger("WebSocketConnection");
31+
3032
const isNotConnecting = (
3133
connectionState: WebSocketConnectionState<InternalConnectionStatus>,
3234
): connectionState is WebSocketConnectionState<ConnectionStatus> =>
@@ -312,10 +314,18 @@ export class WebSocketConnection extends EventEmitter<WebSocketConnectionEvents>
312314

313315
private receive = (evt: MessageEvent) => {
314316
const vuuMessageFromServer = parseWebSocketMessage(evt.data);
317+
if (vuuMessageFromServer.body.type === "CHANGE_VP_RANGE_SUCCESS") {
318+
info?.(`CHANGE_VP_RANGE_SUCCESS<#${vuuMessageFromServer.requestId}>`);
319+
}
315320
this.#callback(vuuMessageFromServer);
316321
};
317322

318323
send = (msg: VuuClientMessage) => {
324+
if (msg.body.type === "CHANGE_VP_RANGE") {
325+
info?.(
326+
`CHANGE_VP_RANGE<#${msg.requestId}> ${msg.body.from}-${msg.body.to}`,
327+
);
328+
}
319329
this.#ws?.send(JSON.stringify(msg));
320330
};
321331

0 commit comments

Comments
 (0)