@vuu-ui/vuu-data-react 0.13.60 → 0.13.61
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/hooks/useSessionDataSource.js +49 -57
- package/cjs/hooks/useSessionDataSource.js.map +1 -1
- package/cjs/hooks/useVisualLinks.js +2 -1
- package/cjs/hooks/useVisualLinks.js.map +1 -1
- package/cjs/index.js +9 -9
- package/esm/hooks/useSessionDataSource.js +51 -59
- package/esm/hooks/useSessionDataSource.js.map +1 -1
- package/esm/hooks/useVisualLinks.js +2 -1
- package/esm/hooks/useVisualLinks.js.map +1 -1
- package/esm/index.js +4 -4
- package/package.json +15 -15
- package/types/hooks/useSessionDataSource.d.ts +8 -5
- package/types/hooks/useVisualLinks.d.ts +1 -1
- package/types/index.d.ts +6 -2
- package/types/hooks/index.d.ts +0 -5
|
@@ -1,71 +1,63 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var vuuLayout = require('@vuu-ui/vuu-layout');
|
|
4
3
|
var vuuUtils = require('@vuu-ui/vuu-utils');
|
|
5
4
|
var react = require('react');
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
const useSessionDataSource = ({
|
|
9
|
-
dataSourceSessionKey = "data-source",
|
|
10
|
-
tableSchema
|
|
11
|
-
}) => {
|
|
12
|
-
const { id, load, save, loadSession, saveSession, title } = vuuLayout.useViewContext();
|
|
6
|
+
const sessionState = /* @__PURE__ */ new Map();
|
|
7
|
+
const useSessionDataSource = (props) => {
|
|
13
8
|
const { VuuDataSource } = vuuUtils.useData();
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
25
|
-
if (noChanges === false) {
|
|
26
|
-
dataSourceConfigRef.current = config;
|
|
27
|
-
save?.(config, "datasource-config");
|
|
9
|
+
const dataSourceConfigRef = react.useRef(void 0);
|
|
10
|
+
const getDataSource = react.useCallback(
|
|
11
|
+
(sessionKey, config) => {
|
|
12
|
+
let ds = sessionState.get(sessionKey);
|
|
13
|
+
if (ds) {
|
|
14
|
+
if (config) {
|
|
15
|
+
ds.applyConfig(config, true);
|
|
16
|
+
}
|
|
17
|
+
if (ds.range.from > 0) {
|
|
18
|
+
ds.range = ds.range.reset;
|
|
28
19
|
}
|
|
20
|
+
return ds;
|
|
21
|
+
}
|
|
22
|
+
if (config?.columns) {
|
|
23
|
+
ds = new VuuDataSource({
|
|
24
|
+
...config,
|
|
25
|
+
viewport: sessionKey,
|
|
26
|
+
...dataSourceConfigRef.current
|
|
27
|
+
});
|
|
28
|
+
if (props?.onConfigChange) {
|
|
29
|
+
ds.on("config", props.onConfigChange);
|
|
30
|
+
}
|
|
31
|
+
sessionState.set(sessionKey, ds);
|
|
32
|
+
return ds;
|
|
33
|
+
} else {
|
|
34
|
+
throw Error(
|
|
35
|
+
`[useSessionDataSource] unable to create new DataSource, columns have not been defined `
|
|
36
|
+
);
|
|
29
37
|
}
|
|
30
38
|
},
|
|
31
|
-
[
|
|
39
|
+
[VuuDataSource, props?.onConfigChange]
|
|
32
40
|
);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
const clearDataSource = react.useCallback(
|
|
42
|
+
(sessionKey, unsubscribe) => {
|
|
43
|
+
const ds = sessionState.get(sessionKey);
|
|
44
|
+
if (ds) {
|
|
45
|
+
sessionState.delete(sessionKey);
|
|
46
|
+
if (unsubscribe === true) {
|
|
47
|
+
ds.unsubscribe();
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
console.warn(
|
|
51
|
+
`[useSessionbDatasource] clearDataSource ${sessionKey} not found `
|
|
52
|
+
);
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...dataSourceConfigRef.current,
|
|
50
|
-
columns,
|
|
51
|
-
title
|
|
52
|
-
});
|
|
53
|
-
ds.on("config", handleDataSourceConfigChange);
|
|
54
|
-
saveSession?.(ds, "data-source");
|
|
55
|
-
return ds;
|
|
56
|
-
}, [
|
|
57
|
-
VuuDataSource,
|
|
58
|
-
dataSourceConfigFromState,
|
|
59
|
-
dataSourceSessionKey,
|
|
60
|
-
handleDataSourceConfigChange,
|
|
61
|
-
id,
|
|
62
|
-
loadSession,
|
|
63
|
-
saveSession,
|
|
64
|
-
tableSchema.columns,
|
|
65
|
-
tableSchema.table,
|
|
66
|
-
title
|
|
67
|
-
]);
|
|
68
|
-
return dataSource;
|
|
54
|
+
},
|
|
55
|
+
[]
|
|
56
|
+
);
|
|
57
|
+
return {
|
|
58
|
+
clearDataSource,
|
|
59
|
+
getDataSource
|
|
60
|
+
};
|
|
69
61
|
};
|
|
70
62
|
|
|
71
63
|
exports.useSessionDataSource = useSessionDataSource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionDataSource.js","sources":["../../../../packages/vuu-data-react/src/hooks/useSessionDataSource.ts"],"sourcesContent":["import type {\n DataSource,\n DataSourceConfig,\n DataSourceConfigChangeHandler,\n
|
|
1
|
+
{"version":3,"file":"useSessionDataSource.js","sources":["../../../../packages/vuu-data-react/src/hooks/useSessionDataSource.ts"],"sourcesContent":["import type {\n DataSource,\n DataSourceConfig,\n DataSourceConfigChangeHandler,\n DataSourceConstructorProps,\n} from \"@vuu-ui/vuu-data-types\";\nimport { useData } from \"@vuu-ui/vuu-utils\";\nimport { useCallback, useRef } from \"react\";\n\nconst sessionState = new Map<string, DataSource>();\n\nexport interface SessionStateHookProps {\n onConfigChange?: DataSourceConfigChangeHandler;\n}\n\nexport const useSessionDataSource = (props?: SessionStateHookProps) => {\n const { VuuDataSource } = useData();\n\n const dataSourceConfigRef = useRef<DataSourceConfig | undefined>(undefined);\n\n const getDataSource = useCallback(\n (sessionKey: string, config?: DataSourceConstructorProps) => {\n let ds = sessionState.get(sessionKey);\n if (ds) {\n if (config) {\n // this won't do anything if dataSource config already matches this\n // This is only really used when injecting a dataSource into session\n // state in Showcase examples\n // Do we definitely need this ? If not apply config can be provate\n ds.applyConfig(config, true);\n }\n\n if (ds.range.from > 0) {\n // UI does not currently restore scroll position, so always reset to top of dataset\n ds.range = ds.range.reset;\n }\n return ds;\n }\n\n if (config?.columns) {\n ds = new VuuDataSource({\n ...config,\n viewport: sessionKey,\n ...dataSourceConfigRef.current,\n });\n if (props?.onConfigChange) {\n ds.on(\"config\", props.onConfigChange);\n }\n sessionState.set(sessionKey, ds);\n return ds;\n } else {\n throw Error(\n `[useSessionDataSource] unable to create new DataSource, columns have not been defined `,\n );\n }\n },\n [VuuDataSource, props?.onConfigChange],\n );\n\n const clearDataSource = useCallback(\n (sessionKey: string, unsubscribe?: boolean) => {\n const ds = sessionState.get(sessionKey);\n if (ds) {\n sessionState.delete(sessionKey);\n if (unsubscribe === true) {\n ds.unsubscribe();\n }\n } else {\n console.warn(\n `[useSessionbDatasource] clearDataSource ${sessionKey} not found `,\n );\n }\n },\n [],\n );\n\n return {\n clearDataSource,\n getDataSource,\n };\n};\n"],"names":["useData","useRef","useCallback"],"mappings":";;;;;AASA,MAAM,YAAA,uBAAmB,GAAwB,EAAA;AAMpC,MAAA,oBAAA,GAAuB,CAAC,KAAkC,KAAA;AACrE,EAAM,MAAA,EAAE,aAAc,EAAA,GAAIA,gBAAQ,EAAA;AAElC,EAAM,MAAA,mBAAA,GAAsBC,aAAqC,KAAS,CAAA,CAAA;AAE1E,EAAA,MAAM,aAAgB,GAAAC,iBAAA;AAAA,IACpB,CAAC,YAAoB,MAAwC,KAAA;AAC3D,MAAI,IAAA,EAAA,GAAK,YAAa,CAAA,GAAA,CAAI,UAAU,CAAA;AACpC,MAAA,IAAI,EAAI,EAAA;AACN,QAAA,IAAI,MAA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AAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -54,12 +54,13 @@ const useVisualLinks = (dataSource) => {
|
|
|
54
54
|
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
55
|
vuuUiControls.IconButton,
|
|
56
56
|
{
|
|
57
|
+
appearance: "transparent",
|
|
57
58
|
"aria-label": "remove-link",
|
|
58
59
|
icon: "link",
|
|
59
60
|
onClick: removeVisualLink,
|
|
60
61
|
onMouseEnter: highlightVisualLinkTarget,
|
|
61
62
|
onMouseLeave: clearVisualLinkTarget,
|
|
62
|
-
|
|
63
|
+
sentiment: "neutral"
|
|
63
64
|
}
|
|
64
65
|
)
|
|
65
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisualLinks.js","sources":["../../../../packages/vuu-data-react/src/hooks/useVisualLinks.tsx"],"sourcesContent":["import { DataSource } from \"@vuu-ui/vuu-data-types\";\nimport { useViewContext } from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { useCallback, useEffect } from \"react\";\n\nexport const useVisualLinks = (dataSource: DataSource) => {\n const { dispatch } = useViewContext();\n\n const clearVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const removeVisualLink = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n\n dataSource.visualLink = undefined;\n }\n }, [dataSource, dispatch]);\n\n const handleLinkRemoved = useCallback(() => {\n dispatch?.({\n type: \"remove-toolbar-contribution\",\n location: \"post-title\",\n });\n }, [dispatch]);\n\n const highlightVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-on\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const handleLinkCreated = useCallback(() => {\n dispatch?.({\n type: \"add-toolbar-contribution\",\n location: \"post-title\",\n content: (\n <IconButton\n aria-label=\"remove-link\"\n icon=\"link\"\n onClick={removeVisualLink}\n onMouseEnter={highlightVisualLinkTarget}\n onMouseLeave={clearVisualLinkTarget}\n
|
|
1
|
+
{"version":3,"file":"useVisualLinks.js","sources":["../../../../packages/vuu-data-react/src/hooks/useVisualLinks.tsx"],"sourcesContent":["import type { DataSource } from \"@vuu-ui/vuu-data-types\";\nimport { useViewContext } from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { useCallback, useEffect } from \"react\";\n\nexport const useVisualLinks = (dataSource: DataSource) => {\n const { dispatch } = useViewContext();\n\n const clearVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const removeVisualLink = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n\n dataSource.visualLink = undefined;\n }\n }, [dataSource, dispatch]);\n\n const handleLinkRemoved = useCallback(() => {\n dispatch?.({\n type: \"remove-toolbar-contribution\",\n location: \"post-title\",\n });\n }, [dispatch]);\n\n const highlightVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-on\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const handleLinkCreated = useCallback(() => {\n dispatch?.({\n type: \"add-toolbar-contribution\",\n location: \"post-title\",\n content: (\n <IconButton\n appearance=\"transparent\"\n aria-label=\"remove-link\"\n icon=\"link\"\n onClick={removeVisualLink}\n onMouseEnter={highlightVisualLinkTarget}\n onMouseLeave={clearVisualLinkTarget}\n sentiment=\"neutral\"\n />\n ),\n });\n }, [\n dispatch,\n removeVisualLink,\n highlightVisualLinkTarget,\n clearVisualLinkTarget,\n ]);\n\n useEffect(() => {\n dataSource.on(\"visual-link-created\", handleLinkCreated);\n dataSource.on(\"visual-link-removed\", handleLinkRemoved);\n return () => {\n dataSource.removeListener(\"visual-link-created\", handleLinkCreated);\n dataSource.removeListener(\"visual-link-removed\", handleLinkRemoved);\n };\n }, [dataSource, handleLinkCreated, handleLinkRemoved]);\n};\n"],"names":["useViewContext","useCallback","jsx","IconButton","useEffect"],"mappings":";;;;;;;AAKa,MAAA,cAAA,GAAiB,CAAC,UAA2B,KAAA;AACxD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAIA,wBAAe,EAAA;AAEpC,EAAM,MAAA,qBAAA,GAAwBC,kBAAY,MAAM;AAC9C,IAAA,IAAI,WAAW,UAAY,EAAA;AACzB,MAAW,QAAA,GAAA;AAAA,QACT,IAAM,EAAA,mBAAA;AAAA,QACN,OAAS,EAAA;AAAA,UACP,QAAA,EAAU,WAAW,UAAW,CAAA,gBAAA;AAAA,UAChC,IAAM,EAAA;AAAA;AACR,OACD,CAAA;AAAA;AACH,GACC,EAAA,CAAC,UAAY,EAAA,QAAQ,CAAC,CAAA;AAEzB,EAAM,MAAA,gBAAA,GAAmBA,kBAAY,MAAM;AACzC,IAAA,IAAI,WAAW,UAAY,EAAA;AACzB,MAAW,QAAA,GAAA;AAAA,QACT,IAAM,EAAA,mBAAA;AAAA,QACN,OAAS,EAAA;AAAA,UACP,QAAA,EAAU,WAAW,UAAW,CAAA,gBAAA;AAAA,UAChC,IAAM,EAAA;AAAA;AACR,OACD,CAAA;AAED,MAAA,UAAA,CAAW,UAAa,GAAA,KAAA,CAAA;AAAA;AAC1B,GACC,EAAA,CAAC,UAAY,EAAA,QAAQ,CAAC,CAAA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B,iBAAiB,CAAA;AAClE,MAAW,UAAA,CAAA,cAAA,CAAe,uBAAuB,iBAAiB,CAAA;AAAA,KACpE;AAAA,GACC,EAAA,CAAC,UAAY,EAAA,iBAAA,EAAmB,iBAAiB,CAAC,CAAA;AACvD;;;;"}
|
package/cjs/index.js
CHANGED
|
@@ -7,14 +7,14 @@ var UnsavedChangesReport = require('./data-editing/UnsavedChangesReport.js');
|
|
|
7
7
|
var useEditForm = require('./data-editing/useEditForm.js');
|
|
8
8
|
var formEditState = require('./data-editing/form-edit-state.js');
|
|
9
9
|
var VuuDataSourceProvider = require('./datasource-provider/VuuDataSourceProvider.js');
|
|
10
|
+
var useLookupValues = require('./hooks/useLookupValues.js');
|
|
11
|
+
var useRemoteConnection = require('./hooks/useRemoteConnection.js');
|
|
10
12
|
var useSessionDataSource = require('./hooks/useSessionDataSource.js');
|
|
13
|
+
var useTypeaheadSuggestions = require('./hooks/useTypeaheadSuggestions.js');
|
|
14
|
+
var useVisualLinks = require('./hooks/useVisualLinks.js');
|
|
11
15
|
var useVuuMenuActions = require('./hooks/useVuuMenuActions.js');
|
|
12
16
|
var useVuuTables = require('./hooks/useVuuTables.js');
|
|
13
|
-
var useVisualLinks = require('./hooks/useVisualLinks.js');
|
|
14
|
-
var useTypeaheadSuggestions = require('./hooks/useTypeaheadSuggestions.js');
|
|
15
17
|
var SessionEditingForm = require('./session-editing-form/SessionEditingForm.js');
|
|
16
|
-
var useLookupValues = require('./hooks/useLookupValues.js');
|
|
17
|
-
var useRemoteConnection = require('./hooks/useRemoteConnection.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -28,15 +28,15 @@ exports.useEditForm = useEditForm.useEditForm;
|
|
|
28
28
|
exports.CLEAN_FORM = formEditState.CLEAN_FORM;
|
|
29
29
|
exports.buildFormEditState = formEditState.buildFormEditState;
|
|
30
30
|
exports.VuuDataSourceProvider = VuuDataSourceProvider.VuuDataSourceProvider;
|
|
31
|
+
exports.useLookupValues = useLookupValues.useLookupValues;
|
|
32
|
+
exports.useRemoteConnection = useRemoteConnection.useRemoteConnection;
|
|
31
33
|
exports.useSessionDataSource = useSessionDataSource.useSessionDataSource;
|
|
34
|
+
exports.getTypeaheadParams = useTypeaheadSuggestions.getTypeaheadParams;
|
|
35
|
+
exports.useTypeaheadSuggestions = useTypeaheadSuggestions.useTypeaheadSuggestions;
|
|
36
|
+
exports.useVisualLinks = useVisualLinks.useVisualLinks;
|
|
32
37
|
exports.isRowMenu = useVuuMenuActions.isRowMenu;
|
|
33
38
|
exports.isSelectionMenu = useVuuMenuActions.isSelectionMenu;
|
|
34
39
|
exports.useVuuMenuActions = useVuuMenuActions.useVuuMenuActions;
|
|
35
40
|
exports.useVuuTables = useVuuTables.useVuuTables;
|
|
36
|
-
exports.useVisualLinks = useVisualLinks.useVisualLinks;
|
|
37
|
-
exports.getTypeaheadParams = useTypeaheadSuggestions.getTypeaheadParams;
|
|
38
|
-
exports.useTypeaheadSuggestions = useTypeaheadSuggestions.useTypeaheadSuggestions;
|
|
39
41
|
exports.SessionEditingForm = SessionEditingForm.SessionEditingForm;
|
|
40
|
-
exports.useLookupValues = useLookupValues.useLookupValues;
|
|
41
|
-
exports.useRemoteConnection = useRemoteConnection.useRemoteConnection;
|
|
42
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,69 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useMemo, useRef, useCallback } from 'react';
|
|
1
|
+
import { useData } from '@vuu-ui/vuu-utils';
|
|
2
|
+
import { useRef, useCallback } from 'react';
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
const useSessionDataSource = ({
|
|
7
|
-
dataSourceSessionKey = "data-source",
|
|
8
|
-
tableSchema
|
|
9
|
-
}) => {
|
|
10
|
-
const { id, load, save, loadSession, saveSession, title } = useViewContext();
|
|
4
|
+
const sessionState = /* @__PURE__ */ new Map();
|
|
5
|
+
const useSessionDataSource = (props) => {
|
|
11
6
|
const { VuuDataSource } = useData();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
if (noChanges === false) {
|
|
24
|
-
dataSourceConfigRef.current = config;
|
|
25
|
-
save?.(config, "datasource-config");
|
|
7
|
+
const dataSourceConfigRef = useRef(void 0);
|
|
8
|
+
const getDataSource = useCallback(
|
|
9
|
+
(sessionKey, config) => {
|
|
10
|
+
let ds = sessionState.get(sessionKey);
|
|
11
|
+
if (ds) {
|
|
12
|
+
if (config) {
|
|
13
|
+
ds.applyConfig(config, true);
|
|
14
|
+
}
|
|
15
|
+
if (ds.range.from > 0) {
|
|
16
|
+
ds.range = ds.range.reset;
|
|
26
17
|
}
|
|
18
|
+
return ds;
|
|
19
|
+
}
|
|
20
|
+
if (config?.columns) {
|
|
21
|
+
ds = new VuuDataSource({
|
|
22
|
+
...config,
|
|
23
|
+
viewport: sessionKey,
|
|
24
|
+
...dataSourceConfigRef.current
|
|
25
|
+
});
|
|
26
|
+
if (props?.onConfigChange) {
|
|
27
|
+
ds.on("config", props.onConfigChange);
|
|
28
|
+
}
|
|
29
|
+
sessionState.set(sessionKey, ds);
|
|
30
|
+
return ds;
|
|
31
|
+
} else {
|
|
32
|
+
throw Error(
|
|
33
|
+
`[useSessionDataSource] unable to create new DataSource, columns have not been defined `
|
|
34
|
+
);
|
|
27
35
|
}
|
|
28
36
|
},
|
|
29
|
-
[
|
|
37
|
+
[VuuDataSource, props?.onConfigChange]
|
|
30
38
|
);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
const clearDataSource = useCallback(
|
|
40
|
+
(sessionKey, unsubscribe) => {
|
|
41
|
+
const ds = sessionState.get(sessionKey);
|
|
42
|
+
if (ds) {
|
|
43
|
+
sessionState.delete(sessionKey);
|
|
44
|
+
if (unsubscribe === true) {
|
|
45
|
+
ds.unsubscribe();
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
console.warn(
|
|
49
|
+
`[useSessionbDatasource] clearDataSource ${sessionKey} not found `
|
|
50
|
+
);
|
|
39
51
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
...dataSourceConfigRef.current,
|
|
48
|
-
columns,
|
|
49
|
-
title
|
|
50
|
-
});
|
|
51
|
-
ds.on("config", handleDataSourceConfigChange);
|
|
52
|
-
saveSession?.(ds, "data-source");
|
|
53
|
-
return ds;
|
|
54
|
-
}, [
|
|
55
|
-
VuuDataSource,
|
|
56
|
-
dataSourceConfigFromState,
|
|
57
|
-
dataSourceSessionKey,
|
|
58
|
-
handleDataSourceConfigChange,
|
|
59
|
-
id,
|
|
60
|
-
loadSession,
|
|
61
|
-
saveSession,
|
|
62
|
-
tableSchema.columns,
|
|
63
|
-
tableSchema.table,
|
|
64
|
-
title
|
|
65
|
-
]);
|
|
66
|
-
return dataSource;
|
|
52
|
+
},
|
|
53
|
+
[]
|
|
54
|
+
);
|
|
55
|
+
return {
|
|
56
|
+
clearDataSource,
|
|
57
|
+
getDataSource
|
|
58
|
+
};
|
|
67
59
|
};
|
|
68
60
|
|
|
69
61
|
export { useSessionDataSource };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionDataSource.js","sources":["../../../../packages/vuu-data-react/src/hooks/useSessionDataSource.ts"],"sourcesContent":["import type {\n DataSource,\n DataSourceConfig,\n DataSourceConfigChangeHandler,\n
|
|
1
|
+
{"version":3,"file":"useSessionDataSource.js","sources":["../../../../packages/vuu-data-react/src/hooks/useSessionDataSource.ts"],"sourcesContent":["import type {\n DataSource,\n DataSourceConfig,\n DataSourceConfigChangeHandler,\n DataSourceConstructorProps,\n} from \"@vuu-ui/vuu-data-types\";\nimport { useData } from \"@vuu-ui/vuu-utils\";\nimport { useCallback, useRef } from \"react\";\n\nconst sessionState = new Map<string, DataSource>();\n\nexport interface SessionStateHookProps {\n onConfigChange?: DataSourceConfigChangeHandler;\n}\n\nexport const useSessionDataSource = (props?: SessionStateHookProps) => {\n const { VuuDataSource } = useData();\n\n const dataSourceConfigRef = useRef<DataSourceConfig | undefined>(undefined);\n\n const getDataSource = useCallback(\n (sessionKey: string, config?: DataSourceConstructorProps) => {\n let ds = sessionState.get(sessionKey);\n if (ds) {\n if (config) {\n // this won't do anything if dataSource config already matches this\n // This is only really used when injecting a dataSource into session\n // state in Showcase examples\n // Do we definitely need this ? If not apply config can be provate\n ds.applyConfig(config, true);\n }\n\n if (ds.range.from > 0) {\n // UI does not currently restore scroll position, so always reset to top of dataset\n ds.range = ds.range.reset;\n }\n return ds;\n }\n\n if (config?.columns) {\n ds = new VuuDataSource({\n ...config,\n viewport: sessionKey,\n ...dataSourceConfigRef.current,\n });\n if (props?.onConfigChange) {\n ds.on(\"config\", props.onConfigChange);\n }\n sessionState.set(sessionKey, ds);\n return ds;\n } else {\n throw Error(\n `[useSessionDataSource] unable to create new DataSource, columns have not been defined `,\n );\n }\n },\n [VuuDataSource, props?.onConfigChange],\n );\n\n const clearDataSource = useCallback(\n (sessionKey: string, unsubscribe?: boolean) => {\n const ds = sessionState.get(sessionKey);\n if (ds) {\n sessionState.delete(sessionKey);\n if (unsubscribe === true) {\n ds.unsubscribe();\n }\n } else {\n console.warn(\n `[useSessionbDatasource] clearDataSource ${sessionKey} not found `,\n );\n }\n },\n [],\n );\n\n return {\n clearDataSource,\n getDataSource,\n };\n};\n"],"names":[],"mappings":";;;AASA,MAAM,YAAA,uBAAmB,GAAwB,EAAA;AAMpC,MAAA,oBAAA,GAAuB,CAAC,KAAkC,KAAA;AACrE,EAAM,MAAA,EAAE,aAAc,EAAA,GAAI,OAAQ,EAAA;AAElC,EAAM,MAAA,mBAAA,GAAsB,OAAqC,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ACxB,UAAA,EAAA,CAAG,WAAY,EAAA;AAAA;AACjB,OACK,MAAA;AACL,QAAQ,OAAA,CAAA,IAAA;AAAA,UACN,2CAA2C,UAAU,CAAA,WAAA;AAAA,SACvD;AAAA;AACF,KACF;AAAA,IACA;AAAC,GACH;AAEA,EAAO,OAAA;AAAA,IACL,eAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
@@ -52,12 +52,13 @@ const useVisualLinks = (dataSource) => {
|
|
|
52
52
|
content: /* @__PURE__ */ jsx(
|
|
53
53
|
IconButton,
|
|
54
54
|
{
|
|
55
|
+
appearance: "transparent",
|
|
55
56
|
"aria-label": "remove-link",
|
|
56
57
|
icon: "link",
|
|
57
58
|
onClick: removeVisualLink,
|
|
58
59
|
onMouseEnter: highlightVisualLinkTarget,
|
|
59
60
|
onMouseLeave: clearVisualLinkTarget,
|
|
60
|
-
|
|
61
|
+
sentiment: "neutral"
|
|
61
62
|
}
|
|
62
63
|
)
|
|
63
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVisualLinks.js","sources":["../../../../packages/vuu-data-react/src/hooks/useVisualLinks.tsx"],"sourcesContent":["import { DataSource } from \"@vuu-ui/vuu-data-types\";\nimport { useViewContext } from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { useCallback, useEffect } from \"react\";\n\nexport const useVisualLinks = (dataSource: DataSource) => {\n const { dispatch } = useViewContext();\n\n const clearVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const removeVisualLink = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n\n dataSource.visualLink = undefined;\n }\n }, [dataSource, dispatch]);\n\n const handleLinkRemoved = useCallback(() => {\n dispatch?.({\n type: \"remove-toolbar-contribution\",\n location: \"post-title\",\n });\n }, [dispatch]);\n\n const highlightVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-on\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const handleLinkCreated = useCallback(() => {\n dispatch?.({\n type: \"add-toolbar-contribution\",\n location: \"post-title\",\n content: (\n <IconButton\n aria-label=\"remove-link\"\n icon=\"link\"\n onClick={removeVisualLink}\n onMouseEnter={highlightVisualLinkTarget}\n onMouseLeave={clearVisualLinkTarget}\n
|
|
1
|
+
{"version":3,"file":"useVisualLinks.js","sources":["../../../../packages/vuu-data-react/src/hooks/useVisualLinks.tsx"],"sourcesContent":["import type { DataSource } from \"@vuu-ui/vuu-data-types\";\nimport { useViewContext } from \"@vuu-ui/vuu-layout\";\nimport { IconButton } from \"@vuu-ui/vuu-ui-controls\";\nimport { useCallback, useEffect } from \"react\";\n\nexport const useVisualLinks = (dataSource: DataSource) => {\n const { dispatch } = useViewContext();\n\n const clearVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const removeVisualLink = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-off\",\n },\n });\n\n dataSource.visualLink = undefined;\n }\n }, [dataSource, dispatch]);\n\n const handleLinkRemoved = useCallback(() => {\n dispatch?.({\n type: \"remove-toolbar-contribution\",\n location: \"post-title\",\n });\n }, [dispatch]);\n\n const highlightVisualLinkTarget = useCallback(() => {\n if (dataSource.visualLink) {\n dispatch?.({\n type: \"broadcast-message\",\n message: {\n targetId: dataSource.visualLink.parentClientVpId,\n type: \"highlight-on\",\n },\n });\n }\n }, [dataSource, dispatch]);\n\n const handleLinkCreated = useCallback(() => {\n dispatch?.({\n type: \"add-toolbar-contribution\",\n location: \"post-title\",\n content: (\n <IconButton\n appearance=\"transparent\"\n aria-label=\"remove-link\"\n icon=\"link\"\n onClick={removeVisualLink}\n onMouseEnter={highlightVisualLinkTarget}\n onMouseLeave={clearVisualLinkTarget}\n sentiment=\"neutral\"\n />\n ),\n });\n }, [\n dispatch,\n removeVisualLink,\n highlightVisualLinkTarget,\n clearVisualLinkTarget,\n ]);\n\n useEffect(() => {\n dataSource.on(\"visual-link-created\", handleLinkCreated);\n dataSource.on(\"visual-link-removed\", handleLinkRemoved);\n return () => {\n dataSource.removeListener(\"visual-link-created\", handleLinkCreated);\n dataSource.removeListener(\"visual-link-removed\", handleLinkRemoved);\n };\n }, [dataSource, handleLinkCreated, handleLinkRemoved]);\n};\n"],"names":[],"mappings":";;;;;AAKa,MAAA,cAAA,GAAiB,CAAC,UAA2B,KAAA;AACxD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,cAAe,EAAA;AAEpC,EAAM,MAAA,qBAAA,GAAwB,YAAY,MAAM;AAC9C,IAAA,IAAI,WAAW,UAAY,EAAA;AACzB,MAAW,QAAA,GAAA;AAAA,QACT,IAAM,EAAA,mBAAA;AAAA,QACN,OAAS,EAAA;AAAA,UACP,QAAA,EAAU,WAAW,UAAW,CAAA,gBAAA;AAAA,UAChC,IAAM,EAAA;AAAA;AACR,OACD,CAAA;AAAA;AACH,GACC,EAAA,CAAC,UAAY,EAAA,QAAQ,CAAC,CAAA;AAEzB,EAAM,MAAA,gBAAA,GAAmB,YAAY,MAAM;AACzC,IAAA,IAAI,WAAW,UAAY,EAAA;AACzB,MAAW,QAAA,GAAA;AAAA,QACT,IAAM,EAAA,mBAAA;AAAA,QACN,OAAS,EAAA;AAAA,UACP,QAAA,EAAU,WAAW,UAAW,CAAA,gBAAA;A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B,iBAAiB,CAAA;AACtD,IAAW,UAAA,CAAA,EAAA,CAAG,uBAAuB,iBAAiB,CAAA;AACtD,IAAA,OAAO,MAAM;AACX,MAAW,UAAA,CAAA,cAAA,CAAe,uBAAuB,iBAAiB,CAAA;AAClE,MAAW,UAAA,CAAA,cAAA,CAAe,uBAAuB,iBAAiB,CAAA;AAAA,KACpE;AAAA,GACC,EAAA,CAAC,UAAY,EAAA,iBAAA,EAAmB,iBAAiB,CAAC,CAAA;AACvD;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -5,12 +5,12 @@ export { UnsavedChangesReport } from './data-editing/UnsavedChangesReport.js';
|
|
|
5
5
|
export { useEditForm } from './data-editing/useEditForm.js';
|
|
6
6
|
export { CLEAN_FORM, buildFormEditState } from './data-editing/form-edit-state.js';
|
|
7
7
|
export { VuuDataSourceProvider } from './datasource-provider/VuuDataSourceProvider.js';
|
|
8
|
+
export { useLookupValues } from './hooks/useLookupValues.js';
|
|
9
|
+
export { useRemoteConnection } from './hooks/useRemoteConnection.js';
|
|
8
10
|
export { useSessionDataSource } from './hooks/useSessionDataSource.js';
|
|
11
|
+
export { getTypeaheadParams, useTypeaheadSuggestions } from './hooks/useTypeaheadSuggestions.js';
|
|
12
|
+
export { useVisualLinks } from './hooks/useVisualLinks.js';
|
|
9
13
|
export { isRowMenu, isSelectionMenu, useVuuMenuActions } from './hooks/useVuuMenuActions.js';
|
|
10
14
|
export { useVuuTables } from './hooks/useVuuTables.js';
|
|
11
|
-
export { useVisualLinks } from './hooks/useVisualLinks.js';
|
|
12
|
-
export { getTypeaheadParams, useTypeaheadSuggestions } from './hooks/useTypeaheadSuggestions.js';
|
|
13
15
|
export { SessionEditingForm } from './session-editing-form/SessionEditingForm.js';
|
|
14
|
-
export { useLookupValues } from './hooks/useLookupValues.js';
|
|
15
|
-
export { useRemoteConnection } from './hooks/useRemoteConnection.js';
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.
|
|
2
|
+
"version": "0.13.61",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"devDependencies": {
|
|
6
|
-
"@vuu-ui/vuu-data-types": "0.13.
|
|
7
|
-
"@vuu-ui/vuu-filter-types": "0.13.
|
|
8
|
-
"@vuu-ui/vuu-popups": "0.13.
|
|
9
|
-
"@vuu-ui/vuu-protocol-types": "0.13.
|
|
10
|
-
"@vuu-ui/vuu-table-types": "0.13.
|
|
6
|
+
"@vuu-ui/vuu-data-types": "0.13.61",
|
|
7
|
+
"@vuu-ui/vuu-filter-types": "0.13.61",
|
|
8
|
+
"@vuu-ui/vuu-popups": "0.13.61",
|
|
9
|
+
"@vuu-ui/vuu-protocol-types": "0.13.61",
|
|
10
|
+
"@vuu-ui/vuu-table-types": "0.13.61"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@vuu-ui/vuu-context-menu": "0.13.
|
|
14
|
-
"@vuu-ui/vuu-data-remote": "0.13.
|
|
15
|
-
"@vuu-ui/vuu-filter-parser": "0.13.
|
|
16
|
-
"@vuu-ui/vuu-filters": "0.13.
|
|
17
|
-
"@vuu-ui/vuu-layout": "0.13.
|
|
18
|
-
"@vuu-ui/vuu-popups": "0.13.
|
|
19
|
-
"@vuu-ui/vuu-ui-controls": "0.13.
|
|
20
|
-
"@vuu-ui/vuu-utils": "0.13.
|
|
21
|
-
"@vuu-ui/vuu-table": "0.13.
|
|
13
|
+
"@vuu-ui/vuu-context-menu": "0.13.61",
|
|
14
|
+
"@vuu-ui/vuu-data-remote": "0.13.61",
|
|
15
|
+
"@vuu-ui/vuu-filter-parser": "0.13.61",
|
|
16
|
+
"@vuu-ui/vuu-filters": "0.13.61",
|
|
17
|
+
"@vuu-ui/vuu-layout": "0.13.61",
|
|
18
|
+
"@vuu-ui/vuu-popups": "0.13.61",
|
|
19
|
+
"@vuu-ui/vuu-ui-controls": "0.13.61",
|
|
20
|
+
"@vuu-ui/vuu-utils": "0.13.61",
|
|
21
|
+
"@vuu-ui/vuu-table": "0.13.61",
|
|
22
22
|
"@salt-ds/core": "1.48.0",
|
|
23
23
|
"@salt-ds/styles": "0.2.1",
|
|
24
24
|
"@salt-ds/window": "0.1.1"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { DataSource,
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { DataSource, DataSourceConfigChangeHandler, DataSourceConstructorProps } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
export interface SessionStateHookProps {
|
|
3
|
+
onConfigChange?: DataSourceConfigChangeHandler;
|
|
4
|
+
}
|
|
5
|
+
export declare const useSessionDataSource: (props?: SessionStateHookProps) => {
|
|
6
|
+
clearDataSource: (sessionKey: string, unsubscribe?: boolean) => void;
|
|
7
|
+
getDataSource: (sessionKey: string, config?: DataSourceConstructorProps) => DataSource;
|
|
8
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataSource } from "@vuu-ui/vuu-data-types";
|
|
1
|
+
import type { DataSource } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
export declare const useVisualLinks: (dataSource: DataSource) => void;
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from "./data-editing";
|
|
2
2
|
export * from "./datasource-provider";
|
|
3
|
-
export * from "./hooks";
|
|
4
|
-
export * from "./session-editing-form";
|
|
5
3
|
export { useLookupValues } from "./hooks/useLookupValues";
|
|
6
4
|
export { useRemoteConnection } from "./hooks/useRemoteConnection";
|
|
5
|
+
export { useSessionDataSource } from "./hooks/useSessionDataSource";
|
|
6
|
+
export { getTypeaheadParams, useTypeaheadSuggestions, } from "./hooks/useTypeaheadSuggestions";
|
|
7
|
+
export { useVisualLinks } from "./hooks/useVisualLinks";
|
|
8
|
+
export { type MenuActionConfig, isRowMenu, isSelectionMenu, useVuuMenuActions, } from "./hooks/useVuuMenuActions";
|
|
9
|
+
export { useVuuTables } from "./hooks/useVuuTables";
|
|
10
|
+
export * from "./session-editing-form";
|