@gravity-ui/dashkit 6.5.0 → 6.5.1-beta.1
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/build/cjs/components/OverlayControls/OverlayControls.d.ts +1 -0
- package/build/cjs/components/OverlayControls/OverlayControls.js +5 -1
- package/build/esm/components/OverlayControls/OverlayControls.d.ts +1 -0
- package/build/esm/components/OverlayControls/OverlayControls.js +5 -1
- package/package.json +1 -1
|
@@ -39,6 +39,7 @@ interface OverlayControlsProps extends OverlayControlsDefaultProps {
|
|
|
39
39
|
overlayControls?: Record<string, OverlayControlItem[]>;
|
|
40
40
|
}
|
|
41
41
|
type DashKitCtx = React.Context<{
|
|
42
|
+
context: Record<string, any>;
|
|
42
43
|
registerManager: RegisterManager;
|
|
43
44
|
itemsParams: Record<string, StringParams>;
|
|
44
45
|
itemsState: Record<string, ItemState>;
|
|
@@ -56,10 +56,11 @@ class OverlayControls extends react_1.default.Component {
|
|
|
56
56
|
return controls;
|
|
57
57
|
};
|
|
58
58
|
this.onCopyItem = () => {
|
|
59
|
+
var _a;
|
|
59
60
|
const correspondedItemLayout = this.context.config.layout.find((item) => {
|
|
60
61
|
return item.i === this.props.configItem.id;
|
|
61
62
|
});
|
|
62
|
-
|
|
63
|
+
let options = {
|
|
63
64
|
timestamp: Date.now(),
|
|
64
65
|
data: this.props.configItem.data,
|
|
65
66
|
type: this.props.configItem.type,
|
|
@@ -70,6 +71,9 @@ class OverlayControls extends react_1.default.Component {
|
|
|
70
71
|
h: correspondedItemLayout.h,
|
|
71
72
|
},
|
|
72
73
|
};
|
|
74
|
+
if (typeof ((_a = this.context.context) === null || _a === void 0 ? void 0 : _a.getPreparedCopyItemOptions) === 'function') {
|
|
75
|
+
options = this.context.context.getPreparedCopyItemOptions(options);
|
|
76
|
+
}
|
|
73
77
|
localStorage.setItem(constants_1.COPIED_WIDGET_STORE_KEY, JSON.stringify(options));
|
|
74
78
|
// https://stackoverflow.com/questions/35865481/storage-event-not-firing
|
|
75
79
|
window.dispatchEvent(new Event('storage'));
|
|
@@ -40,6 +40,7 @@ interface OverlayControlsProps extends OverlayControlsDefaultProps {
|
|
|
40
40
|
overlayControls?: Record<string, OverlayControlItem[]>;
|
|
41
41
|
}
|
|
42
42
|
type DashKitCtx = React.Context<{
|
|
43
|
+
context: Record<string, any>;
|
|
43
44
|
registerManager: RegisterManager;
|
|
44
45
|
itemsParams: Record<string, StringParams>;
|
|
45
46
|
itemsState: Record<string, ItemState>;
|
|
@@ -53,10 +53,11 @@ class OverlayControls extends React.Component {
|
|
|
53
53
|
return controls;
|
|
54
54
|
};
|
|
55
55
|
this.onCopyItem = () => {
|
|
56
|
+
var _a;
|
|
56
57
|
const correspondedItemLayout = this.context.config.layout.find((item) => {
|
|
57
58
|
return item.i === this.props.configItem.id;
|
|
58
59
|
});
|
|
59
|
-
|
|
60
|
+
let options = {
|
|
60
61
|
timestamp: Date.now(),
|
|
61
62
|
data: this.props.configItem.data,
|
|
62
63
|
type: this.props.configItem.type,
|
|
@@ -67,6 +68,9 @@ class OverlayControls extends React.Component {
|
|
|
67
68
|
h: correspondedItemLayout.h,
|
|
68
69
|
},
|
|
69
70
|
};
|
|
71
|
+
if (typeof ((_a = this.context.context) === null || _a === void 0 ? void 0 : _a.getPreparedCopyItemOptions) === 'function') {
|
|
72
|
+
options = this.context.context.getPreparedCopyItemOptions(options);
|
|
73
|
+
}
|
|
70
74
|
localStorage.setItem(COPIED_WIDGET_STORE_KEY, JSON.stringify(options));
|
|
71
75
|
// https://stackoverflow.com/questions/35865481/storage-event-not-firing
|
|
72
76
|
window.dispatchEvent(new Event('storage'));
|