@gravity-ui/dynamic-forms 2.1.0 → 2.1.1

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.
@@ -49,8 +49,8 @@ const useField = ({ name, spec, initialValue, value: externalValue, validate: pr
49
49
  const _value = lodash_1.default.isFunction(valOrSetter) ? valOrSetter(state.value) : valOrSetter;
50
50
  const error = validate === null || validate === void 0 ? void 0 : validate(_value);
51
51
  let value = (0, utils_1.transformArrIn)(_value);
52
- if ((0, helpers_1.isNumberSpec)(spec) && value && !error) {
53
- value = Number(value);
52
+ if ((0, helpers_1.isNumberSpec)(spec) && !error) {
53
+ value = (value ? Number(value) : undefined);
54
54
  }
55
55
  let newChildErrors = Object.assign({}, state.childErrors);
56
56
  if (childErrors) {
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.block = void 0;
4
- const tslib_1 = require("tslib");
5
- const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
3
+ exports.block = exports.cn = void 0;
4
+ const classname_1 = require("@bem-react/classname");
6
5
  const NAMESPACE = 'df-';
7
- const block = (name) => (0, bem_cn_lite_1.default)(`${NAMESPACE}${name}`);
8
- exports.block = block;
6
+ exports.cn = (0, classname_1.withNaming)({ e: '__', m: '_' });
7
+ exports.block = (0, classname_1.withNaming)({ n: NAMESPACE, e: '__', m: '_' });
@@ -45,8 +45,8 @@ export const useField = ({ name, spec, initialValue, value: externalValue, valid
45
45
  const _value = _.isFunction(valOrSetter) ? valOrSetter(state.value) : valOrSetter;
46
46
  const error = validate === null || validate === void 0 ? void 0 : validate(_value);
47
47
  let value = transformArrIn(_value);
48
- if (isNumberSpec(spec) && value && !error) {
49
- value = Number(value);
48
+ if (isNumberSpec(spec) && !error) {
49
+ value = (value ? Number(value) : undefined);
50
50
  }
51
51
  let newChildErrors = Object.assign({}, state.childErrors);
52
52
  if (childErrors) {
@@ -1,2 +1,2 @@
1
- import blockOrigin from 'bem-cn-lite';
2
- export declare const block: (name: string) => ReturnType<typeof blockOrigin>;
1
+ export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
2
+ export declare const block: import("@bem-react/classname").ClassNameInitilizer;
@@ -1,3 +1,4 @@
1
- import blockOrigin from 'bem-cn-lite';
1
+ import { withNaming } from '@bem-react/classname';
2
2
  const NAMESPACE = 'df-';
3
- export const block = (name) => blockOrigin(`${NAMESPACE}${name}`);
3
+ export const cn = withNaming({ e: '__', m: '_' });
4
+ export const block = withNaming({ n: NAMESPACE, e: '__', m: '_' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dynamic-forms",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/cjs/index.js",
@@ -37,10 +37,10 @@
37
37
  "prepublishOnly": "npm run build"
38
38
  },
39
39
  "dependencies": {
40
- "@gravity-ui/components": "^2.0.0",
41
- "@gravity-ui/i18n": "^1.0.0",
42
- "@gravity-ui/icons": "^2.1.0",
43
- "bem-cn-lite": "^4.0.0",
40
+ "@bem-react/classname": "^1.6.0",
41
+ "@gravity-ui/components": "^2.4.0",
42
+ "@gravity-ui/i18n": "^1.1.0",
43
+ "@gravity-ui/icons": "^2.5.0",
44
44
  "lodash": "^4.17.20"
45
45
  },
46
46
  "devDependencies": {
@@ -52,7 +52,7 @@
52
52
  "@gravity-ui/prettier-config": "^1.0.1",
53
53
  "@gravity-ui/stylelint-config": "^2.0.0",
54
54
  "@gravity-ui/tsconfig": "^1.0.0",
55
- "@gravity-ui/uikit": "^5.0.2",
55
+ "@gravity-ui/uikit": "^5.8.0",
56
56
  "@storybook/addon-essentials": "^7.0.27",
57
57
  "@storybook/preset-scss": "^1.0.3",
58
58
  "@storybook/react": "^7.0.27",