@gravity-ui/dashkit 8.15.3 → 8.16.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 +1 -0
- package/build/cjs/components/DashKit/DashKit.js +5 -0
- package/build/cjs/utils/register-manager.d.ts +1 -0
- package/build/cjs/utils/register-manager.js +5 -1
- package/build/esm/components/DashKit/DashKit.d.ts +1 -0
- package/build/esm/components/DashKit/DashKit.js +5 -0
- package/build/esm/utils/register-manager.d.ts +1 -0
- package/build/esm/utils/register-manager.js +5 -1
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ type DashKitInnerProps = DashKitGeneralProps & DashKitDefaultProps;
|
|
|
44
44
|
export declare class DashKit extends React.PureComponent<DashKitInnerProps> {
|
|
45
45
|
static defaultProps: DashKitDefaultProps;
|
|
46
46
|
static registerPlugins(...plugins: Plugin[]): void;
|
|
47
|
+
static reloadPlugins(...plugins: Plugin[]): void;
|
|
47
48
|
static setSettings(settings: Settings): void;
|
|
48
49
|
static setItem({ item: setItem, namespace, config, options, groups, }: {
|
|
49
50
|
item: SetConfigItem;
|
|
@@ -33,6 +33,11 @@ class DashKit extends react_1.default.PureComponent {
|
|
|
33
33
|
registerManager.registerPlugin(plugin);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
static reloadPlugins(...plugins) {
|
|
37
|
+
plugins.forEach((plugin) => {
|
|
38
|
+
registerManager.reloadPlugin(plugin);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
36
41
|
static setSettings(settings) {
|
|
37
42
|
registerManager.setSettings(settings);
|
|
38
43
|
}
|
|
@@ -21,6 +21,7 @@ export declare class RegisterManager {
|
|
|
21
21
|
private _gridLayout;
|
|
22
22
|
private _settings;
|
|
23
23
|
registerPlugin(plugin: Plugin): void;
|
|
24
|
+
reloadPlugin(plugin: Plugin): void;
|
|
24
25
|
setSettings(settings?: Settings): void;
|
|
25
26
|
get settings(): RegisterManagerSettings;
|
|
26
27
|
get gridLayout(): ReactGridLayout.ReactGridLayoutProps;
|
|
@@ -24,10 +24,14 @@ class RegisterManager {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
registerPlugin(plugin) {
|
|
27
|
-
const { type
|
|
27
|
+
const { type } = plugin;
|
|
28
28
|
if (type in this._items) {
|
|
29
29
|
throw new Error(`DashKit.registerPlugins: type ${type} уже был зарегистрирован`);
|
|
30
30
|
}
|
|
31
|
+
this.reloadPlugin(plugin);
|
|
32
|
+
}
|
|
33
|
+
reloadPlugin(plugin) {
|
|
34
|
+
const { type, defaultLayout = {} } = plugin, item = tslib_1.__rest(plugin, ["type", "defaultLayout"]);
|
|
31
35
|
if (typeof plugin.renderer !== 'function') {
|
|
32
36
|
throw new Error('DashKit.registerPlugins: renderer должна быть функцией');
|
|
33
37
|
}
|
|
@@ -44,6 +44,7 @@ type DashKitInnerProps = DashKitGeneralProps & DashKitDefaultProps;
|
|
|
44
44
|
export declare class DashKit extends React.PureComponent<DashKitInnerProps> {
|
|
45
45
|
static defaultProps: DashKitDefaultProps;
|
|
46
46
|
static registerPlugins(...plugins: Plugin[]): void;
|
|
47
|
+
static reloadPlugins(...plugins: Plugin[]): void;
|
|
47
48
|
static setSettings(settings: Settings): void;
|
|
48
49
|
static setItem({ item: setItem, namespace, config, options, groups, }: {
|
|
49
50
|
item: SetConfigItem;
|
|
@@ -29,6 +29,11 @@ export class DashKit extends React.PureComponent {
|
|
|
29
29
|
registerManager.registerPlugin(plugin);
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
static reloadPlugins(...plugins) {
|
|
33
|
+
plugins.forEach((plugin) => {
|
|
34
|
+
registerManager.reloadPlugin(plugin);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
32
37
|
static setSettings(settings) {
|
|
33
38
|
registerManager.setSettings(settings);
|
|
34
39
|
}
|
|
@@ -21,6 +21,7 @@ export declare class RegisterManager {
|
|
|
21
21
|
private _gridLayout;
|
|
22
22
|
private _settings;
|
|
23
23
|
registerPlugin(plugin: Plugin): void;
|
|
24
|
+
reloadPlugin(plugin: Plugin): void;
|
|
24
25
|
setSettings(settings?: Settings): void;
|
|
25
26
|
get settings(): RegisterManagerSettings;
|
|
26
27
|
get gridLayout(): ReactGridLayout.ReactGridLayoutProps;
|
|
@@ -21,10 +21,14 @@ export class RegisterManager {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
registerPlugin(plugin) {
|
|
24
|
-
const { type
|
|
24
|
+
const { type } = plugin;
|
|
25
25
|
if (type in this._items) {
|
|
26
26
|
throw new Error(`DashKit.registerPlugins: type ${type} уже был зарегистрирован`);
|
|
27
27
|
}
|
|
28
|
+
this.reloadPlugin(plugin);
|
|
29
|
+
}
|
|
30
|
+
reloadPlugin(plugin) {
|
|
31
|
+
const { type, defaultLayout = {} } = plugin, item = __rest(plugin, ["type", "defaultLayout"]);
|
|
28
32
|
if (typeof plugin.renderer !== 'function') {
|
|
29
33
|
throw new Error('DashKit.registerPlugins: renderer должна быть функцией');
|
|
30
34
|
}
|