@vuu-ui/vuu-utils 2.1.4 → 2.1.6
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/cjs/packages/vuu-utils/src/data-editing/DataEditingProvider.js +8 -8
- package/cjs/packages/vuu-utils/src/data-editing/DataEditingProvider.js.map +1 -1
- package/cjs/packages/vuu-utils/src/data-editing/EditButtons.js +3 -3
- package/cjs/packages/vuu-utils/src/data-editing/EditButtons.js.map +1 -1
- package/cjs/packages/vuu-utils/src/data-editing/{EditTracker.js → EditSession.js} +28 -57
- package/cjs/packages/vuu-utils/src/data-editing/EditSession.js.map +1 -0
- package/cjs/packages/vuu-utils/src/data-editing/edit-utils.js +6 -0
- package/cjs/packages/vuu-utils/src/data-editing/edit-utils.js.map +1 -0
- package/cjs/packages/vuu-utils/src/data-editing/useEditableTable.js +36 -39
- package/cjs/packages/vuu-utils/src/data-editing/useEditableTable.js.map +1 -1
- package/cjs/packages/vuu-utils/src/form-utils.js +28 -1
- package/cjs/packages/vuu-utils/src/form-utils.js.map +1 -1
- package/cjs/packages/vuu-utils/src/index.js +8 -5
- package/cjs/packages/vuu-utils/src/index.js.map +1 -1
- package/cjs/packages/vuu-utils/src/protocol-message-utils.js +1 -1
- package/cjs/packages/vuu-utils/src/protocol-message-utils.js.map +1 -1
- package/esm/packages/vuu-utils/src/data-editing/DataEditingProvider.js +8 -8
- package/esm/packages/vuu-utils/src/data-editing/DataEditingProvider.js.map +1 -1
- package/esm/packages/vuu-utils/src/data-editing/EditButtons.js +3 -3
- package/esm/packages/vuu-utils/src/data-editing/EditButtons.js.map +1 -1
- package/esm/packages/vuu-utils/src/data-editing/{EditTracker.js → EditSession.js} +28 -57
- package/esm/packages/vuu-utils/src/data-editing/EditSession.js.map +1 -0
- package/esm/packages/vuu-utils/src/data-editing/edit-utils.js +4 -0
- package/esm/packages/vuu-utils/src/data-editing/edit-utils.js.map +1 -0
- package/esm/packages/vuu-utils/src/data-editing/useEditableTable.js +37 -40
- package/esm/packages/vuu-utils/src/data-editing/useEditableTable.js.map +1 -1
- package/esm/packages/vuu-utils/src/form-utils.js +28 -2
- package/esm/packages/vuu-utils/src/form-utils.js.map +1 -1
- package/esm/packages/vuu-utils/src/index.js +4 -3
- package/esm/packages/vuu-utils/src/index.js.map +1 -1
- package/esm/packages/vuu-utils/src/protocol-message-utils.js +1 -1
- package/esm/packages/vuu-utils/src/protocol-message-utils.js.map +1 -1
- package/package.json +6 -6
- package/types/data-editing/DataEditingProvider.d.ts +5 -5
- package/types/data-editing/EditButtons.d.ts +3 -3
- package/types/data-editing/EditSession.d.ts +24 -0
- package/types/data-editing/edit-utils.d.ts +2 -0
- package/types/data-editing/useEditableTable.d.ts +7 -5
- package/types/form-utils.d.ts +5 -0
- package/types/index.d.ts +3 -2
- package/cjs/packages/vuu-utils/src/data-editing/EditTracker.js.map +0 -1
- package/esm/packages/vuu-utils/src/data-editing/EditTracker.js.map +0 -1
- package/types/data-editing/EditTracker.d.ts +0 -24
|
@@ -4,22 +4,22 @@ import { createContext, useContext } from 'react';
|
|
|
4
4
|
const DataEditingContext = createContext(void 0);
|
|
5
5
|
const DataEditingProvider = ({
|
|
6
6
|
children,
|
|
7
|
-
|
|
7
|
+
editSession
|
|
8
8
|
}) => {
|
|
9
|
-
return /* @__PURE__ */ jsx(DataEditingContext.Provider, { value:
|
|
9
|
+
return /* @__PURE__ */ jsx(DataEditingContext.Provider, { value: editSession, children });
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
11
|
+
function useEditSession(throwIfUnavailable = false) {
|
|
12
|
+
const editSession = useContext(DataEditingContext);
|
|
13
|
+
if (editSession === void 0) {
|
|
14
14
|
if (throwIfUnavailable) {
|
|
15
15
|
throw Error(
|
|
16
|
-
"[
|
|
16
|
+
"[useEditSession] no DataEditingContext in scope. You need to enclose editable component(s) with DataEditingProvider"
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
} else {
|
|
20
|
-
return
|
|
20
|
+
return editSession;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export { DataEditingProvider,
|
|
24
|
+
export { DataEditingProvider, useEditSession };
|
|
25
25
|
//# sourceMappingURL=DataEditingProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataEditingProvider.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/DataEditingProvider.tsx"],"sourcesContent":["import { createContext, ReactNode, useContext } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"DataEditingProvider.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/DataEditingProvider.tsx"],"sourcesContent":["import { createContext, ReactNode, useContext } from \"react\";\nimport { EditSession } from \"./EditSession\";\n\nconst DataEditingContext = createContext<EditSession | undefined>(undefined);\n\nexport const DataEditingProvider = ({\n children,\n editSession,\n}: {\n children: ReactNode;\n editSession: EditSession;\n}) => {\n return (\n <DataEditingContext.Provider value={editSession}>\n {children}\n </DataEditingContext.Provider>\n );\n};\n\nexport function useEditSession(\n throwIfUnavailable?: false,\n): EditSession | undefined;\nexport function useEditSession(throwIfUnavailable: true): EditSession;\nexport function useEditSession(throwIfUnavailable = false) {\n const editSession = useContext(DataEditingContext);\n if (editSession === undefined) {\n if (throwIfUnavailable) {\n throw Error(\n \"[useEditSession] no DataEditingContext in scope. You need to enclose editable component(s) with DataEditingProvider\",\n );\n }\n } else {\n return editSession;\n }\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,kBAAA,GAAqB,cAAuC,KAAS,CAAA,CAAA;AAEpE,MAAM,sBAAsB,CAAC;AAAA,EAClC,QAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EAAA,2BACG,kBAAmB,CAAA,QAAA,EAAnB,EAA4B,KAAA,EAAO,aACjC,QACH,EAAA,CAAA;AAEJ;AAMgB,SAAA,cAAA,CAAe,qBAAqB,KAAO,EAAA;AACzD,EAAM,MAAA,WAAA,GAAc,WAAW,kBAAkB,CAAA;AACjD,EAAA,IAAI,gBAAgB,KAAW,CAAA,EAAA;AAC7B,IAAA,IAAI,kBAAoB,EAAA;AACtB,MAAM,MAAA,KAAA;AAAA,QACJ;AAAA,OACF;AAAA;AACF,GACK,MAAA;AACL,IAAO,OAAA,WAAA;AAAA;AAEX;;;;"}
|
|
@@ -3,14 +3,14 @@ import { Button } from '@salt-ds/core';
|
|
|
3
3
|
import { useState, useMemo } from 'react';
|
|
4
4
|
|
|
5
5
|
const EditButtons = ({
|
|
6
|
-
|
|
6
|
+
editSession,
|
|
7
7
|
onCancel,
|
|
8
8
|
onSave
|
|
9
9
|
}) => {
|
|
10
10
|
const [editState, setEditState] = useState("clean");
|
|
11
11
|
useMemo(() => {
|
|
12
|
-
|
|
13
|
-
}, [
|
|
12
|
+
editSession?.on("editState", setEditState);
|
|
13
|
+
}, [editSession]);
|
|
14
14
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
15
|
/* @__PURE__ */ jsx(
|
|
16
16
|
Button,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditButtons.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/EditButtons.tsx"],"sourcesContent":["import { Button } from \"@salt-ds/core\";\nimport { EditState,
|
|
1
|
+
{"version":3,"file":"EditButtons.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/EditButtons.tsx"],"sourcesContent":["import { Button } from \"@salt-ds/core\";\nimport { EditState, EditSession } from \"./EditSession\";\nimport { useMemo, useState } from \"react\";\n\nexport interface EditButtonProps {\n editSession?: EditSession;\n onCancel: () => void;\n onSave: () => void;\n}\n\nexport const EditButtons = ({\n editSession,\n onCancel,\n onSave,\n}: EditButtonProps) => {\n const [editState, setEditState] = useState<EditState>(\"clean\");\n\n useMemo(() => {\n editSession?.on(\"editState\", setEditState);\n }, [editSession]);\n\n return (\n <>\n <Button\n disabled={editState === \"clean\"}\n onClick={onSave}\n sentiment=\"accented\"\n >\n Save\n </Button>\n <Button onClick={onCancel}>Cancel</Button>\n </>\n );\n};\n"],"names":[],"mappings":";;;;AAUO,MAAM,cAAc,CAAC;AAAA,EAC1B,WAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAuB,KAAA;AACrB,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAoB,OAAO,CAAA;AAE7D,EAAA,OAAA,CAAQ,MAAM;AACZ,IAAa,WAAA,EAAA,EAAA,CAAG,aAAa,YAAY,CAAA;AAAA,GAC3C,EAAG,CAAC,WAAW,CAAC,CAAA;AAEhB,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,UAAU,SAAc,KAAA,OAAA;AAAA,QACxB,OAAS,EAAA,MAAA;AAAA,QACT,SAAU,EAAA,UAAA;AAAA,QACX,QAAA,EAAA;AAAA;AAAA,KAED;AAAA,oBACC,GAAA,CAAA,MAAA,EAAA,EAAO,OAAS,EAAA,QAAA,EAAU,QAAM,EAAA,QAAA,EAAA;AAAA,GACnC,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EventEmitter } from '../event-emitter.js';
|
|
2
|
-
import { isRpcSuccess } from '../protocol-message-utils.js';
|
|
3
2
|
|
|
4
3
|
var __typeError = (msg) => {
|
|
5
4
|
throw TypeError(msg);
|
|
@@ -8,18 +7,20 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
8
7
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
8
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
9
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
11
|
-
var _active, _rowEdits, _editCount,
|
|
12
|
-
class
|
|
13
|
-
constructor() {
|
|
14
|
-
super(
|
|
10
|
+
var _active, _rowEdits, _editCount, _sourceTableDataSource, _sessionDataSource, _inEditMode;
|
|
11
|
+
class EditSession extends EventEmitter {
|
|
12
|
+
constructor(dataSource) {
|
|
13
|
+
super();
|
|
15
14
|
__privateAdd(this, _active, false);
|
|
16
15
|
/**
|
|
17
16
|
* Row key => row edits
|
|
18
17
|
*/
|
|
19
18
|
__privateAdd(this, _rowEdits, /* @__PURE__ */ new Map());
|
|
20
19
|
__privateAdd(this, _editCount, 0);
|
|
21
|
-
__privateAdd(this,
|
|
20
|
+
__privateAdd(this, _sourceTableDataSource);
|
|
21
|
+
__privateAdd(this, _sessionDataSource);
|
|
22
22
|
__privateAdd(this, _inEditMode, false);
|
|
23
|
+
__privateSet(this, _sourceTableDataSource, dataSource);
|
|
23
24
|
}
|
|
24
25
|
get active() {
|
|
25
26
|
return __privateGet(this, _active);
|
|
@@ -41,26 +42,22 @@ class EditTracker extends EventEmitter {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
set dataSource(ds) {
|
|
45
|
-
__privateSet(this, _dataSource, ds);
|
|
46
|
-
}
|
|
47
45
|
clear() {
|
|
48
46
|
__privateGet(this, _rowEdits).clear();
|
|
49
47
|
__privateSet(this, _editCount, 0);
|
|
50
48
|
}
|
|
51
|
-
async
|
|
49
|
+
async begin(editSessionMode) {
|
|
52
50
|
__privateSet(this, _inEditMode, true);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
51
|
+
const sessionDataSource = await __privateGet(this, _sourceTableDataSource)?.beginEditSession?.(editSessionMode);
|
|
52
|
+
__privateSet(this, _sessionDataSource, sessionDataSource);
|
|
53
|
+
return sessionDataSource;
|
|
54
|
+
}
|
|
55
|
+
get dataSource() {
|
|
56
|
+
return __privateGet(this, _sessionDataSource) ?? __privateGet(this, _sourceTableDataSource);
|
|
57
|
+
}
|
|
58
|
+
async end(saveChanges = false) {
|
|
59
|
+
await this.dataSource?.endEditSession?.(saveChanges);
|
|
60
|
+
this.clear();
|
|
64
61
|
}
|
|
65
62
|
get inEditMode() {
|
|
66
63
|
return __privateGet(this, _inEditMode);
|
|
@@ -68,24 +65,6 @@ class EditTracker extends EventEmitter {
|
|
|
68
65
|
get editState() {
|
|
69
66
|
return this.editCount === 0 ? "clean" : "dirty";
|
|
70
67
|
}
|
|
71
|
-
async cancelChanges() {
|
|
72
|
-
const rpcResponse = await __privateGet(this, _dataSource)?.rpcRequest?.({
|
|
73
|
-
type: "RPC_REQUEST",
|
|
74
|
-
rpcName: "EXIT_EDIT_MODE",
|
|
75
|
-
params: {}
|
|
76
|
-
});
|
|
77
|
-
this.clear();
|
|
78
|
-
return rpcResponse;
|
|
79
|
-
}
|
|
80
|
-
async saveChanges() {
|
|
81
|
-
const rpcResponse = await __privateGet(this, _dataSource)?.rpcRequest?.({
|
|
82
|
-
type: "RPC_REQUEST",
|
|
83
|
-
rpcName: "EXIT_EDIT_MODE",
|
|
84
|
-
params: { save: true }
|
|
85
|
-
});
|
|
86
|
-
this.clear();
|
|
87
|
-
return rpcResponse;
|
|
88
|
-
}
|
|
89
68
|
// TODO how do we deal with the '_edited' pattern
|
|
90
69
|
edit(key, columnName, originalValue, newValue) {
|
|
91
70
|
const rowEditDetails = __privateGet(this, _rowEdits).get(key);
|
|
@@ -119,26 +98,17 @@ class EditTracker extends EventEmitter {
|
|
|
119
98
|
this.editCount = __privateGet(this, _editCount) + 1;
|
|
120
99
|
}
|
|
121
100
|
}
|
|
122
|
-
|
|
123
|
-
// for edit. Thids caters for boolean values, dropdown list etc
|
|
124
|
-
// that have no intermediate edit phase
|
|
125
|
-
async commit(key, columnName) {
|
|
101
|
+
async commit(key, columnName, typedValue) {
|
|
126
102
|
const rowEditDetails = __privateGet(this, _rowEdits).get(key);
|
|
127
103
|
if (rowEditDetails) {
|
|
128
104
|
const { cellEdits } = rowEditDetails;
|
|
129
105
|
const cellEditValues = cellEdits.get(columnName);
|
|
130
106
|
if (cellEditValues) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
column: columnName,
|
|
137
|
-
data: editedValue,
|
|
138
|
-
key
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return rpcResponse;
|
|
107
|
+
try {
|
|
108
|
+
this.dataSource?.editCell?.(key, columnName, typedValue);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
console.error(e);
|
|
111
|
+
}
|
|
142
112
|
}
|
|
143
113
|
} else {
|
|
144
114
|
return {
|
|
@@ -151,8 +121,9 @@ class EditTracker extends EventEmitter {
|
|
|
151
121
|
_active = new WeakMap();
|
|
152
122
|
_rowEdits = new WeakMap();
|
|
153
123
|
_editCount = new WeakMap();
|
|
154
|
-
|
|
124
|
+
_sourceTableDataSource = new WeakMap();
|
|
125
|
+
_sessionDataSource = new WeakMap();
|
|
155
126
|
_inEditMode = new WeakMap();
|
|
156
127
|
|
|
157
|
-
export {
|
|
158
|
-
//# sourceMappingURL=
|
|
128
|
+
export { EditSession };
|
|
129
|
+
//# sourceMappingURL=EditSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditSession.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/EditSession.tsx"],"sourcesContent":["import { DataSource, EditSessionMode } from \"@vuu-ui/vuu-data-types\";\nimport type {\n RpcResultError,\n VuuRowDataItemType,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { EventEmitter } from \"../event-emitter\";\n\nexport type EditState = \"clean\" | \"dirty\";\n\ntype CellEdit = {\n originalValue: VuuRowDataItemType;\n editedValue: VuuRowDataItemType;\n};\n\ntype RowEditDetails = {\n /**\n * Column name => cell edit details\n */\n cellEdits: Map<string, CellEdit>;\n};\n\ntype EditSessionEvents = {\n editState: (editState: EditState) => void;\n};\n\nexport class EditSession extends EventEmitter<EditSessionEvents> {\n #active = false;\n /**\n * Row key => row edits\n */\n #rowEdits = new Map<string, RowEditDetails>();\n #editCount = 0;\n #sourceTableDataSource?: DataSource;\n #sessionDataSource?: DataSource;\n #inEditMode = false;\n\n constructor(dataSource: DataSource) {\n super();\n this.#sourceTableDataSource = dataSource;\n }\n\n get active() {\n return this.#active;\n }\n set active(isActive: boolean) {\n this.#active = isActive;\n }\n get editCount() {\n return this.#editCount;\n }\n\n set editCount(val: number) {\n if (val !== this.#editCount) {\n const oldCount = this.#editCount;\n this.#editCount = val;\n if (val === 0) {\n this.emit(\"editState\", \"clean\");\n } else if (oldCount === 0) {\n this.emit(\"editState\", \"dirty\");\n }\n }\n }\n\n clear() {\n this.#rowEdits.clear();\n this.#editCount = 0;\n }\n\n async begin(editSessionMode?: EditSessionMode) {\n this.#inEditMode = true;\n\n const sessionDataSource =\n await this.#sourceTableDataSource?.beginEditSession?.(editSessionMode);\n\n this.#sessionDataSource = sessionDataSource;\n\n return sessionDataSource;\n }\n\n get dataSource() {\n return this.#sessionDataSource ?? this.#sourceTableDataSource;\n }\n\n async end(saveChanges = false) {\n await this.dataSource?.endEditSession?.(saveChanges);\n this.clear();\n }\n\n get inEditMode() {\n return this.#inEditMode;\n }\n\n get editState(): EditState {\n return this.editCount === 0 ? \"clean\" : \"dirty\";\n }\n\n // TODO how do we deal with the '_edited' pattern\n edit(\n key: string,\n columnName: string,\n originalValue: VuuRowDataItemType,\n newValue: VuuRowDataItemType,\n ) {\n const rowEditDetails = this.#rowEdits.get(key);\n if (rowEditDetails) {\n const { cellEdits } = rowEditDetails;\n const cellEdit = cellEdits.get(columnName);\n if (cellEdit) {\n if (newValue === cellEdit.originalValue) {\n if (cellEdits.size === 1) {\n this.#rowEdits.delete(key);\n } else {\n // re-editing a cell had removed the edit\n cellEdits.delete(columnName);\n }\n this.editCount = this.#editCount - 1;\n } else {\n cellEdit.editedValue = newValue;\n }\n } else {\n // row has already been edited, but this column has not\n cellEdits.set(columnName, {\n originalValue,\n editedValue: newValue,\n });\n this.editCount = this.#editCount + 1;\n }\n } else {\n this.#rowEdits.set(key, {\n cellEdits: new Map([\n [columnName, { originalValue, editedValue: newValue }],\n ]),\n });\n this.editCount = this.#editCount + 1;\n }\n }\n\n async commit(\n key: string,\n columnName: string,\n typedValue: string | number | boolean,\n ) {\n const rowEditDetails = this.#rowEdits.get(key);\n if (rowEditDetails) {\n const { cellEdits } = rowEditDetails;\n const cellEditValues = cellEdits.get(columnName);\n if (cellEditValues) {\n try {\n this.dataSource?.editCell?.(key, columnName, typedValue);\n } catch (e) {\n // ??\n console.error(e);\n }\n }\n } else {\n return {\n errorMessage: \"CHANGE_REVERTED\",\n type: \"ERROR_RESULT\",\n } as RpcResultError;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,OAAA,EAAA,SAAA,EAAA,UAAA,EAAA,sBAAA,EAAA,kBAAA,EAAA,WAAA;AAyBO,MAAM,oBAAoB,YAAgC,CAAA;AAAA,EAW/D,YAAY,UAAwB,EAAA;AAClC,IAAM,KAAA,EAAA;AAXR,IAAU,YAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA;AAIV;AAAA;AAAA;AAAA,IAAA,YAAA,CAAA,IAAA,EAAA,SAAA,sBAAgB,GAA4B,EAAA,CAAA;AAC5C,IAAa,YAAA,CAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AACb,IAAA,YAAA,CAAA,IAAA,EAAA,sBAAA,CAAA;AACA,IAAA,YAAA,CAAA,IAAA,EAAA,kBAAA,CAAA;AACA,IAAc,YAAA,CAAA,IAAA,EAAA,WAAA,EAAA,KAAA,CAAA;AAIZ,IAAA,YAAA,CAAA,IAAA,EAAK,sBAAyB,EAAA,UAAA,CAAA;AAAA;AAChC,EAEA,IAAI,MAAS,GAAA;AACX,IAAA,OA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packages/vuu-utils/src/data-editing/edit-utils.ts"],"sourcesContent":["import { EditSessionMode, InlineEditSessionMode } from \"@vuu-ui/vuu-data-types\";\n\nexport const isInlineEditingSession = (\n editSessionMode: EditSessionMode,\n): editSessionMode is InlineEditSessionMode =>\n editSessionMode === \"inline-all-rows\";\n"],"names":[],"mappings":"AAEa,MAAA,sBAAA,GAAyB,CACpC,eAAA,KAEA,eAAoB,KAAA;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useState,
|
|
2
|
-
import { EditTracker } from './EditTracker.js';
|
|
1
|
+
import { useState, useMemo, useCallback } from 'react';
|
|
3
2
|
import { useData } from '../context-definitions/DataProvider.js';
|
|
4
|
-
import { isRpcSuccess } from '../protocol-message-utils.js';
|
|
5
3
|
import { useLayoutEffectSkipFirst } from '../useLayoutEffectSkipFirst.js';
|
|
4
|
+
import { EditSession } from './EditSession.js';
|
|
6
5
|
|
|
7
6
|
const useEditableTable = ({
|
|
8
7
|
columns,
|
|
9
8
|
dataSource: dataSourceProp,
|
|
9
|
+
editSessionMode = "all-rows",
|
|
10
10
|
isEditMode,
|
|
11
11
|
onCancel,
|
|
12
12
|
onSave,
|
|
@@ -14,59 +14,56 @@ const useEditableTable = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
const { VuuDataSource } = useData();
|
|
16
16
|
const [sessionDataSource, setSessionDataSource] = useState(void 0);
|
|
17
|
-
const clearSessionDataSource = useCallback(() => {
|
|
18
|
-
setSessionDataSource((dataSource2) => {
|
|
19
|
-
dataSource2?.unsubscribe();
|
|
20
|
-
return void 0;
|
|
21
|
-
});
|
|
22
|
-
}, []);
|
|
23
17
|
useLayoutEffectSkipFirst(() => {
|
|
24
18
|
console.warn(`[useEditableTable] columns and or table changed`);
|
|
25
19
|
}, [columns, table]);
|
|
26
20
|
const dataSource = useMemo(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
if (dataSourceProp) {
|
|
22
|
+
return dataSourceProp;
|
|
23
|
+
} else if (table) {
|
|
24
|
+
return new VuuDataSource({ columns, table });
|
|
25
|
+
} else {
|
|
26
|
+
throw Error(
|
|
27
|
+
`useEditableTable unable to provide DataSource, neither dataSource nor table available as props`
|
|
28
|
+
);
|
|
33
29
|
}
|
|
34
|
-
}, [
|
|
30
|
+
}, [VuuDataSource, columns, dataSourceProp, table]);
|
|
31
|
+
const editSession = useMemo(() => new EditSession(dataSource), [dataSource]);
|
|
35
32
|
const handleCancel = useCallback(() => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
try {
|
|
34
|
+
editSession.end();
|
|
35
|
+
onCancel();
|
|
36
|
+
} catch (e) {
|
|
37
|
+
}
|
|
38
|
+
}, [editSession, onCancel]);
|
|
41
39
|
const handleSave = useCallback(async () => {
|
|
42
40
|
dataSource.resume?.();
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
try {
|
|
42
|
+
await editSession.end(true);
|
|
45
43
|
onSave();
|
|
46
|
-
|
|
44
|
+
} catch (e) {
|
|
47
45
|
}
|
|
48
|
-
}, [
|
|
46
|
+
}, [dataSource, editSession, onSave]);
|
|
49
47
|
useMemo(async () => {
|
|
48
|
+
console.log(`[useEditableTable] editMode ${isEditMode}`);
|
|
50
49
|
if (isEditMode) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
setSessionDataSource(sessionDataSource2);
|
|
60
|
-
editTracker.dataSource = sessionDataSource2;
|
|
50
|
+
try {
|
|
51
|
+
const sessionDataSource2 = await editSession.begin(editSessionMode);
|
|
52
|
+
if (sessionDataSource2) {
|
|
53
|
+
setSessionDataSource(sessionDataSource2);
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.error(e);
|
|
57
|
+
onCancel();
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
|
-
}, [
|
|
60
|
+
}, [editSession, editSessionMode, isEditMode, onCancel]);
|
|
64
61
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
editTracker,
|
|
62
|
+
dataSource,
|
|
63
|
+
editSession,
|
|
68
64
|
onCancel: handleCancel,
|
|
69
|
-
onSave: handleSave
|
|
65
|
+
onSave: handleSave,
|
|
66
|
+
sessionDataSource
|
|
70
67
|
};
|
|
71
68
|
};
|
|
72
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditableTable.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/useEditableTable.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useEditableTable.js","sources":["../../../../../../../packages/vuu-utils/src/data-editing/useEditableTable.ts"],"sourcesContent":["import { DataSource, EditSessionMode } from \"@vuu-ui/vuu-data-types\";\n// import { useNotifications } from \"@vuu-ui/vuu-notifications\";\nimport { VuuTable } from \"@vuu-ui/vuu-protocol-types\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { useData } from \"../context-definitions/DataProvider\";\nimport { useLayoutEffectSkipFirst } from \"../useLayoutEffectSkipFirst\";\nimport { EditSession } from \"./EditSession\";\n// import { useNotifications } from \"@vuu-ui/vuu-notifications\";\n\nexport type EditMode = \"edit\" | \"view\";\n\nexport interface EditableTableHookProps {\n /**\n * columns to be included in subscription. If not provided,\n * default will be '*'. Ignored if dataSource prop present.\n */\n columns?: string[];\n dataSource?: DataSource;\n editSessionMode?: EditSessionMode;\n isEditMode: boolean;\n onCancel: () => void;\n onSave: () => void;\n /**\n * If dataSource not provided, new DataSource\n * will be created using table and columns\n */\n table?: VuuTable;\n}\n\nexport const useEditableTable = ({\n columns,\n dataSource: dataSourceProp,\n editSessionMode = \"all-rows\",\n isEditMode,\n onCancel,\n onSave,\n table,\n}: EditableTableHookProps) => {\n const { VuuDataSource } = useData();\n const [sessionDataSource, setSessionDataSource] = useState<\n DataSource | undefined\n >(undefined);\n // const { showNotification } = useNotifications();\n useLayoutEffectSkipFirst(() => {\n console.warn(`[useEditableTable] columns and or table changed`);\n }, [columns, table]);\n\n const dataSource = useMemo(() => {\n // The dataSource would normally be managed by client and passed in, but for\n // simple use cases we can create it here.\n if (dataSourceProp) {\n return dataSourceProp;\n } else if (table) {\n return new VuuDataSource({ columns, table });\n } else {\n throw Error(\n `useEditableTable unable to provide DataSource, neither dataSource nor table available as props`,\n );\n }\n }, [VuuDataSource, columns, dataSourceProp, table]);\n\n // The editSession will be made available to all the edit controls in scope by\n // wrapping the edit component with a DataEditingProvider.\n const editSession = useMemo(() => new EditSession(dataSource), [dataSource]);\n\n const handleCancel = useCallback(() => {\n // editTracker.dataSource = dataSource;\n try {\n editSession.end();\n onCancel();\n } catch (e) {\n //\n }\n }, [editSession, onCancel]);\n\n const handleSave = useCallback(async () => {\n dataSource.resume?.();\n try {\n await editSession.end(true);\n onSave();\n } catch (e) {\n // cleanup\n }\n }, [dataSource, editSession, onSave]);\n\n useMemo(async () => {\n console.log(`[useEditableTable] editMode ${isEditMode}`);\n if (isEditMode) {\n try {\n const sessionDataSource = await editSession.begin(editSessionMode);\n if (sessionDataSource) {\n setSessionDataSource(sessionDataSource);\n }\n } catch (e) {\n console.error(e);\n // deal with error\n // showNotification?.({\n // header: \"Error unable to edit\",\n // status: \"error\",\n // type: \"toast\",\n // });\n onCancel();\n }\n }\n }, [editSession, editSessionMode, isEditMode, onCancel]);\n\n return {\n dataSource,\n editSession,\n onCancel: handleCancel,\n onSave: handleSave,\n sessionDataSource,\n };\n};\n"],"names":["sessionDataSource"],"mappings":";;;;;AA6BO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,OAAA;AAAA,EACA,UAAY,EAAA,cAAA;AAAA,EACZ,eAAkB,GAAA,UAAA;AAAA,EAClB,UAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAA8B,KAAA;AAC5B,EAAM,MAAA,EAAE,aAAc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,CAAI,CAA+B,4BAAA,EAAA,UAAU,CAAE,CAAA,CAAA;AACvD,IAAA,IAAI,UAAY,EAAA;AACd,MAAI,IAAA;AACF,QAAA,MAAMA,kBAAoB,GAAA,MAAM,WAAY,CAAA,KAAA,CAAM,eAAe,CAAA;AACjE,QAAA,IAAIA,kBAAmB,EAAA;AACrB,UAAA,oBAAA,CAAqBA,kBAAiB,CAAA;AAAA;AACxC,eACO,CAAG,EAAA;AACV,QAAA,OAAA,CAAQ,MAAM,CAAC,CAAA;AAOf,QAAS,QAAA,EAAA;AAAA;AACX;AACF,KACC,CAAC,WAAA,EAAa,eAAiB,EAAA,UAAA,EAAY,QAAQ,CAAC,CAAA;AAEvD,EAAO,OAAA;AAAA,IACL,UAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAU,EAAA,YAAA;AAAA,IACV,MAAQ,EAAA,UAAA;AAAA,IACR;AAAA,GACF;AACF;;;;"}
|
|
@@ -5,6 +5,18 @@ import '@internationalized/date';
|
|
|
5
5
|
import { queryClosest } from './html-utils.js';
|
|
6
6
|
import { ScaledDecimal8, ScaledDecimal6, ScaledDecimal4, ScaledDecimal2 } from './ScaledDecimal.js';
|
|
7
7
|
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
11
|
+
class DataValidationError extends Error {
|
|
12
|
+
constructor(message, expectedType, actualType) {
|
|
13
|
+
super(message);
|
|
14
|
+
__publicField(this, "actualType");
|
|
15
|
+
__publicField(this, "expectedType");
|
|
16
|
+
this.actualType = actualType;
|
|
17
|
+
this.expectedType = expectedType;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
8
20
|
const getFieldName = (target) => {
|
|
9
21
|
const saltFormField = queryClosest(target, "[data-field]");
|
|
10
22
|
const fieldName = saltFormField?.dataset.field;
|
|
@@ -27,6 +39,16 @@ function getTypedRange([value1, value2], dataType, options) {
|
|
|
27
39
|
getTypedValue(value2, dataType, false, options)
|
|
28
40
|
];
|
|
29
41
|
}
|
|
42
|
+
const getActualType = (value) => {
|
|
43
|
+
if (typeof value === "boolean") {
|
|
44
|
+
return "boolean";
|
|
45
|
+
} else if (typeof value === "number") {
|
|
46
|
+
return "number";
|
|
47
|
+
} else if (typeof value === "string") {
|
|
48
|
+
return "string";
|
|
49
|
+
}
|
|
50
|
+
return "string";
|
|
51
|
+
};
|
|
30
52
|
function getTypedValue(value, type, throwIfInvalid = false, options) {
|
|
31
53
|
switch (type) {
|
|
32
54
|
case "int":
|
|
@@ -54,7 +76,11 @@ function getTypedValue(value, type, throwIfInvalid = false, options) {
|
|
|
54
76
|
if (stringIsValidDecimal(value)) {
|
|
55
77
|
return parseFloat(value);
|
|
56
78
|
} else if (throwIfInvalid) {
|
|
57
|
-
throw
|
|
79
|
+
throw new DataValidationError(
|
|
80
|
+
`value ${value} is not a valid ${type}`,
|
|
81
|
+
"decimal",
|
|
82
|
+
getActualType(value)
|
|
83
|
+
);
|
|
58
84
|
} else {
|
|
59
85
|
return void 0;
|
|
60
86
|
}
|
|
@@ -80,5 +106,5 @@ function getTypedValue(value, type, throwIfInvalid = false, options) {
|
|
|
80
106
|
}
|
|
81
107
|
}
|
|
82
108
|
|
|
83
|
-
export { getFieldName, getTypedRange, getTypedValue, isNumber, isValidRange };
|
|
109
|
+
export { DataValidationError, getFieldName, getTypedRange, getTypedValue, isNumber, isValidRange };
|
|
84
110
|
//# sourceMappingURL=form-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-utils.js","sources":["../../../../../../packages/vuu-utils/src/form-utils.ts"],"sourcesContent":["import { DataValueTypeSimple } from \"@vuu-ui/vuu-data-types\";\nimport {\n VuuColumnDataType,\n VuuRowDataItemType,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { KeyboardEvent, SyntheticEvent } from \"react\";\nimport { stringIsValidDecimal, stringIsValidInt } from \"./data-utils\";\nimport { isValidTimeString, Time } from \"./date\";\nimport { queryClosest } from \"./html-utils\";\nimport { ExtendedFilterOptions } from \"@vuu-ui/vuu-filter-types\";\nimport {\n type ScaledDecimal,\n ScaledDecimal2,\n ScaledDecimal4,\n ScaledDecimal6,\n ScaledDecimal8,\n} from \"./ScaledDecimal\";\n\n/**\n * Use with the following convention:\n *\n * <FormField data-field=\"my-field-name\">\n */\nexport const getFieldName = (target: EventTarget | HTMLElement): string => {\n const saltFormField = queryClosest(target, \"[data-field]\") as HTMLElement;\n const fieldName = saltFormField?.dataset.field;\n if (fieldName) {\n return fieldName;\n } else {\n throw Error(\"named form field not found\");\n }\n};\n\nexport type InputSource = \"typeahead-suggestion\" | \"text-input\";\n\nexport const isNumber = (\n type: string,\n value: VuuRowDataItemType,\n): value is number => type === \"number\";\n\nexport type CommitHandler<\n E extends HTMLElement = HTMLInputElement,\n T = VuuRowDataItemType,\n> = (\n evt: SyntheticEvent<E> | KeyboardEvent<E>,\n value: T,\n source?: InputSource,\n) => void;\n\nexport const isValidRange = <T>([val1, val2]: [T, T]) => {\n if (isValidTimeString(val1) && isValidTimeString(val2)) {\n return val2 > val1;\n }\n return true;\n};\n\n/**\n * Convert a pair of string values to the type appropriate for the\n * associated column or form field. Can be used when processing a string value\n * from an input used for user editing.\n *\n */\nexport function getTypedRange(\n [value1, value2]: [string, string],\n dataType: VuuColumnDataType | DataValueTypeSimple,\n options?: ExtendedFilterOptions,\n) {\n return [\n getTypedValue(value1, dataType, false, options),\n getTypedValue(value2, dataType, false, options),\n ];\n}\n\n/**\n * Convert a string value to the type appropriate for the associated\n * column or form field. Can be used when processing a string value\n * from an input used for user editing.\n *\n * @param value\n * @param type\n * @param throwIfInvalid\n */\nexport function getTypedValue(\n value: string,\n type: VuuColumnDataType | DataValueTypeSimple,\n throwIfInvalid?: false,\n options?: ExtendedFilterOptions,\n): VuuRowDataItemType | undefined;\nexport function getTypedValue(\n value: string,\n type: VuuColumnDataType | DataValueTypeSimple,\n throwIfInvalid: true,\n options?: ExtendedFilterOptions,\n): VuuRowDataItemType;\nexport function getTypedValue(\n value: string,\n type: VuuColumnDataType | DataValueTypeSimple,\n throwIfInvalid = false,\n options?: ExtendedFilterOptions,\n): VuuRowDataItemType | ScaledDecimal | undefined {\n switch (type) {\n case \"int\":\n case \"long\": {\n if (stringIsValidInt(value)) {\n return parseInt(value, 10);\n } else if (isValidTimeString(value)) {\n //TOCHECK\n return value;\n } else if (throwIfInvalid) {\n throw Error(`value ${value} is not a valid ${type}`);\n } else {\n return undefined;\n }\n }\n\n case \"scaleddecimal2\":\n return ScaledDecimal2(value);\n case \"scaleddecimal4\":\n return ScaledDecimal4(value);\n case \"scaleddecimal6\":\n return ScaledDecimal6(value);\n case \"scaleddecimal8\":\n return ScaledDecimal8(value);\n case \"double\":\n case \"number\": {\n if (stringIsValidDecimal(value)) {\n return parseFloat(value);\n } else if (throwIfInvalid) {\n throw
|
|
1
|
+
{"version":3,"file":"form-utils.js","sources":["../../../../../../packages/vuu-utils/src/form-utils.ts"],"sourcesContent":["import { DataValueTypeSimple } from \"@vuu-ui/vuu-data-types\";\nimport {\n VuuColumnDataType,\n VuuRowDataItemType,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { KeyboardEvent, SyntheticEvent } from \"react\";\nimport { stringIsValidDecimal, stringIsValidInt } from \"./data-utils\";\nimport { isValidTimeString, Time } from \"./date\";\nimport { queryClosest } from \"./html-utils\";\nimport { ExtendedFilterOptions } from \"@vuu-ui/vuu-filter-types\";\nimport {\n type ScaledDecimal,\n ScaledDecimal2,\n ScaledDecimal4,\n ScaledDecimal6,\n ScaledDecimal8,\n} from \"./ScaledDecimal\";\n\nexport class DataValidationError extends Error {\n actualType: string;\n expectedType: string;\n constructor(message: string, expectedType: string, actualType: string) {\n super(message);\n this.actualType = actualType;\n this.expectedType = expectedType;\n }\n}\n\n/**\n * Use with the following convention:\n *\n * <FormField data-field=\"my-field-name\">\n */\nexport const getFieldName = (target: EventTarget | HTMLElement): string => {\n const saltFormField = queryClosest(target, \"[data-field]\") as HTMLElement;\n const fieldName = saltFormField?.dataset.field;\n if (fieldName) {\n return fieldName;\n } else {\n throw Error(\"named form field not found\");\n }\n};\n\nexport type InputSource = \"typeahead-suggestion\" | \"text-input\";\n\nexport const isNumber = (\n type: string,\n value: VuuRowDataItemType,\n): value is number => type === \"number\";\n\nexport type CommitHandler<\n E extends HTMLElement = HTMLInputElement,\n T = VuuRowDataItemType,\n> = (\n evt: SyntheticEvent<E> | KeyboardEvent<E>,\n value: T,\n source?: InputSource,\n) => void;\n\nexport const isValidRange = <T>([val1, val2]: [T, T]) => {\n if (isValidTimeString(val1) && isValidTimeString(val2)) {\n return val2 > val1;\n }\n return true;\n};\n\n/**\n * Convert a pair of string values to the type appropriate for the\n * associated column or form field. Can be used when processing a string value\n * from an input used for user editing.\n *\n */\nexport function getTypedRange(\n [value1, value2]: [string, string],\n dataType: VuuColumnDataType | DataValueTypeSimple,\n options?: ExtendedFilterOptions,\n) {\n return [\n getTypedValue(value1, dataType, false, options),\n getTypedValue(value2, dataType, false, options),\n ];\n}\n\nconst getActualType = (\n value: string | number | boolean,\n): \"string\" | \"number\" | \"boolean\" => {\n if (typeof value === \"boolean\") {\n return \"boolean\";\n } else if (typeof value === \"number\") {\n return \"number\";\n } else if (typeof value === \"string\") {\n return \"string\";\n }\n return \"string\";\n};\n\n/**\n * Convert a string value to the type appropriate for the associated\n * column or form field. Can be used when processing a string value\n * from an input used for user editing.\n *\n * @param value\n * @param type\n * @param throwIfInvalid\n */\nexport function getTypedValue(\n value: string,\n type: VuuColumnDataType | DataValueTypeSimple,\n throwIfInvalid?: false,\n options?: ExtendedFilterOptions,\n): VuuRowDataItemType | undefined;\nexport function getTypedValue(\n value: string,\n type: VuuColumnDataType | DataValueTypeSimple,\n throwIfInvalid: true,\n options?: ExtendedFilterOptions,\n): VuuRowDataItemType;\nexport function getTypedValue(\n value: string,\n type: VuuColumnDataType | DataValueTypeSimple,\n throwIfInvalid = false,\n options?: ExtendedFilterOptions,\n): VuuRowDataItemType | ScaledDecimal | undefined {\n switch (type) {\n case \"int\":\n case \"long\": {\n if (stringIsValidInt(value)) {\n return parseInt(value, 10);\n } else if (isValidTimeString(value)) {\n //TOCHECK\n return value;\n } else if (throwIfInvalid) {\n throw Error(`value ${value} is not a valid ${type}`);\n } else {\n return undefined;\n }\n }\n\n case \"scaleddecimal2\":\n return ScaledDecimal2(value);\n case \"scaleddecimal4\":\n return ScaledDecimal4(value);\n case \"scaleddecimal6\":\n return ScaledDecimal6(value);\n case \"scaleddecimal8\":\n return ScaledDecimal8(value);\n case \"double\":\n case \"number\": {\n if (stringIsValidDecimal(value)) {\n return parseFloat(value);\n } else if (throwIfInvalid) {\n throw new DataValidationError(\n `value ${value} is not a valid ${type}`,\n \"decimal\",\n getActualType(value),\n );\n } else {\n return undefined;\n }\n }\n\n case \"boolean\":\n return value === \"true\" ? true : false;\n\n case \"time\":\n if (isValidTimeString(value)) {\n // We don't manipulate the values of 'extended' filters, the\n // ExtendedFilter impementation will do that.\n if (options?.type === \"TimeString\") {\n return value;\n } else {\n return +Time(value).asDate();\n }\n } else if (value.length > 0 && Time.isDateInMillis(value)) {\n //if value previously converted\n return Number(value);\n } else if (throwIfInvalid) {\n throw Error(`value ${value} is not a valid ${type}`);\n } else {\n return undefined;\n }\n default:\n return value;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAkBO,MAAM,4BAA4B,KAAM,CAAA;AAAA,EAG7C,WAAA,CAAY,OAAiB,EAAA,YAAA,EAAsB,UAAoB,EAAA;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AAHf,IAAA,aAAA,CAAA,IAAA,EAAA,YAAA,CAAA;AACA,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,CAAA;AAGE,IAAA,IAAA,CAAK,UAAa,GAAA,UAAA;AAClB,IAAA,IAAA,CAAK,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A,OAAA,EAAS,SAAS,YAAc,EAAA;AAClC,UAAO,OAAA,KAAA;AAAA,SACF,MAAA;AACL,UAAA,OAAO,CAAC,IAAA,CAAK,KAAK,CAAA,CAAE,MAAO,EAAA;AAAA;AAC7B,iBACS,KAAM,CAAA,MAAA,GAAS,KAAK,IAAK,CAAA,cAAA,CAAe,KAAK,CAAG,EAAA;AAEzD,QAAA,OAAO,OAAO,KAAK,CAAA;AAAA,iBACV,cAAgB,EAAA;AACzB,QAAA,MAAM,KAAM,CAAA,CAAA,MAAA,EAAS,KAAK,CAAA,gBAAA,EAAmB,IAAI,CAAE,CAAA,CAAA;AAAA,OAC9C,MAAA;AACL,QAAO,OAAA,KAAA,CAAA;AAAA;AACT,IACF;AACE,MAAO,OAAA,KAAA;AAAA;AAEb;;;;"}
|
|
@@ -10,9 +10,9 @@ export { MEASURES } from './common-types.js';
|
|
|
10
10
|
export { getCellConfigPanelRenderer, getCellRenderer, getCellRendererOptions, getColumnHeaderContentRenderer, getColumnHeaderLabelRenderer, getConfigurationEditor, getEditRuleValidator, getLayoutComponent, getRegisteredCellRenderers, getRowClassNameGenerator, isContainer, isLayoutComponent, isView, registerComponent, registerConfigurationEditor } from './component-registry.js';
|
|
11
11
|
export { getCookieValue, setCookieValue } from './cookie-utils.js';
|
|
12
12
|
export { importCSS } from './css-utils.js';
|
|
13
|
+
export { DataEditingProvider, useEditSession } from './data-editing/DataEditingProvider.js';
|
|
13
14
|
export { EditButtons } from './data-editing/EditButtons.js';
|
|
14
|
-
export {
|
|
15
|
-
export { EditTracker } from './data-editing/EditTracker.js';
|
|
15
|
+
export { EditSession } from './data-editing/EditSession.js';
|
|
16
16
|
export { useEditableTable } from './data-editing/useEditableTable.js';
|
|
17
17
|
export { DOWN1, DOWN2, UP1, UP2, asInteger, dataDescriptorTypeToVuuRowDataItemType, getMovingValueDirection, isValidNumber, numericTypeOfStringValue, shallowEquals, stringIsValidDecimal, stringIsValidInt, stringIsValidNumber } from './data-utils.js';
|
|
18
18
|
export { BaseDataSource, defaultSuspenseProps } from './datasource/BaseDataSource.js';
|
|
@@ -28,7 +28,7 @@ export { EventEmitter } from './event-emitter.js';
|
|
|
28
28
|
export { assertComponentRegistered, assertComponentsRegistered, byModule, env, featureFromJson, getCustomAndTableFeatures, getFilterTableFeatures, hasFilterTableFeatureProps, isCustomFeature, isSameTable, isStaticFeatures, isVuuTables, isWildcardSchema } from './feature-utils.js';
|
|
29
29
|
export { applyFilterToColumns, extractFilterForColumn, filtersAreEqual, getColumnValueFromFilter, isAndFilter, isBetweenFilter, isBetweenOperator, isCompleteFilter, isExtendedFilter, isFilter, isFilterClause, isFilteredColumn, isInFilter, isMultiClauseFilter, isMultiValueFilter, isNamedFilter, isOrFilter, isScaledDecimalFilterClause, isSerializableFilter, isSingleValueFilter, isValidFilterClauseOp, stripFilterFromColumns } from './filters/filter-utils.js';
|
|
30
30
|
export { ONE_DAY_IN_MILLIS, dateFilterAsQuery, filterAsQuery } from './filters/filterAsQuery.js';
|
|
31
|
-
export { getFieldName, getTypedRange, getTypedValue, isNumber, isValidRange } from './form-utils.js';
|
|
31
|
+
export { DataValidationError, getFieldName, getTypedRange, getTypedValue, isNumber, isValidRange } from './form-utils.js';
|
|
32
32
|
export { defaultValueFormatter, getValueFormatter, lowerCase, numericFormatter } from './formatting-utils.js';
|
|
33
33
|
export { getUniqueId } from './getUniqueId.js';
|
|
34
34
|
export { addGroupColumn, getGroupStatus, removeGroupColumn } from './group-utils.js';
|
|
@@ -70,6 +70,7 @@ export { DataContext } from './context-definitions/DataContext.js';
|
|
|
70
70
|
export { DataProvider, useData } from './context-definitions/DataProvider.js';
|
|
71
71
|
export { DataSourceProvider, useDataSource } from './context-definitions/DataSourceProvider.js';
|
|
72
72
|
export { WorkspaceContext, usePlaceholderJSON } from './context-definitions/WorkspaceContext.js';
|
|
73
|
+
export { isInlineEditingSession } from './data-editing/edit-utils.js';
|
|
73
74
|
export { PageVisibilityObserver } from './PageVisibilityObserver.js';
|
|
74
75
|
export { ShellContext, useShellContext } from './ShellContext.js';
|
|
75
76
|
export { ThemeLoadChecker } from './theme-utils.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -48,7 +48,7 @@ function isActionMessage(rpcResponse) {
|
|
|
48
48
|
return rpcResponse.type === "VIEW_PORT_MENU_RESP";
|
|
49
49
|
}
|
|
50
50
|
function isSessionTableActionMessage(rpcResponse) {
|
|
51
|
-
return isActionMessage(rpcResponse) && isOpenDialogAction(rpcResponse.action) && isSessionTable(rpcResponse.action.table) && rpcResponse.action?.renderComponent === "inline-form";
|
|
51
|
+
return isActionMessage(rpcResponse) && isOpenDialogAction(rpcResponse.action) && isSessionTable(rpcResponse.action.table) && (rpcResponse.action?.renderComponent === "inline-form" || rpcResponse.action?.renderComponent === "grid");
|
|
52
52
|
}
|
|
53
53
|
function isCustomComponentActionMessage(rpcResponse) {
|
|
54
54
|
return isActionMessage(rpcResponse) && isOpenDialogAction(rpcResponse.action) && isSessionTable(rpcResponse.action.table) && typeof rpcResponse.action.renderComponent === "string" && isView(rpcResponse.action.renderComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-message-utils.js","sources":["../../../../../../packages/vuu-utils/src/protocol-message-utils.ts"],"sourcesContent":["import type {\n MenuRpcAction,\n MenuRpcResponse,\n OpenDialogActionWithSchema,\n RpcResponse,\n TableSchema,\n VuuUiMessageInRequestResponse,\n} from \"@vuu-ui/vuu-data-types\";\nimport {\n VuuRpcMenuRequest,\n OpenDialogAction,\n VuuRpcRequest,\n VuuRpcResponse,\n VuuRpcMenuSuccess,\n VuuTable,\n VuuViewportRpcTypeaheadRequest,\n VuuRpcServiceRequest,\n ViewportRpcContext,\n OpenComponentInDialogAction,\n VuuLoginSuccessResponse,\n SelectRequest,\n SelectResponse,\n SelectSuccessWithRowCount,\n VuuViewportCreateSuccessResponse,\n VuuViewportCreateResponse,\n InvalidTokenReason,\n InvalidSessionReason,\n LoginErrorMessage,\n RpcResult,\n RpcResultSuccess,\n RpcResultError,\n VuuColumnDataType,\n VuuNumericType,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { isView as componentInRegistry } from \"./component-registry\";\n\nconst MENU_RPC_TYPES = [\n \"VIEW_PORT_MENUS_SELECT_RPC\",\n \"VIEW_PORT_MENU_TABLE_RPC\",\n \"VIEW_PORT_MENU_ROW_RPC\",\n \"VIEW_PORT_MENU_CELL_RPC\",\n];\n\nexport const INVALID_SESSION: InvalidSessionReason = \"Invalid session\";\nexport const SESSION_LIMIT_EXCEEDED: InvalidSessionReason =\n \"User session limit exceeded\";\nexport const INVALID_TOKEN: InvalidTokenReason = \"Invalid token\";\nexport const TOKEN_EXPIRED: InvalidTokenReason = \"Token has expired\";\n\nconst InvalidLoginMessages: string[] = [\n INVALID_SESSION,\n SESSION_LIMIT_EXCEEDED,\n INVALID_TOKEN,\n TOKEN_EXPIRED,\n];\n\nexport const isLoginErrorMessage = (\n message: unknown,\n): message is LoginErrorMessage =>\n typeof message === \"string\" && InvalidLoginMessages.includes(message);\n\nexport const isSelectRequest = (message: object): message is SelectRequest =>\n message &&\n typeof message === \"object\" &&\n \"type\" in message &&\n (message.type === \"SELECT_ROW\" ||\n message.type === \"DESELECT_ROW\" ||\n message.type === \"SELECT_ROW_RANGE\" ||\n message.type === \"SELECT_ALL\" ||\n message.type === \"DESELECT_ALL\");\n\nexport const isSelectSuccessWithRowCount = (\n response: SelectResponse | SelectSuccessWithRowCount,\n): response is SelectSuccessWithRowCount =>\n [\n \"SELECT_ROW_SUCCESS\",\n \"DESELECT_ROW_SUCCESS\",\n \"SELECT_ROW_RANGE_SUCCESS\",\n \"SELECT_ALL_SUCCESS\",\n \"DESELECT_ALL_SUCCESS\",\n ].includes(response.type ?? \"\") &&\n typeof (response as SelectSuccessWithRowCount).selectedRowCount === \"number\";\n\nexport const isRpcServiceRequest = (message: {\n type: string;\n}): message is VuuRpcServiceRequest | Omit<VuuRpcServiceRequest, \"context\"> =>\n message.type === \"RPC_REQUEST\";\n\nexport const hasViewPortContext = (\n message: VuuRpcServiceRequest,\n): message is VuuRpcServiceRequest<ViewportRpcContext> =>\n message.context.type === \"VIEWPORT_CONTEXT\";\n\nexport const isVuuMenuRpcRequest = (\n message: VuuRpcRequest | Omit<VuuRpcRequest, \"vpId\">,\n): message is VuuRpcMenuRequest => MENU_RPC_TYPES.includes(message[\"type\"]);\n\nexport const isLoginResponse = (\n message: unknown,\n): message is VuuLoginSuccessResponse =>\n message !== null &&\n typeof message === \"object\" &&\n \"type\" in message &&\n (message.type === \"LOGIN_SUCCESS\" || message.type === \"LOGIN_FAIL\");\n\nexport const isRpcSuccess = (\n rpcResult?: RpcResult,\n): rpcResult is RpcResultSuccess => rpcResult?.type === \"SUCCESS_RESULT\";\n\nexport const isRpcError = (\n rpcResult?: RpcResult,\n): rpcResult is RpcResultError => rpcResult?.type === \"ERROR_RESULT\";\n\nexport const isRequestResponse = (\n message: object,\n): message is VuuUiMessageInRequestResponse => \"requestId\" in message;\n\nexport const isOpenSessionTableDialogMessage = (\n rpcResponse: RpcResponse,\n): rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema> =>\n rpcResponse.type === \"VIEW_PORT_MENU_RESP\" &&\n isOpenDialogAction(rpcResponse.action) &&\n \"tableSchema\" in rpcResponse.action;\n\nexport const isOpenDialogAction = (\n action?: MenuRpcAction,\n): action is OpenDialogAction =>\n action !== undefined && action.type === \"OPEN_DIALOG_ACTION\";\n\nexport const isTypeaheadRequest = (\n request: Omit<VuuRpcRequest, \"vpId\">,\n): request is Omit<VuuViewportRpcTypeaheadRequest, \"vpId\"> => {\n return (\n isRpcServiceRequest(request) &&\n (request.rpcName === \"getUniqueFieldValues\" ||\n request.rpcName === \"getUniqueFieldValuesStartingWith\")\n );\n};\n\nexport const isCreateVpSuccess = (\n response: VuuViewportCreateResponse,\n): response is VuuViewportCreateSuccessResponse =>\n response.type === \"CREATE_VP_SUCCESS\";\n\nexport const isSessionTable = (table?: unknown) => {\n if (\n table !== null &&\n typeof table === \"object\" &&\n \"table\" in table &&\n \"module\" in table\n ) {\n return (table as VuuTable).table.startsWith(\"session\");\n }\n return false;\n};\n\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess;\nexport function isActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<VuuRpcMenuSuccess, \"vpId\">;\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n) {\n return rpcResponse.type === \"VIEW_PORT_MENU_RESP\";\n}\n\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<\n VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n >,\n \"vpId\"\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n rpcResponse.action?.renderComponent === \"inline-form\"\n );\n}\n\nexport function isCustomComponentActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenComponentInDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n typeof rpcResponse.action.renderComponent === \"string\" &&\n componentInRegistry(rpcResponse.action.renderComponent)\n );\n}\n\nconst numericTypes: VuuNumericType[] = [\n \"int\",\n \"long\",\n \"double\",\n \"scaleddecimal2\",\n \"scaleddecimal4\",\n \"scaleddecimal6\",\n \"scaleddecimal8\",\n];\n\nexport function isNumericType(\n dataType?: VuuColumnDataType,\n): dataType is VuuNumericType {\n return numericTypes.includes(dataType as VuuNumericType);\n}\n"],"names":["componentInRegistry"],"mappings":";;AAoCA,MAAM,cAAiB,GAAA;AAAA,EACrB,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,CAAA;AAEO,MAAM,eAAwC,GAAA;AAC9C,MAAM,sBACX,GAAA;AACK,MAAM,aAAoC,GAAA;AAC1C,MAAM,aAAoC,GAAA;AAEjD,MAAM,oBAAiC,GAAA;AAAA,EACrC,eAAA;AAAA,EACA,sBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA;AAEa,MAAA,mBAAA,GAAsB,CACjC,OAEA,KAAA,OAAO,YAAY,QAAY,IAAA,oBAAA,CAAqB,SAAS,OAAO;AAEzD,MAAA,eAAA,GAAkB,CAAC,OAC9B,KAAA,OAAA,IACA,OAAO,OAAY,KAAA,QAAA,IACnB,MAAU,IAAA,OAAA,KACT,OAAQ,CAAA,IAAA,KAAS,gBAChB,OAAQ,CAAA,IAAA,KAAS,kBACjB,OAAQ,CAAA,IAAA,KAAS,sBACjB,OAAQ,CAAA,IAAA,KAAS,YACjB,IAAA,OAAA,CAAQ,IAAS,KAAA,cAAA;AAER,MAAA,2BAAA,GAA8B,CACzC,QAEA,KAAA;AAAA,EACE,oBAAA;AAAA,EACA,sBAAA;AAAA,EACA,0BAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA,CAAE,SAAS,QAAS,C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AO,KAAA,KAAU,YACjB,OAAW,IAAA,KAAA,IACX,YAAY,KACZ,EAAA;AACA,IAAQ,OAAA,KAAA,CAAmB,KAAM,CAAA,UAAA,CAAW,SAAS,CAAA;AAAA;AAEvD,EAAO,OAAA,KAAA;AACT;AAQO,SAAS,gBACd,WACA,EAAA;AACA,EAAA,OAAO,YAAY,IAAS,KAAA,qBAAA;AAC9B;AAmBO,SAAS,4BACd,WAKA,EAAA;AACA,EAAA,OACE,
|
|
1
|
+
{"version":3,"file":"protocol-message-utils.js","sources":["../../../../../../packages/vuu-utils/src/protocol-message-utils.ts"],"sourcesContent":["import type {\n MenuRpcAction,\n MenuRpcResponse,\n OpenDialogActionWithSchema,\n RpcResponse,\n TableSchema,\n VuuUiMessageInRequestResponse,\n} from \"@vuu-ui/vuu-data-types\";\nimport {\n VuuRpcMenuRequest,\n OpenDialogAction,\n VuuRpcRequest,\n VuuRpcResponse,\n VuuRpcMenuSuccess,\n VuuTable,\n VuuViewportRpcTypeaheadRequest,\n VuuRpcServiceRequest,\n ViewportRpcContext,\n OpenComponentInDialogAction,\n VuuLoginSuccessResponse,\n SelectRequest,\n SelectResponse,\n SelectSuccessWithRowCount,\n VuuViewportCreateSuccessResponse,\n VuuViewportCreateResponse,\n InvalidTokenReason,\n InvalidSessionReason,\n LoginErrorMessage,\n RpcResult,\n RpcResultSuccess,\n RpcResultError,\n VuuColumnDataType,\n VuuNumericType,\n} from \"@vuu-ui/vuu-protocol-types\";\nimport { isView as componentInRegistry } from \"./component-registry\";\n\nconst MENU_RPC_TYPES = [\n \"VIEW_PORT_MENUS_SELECT_RPC\",\n \"VIEW_PORT_MENU_TABLE_RPC\",\n \"VIEW_PORT_MENU_ROW_RPC\",\n \"VIEW_PORT_MENU_CELL_RPC\",\n];\n\nexport const INVALID_SESSION: InvalidSessionReason = \"Invalid session\";\nexport const SESSION_LIMIT_EXCEEDED: InvalidSessionReason =\n \"User session limit exceeded\";\nexport const INVALID_TOKEN: InvalidTokenReason = \"Invalid token\";\nexport const TOKEN_EXPIRED: InvalidTokenReason = \"Token has expired\";\n\nconst InvalidLoginMessages: string[] = [\n INVALID_SESSION,\n SESSION_LIMIT_EXCEEDED,\n INVALID_TOKEN,\n TOKEN_EXPIRED,\n];\n\nexport const isLoginErrorMessage = (\n message: unknown,\n): message is LoginErrorMessage =>\n typeof message === \"string\" && InvalidLoginMessages.includes(message);\n\nexport const isSelectRequest = (message: object): message is SelectRequest =>\n message &&\n typeof message === \"object\" &&\n \"type\" in message &&\n (message.type === \"SELECT_ROW\" ||\n message.type === \"DESELECT_ROW\" ||\n message.type === \"SELECT_ROW_RANGE\" ||\n message.type === \"SELECT_ALL\" ||\n message.type === \"DESELECT_ALL\");\n\nexport const isSelectSuccessWithRowCount = (\n response: SelectResponse | SelectSuccessWithRowCount,\n): response is SelectSuccessWithRowCount =>\n [\n \"SELECT_ROW_SUCCESS\",\n \"DESELECT_ROW_SUCCESS\",\n \"SELECT_ROW_RANGE_SUCCESS\",\n \"SELECT_ALL_SUCCESS\",\n \"DESELECT_ALL_SUCCESS\",\n ].includes(response.type ?? \"\") &&\n typeof (response as SelectSuccessWithRowCount).selectedRowCount === \"number\";\n\nexport const isRpcServiceRequest = (message: {\n type: string;\n}): message is VuuRpcServiceRequest | Omit<VuuRpcServiceRequest, \"context\"> =>\n message.type === \"RPC_REQUEST\";\n\nexport const hasViewPortContext = (\n message: VuuRpcServiceRequest,\n): message is VuuRpcServiceRequest<ViewportRpcContext> =>\n message.context.type === \"VIEWPORT_CONTEXT\";\n\nexport const isVuuMenuRpcRequest = (\n message: VuuRpcRequest | Omit<VuuRpcRequest, \"vpId\">,\n): message is VuuRpcMenuRequest => MENU_RPC_TYPES.includes(message[\"type\"]);\n\nexport const isLoginResponse = (\n message: unknown,\n): message is VuuLoginSuccessResponse =>\n message !== null &&\n typeof message === \"object\" &&\n \"type\" in message &&\n (message.type === \"LOGIN_SUCCESS\" || message.type === \"LOGIN_FAIL\");\n\nexport const isRpcSuccess = (\n rpcResult?: RpcResult,\n): rpcResult is RpcResultSuccess => rpcResult?.type === \"SUCCESS_RESULT\";\n\nexport const isRpcError = (\n rpcResult?: RpcResult,\n): rpcResult is RpcResultError => rpcResult?.type === \"ERROR_RESULT\";\n\nexport const isRequestResponse = (\n message: object,\n): message is VuuUiMessageInRequestResponse => \"requestId\" in message;\n\nexport const isOpenSessionTableDialogMessage = (\n rpcResponse: RpcResponse,\n): rpcResponse is MenuRpcResponse<OpenDialogActionWithSchema> =>\n rpcResponse.type === \"VIEW_PORT_MENU_RESP\" &&\n isOpenDialogAction(rpcResponse.action) &&\n \"tableSchema\" in rpcResponse.action;\n\nexport const isOpenDialogAction = (\n action?: MenuRpcAction,\n): action is OpenDialogAction =>\n action !== undefined && action.type === \"OPEN_DIALOG_ACTION\";\n\nexport const isTypeaheadRequest = (\n request: Omit<VuuRpcRequest, \"vpId\">,\n): request is Omit<VuuViewportRpcTypeaheadRequest, \"vpId\"> => {\n return (\n isRpcServiceRequest(request) &&\n (request.rpcName === \"getUniqueFieldValues\" ||\n request.rpcName === \"getUniqueFieldValuesStartingWith\")\n );\n};\n\nexport const isCreateVpSuccess = (\n response: VuuViewportCreateResponse,\n): response is VuuViewportCreateSuccessResponse =>\n response.type === \"CREATE_VP_SUCCESS\";\n\nexport const isSessionTable = (table?: unknown) => {\n if (\n table !== null &&\n typeof table === \"object\" &&\n \"table\" in table &&\n \"module\" in table\n ) {\n return (table as VuuTable).table.startsWith(\"session\");\n }\n return false;\n};\n\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess;\nexport function isActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<VuuRpcMenuSuccess, \"vpId\">;\nexport function isActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n) {\n return rpcResponse.type === \"VIEW_PORT_MENU_RESP\";\n}\n\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is Omit<\n VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n >,\n \"vpId\"\n>;\nexport function isSessionTableActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n (rpcResponse.action?.renderComponent === \"inline-form\" ||\n rpcResponse.action?.renderComponent === \"grid\")\n );\n}\n\nexport function isCustomComponentActionMessage(\n rpcResponse: VuuRpcResponse | Omit<VuuRpcResponse, \"vpId\">,\n): rpcResponse is VuuRpcMenuSuccess<\n OpenComponentInDialogAction & {\n tableSchema: TableSchema;\n }\n> {\n return (\n isActionMessage(rpcResponse) &&\n isOpenDialogAction(rpcResponse.action) &&\n isSessionTable(rpcResponse.action.table) &&\n typeof rpcResponse.action.renderComponent === \"string\" &&\n componentInRegistry(rpcResponse.action.renderComponent)\n );\n}\n\nconst numericTypes: VuuNumericType[] = [\n \"int\",\n \"long\",\n \"double\",\n \"scaleddecimal2\",\n \"scaleddecimal4\",\n \"scaleddecimal6\",\n \"scaleddecimal8\",\n];\n\nexport function isNumericType(\n dataType?: VuuColumnDataType,\n): dataType is VuuNumericType {\n return numericTypes.includes(dataType as VuuNumericType);\n}\n"],"names":["componentInRegistry"],"mappings":";;AAoCA,MAAM,cAAiB,GAAA;AAAA,EACrB,4BAAA;AAAA,EACA,0BAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,CAAA;AAEO,MAAM,eAAwC,GAAA;AAC9C,MAAM,sBACX,GAAA;AACK,MAAM,aAAoC,GAAA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kBAAA,CAAmB,YAAY,MAAM,CAAA,IACrC,eAAe,WAAY,CAAA,MAAA,CAAO,KAAK,CACvC,IAAA,OAAO,YAAY,MAAO,CAAA,eAAA,KAAoB,YAC9CA,MAAoB,CAAA,WAAA,CAAY,OAAO,eAAe,CAAA;AAE1D;AAEA,MAAM,YAAiC,GAAA;AAAA,EACrC,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAA;AAEO,SAAS,cACd,QAC4B,EAAA;AAC5B,EAAO,OAAA,YAAA,CAAa,SAAS,QAA0B,CAAA;AACzD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.6",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
"@salt-ds/core": "1.54.1"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@vuu-ui/vuu-data-types": "2.1.
|
|
11
|
-
"@vuu-ui/vuu-table-types": "2.1.
|
|
12
|
-
"@vuu-ui/vuu-filter-types": "2.1.
|
|
13
|
-
"@vuu-ui/vuu-protocol-types": "2.1.
|
|
10
|
+
"@vuu-ui/vuu-data-types": "2.1.6",
|
|
11
|
+
"@vuu-ui/vuu-table-types": "2.1.6",
|
|
12
|
+
"@vuu-ui/vuu-filter-types": "2.1.6",
|
|
13
|
+
"@vuu-ui/vuu-protocol-types": "2.1.6"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@internationalized/date": "^3.0.0",
|
|
17
|
-
"@vuu-ui/vuu-filter-parser": "2.1.
|
|
17
|
+
"@vuu-ui/vuu-filter-parser": "2.1.6",
|
|
18
18
|
"clsx": "^2.0.0",
|
|
19
19
|
"react": "^19.2.3",
|
|
20
20
|
"react-dom": "^19.2.3"
|