@gravity-ui/dashkit
Advanced tools
Comparing version 8.20.2 to 8.21.0
@@ -73,3 +73,7 @@ import React from 'react'; | ||
getItemsMeta(): any; | ||
reloadItems(options?: { | ||
targetIds?: string[]; | ||
force?: boolean; | ||
}): void; | ||
} | ||
export {}; |
@@ -94,2 +94,6 @@ "use strict"; | ||
} | ||
reloadItems(options) { | ||
var _a; | ||
(_a = this.metaRef.current) === null || _a === void 0 ? void 0 : _a.reloadItems(options); | ||
} | ||
} | ||
@@ -96,0 +100,0 @@ exports.DashKit = DashKit; |
@@ -41,3 +41,3 @@ export default class GridLayout extends React.PureComponent<any, any, any> { | ||
mergeGroupsLayout(group: any, newLayout: any, temporaryItem: any): any; | ||
reloadItems(): void; | ||
reloadItems(options: any): void; | ||
prepareDefaultArguments(group: any, layout: any, oldItem: any, newItem: any, placeholder: any, e: any, element: any): { | ||
@@ -44,0 +44,0 @@ group: any; |
@@ -255,15 +255,22 @@ "use strict"; | ||
} | ||
reloadItems() { | ||
reloadItems(options) { | ||
const { targetIds, force } = options || {}; | ||
const { editMode, settings: { autoupdateInterval, silentLoading } = {}, reloadItems, } = this.context; | ||
const { isPageHidden } = this.state; | ||
const autoupdateIntervalMs = Number(autoupdateInterval) * 1000; | ||
const targetPlugins = targetIds | ||
? this.pluginsRefs.filter((plugin) => targetIds.includes(plugin.props.id)) | ||
: this.pluginsRefs; | ||
if (autoupdateIntervalMs) { | ||
const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0); | ||
const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload; | ||
if (!isPageHidden && !editMode && reloadIntervalRemains <= 0) { | ||
if (force || (!isPageHidden && !editMode && reloadIntervalRemains <= 0)) { | ||
this._lastReloadAt = new Date().getTime(); | ||
reloadItems(this.pluginsRefs, { silentLoading, noVeil: true }); | ||
reloadItems(targetPlugins, { silentLoading, noVeil: true }); | ||
} | ||
this._timeout = setTimeout(() => this.reloadItems(), reloadIntervalRemains <= 0 ? autoupdateIntervalMs : reloadIntervalRemains); | ||
} | ||
else if (force || (!isPageHidden && !editMode)) { | ||
reloadItems(targetPlugins, { silentLoading, noVeil: true }); | ||
} | ||
} | ||
@@ -270,0 +277,0 @@ prepareDefaultArguments(group, layout, oldItem, newItem, placeholder, e, element) { |
@@ -1,1 +0,5 @@ | ||
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; | ||
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) & { | ||
keysetData: { | ||
dashkit: Record<"button_retry" | "label_render-markdown-error" | "label_settings" | "label_copy" | "label_delete" | "label_error", import("@gravity-ui/i18n").KeyData>; | ||
}; | ||
}; |
@@ -73,3 +73,7 @@ import React from 'react'; | ||
getItemsMeta(): any; | ||
reloadItems(options?: { | ||
targetIds?: string[]; | ||
force?: boolean; | ||
}): void; | ||
} | ||
export {}; |
@@ -90,2 +90,6 @@ import React from 'react'; | ||
} | ||
reloadItems(options) { | ||
var _a; | ||
(_a = this.metaRef.current) === null || _a === void 0 ? void 0 : _a.reloadItems(options); | ||
} | ||
} | ||
@@ -92,0 +96,0 @@ DashKit.defaultProps = { |
@@ -41,3 +41,3 @@ export default class GridLayout extends React.PureComponent<any, any, any> { | ||
mergeGroupsLayout(group: any, newLayout: any, temporaryItem: any): any; | ||
reloadItems(): void; | ||
reloadItems(options: any): void; | ||
prepareDefaultArguments(group: any, layout: any, oldItem: any, newItem: any, placeholder: any, e: any, element: any): { | ||
@@ -44,0 +44,0 @@ group: any; |
@@ -252,15 +252,22 @@ import React from 'react'; | ||
} | ||
reloadItems() { | ||
reloadItems(options) { | ||
const { targetIds, force } = options || {}; | ||
const { editMode, settings: { autoupdateInterval, silentLoading } = {}, reloadItems, } = this.context; | ||
const { isPageHidden } = this.state; | ||
const autoupdateIntervalMs = Number(autoupdateInterval) * 1000; | ||
const targetPlugins = targetIds | ||
? this.pluginsRefs.filter((plugin) => targetIds.includes(plugin.props.id)) | ||
: this.pluginsRefs; | ||
if (autoupdateIntervalMs) { | ||
const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0); | ||
const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload; | ||
if (!isPageHidden && !editMode && reloadIntervalRemains <= 0) { | ||
if (force || (!isPageHidden && !editMode && reloadIntervalRemains <= 0)) { | ||
this._lastReloadAt = new Date().getTime(); | ||
reloadItems(this.pluginsRefs, { silentLoading, noVeil: true }); | ||
reloadItems(targetPlugins, { silentLoading, noVeil: true }); | ||
} | ||
this._timeout = setTimeout(() => this.reloadItems(), reloadIntervalRemains <= 0 ? autoupdateIntervalMs : reloadIntervalRemains); | ||
} | ||
else if (force || (!isPageHidden && !editMode)) { | ||
reloadItems(targetPlugins, { silentLoading, noVeil: true }); | ||
} | ||
} | ||
@@ -267,0 +274,0 @@ prepareDefaultArguments(group, layout, oldItem, newItem, placeholder, e, element) { |
@@ -1,1 +0,5 @@ | ||
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; | ||
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) & { | ||
keysetData: { | ||
dashkit: Record<"button_retry" | "label_render-markdown-error" | "label_settings" | "label_copy" | "label_delete" | "label_error", import("@gravity-ui/i18n").KeyData>; | ||
}; | ||
}; |
{ | ||
"name": "@gravity-ui/dashkit", | ||
"version": "8.20.2", | ||
"version": "8.21.0", | ||
"description": "Library for rendering dashboard grid layout", | ||
@@ -64,3 +64,3 @@ "license": "MIT", | ||
"@bem-react/classname": "^1.6.0", | ||
"@gravity-ui/icons": "^2.8.1", | ||
"@gravity-ui/icons": "^2.11.0", | ||
"hashids": "^2.2.8", | ||
@@ -79,7 +79,7 @@ "immutability-helper": "^3.1.1", | ||
"@commitlint/config-conventional": "^17.0.3", | ||
"@gravity-ui/eslint-config": "^3.1.1", | ||
"@gravity-ui/eslint-config": "^3.2.0", | ||
"@gravity-ui/prettier-config": "^1.1.0", | ||
"@gravity-ui/stylelint-config": "^4.0.1", | ||
"@gravity-ui/tsconfig": "^1.0.0", | ||
"@gravity-ui/uikit": "^6.0.0", | ||
"@gravity-ui/uikit": "^6.37.0", | ||
"@storybook/addon-essentials": "^7.6.15", | ||
@@ -86,0 +86,0 @@ "@storybook/addon-knobs": "^7.0.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
596429
14710
Updated@gravity-ui/icons@^2.11.0