@gravity-ui/dashkit 8.24.0 → 8.24.2

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.
@@ -8,6 +8,8 @@ export interface PluginTitleProps extends PluginWidgetProps {
8
8
  showInTOC: boolean;
9
9
  } & PluginWidgetProps['data'];
10
10
  }
11
- export declare const PluginTitle: React.ForwardRefExoticComponent<PluginTitleProps & React.RefAttributes<HTMLDivElement>>;
11
+ export declare class PluginTitle extends React.Component<PluginTitleProps> {
12
+ render(): JSX.Element;
13
+ }
12
14
  declare const plugin: Plugin<PluginTitleProps>;
13
15
  export default plugin;
@@ -8,25 +8,28 @@ const constants_1 = require("../constants");
8
8
  const constants_2 = require("./constants");
9
9
  const utils_1 = require("./utils");
10
10
  const b = (0, cn_1.cn)('dashkit-plugin-title');
11
- exports.PluginTitle = react_1.default.forwardRef(function PluginTitleForwardRef(props, ref) {
12
- var _a, _b;
13
- const { data } = props;
14
- const text = data.text ? data.text : '';
15
- const size = (0, utils_1.isCustomSize)(data.size) ? false : data.size;
16
- const styles = (0, utils_1.isCustomSize)(data.size) && ((_a = data.size) === null || _a === void 0 ? void 0 : _a.fontSize)
17
- ? {
18
- fontSize: data.size.fontSize,
19
- lineHeight: (_b = data.size.lineHeight) !== null && _b !== void 0 ? _b : constants_2.RECCOMMENDED_LINE_HEIGHT_MULTIPLIER,
20
- }
21
- : undefined;
22
- const id = data.showInTOC && text ? encodeURIComponent(text) : undefined;
23
- return (react_1.default.createElement("div", { ref: ref, id: id, style: styles, className: b({ size }), [constants_1.PLUGIN_ROOT_ATTR_NAME]: 'title' }, text));
24
- });
11
+ class PluginTitle extends react_1.default.Component {
12
+ render() {
13
+ var _a, _b;
14
+ const { data } = this.props;
15
+ const text = data.text ? data.text : '';
16
+ const size = (0, utils_1.isCustomSize)(data.size) ? false : data.size;
17
+ const styles = (0, utils_1.isCustomSize)(data.size) && ((_a = data.size) === null || _a === void 0 ? void 0 : _a.fontSize)
18
+ ? {
19
+ fontSize: data.size.fontSize,
20
+ lineHeight: (_b = data.size.lineHeight) !== null && _b !== void 0 ? _b : constants_2.RECCOMMENDED_LINE_HEIGHT_MULTIPLIER,
21
+ }
22
+ : undefined;
23
+ const id = data.showInTOC && text ? encodeURIComponent(text) : undefined;
24
+ return (react_1.default.createElement("div", { id: id, style: styles, className: b({ size }), [constants_1.PLUGIN_ROOT_ATTR_NAME]: 'title' }, text));
25
+ }
26
+ }
27
+ exports.PluginTitle = PluginTitle;
25
28
  const plugin = {
26
29
  type: 'title',
27
30
  defaultLayout: { w: 36, h: 2 },
28
31
  renderer(props, forwardedRef) {
29
- return react_1.default.createElement(exports.PluginTitle, Object.assign({}, props, { ref: forwardedRef }));
32
+ return react_1.default.createElement(PluginTitle, Object.assign({}, props, { ref: forwardedRef }));
30
33
  },
31
34
  };
32
35
  exports.default = plugin;
@@ -1,3 +1,3 @@
1
1
  import { PluginTitleSize, TitleFontParams } from './types';
2
2
  export declare const TITLE_DEFAULT_SIZES: Record<PluginTitleSize, TitleFontParams>;
3
- export declare const RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.25;
3
+ export declare const RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.1;
@@ -23,4 +23,4 @@ exports.TITLE_DEFAULT_SIZES = {
23
23
  lineHeight: '20px',
24
24
  },
25
25
  };
26
- exports.RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.25;
26
+ exports.RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.1;
@@ -9,6 +9,8 @@ export interface PluginTitleProps extends PluginWidgetProps {
9
9
  showInTOC: boolean;
10
10
  } & PluginWidgetProps['data'];
11
11
  }
12
- export declare const PluginTitle: React.ForwardRefExoticComponent<PluginTitleProps & React.RefAttributes<HTMLDivElement>>;
12
+ export declare class PluginTitle extends React.Component<PluginTitleProps> {
13
+ render(): JSX.Element;
14
+ }
13
15
  declare const plugin: Plugin<PluginTitleProps>;
14
16
  export default plugin;
@@ -5,20 +5,22 @@ import { RECCOMMENDED_LINE_HEIGHT_MULTIPLIER } from './constants';
5
5
  import { isCustomSize } from './utils';
6
6
  import './Title.css';
7
7
  const b = cn('dashkit-plugin-title');
8
- export const PluginTitle = React.forwardRef(function PluginTitleForwardRef(props, ref) {
9
- var _a, _b;
10
- const { data } = props;
11
- const text = data.text ? data.text : '';
12
- const size = isCustomSize(data.size) ? false : data.size;
13
- const styles = isCustomSize(data.size) && ((_a = data.size) === null || _a === void 0 ? void 0 : _a.fontSize)
14
- ? {
15
- fontSize: data.size.fontSize,
16
- lineHeight: (_b = data.size.lineHeight) !== null && _b !== void 0 ? _b : RECCOMMENDED_LINE_HEIGHT_MULTIPLIER,
17
- }
18
- : undefined;
19
- const id = data.showInTOC && text ? encodeURIComponent(text) : undefined;
20
- return (React.createElement("div", { ref: ref, id: id, style: styles, className: b({ size }), [PLUGIN_ROOT_ATTR_NAME]: 'title' }, text));
21
- });
8
+ export class PluginTitle extends React.Component {
9
+ render() {
10
+ var _a, _b;
11
+ const { data } = this.props;
12
+ const text = data.text ? data.text : '';
13
+ const size = isCustomSize(data.size) ? false : data.size;
14
+ const styles = isCustomSize(data.size) && ((_a = data.size) === null || _a === void 0 ? void 0 : _a.fontSize)
15
+ ? {
16
+ fontSize: data.size.fontSize,
17
+ lineHeight: (_b = data.size.lineHeight) !== null && _b !== void 0 ? _b : RECCOMMENDED_LINE_HEIGHT_MULTIPLIER,
18
+ }
19
+ : undefined;
20
+ const id = data.showInTOC && text ? encodeURIComponent(text) : undefined;
21
+ return (React.createElement("div", { id: id, style: styles, className: b({ size }), [PLUGIN_ROOT_ATTR_NAME]: 'title' }, text));
22
+ }
23
+ }
22
24
  const plugin = {
23
25
  type: 'title',
24
26
  defaultLayout: { w: 36, h: 2 },
@@ -1,3 +1,3 @@
1
1
  import { PluginTitleSize, TitleFontParams } from './types';
2
2
  export declare const TITLE_DEFAULT_SIZES: Record<PluginTitleSize, TitleFontParams>;
3
- export declare const RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.25;
3
+ export declare const RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.1;
@@ -20,4 +20,4 @@ export const TITLE_DEFAULT_SIZES = {
20
20
  lineHeight: '20px',
21
21
  },
22
22
  };
23
- export const RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.25;
23
+ export const RECCOMMENDED_LINE_HEIGHT_MULTIPLIER = 1.1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "8.24.0",
3
+ "version": "8.24.2",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {