@vuu-ui/vuu-data-editing 3.2.0 → 3.3.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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.3.0",
|
|
3
3
|
"description": "Shared data editing APIs and React components for VUU UI",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"author": "heswell",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@salt-ds/core": "1.54.1",
|
|
15
|
-
"@vuu-ui/vuu-ui-controls": "3.
|
|
16
|
-
"@vuu-ui/vuu-utils": "3.
|
|
15
|
+
"@vuu-ui/vuu-ui-controls": "3.3.0",
|
|
16
|
+
"@vuu-ui/vuu-utils": "3.3.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@vuu-ui/vuu-data-types": "3.
|
|
20
|
-
"@vuu-ui/vuu-protocol-types": "3.
|
|
21
|
-
"@vuu-ui/vuu-table-types": "3.
|
|
19
|
+
"@vuu-ui/vuu-data-types": "3.3.0",
|
|
20
|
+
"@vuu-ui/vuu-protocol-types": "3.3.0",
|
|
21
|
+
"@vuu-ui/vuu-table-types": "3.3.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.2.3"
|
package/src/EditSession.js
CHANGED
|
@@ -334,7 +334,7 @@ class EditSession extends EventEmitter {
|
|
|
334
334
|
this.#transitionQueue = result.then(()=>void 0, ()=>void 0);
|
|
335
335
|
return result;
|
|
336
336
|
}
|
|
337
|
-
begin(copyOption = "All") {
|
|
337
|
+
begin(copyOption = "All", sessionType = "edit") {
|
|
338
338
|
return this.#enqueue(async ()=>{
|
|
339
339
|
if ("active" === this.#lifecycle.status || "error" === this.#lifecycle.status && "end" === this.#lifecycle.operation) {
|
|
340
340
|
const sessionDataSource = this.#sessionDataSource;
|
|
@@ -350,7 +350,7 @@ class EditSession extends EventEmitter {
|
|
|
350
350
|
});
|
|
351
351
|
try {
|
|
352
352
|
const sourceDataSource = this.#sourceTableDataSource;
|
|
353
|
-
const sessionDataSource = "beginEditSession" === this.#editSessionApi ? await sourceDataSource?.beginEditSession?.(toEditSessionMode(copyOption)) : await sourceDataSource?.createSessionDataSource?.(copyOption);
|
|
353
|
+
const sessionDataSource = "beginEditSession" === this.#editSessionApi ? await sourceDataSource?.beginEditSession?.(toEditSessionMode(copyOption)) : await sourceDataSource?.createSessionDataSource?.(copyOption, sessionType);
|
|
354
354
|
if (!sessionDataSource) throw new Error(`[EditSession] datasource does not support ${this.#editSessionApi}`);
|
|
355
355
|
this.#sessionDataSource = sessionDataSource;
|
|
356
356
|
this.#setStale(false);
|
package/src/UndoCellRenderer.js
CHANGED
|
@@ -13,7 +13,7 @@ const UndoCellRenderer = ({ column, dataRow })=>{
|
|
|
13
13
|
const editSession = useEditSession();
|
|
14
14
|
const renderer = column.type?.renderer;
|
|
15
15
|
const { icon, text } = getUndoButtonContent(renderer?.componentProps);
|
|
16
|
-
const tooltipContent = getUndoTooltipContent(dataRow.
|
|
16
|
+
const tooltipContent = getUndoTooltipContent(dataRow.vuuAction);
|
|
17
17
|
if (void 0 === tooltipContent) return null;
|
|
18
18
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
19
19
|
content: tooltipContent,
|
package/src/edit-utils.js
CHANGED
|
@@ -4,7 +4,7 @@ const timeFormatter = formatDate({
|
|
|
4
4
|
time: "hh:mm:ss"
|
|
5
5
|
});
|
|
6
6
|
const dataRowEditErrors = Symbol("vuuDataRowEditErrors");
|
|
7
|
-
const isEditRowReadOnly = (dataRow)=>"deleteRow" === dataRow.
|
|
7
|
+
const isEditRowReadOnly = (dataRow)=>"deleteRow" === dataRow.vuuAction;
|
|
8
8
|
const withDataRowEditErrors = (dataRow, errors)=>{
|
|
9
9
|
Object.defineProperty(dataRow, dataRowEditErrors, {
|
|
10
10
|
configurable: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registerComponent } from "@vuu-ui/vuu-utils";
|
|
2
2
|
const EDIT_ACTION_ROW_CLASS_NAME_GENERATOR = "vuu-edit-actions";
|
|
3
3
|
const editActionRowClassNameGenerator = (dataRow)=>{
|
|
4
|
-
switch(dataRow.
|
|
4
|
+
switch(dataRow.vuuAction){
|
|
5
5
|
case "addRow":
|
|
6
6
|
return "vuuTableRow-inserted";
|
|
7
7
|
case "deleteRow":
|
package/types/EditSession.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CopyOption, DataSource, DeleteRowMode, EditApi } from "@vuu-ui/vuu-data-types";
|
|
1
|
+
import type { CopyOption, DataSource, DeleteRowMode, EditApi, SessionType } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import type { RpcResult, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
3
|
import { EventEmitter } from "@vuu-ui/vuu-utils";
|
|
4
4
|
export type EditState = "clean" | "dirty" | "invalid" | "stale";
|
|
@@ -62,7 +62,7 @@ export declare class EditSession extends EventEmitter<EditSessionEvents> {
|
|
|
62
62
|
hasRowChanges(key: string): boolean;
|
|
63
63
|
isCellEdited(key: string, columnName: string): boolean;
|
|
64
64
|
undoRowChange(key: string): Promise<void>;
|
|
65
|
-
begin(copyOption?: CopyOption): Promise<DataSource>;
|
|
65
|
+
begin(copyOption?: CopyOption, sessionType?: SessionType): Promise<DataSource>;
|
|
66
66
|
get dataSource(): EditApi<import("@vuu-ui/vuu-data-types").DataSourceRow<VuuRowDataItemType>> | undefined;
|
|
67
67
|
get sessionDataSource(): DataSource | undefined;
|
|
68
68
|
end(saveChanges?: boolean, force?: boolean): Promise<void>;
|