@gravity-ui/dynamic-forms 4.9.0 → 4.10.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.
@@ -12,4 +12,7 @@
12
12
  }
13
13
  .df-long-value_long:hover {
14
14
  color: var(--g-color-text-secondary);
15
+ }
16
+ .df-long-value_long.df-long-value_secondary:hover {
17
+ color: var(--g-color-text-primary);
15
18
  }
@@ -8,7 +8,7 @@ const uikit_1 = require("@gravity-ui/uikit");
8
8
  const utils_1 = require("../../utils");
9
9
  const b = (0, utils_1.block)('long-value');
10
10
  const LongValue = (_a) => {
11
- var { value, onClick, className } = _a, restProps = tslib_1.__rest(_a, ["value", "onClick", "className"]);
11
+ var { value, onClick, className: externalClassName } = _a, restProps = tslib_1.__rest(_a, ["value", "onClick", "className"]);
12
12
  const ref = react_1.default.useRef(null);
13
13
  const [open, setOpen] = react_1.default.useState(false);
14
14
  const [long, setLong] = react_1.default.useState(false);
@@ -16,6 +16,8 @@ const LongValue = (_a) => {
16
16
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
17
17
  setOpen((f) => !f);
18
18
  }, [setOpen, onClick]);
19
+ const className = react_1.default.useMemo(() => b(Object.assign({ open,
20
+ long }, (restProps.color ? { [restProps.color]: true } : {})), externalClassName), [open, long, externalClassName, restProps.color]);
19
21
  react_1.default.useEffect(() => {
20
22
  if (ref.current) {
21
23
  const { offsetWidth, scrollWidth } = ref.current;
@@ -12,4 +12,7 @@
12
12
  }
13
13
  .df-long-value_long:hover {
14
14
  color: var(--g-color-text-secondary);
15
+ }
16
+ .df-long-value_long.df-long-value_secondary:hover {
17
+ color: var(--g-color-text-primary);
15
18
  }
@@ -6,7 +6,7 @@ import { block } from '../../utils';
6
6
  import './LongValue.css';
7
7
  const b = block('long-value');
8
8
  export const LongValue = (_a) => {
9
- var { value, onClick, className } = _a, restProps = __rest(_a, ["value", "onClick", "className"]);
9
+ var { value, onClick, className: externalClassName } = _a, restProps = __rest(_a, ["value", "onClick", "className"]);
10
10
  const ref = React.useRef(null);
11
11
  const [open, setOpen] = React.useState(false);
12
12
  const [long, setLong] = React.useState(false);
@@ -14,6 +14,8 @@ export const LongValue = (_a) => {
14
14
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
15
15
  setOpen((f) => !f);
16
16
  }, [setOpen, onClick]);
17
+ const className = React.useMemo(() => b(Object.assign({ open,
18
+ long }, (restProps.color ? { [restProps.color]: true } : {})), externalClassName), [open, long, externalClassName, restProps.color]);
17
19
  React.useEffect(() => {
18
20
  if (ref.current) {
19
21
  const { offsetWidth, scrollWidth } = ref.current;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dynamic-forms",
3
- "version": "4.9.0",
3
+ "version": "4.10.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/cjs/index.js",