@hi-ui/grid 4.0.0-beta.16 → 4.0.0-beta.17
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/lib/cjs/Grid.js
CHANGED
|
@@ -25,7 +25,7 @@ var env = require('@hi-ui/env');
|
|
|
25
25
|
|
|
26
26
|
var context = require('./context.js');
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var typeAssertion = require('@hi-ui/type-assertion');
|
|
29
29
|
|
|
30
30
|
function _interopDefaultLegacy(e) {
|
|
31
31
|
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
@@ -68,7 +68,7 @@ var Row = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
68
68
|
return gutterProp ? DEFAULT_GUTTER_GAP : 0;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
if (
|
|
71
|
+
if (typeAssertion.isNumeric(gutterProp)) {
|
|
72
72
|
var gap = Number(gutterProp);
|
|
73
73
|
|
|
74
74
|
if (gap < 0) {
|
|
@@ -130,8 +130,8 @@ var Col = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
130
130
|
columns = _useGridContext$colum === void 0 ? 24 : _useGridContext$colum; // 需要 warning 不合法
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
var span =
|
|
134
|
-
var offset =
|
|
133
|
+
var span = typeAssertion.isNumeric(spanProp) && spanProp >= 0 && spanProp <= columns ? spanProp : null;
|
|
134
|
+
var offset = typeAssertion.isNumeric(offsetProp) && offsetProp >= 0 && offsetProp < columns ? offsetProp : 0;
|
|
135
135
|
var style = Object.assign(justifyContent ? Object.assign(Object.assign({}, styleProp), {
|
|
136
136
|
display: 'flex',
|
|
137
137
|
justifyContent: justifyContent
|
package/lib/esm/Grid.js
CHANGED
|
@@ -12,7 +12,7 @@ import React, { forwardRef, useMemo } from 'react';
|
|
|
12
12
|
import { getPrefixCls, getPrefixStyleVar, cx } from '@hi-ui/classname';
|
|
13
13
|
import { __DEV__ } from '@hi-ui/env';
|
|
14
14
|
import { GridProvider, useGridContext } from './context.js';
|
|
15
|
-
import { isNumeric } from '
|
|
15
|
+
import { isNumeric } from '@hi-ui/type-assertion';
|
|
16
16
|
var rowPrefix = getPrefixCls('grid-row');
|
|
17
17
|
var gutterNameVar = getPrefixStyleVar('grid-row-gutter');
|
|
18
18
|
var gapNameVar = getPrefixStyleVar('grid-row-gap'); // Row 与 Row 默认间距
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/grid",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.17",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HIUI <mi-hiui@xiaomi.com>",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"@hi-ui/classname": "^4.0.0-beta.0",
|
|
47
47
|
"@hi-ui/core": "^4.0.0-beta.9",
|
|
48
48
|
"@hi-ui/core-css": "^4.0.0-beta.5",
|
|
49
|
-
"@hi-ui/env": "^4.0.0-beta.1"
|
|
49
|
+
"@hi-ui/env": "^4.0.0-beta.1",
|
|
50
|
+
"@hi-ui/type-assertion": "^4.0.0-beta.5"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"react": ">=16.8.6",
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"react": "^17.0.1",
|
|
58
59
|
"react-dom": "^17.0.1"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8bb668d29361fae483ac3fde460bfc7e010417a6"
|
|
61
62
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/grid
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HIUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, '__esModule', {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
require('@babel/runtime/helpers/esm/typeof');
|
|
17
|
-
/**
|
|
18
|
-
* Assert is numeric
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var isNumeric = function isNumeric(arg) {
|
|
23
|
-
return !Number.isNaN(Number(arg));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.isNumeric = isNumeric;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @LICENSE
|
|
2
|
-
* @hi-ui/grid
|
|
3
|
-
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) HIUI <mi-hiui@xiaomi.com>.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
11
|
-
/**
|
|
12
|
-
* Assert is numeric
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
var isNumeric = function isNumeric(arg) {
|
|
16
|
-
return !Number.isNaN(Number(arg));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { isNumeric };
|