@gravity-ui/dashkit 8.21.1-beta.0 → 8.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/DashKit/DashKit.d.ts +16 -14
- package/build/cjs/components/DashKit/DashKit.js +6 -2
- package/build/cjs/components/DashKitDnDWrapper/DashKitDnDWrapper.js +2 -2
- package/build/cjs/components/DashKitView/DashKitView.js +2 -2
- package/build/cjs/components/GridItem/GridItem.js +2 -2
- package/build/cjs/components/GridLayout/GridLayout.d.ts +2 -2
- package/build/cjs/components/GridLayout/GridLayout.js +12 -6
- package/build/cjs/components/Item/Item.d.ts +1 -2
- package/build/cjs/components/MobileLayout/MobileLayout.d.ts +21 -28
- package/build/cjs/components/MobileLayout/MobileLayout.js +47 -60
- package/build/cjs/components/OverlayControls/OverlayControls.d.ts +16 -4
- package/build/cjs/components/OverlayControls/OverlayControls.js +9 -8
- package/build/cjs/context/DashKitContext.d.ts +3 -30
- package/build/cjs/context/DashKitContext.js +6 -2
- package/build/cjs/hocs/prepareItem.d.ts +1 -2
- package/build/cjs/hocs/prepareItem.js +2 -2
- package/build/cjs/hocs/withContext.js +20 -23
- package/build/cjs/hooks/useDnDItemProps.js +2 -2
- package/build/cjs/i18n/en.json +1 -1
- package/build/cjs/i18n/index.d.ts +5 -1
- package/build/cjs/plugins/Title/Title.css +4 -0
- package/build/cjs/plugins/Title/Title.d.ts +2 -1
- package/build/cjs/shared/modules/helpers.d.ts +1 -1
- package/build/cjs/shared/modules/helpers.js +1 -1
- package/build/cjs/shared/types/state-and-params.d.ts +1 -2
- package/build/cjs/typings/config.d.ts +0 -1
- package/build/esm/components/DashKit/DashKit.d.ts +16 -14
- package/build/esm/components/DashKit/DashKit.js +5 -1
- package/build/esm/components/DashKitDnDWrapper/DashKitDnDWrapper.js +1 -1
- package/build/esm/components/DashKitView/DashKitView.js +1 -1
- package/build/esm/components/GridItem/GridItem.js +1 -1
- package/build/esm/components/GridLayout/GridLayout.d.ts +2 -2
- package/build/esm/components/GridLayout/GridLayout.js +11 -5
- package/build/esm/components/Item/Item.d.ts +1 -2
- package/build/esm/components/MobileLayout/MobileLayout.d.ts +21 -29
- package/build/esm/components/MobileLayout/MobileLayout.js +46 -59
- package/build/esm/components/OverlayControls/OverlayControls.d.ts +16 -4
- package/build/esm/components/OverlayControls/OverlayControls.js +8 -7
- package/build/esm/context/DashKitContext.d.ts +3 -30
- package/build/esm/context/DashKitContext.js +4 -2
- package/build/esm/hocs/prepareItem.d.ts +1 -2
- package/build/esm/hocs/prepareItem.js +1 -1
- package/build/esm/hocs/withContext.js +17 -20
- package/build/esm/hooks/useDnDItemProps.js +1 -1
- package/build/esm/i18n/en.json +1 -1
- package/build/esm/i18n/index.d.ts +5 -1
- package/build/esm/plugins/Title/Title.css +4 -0
- package/build/esm/plugins/Title/Title.d.ts +2 -1
- package/build/esm/shared/modules/helpers.d.ts +1 -1
- package/build/esm/shared/modules/helpers.js +1 -1
- package/build/esm/shared/types/state-and-params.d.ts +1 -2
- package/build/esm/typings/config.d.ts +0 -1
- package/package.json +4 -4
- package/build/cjs/context/DashKitDnDContext.d.ts +0 -10
- package/build/cjs/context/DashKitDnDContext.js +0 -6
- package/build/cjs/context/DashkitOverlayControlsContext.d.ts +0 -13
- package/build/cjs/context/DashkitOverlayControlsContext.js +0 -6
- package/build/cjs/context/index.d.ts +0 -3
- package/build/cjs/context/index.js +0 -6
- package/build/esm/context/DashKitDnDContext.d.ts +0 -10
- package/build/esm/context/DashKitDnDContext.js +0 -2
- package/build/esm/context/DashkitOverlayControlsContext.d.ts +0 -13
- package/build/esm/context/DashkitOverlayControlsContext.js +0 -2
- package/build/esm/context/index.d.ts +0 -3
- package/build/esm/context/index.js +0 -3
|
@@ -3,7 +3,7 @@ import { Ellipsis, Gear, Xmark } from '@gravity-ui/icons';
|
|
|
3
3
|
import { Button, DropdownMenu, Icon, } from '@gravity-ui/uikit';
|
|
4
4
|
import noop from 'lodash/noop';
|
|
5
5
|
import { COPIED_WIDGET_STORE_KEY, DRAGGABLE_CANCEL_CLASS_NAME, MenuItems, OVERLAY_CONTROLS_CLASS_NAME, OVERLAY_ICON_SIZE, } from '../../constants';
|
|
6
|
-
import { DashkitOvelayControlsContext } from '../../context';
|
|
6
|
+
import { DashkitOvelayControlsContext } from '../../context/DashKitContext';
|
|
7
7
|
import { i18n } from '../../i18n';
|
|
8
8
|
import { isItemWithTabs, resolveItemInnerId, } from '../../shared';
|
|
9
9
|
import { cn } from '../../utils/cn';
|
|
@@ -119,9 +119,9 @@ class OverlayControls extends React.Component {
|
|
|
119
119
|
(_l = (_k = this.props).onItemClick) === null || _l === void 0 ? void 0 : _l.call(_k);
|
|
120
120
|
};
|
|
121
121
|
this.onEditItem = () => {
|
|
122
|
-
var _a, _b
|
|
123
|
-
|
|
124
|
-
(
|
|
122
|
+
var _a, _b;
|
|
123
|
+
this.context.editItem(this.props.configItem);
|
|
124
|
+
(_b = (_a = this.props).onItemClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
125
125
|
};
|
|
126
126
|
this.onRemoveItem = () => {
|
|
127
127
|
var _a, _b;
|
|
@@ -192,12 +192,13 @@ class OverlayControls extends React.Component {
|
|
|
192
192
|
return menu === null || menu === void 0 ? void 0 : menu.every((item) => Object.values(MenuItems).includes(String(item)));
|
|
193
193
|
}
|
|
194
194
|
renderDropdownMenu(isOnlyOneItem) {
|
|
195
|
+
var _a;
|
|
195
196
|
const { view, size, onItemClick } = this.props;
|
|
196
|
-
const { menu: contextMenu, itemsParams,
|
|
197
|
+
const { menu: contextMenu, itemsParams, itemsStateAndParams } = this.context;
|
|
197
198
|
const configItem = this.props.configItem;
|
|
198
199
|
const itemParams = itemsParams[configItem.id];
|
|
199
|
-
const itemState = (
|
|
200
|
-
const menu = contextMenu
|
|
200
|
+
const itemState = ((_a = itemsStateAndParams[configItem.id]) === null || _a === void 0 ? void 0 : _a.state) || {};
|
|
201
|
+
const menu = (contextMenu === null || contextMenu === void 0 ? void 0 : contextMenu.length) > 0 ? contextMenu : DEFAULT_DROPDOWN_MENU;
|
|
201
202
|
const isDefaultMenu = this.isDefaultMenu(menu);
|
|
202
203
|
const items = isDefaultMenu
|
|
203
204
|
? (menu || []).reduce((memo, name) => {
|
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export const DashKitContext: React.Context<any>;
|
|
2
|
+
export const DashkitOvelayControlsContext: React.Context<any>;
|
|
3
|
+
export const DashKitDnDContext: React.Context<any>;
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import type { RegisterManager } from '..//utils';
|
|
4
|
-
import type { DashKitProps } from '../components/DashKit';
|
|
5
|
-
import type { ConfigItem, ConfigLayout, ItemParams, ItemState, ItemStateAndParams, ItemStateAndParamsChangeOptions } from '../shared';
|
|
6
|
-
type DashkitPropsPassedToCtx = Pick<DashKitProps, 'config' | 'groups' | 'context' | 'noOverlay' | 'focusable' | 'globalParams' | 'editMode' | 'settings' | 'onItemMountChange' | 'onItemRender' | 'draggableHandleClassName' | 'onDragStart' | 'onDrag' | 'onDragStop' | 'onResizeStart' | 'onResize' | 'onResizeStop'>;
|
|
7
|
-
type PluginType = string;
|
|
8
|
-
export type DashKitCtxShape = DashkitPropsPassedToCtx & {
|
|
9
|
-
registerManager: RegisterManager;
|
|
10
|
-
forwardedMetaRef: React.ForwardedRef<any>;
|
|
11
|
-
layout: ConfigLayout[];
|
|
12
|
-
temporaryLayout: ConfigLayout[] | null;
|
|
13
|
-
memorizeOriginalLayout: (widgetId: string, preAutoHeightLayout: ConfigLayout, postAutoHeightLayout: ConfigLayout) => void;
|
|
14
|
-
revertToOriginalLayout: (widgetId: string) => void;
|
|
15
|
-
itemsState?: Record<string, ItemState>;
|
|
16
|
-
itemsParams: Record<string, ItemParams>;
|
|
17
|
-
onItemStateAndParamsChange: (id: string, stateAndParams: ItemStateAndParams, options: ItemStateAndParamsChangeOptions) => void;
|
|
18
|
-
getItemsMeta: (pluginsRefs: Array<React.RefObject<any>>) => Array<Promise<any>>;
|
|
19
|
-
reloadItems: (pluginsRefs: Array<React.RefObject<any>>, data: {
|
|
20
|
-
silentLoading: boolean;
|
|
21
|
-
noVeil: boolean;
|
|
22
|
-
}) => void;
|
|
23
|
-
onDrop: (newLayout: ConfigLayout, item: ConfigItem) => void;
|
|
24
|
-
onDropDragOver: (e: DragEvent | MouseEvent, group: string | void, gridProps: Partial<ReactGridLayout.ReactGridLayoutProps>, groupLayout: ConfigLayout[], sharedItem: (Partial<ConfigLayout> & {
|
|
25
|
-
type: PluginType;
|
|
26
|
-
}) | void) => void | boolean;
|
|
27
|
-
outerDnDEnable: boolean;
|
|
28
|
-
dragOverPlugin: null | PluginType;
|
|
29
|
-
};
|
|
30
|
-
declare const DashKitContext: React.Context<DashKitCtxShape>;
|
|
31
|
-
export { DashKitContext };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
const DashKitContext = React.createContext(
|
|
3
|
-
|
|
2
|
+
const DashKitContext = React.createContext();
|
|
3
|
+
const DashkitOvelayControlsContext = React.createContext();
|
|
4
|
+
const DashKitDnDContext = React.createContext();
|
|
5
|
+
export { DashKitContext, DashkitOvelayControlsContext, DashKitDnDContext };
|
|
@@ -66,7 +66,6 @@ export function prepareItem(Component: any): {
|
|
|
66
66
|
onItemMountChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
67
67
|
forwardedPluginRef: PropTypes.Requireable<any>;
|
|
68
68
|
};
|
|
69
|
-
contextType: React.Context<
|
|
69
|
+
contextType: React.Context<any>;
|
|
70
70
|
};
|
|
71
71
|
import React from 'react';
|
|
72
|
-
import PropTypes from 'prop-types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { DashKitContext } from '../context';
|
|
4
|
+
import { DashKitContext } from '../context/DashKitContext';
|
|
5
5
|
export function prepareItem(Component) {
|
|
6
6
|
var _a;
|
|
7
7
|
return _a = class PrepareItem extends React.Component {
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import isEqual from 'lodash/isEqual';
|
|
4
4
|
import pick from 'lodash/pick';
|
|
5
5
|
import { COMPACT_TYPE_HORIZONTAL_NOWRAP, DEFAULT_GROUP, DEFAULT_WIDGET_HEIGHT, DEFAULT_WIDGET_WIDTH, TEMPORARY_ITEM_ID, } from '../constants/common';
|
|
6
|
-
import { DashKitContext, DashKitDnDContext, DashkitOvelayControlsContext } from '../context';
|
|
6
|
+
import { DashKitContext, DashKitDnDContext, DashkitOvelayControlsContext, } from '../context/DashKitContext';
|
|
7
7
|
import { useDeepEqualMemo } from '../hooks/useDeepEqualMemo';
|
|
8
8
|
import { getItemsParams, getItemsState } from '../shared';
|
|
9
9
|
import { UpdateManager, resolveLayoutGroup } from '../utils';
|
|
@@ -283,7 +283,6 @@ function useMemoStateContext(props) {
|
|
|
283
283
|
}
|
|
284
284
|
return itemLayout;
|
|
285
285
|
}, [
|
|
286
|
-
props.registerManager,
|
|
287
286
|
resetTemporaryLayout,
|
|
288
287
|
temporaryLayout,
|
|
289
288
|
dragOverPlugin,
|
|
@@ -312,6 +311,8 @@ function useMemoStateContext(props) {
|
|
|
312
311
|
});
|
|
313
312
|
}, [dragPropsContext, onDropProp, setTemporaryLayout, resetTemporaryLayout]);
|
|
314
313
|
const dashkitContextValue = React.useMemo(() => ({
|
|
314
|
+
layout: resultLayout,
|
|
315
|
+
temporaryLayout,
|
|
315
316
|
config: props.config,
|
|
316
317
|
groups: props.groups,
|
|
317
318
|
context: props.context,
|
|
@@ -321,26 +322,24 @@ function useMemoStateContext(props) {
|
|
|
321
322
|
globalParams: props.globalParams,
|
|
322
323
|
editMode: props.editMode,
|
|
323
324
|
settings: props.settings,
|
|
324
|
-
onItemMountChange: props.onItemMountChange,
|
|
325
|
-
onItemRender: props.onItemRender,
|
|
326
|
-
draggableHandleClassName: props.draggableHandleClassName,
|
|
327
|
-
registerManager: props.registerManager,
|
|
328
|
-
forwardedMetaRef: props.forwardedMetaRef,
|
|
329
|
-
layout: resultLayout,
|
|
330
|
-
temporaryLayout,
|
|
331
|
-
layoutChange: onLayoutChange,
|
|
332
|
-
memorizeOriginalLayout,
|
|
333
|
-
revertToOriginalLayout,
|
|
334
325
|
itemsState,
|
|
335
326
|
itemsParams,
|
|
327
|
+
registerManager: props.registerManager,
|
|
336
328
|
onItemStateAndParamsChange,
|
|
337
|
-
getItemsMeta,
|
|
338
|
-
reloadItems,
|
|
339
329
|
onDrop,
|
|
340
330
|
onDropDragOver,
|
|
331
|
+
onItemMountChange: props.onItemMountChange,
|
|
332
|
+
onItemRender: props.onItemRender,
|
|
333
|
+
layoutChange: onLayoutChange,
|
|
334
|
+
getItemsMeta,
|
|
335
|
+
reloadItems,
|
|
336
|
+
memorizeOriginalLayout,
|
|
337
|
+
revertToOriginalLayout,
|
|
338
|
+
forwardedMetaRef: props.forwardedMetaRef,
|
|
339
|
+
draggableHandleClassName: props.draggableHandleClassName,
|
|
341
340
|
outerDnDEnable,
|
|
342
341
|
dragOverPlugin,
|
|
343
|
-
/* default handlers
|
|
342
|
+
/* default bypassing handlers */
|
|
344
343
|
onDragStart: props.onDragStart,
|
|
345
344
|
onDrag: props.onDrag,
|
|
346
345
|
onDragStop: props.onDragStop,
|
|
@@ -386,15 +385,14 @@ function useMemoStateContext(props) {
|
|
|
386
385
|
const controlsContextValue = React.useMemo(() => ({
|
|
387
386
|
overlayControls: props.overlayControls,
|
|
388
387
|
context: props.context,
|
|
388
|
+
menu: overlayMenuItems,
|
|
389
389
|
itemsStateAndParams: props.itemsStateAndParams,
|
|
390
|
-
itemsState,
|
|
391
390
|
itemsParams,
|
|
392
|
-
getPreparedCopyItemOptions: props.getPreparedCopyItemOptions,
|
|
393
|
-
onCopyFulfill: props.onCopyFulfill,
|
|
394
|
-
menu: overlayMenuItems,
|
|
395
391
|
editItem: props.onItemEdit,
|
|
396
392
|
removeItem: onItemRemove,
|
|
397
393
|
getLayoutItem: getLayoutItem,
|
|
394
|
+
getPreparedCopyItemOptions: props.getPreparedCopyItemOptions,
|
|
395
|
+
onCopyFulfill: props.onCopyFulfill,
|
|
398
396
|
}), [
|
|
399
397
|
props.overlayControls,
|
|
400
398
|
props.context,
|
|
@@ -403,7 +401,6 @@ function useMemoStateContext(props) {
|
|
|
403
401
|
props.getPreparedCopyItemOptions,
|
|
404
402
|
props.onCopyFulfill,
|
|
405
403
|
overlayMenuItems,
|
|
406
|
-
itemsState,
|
|
407
404
|
itemsParams,
|
|
408
405
|
onItemRemove,
|
|
409
406
|
getLayoutItem,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DashKitDnDContext } from '../context';
|
|
2
|
+
import { DashKitDnDContext } from '../context/DashKitContext';
|
|
3
3
|
export const useDnDItemProps = (item) => {
|
|
4
4
|
const dragContext = React.useContext(DashKitDnDContext);
|
|
5
5
|
const onDragStart = React.useCallback((e) => {
|
package/build/esm/i18n/en.json
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const i18n: (key: "button_retry" | "label_render-markdown-error" | "label_settings" | "label_copy" | "label_delete" | "label_error", params?: import("@gravity-ui/i18n").Params | undefined) => string
|
|
1
|
+
export declare const i18n: ((key: "button_retry" | "label_render-markdown-error" | "label_settings" | "label_copy" | "label_delete" | "label_error", params?: import("@gravity-ui/i18n").Params | undefined) => string) & {
|
|
2
|
+
keysetData: {
|
|
3
|
+
dashkit: Record<"button_retry" | "label_render-markdown-error" | "label_settings" | "label_copy" | "label_delete" | "label_error", import("@gravity-ui/i18n").KeyData>;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Plugin, PluginWidgetProps } from '../../typings';
|
|
3
3
|
import './Title.css';
|
|
4
|
+
export type PluginTitleSize = 'xl' | 'l' | 'm' | 's' | 'xs';
|
|
4
5
|
export interface PluginTitleProps extends PluginWidgetProps {
|
|
5
6
|
data: {
|
|
6
|
-
size:
|
|
7
|
+
size: PluginTitleSize;
|
|
7
8
|
text: string;
|
|
8
9
|
showInTOC: boolean;
|
|
9
10
|
} & PluginWidgetProps['data'];
|
|
@@ -18,7 +18,7 @@ export declare function formQueueData({ items, itemsStateAndParams, }: {
|
|
|
18
18
|
}): FormedQueueData[];
|
|
19
19
|
export declare function resolveItemInnerId({ item, itemsStateAndParams, }: {
|
|
20
20
|
item: Pick<ConfigItemWithTabs, 'data' | 'id'>;
|
|
21
|
-
itemsStateAndParams
|
|
21
|
+
itemsStateAndParams: ItemsStateAndParams;
|
|
22
22
|
}): string;
|
|
23
23
|
export declare function getMapItemsIgnores({ items, ignores, itemsStateAndParams, isFirstVersion, }: {
|
|
24
24
|
items: (ConfigItem | ConfigItemGroup)[];
|
|
@@ -108,7 +108,7 @@ export function formQueueData({ items, itemsStateAndParams, }) {
|
|
|
108
108
|
export function resolveItemInnerId({ item, itemsStateAndParams, }) {
|
|
109
109
|
var _a, _b;
|
|
110
110
|
const { id } = item;
|
|
111
|
-
const stateTabId = (_b = (_a = itemsStateAndParams
|
|
111
|
+
const stateTabId = (_b = (_a = itemsStateAndParams[id]) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.tabId;
|
|
112
112
|
const { tabs } = item.data;
|
|
113
113
|
if (stateTabId && tabs.some((tab) => tab.id === stateTabId)) {
|
|
114
114
|
return stateTabId;
|
|
@@ -3,7 +3,6 @@ import { StringParams } from './common';
|
|
|
3
3
|
export interface ItemState {
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
}
|
|
6
|
-
export type ItemParams = StringParams | Record<string, StringParams>;
|
|
7
6
|
export interface QueueItem {
|
|
8
7
|
id: string;
|
|
9
8
|
tabId?: string;
|
|
@@ -17,7 +16,7 @@ export type StateAndParamsMeta = {
|
|
|
17
16
|
[META_KEY]: StateAndParamsMetaData;
|
|
18
17
|
};
|
|
19
18
|
export type ItemStateAndParams = {
|
|
20
|
-
params?:
|
|
19
|
+
params?: StringParams | Record<string, StringParams>;
|
|
21
20
|
state?: ItemState;
|
|
22
21
|
};
|
|
23
22
|
export type ItemStateAndParamsChangeOptions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/dashkit",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.22.0",
|
|
4
4
|
"description": "Library for rendering dashboard grid layout",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@bem-react/classname": "^1.6.0",
|
|
64
|
-
"@gravity-ui/icons": "^2.
|
|
64
|
+
"@gravity-ui/icons": "^2.11.0",
|
|
65
65
|
"hashids": "^2.2.8",
|
|
66
66
|
"immutability-helper": "^3.1.1",
|
|
67
67
|
"prop-types": "^15.8.1",
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@commitlint/cli": "^17.0.3",
|
|
77
77
|
"@commitlint/config-conventional": "^17.0.3",
|
|
78
|
-
"@gravity-ui/eslint-config": "^3.
|
|
78
|
+
"@gravity-ui/eslint-config": "^3.2.0",
|
|
79
79
|
"@gravity-ui/prettier-config": "^1.1.0",
|
|
80
80
|
"@gravity-ui/stylelint-config": "^4.0.1",
|
|
81
81
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
82
|
-
"@gravity-ui/uikit": "^6.
|
|
82
|
+
"@gravity-ui/uikit": "^6.37.0",
|
|
83
83
|
"@storybook/addon-essentials": "^7.6.15",
|
|
84
84
|
"@storybook/addon-knobs": "^7.0.2",
|
|
85
85
|
"@storybook/cli": "^7.6.15",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DraggedOverItem, ItemDragProps } from '../shared/types';
|
|
3
|
-
export type DashKitDnDCtxShape = {
|
|
4
|
-
dragProps: ItemDragProps | null;
|
|
5
|
-
dragImagePreview: HTMLImageElement;
|
|
6
|
-
onDragStart: (e: React.DragEvent<Element>, itemDragProps: ItemDragProps) => void;
|
|
7
|
-
onDragEnd: (e: React.DragEvent<Element>) => void;
|
|
8
|
-
onDropDragOver?: (draggedItem: DraggedOverItem, sharedItem: DraggedOverItem | null) => void | boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare const DashKitDnDContext: React.Context<void | DashKitDnDCtxShape>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DashKitDnDContext = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
exports.DashKitDnDContext = react_1.default.createContext(undefined);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DashKitProps } from '../components';
|
|
3
|
-
import type { ConfigLayout, ItemParams, ItemState } from '../shared';
|
|
4
|
-
import type { MenuItem } from '../typings';
|
|
5
|
-
export type OverlayControlsCtxShape = Pick<DashKitProps, 'context' | 'overlayControls' | 'itemsStateAndParams' | 'getPreparedCopyItemOptions' | 'onCopyFulfill'> & {
|
|
6
|
-
menu: DashKitProps['overlayMenuItems'] | MenuItem[];
|
|
7
|
-
itemsState?: Record<string, ItemState>;
|
|
8
|
-
itemsParams: Record<string, ItemParams>;
|
|
9
|
-
editItem: DashKitProps['onItemEdit'];
|
|
10
|
-
removeItem: (id: string) => void;
|
|
11
|
-
getLayoutItem: (id: string) => ConfigLayout | void;
|
|
12
|
-
};
|
|
13
|
-
export declare const DashkitOvelayControlsContext: React.Context<void | OverlayControlsCtxShape>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DashkitOvelayControlsContext = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
-
exports.DashkitOvelayControlsContext = react_1.default.createContext(undefined);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./DashKitContext"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./DashkitOverlayControlsContext"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./DashKitDnDContext"), exports);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DraggedOverItem, ItemDragProps } from '../shared/types';
|
|
3
|
-
export type DashKitDnDCtxShape = {
|
|
4
|
-
dragProps: ItemDragProps | null;
|
|
5
|
-
dragImagePreview: HTMLImageElement;
|
|
6
|
-
onDragStart: (e: React.DragEvent<Element>, itemDragProps: ItemDragProps) => void;
|
|
7
|
-
onDragEnd: (e: React.DragEvent<Element>) => void;
|
|
8
|
-
onDropDragOver?: (draggedItem: DraggedOverItem, sharedItem: DraggedOverItem | null) => void | boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare const DashKitDnDContext: React.Context<void | DashKitDnDCtxShape>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DashKitProps } from '../components';
|
|
3
|
-
import type { ConfigLayout, ItemParams, ItemState } from '../shared';
|
|
4
|
-
import type { MenuItem } from '../typings';
|
|
5
|
-
export type OverlayControlsCtxShape = Pick<DashKitProps, 'context' | 'overlayControls' | 'itemsStateAndParams' | 'getPreparedCopyItemOptions' | 'onCopyFulfill'> & {
|
|
6
|
-
menu: DashKitProps['overlayMenuItems'] | MenuItem[];
|
|
7
|
-
itemsState?: Record<string, ItemState>;
|
|
8
|
-
itemsParams: Record<string, ItemParams>;
|
|
9
|
-
editItem: DashKitProps['onItemEdit'];
|
|
10
|
-
removeItem: (id: string) => void;
|
|
11
|
-
getLayoutItem: (id: string) => ConfigLayout | void;
|
|
12
|
-
};
|
|
13
|
-
export declare const DashkitOvelayControlsContext: React.Context<void | OverlayControlsCtxShape>;
|