@hi-ui/grid 4.0.0-beta.7 → 4.0.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.
- package/lib/cjs/Grid.js +8 -38
- package/lib/cjs/context.js +1 -2
- package/lib/cjs/index.js +2 -5
- package/lib/cjs/styles/index.scss.js +3 -4
- package/lib/esm/Grid.js +3 -32
- package/lib/esm/context.js +1 -2
- package/lib/esm/index.js +5 -7
- package/lib/esm/styles/index.scss.js +4 -6
- package/lib/types/Grid.d.ts +3 -12
- package/lib/types/index.d.ts +1 -1
- package/lib/types/types.d.ts +1 -0
- package/package.json +10 -8
- package/lib/cjs/Grid.js.map +0 -1
- package/lib/cjs/context.js.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/styles/index.scss.js.map +0 -1
- package/lib/cjs/utils/type-assertion/lib/esm/index.js +0 -27
- package/lib/cjs/utils/type-assertion/lib/esm/index.js.map +0 -1
- package/lib/esm/Grid.js.map +0 -1
- package/lib/esm/context.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/styles/index.scss.js.map +0 -1
- package/lib/esm/utils/type-assertion/lib/esm/index.js +0 -20
- package/lib/esm/utils/type-assertion/lib/esm/index.js.map +0 -1
package/lib/cjs/Grid.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -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) {
|
|
@@ -91,9 +91,9 @@ var Row = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
91
91
|
columns: columns
|
|
92
92
|
};
|
|
93
93
|
}, [columns]);
|
|
94
|
-
return /*#__PURE__*/React__default[
|
|
94
|
+
return /*#__PURE__*/React__default["default"].createElement(context.GridProvider, {
|
|
95
95
|
value: providedContext
|
|
96
|
-
}, /*#__PURE__*/React__default[
|
|
96
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
97
97
|
ref: ref,
|
|
98
98
|
className: cls,
|
|
99
99
|
style: style
|
|
@@ -130,14 +130,14 @@ 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
|
|
138
138
|
}) : {}, styleProp, (_Object$assign2 = {}, _Object$assign2[spanNameVar] = span === null ? 'unset' : "calc(" + span + " / " + columns + " * 100%)", _Object$assign2[offsetNameVar] = "calc(" + offset + " / " + columns + " * 100%)", _Object$assign2));
|
|
139
139
|
var cls = classname.cx(prefixCls, className);
|
|
140
|
-
return /*#__PURE__*/React__default[
|
|
140
|
+
return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
141
141
|
ref: ref,
|
|
142
142
|
className: cls,
|
|
143
143
|
style: style
|
|
@@ -148,35 +148,5 @@ if (env.__DEV__) {
|
|
|
148
148
|
Col.displayName = 'Col';
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
var brPrefix = classname.getPrefixCls('grid-br');
|
|
152
|
-
/**
|
|
153
|
-
* TODO: What is Grid Br
|
|
154
|
-
*/
|
|
155
|
-
|
|
156
|
-
var Br = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
157
|
-
var _a$prefixCls3 = _a.prefixCls,
|
|
158
|
-
prefixCls = _a$prefixCls3 === void 0 ? brPrefix : _a$prefixCls3,
|
|
159
|
-
className = _a.className,
|
|
160
|
-
styleProp = _a.style,
|
|
161
|
-
height = _a.height,
|
|
162
|
-
rest = tslib.__rest(_a, ["prefixCls", "className", "style", "height"]);
|
|
163
|
-
|
|
164
|
-
var cls = classname.cx(prefixCls, className);
|
|
165
|
-
var style = height ? Object.assign(Object.assign({}, styleProp), {
|
|
166
|
-
height: height
|
|
167
|
-
}) : styleProp;
|
|
168
|
-
return /*#__PURE__*/React__default['default'].createElement("div", Object.assign({
|
|
169
|
-
ref: ref,
|
|
170
|
-
className: cls,
|
|
171
|
-
style: style
|
|
172
|
-
}, rest));
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
if (env.__DEV__) {
|
|
176
|
-
Br.displayName = 'Br';
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
exports.Br = Br;
|
|
180
151
|
exports.Col = Col;
|
|
181
152
|
exports.Row = Row;
|
|
182
|
-
//# sourceMappingURL=Grid.js.map
|
package/lib/cjs/context.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -30,4 +30,3 @@ var useGridContext = function useGridContext() {
|
|
|
30
30
|
|
|
31
31
|
exports.GridProvider = GridProvider;
|
|
32
32
|
exports.useGridContext = useGridContext;
|
|
33
|
-
//# sourceMappingURL=context.js.map
|
package/lib/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -19,11 +19,8 @@ var Grid$1 = require('./Grid.js');
|
|
|
19
19
|
|
|
20
20
|
var Grid = {
|
|
21
21
|
Row: Grid$1.Row,
|
|
22
|
-
Col: Grid$1.Col
|
|
23
|
-
Br: Grid$1.Br
|
|
22
|
+
Col: Grid$1.Col
|
|
24
23
|
};
|
|
25
|
-
exports.Br = Grid$1.Br;
|
|
26
24
|
exports.Col = Grid$1.Col;
|
|
27
25
|
exports.Row = Grid$1.Row;
|
|
28
26
|
exports["default"] = Grid;
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
var css_248z = "
|
|
15
|
+
var css_248z = ".hi-v4-grid-row {position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;row-gap: var(--hi-v4-grid-row-gap);margin-left: calc(-1 * var(--hi-v4-grid-row-gutter) / 2);margin-right: calc(-1 * var(--hi-v4-grid-row-gutter) / 2); }.hi-v4-grid-row + .hi-v4-grid-row {margin-top: var(--hi-v4-grid-row-gap); }.hi-v4-grid-col {-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-box-flex: 0;-ms-flex-positive: 0;flex-grow: 0;-ms-flex-negative: 0;flex-shrink: 0;-ms-flex-preferred-size: var(--hi-v4-grid-col-span);flex-basis: var(--hi-v4-grid-col-span);max-width: var(--hi-v4-grid-col-span);margin-left: var(--hi-v4-grid-col-offset);padding-left: calc(var(--hi-v4-grid-row-gutter) / 2);padding-right: calc(var(--hi-v4-grid-row-gutter) / 2); }";
|
|
16
16
|
|
|
17
|
-
var __styleInject__ = require('
|
|
17
|
+
var __styleInject__ = require('inject-head-style')["default"];
|
|
18
18
|
|
|
19
19
|
__styleInject__(css_248z);
|
|
20
20
|
|
|
21
21
|
exports["default"] = css_248z;
|
|
22
|
-
//# sourceMappingURL=index.scss.js.map
|
package/lib/esm/Grid.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -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 默认间距
|
|
@@ -126,33 +126,4 @@ if (__DEV__) {
|
|
|
126
126
|
Col.displayName = 'Col';
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* TODO: What is Grid Br
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
var Br = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
135
|
-
var _a$prefixCls3 = _a.prefixCls,
|
|
136
|
-
prefixCls = _a$prefixCls3 === void 0 ? brPrefix : _a$prefixCls3,
|
|
137
|
-
className = _a.className,
|
|
138
|
-
styleProp = _a.style,
|
|
139
|
-
height = _a.height,
|
|
140
|
-
rest = __rest(_a, ["prefixCls", "className", "style", "height"]);
|
|
141
|
-
|
|
142
|
-
var cls = cx(prefixCls, className);
|
|
143
|
-
var style = height ? Object.assign(Object.assign({}, styleProp), {
|
|
144
|
-
height: height
|
|
145
|
-
}) : styleProp;
|
|
146
|
-
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
147
|
-
ref: ref,
|
|
148
|
-
className: cls,
|
|
149
|
-
style: style
|
|
150
|
-
}, rest));
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
if (__DEV__) {
|
|
154
|
-
Br.displayName = 'Br';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export { Br, Col, Row };
|
|
158
|
-
//# sourceMappingURL=Grid.js.map
|
|
129
|
+
export { Col, Row };
|
package/lib/esm/context.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -22,4 +22,3 @@ var useGridContext = function useGridContext() {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export { GridProvider, useGridContext };
|
|
25
|
-
//# sourceMappingURL=context.js.map
|
package/lib/esm/index.js
CHANGED
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import './styles/index.scss.js';
|
|
11
|
-
import { Row, Col
|
|
12
|
-
export {
|
|
11
|
+
import { Row, Col } from './Grid.js';
|
|
12
|
+
export { Col, Row } from './Grid.js';
|
|
13
13
|
var Grid = {
|
|
14
14
|
Row: Row,
|
|
15
|
-
Col: Col
|
|
16
|
-
Br: Br
|
|
15
|
+
Col: Col
|
|
17
16
|
};
|
|
18
|
-
export default
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
17
|
+
export { Grid as default };
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
* @hi-ui/grid
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var __styleInject__ = require('style-inject/dist/style-inject.es.js')["default"];
|
|
10
|
+
import __styleInject__ from 'inject-head-style';
|
|
11
|
+
var css_248z = ".hi-v4-grid-row {position: relative;-webkit-box-sizing: border-box;box-sizing: border-box;display: -webkit-box;display: -ms-flexbox;display: flex;-ms-flex-wrap: wrap;flex-wrap: wrap;row-gap: var(--hi-v4-grid-row-gap);margin-left: calc(-1 * var(--hi-v4-grid-row-gutter) / 2);margin-right: calc(-1 * var(--hi-v4-grid-row-gutter) / 2); }.hi-v4-grid-row + .hi-v4-grid-row {margin-top: var(--hi-v4-grid-row-gap); }.hi-v4-grid-col {-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-box-flex: 0;-ms-flex-positive: 0;flex-grow: 0;-ms-flex-negative: 0;flex-shrink: 0;-ms-flex-preferred-size: var(--hi-v4-grid-col-span);flex-basis: var(--hi-v4-grid-col-span);max-width: var(--hi-v4-grid-col-span);margin-left: var(--hi-v4-grid-col-offset);padding-left: calc(var(--hi-v4-grid-row-gutter) / 2);padding-right: calc(var(--hi-v4-grid-row-gutter) / 2); }";
|
|
13
12
|
|
|
14
13
|
__styleInject__(css_248z);
|
|
15
14
|
|
|
16
|
-
export default
|
|
17
|
-
//# sourceMappingURL=index.scss.js.map
|
|
15
|
+
export { css_248z as default };
|
package/lib/types/Grid.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HiBaseHTMLProps } from '@hi-ui/core';
|
|
3
|
+
import { GridJustifyEnum } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* TODO: What is Grid Row
|
|
5
6
|
*/
|
|
@@ -8,7 +9,7 @@ export interface RowProps extends HiBaseHTMLProps<'div'> {
|
|
|
8
9
|
/**
|
|
9
10
|
* 里面的元素排布方式
|
|
10
11
|
*/
|
|
11
|
-
justify?:
|
|
12
|
+
justify?: GridJustifyEnum;
|
|
12
13
|
/**
|
|
13
14
|
* Row 里面元素之间是否有外边距,建议使用偶数
|
|
14
15
|
*/
|
|
@@ -39,15 +40,5 @@ export interface ColProps extends HiBaseHTMLProps<'div'> {
|
|
|
39
40
|
/**
|
|
40
41
|
* 里面的元素排布方式
|
|
41
42
|
*/
|
|
42
|
-
justify?:
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* TODO: What is Grid Br
|
|
46
|
-
*/
|
|
47
|
-
export declare const Br: React.ForwardRefExoticComponent<BrProps & React.RefAttributes<HTMLDivElement | null>>;
|
|
48
|
-
export interface BrProps extends HiBaseHTMLProps<'div'> {
|
|
49
|
-
/**
|
|
50
|
-
* 换行符高度
|
|
51
|
-
*/
|
|
52
|
-
height?: number;
|
|
43
|
+
justify?: GridJustifyEnum;
|
|
53
44
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import './styles/index.scss';
|
|
|
3
3
|
declare const Grid: {
|
|
4
4
|
Row: import("react").ForwardRefExoticComponent<import("./Grid").RowProps & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
5
5
|
Col: import("react").ForwardRefExoticComponent<import("./Grid").ColProps & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
6
|
-
Br: import("react").ForwardRefExoticComponent<import("./Grid").BrProps & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
7
6
|
};
|
|
8
7
|
export default Grid;
|
|
9
8
|
export * from './Grid';
|
|
9
|
+
export * from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type GridJustifyEnum = 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/grid",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
7
7
|
"homepage": "https://github.com/XiaoMi/hiui/tree/master/packages/ui/grid#readme",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"directories": {
|
|
@@ -43,19 +43,21 @@
|
|
|
43
43
|
"url": "https://github.com/XiaoMi/hiui/issues"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@hi-ui/classname": "^4.0.0
|
|
47
|
-
"@hi-ui/
|
|
48
|
-
"@hi-ui/
|
|
49
|
-
"@hi-ui/env": "^4.0.0-beta.0"
|
|
46
|
+
"@hi-ui/classname": "^4.0.0",
|
|
47
|
+
"@hi-ui/env": "^4.0.0",
|
|
48
|
+
"@hi-ui/type-assertion": "^4.0.0"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
51
|
+
"@hi-ui/core": ">=4.0.0",
|
|
52
52
|
"react": ">=16.8.6",
|
|
53
53
|
"react-dom": ">=16.8.6"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@hi-ui/
|
|
56
|
+
"@hi-ui/core": "^4.0.0",
|
|
57
|
+
"@hi-ui/core-css": "^4.0.0",
|
|
58
|
+
"@hi-ui/hi-build": "^4.0.0",
|
|
57
59
|
"react": "^17.0.1",
|
|
58
60
|
"react-dom": "^17.0.1"
|
|
59
61
|
},
|
|
60
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "3530e4f3c0b4394b91d66a4aa749579708ebff84"
|
|
61
63
|
}
|
package/lib/cjs/Grid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.js","sources":["../../src/Grid.tsx"],"sourcesContent":[null],"names":["rowPrefix","getPrefixCls","gutterNameVar","getPrefixStyleVar","gapNameVar","DEFAULT_ROW_GAP","DEFAULT_GUTTER_GAP","Row","forwardRef","_a","ref","prefixCls","className","children","styleProp","style","justifyContent","justify","columns","rowGap","gutter","gutterProp","rest","useMemo","isNumeric","gap","Number","console","info","Object","assign","display","cls","cx","providedContext","React","GridProvider","value","__DEV__","displayName","colPrefix","spanNameVar","offsetNameVar","Col","spanProp","span","offset","offsetProp","useGridContext","brPrefix","Br","height"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,SAAS,GAAGC,sBAAAA,CAAa,UAAbA,CAAlB;AACA,IAAMC,aAAa,GAAGC,2BAAAA,CAAkB,iBAAlBA,CAAtB;AACA,IAAMC,UAAU,GAAGD,2BAAAA,CAAkB,cAAlBA,CAAnB;;AAGA,IAAME,eAAe,GAAG,EAAxB;;AAEA,IAAMC,kBAAkB,GAAG,EAA3B;AAEA;;;;IAGaC,GAAG,gBAAGC,gBAAAA,CACjB,UACEC,EADF,EAYEC,GAZF;;;wBAEIC;MAAAA,sCAAYX;MACZY,eAAAA;MACAC,cAAAA;MACOC,eAAPC;MACSC,oBAATC;sBACAC;MAAAA,kCAAU;qBACVC;MAAAA,gCAASd;qBACTe;MAAQC,oCAAa;MAClBC,wBATL,YAAA,aAAA,YAAA,SAAA,WAAA,WAAA,UAAA,UAAA;;MAaMF,MAAM,GAAGG,aAAAA,CAAQ;QACjB,OAAOF,UAAP,KAAsB,WAAW;aAC5BA,UAAU,GAAGf,kBAAH,GAAwB;;;QAGvCkB,eAAAA,CAAUH,UAAVG,GAAuB;UACrBC,GAAG,GAAGC,MAAM,CAACL,UAAD;;UACZI,GAAG,GAAG,GAAG;AACXE,QAAAA,OAAO,CAACC,IAARD,CAAa,kDAAbA;AACAF,QAAAA,GAAG,GAAGnB,kBAANmB;;;aAE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rC;sBAE3CqB,yBAAAA,cAAAA,MAAAA;AAAKzB,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,SAAS,EAAEoB;AAAKjB,IAAAA,KAAK,EAAEA;KAAWO,KAAjDa;AANiB,CAAV3B;;AAiBlB,IAAI8B,WAAJ,EAAa;AACXY,EAAAA,EAAE,CAACX,WAAHW,GAAiB,IAAjBA;;;;;"}
|
package/lib/cjs/context.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../src/context.ts"],"sourcesContent":[null],"names":["gridContext","createContext","GridProvider","Provider","useGridContext","context","useContext","Error"],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAMA,WAAW,gBAAGC,mBAAAA,CAA2B,EAA3BA,CAApB;IAEaC,YAAY,GAAGF,WAAW,CAACG;;IAE3BC,cAAc,GAAG,SAAjBA,cAAiB;MACtBC,OAAO,GAAGC,gBAAAA,CAAWN,WAAXM;;MAEZ,CAACD,SAAS;UACN,IAAIE,KAAJ,CAAU,4EAAV;;;SAGDF;;;;"}
|
package/lib/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Grid","Row","Col","Br"],"mappings":";;;;;;;;;;;;;;;;;;;IAIMA,IAAI,GAAG;AACXC,EAAAA,GAAG,EAAHA,UADW;AAEXC,EAAAA,GAAG,EAAHA,UAFW;AAGXC,EAAAA,EAAE,EAAFA;AAHW;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,27 +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;
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../utils/type-assertion/lib/esm/index.js"],"sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/** @LICENSE\n * @hi-ui/type-assertion\n * https://github.com/XiaoMi/hiui/tree/master/packages/utils/type-assertion#readme\n *\n * Copyright (c) HIUI <mi-hiui@xiaomi.com>.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Assert is undefined\n */\nvar isUndefined = function isUndefined(arg) {\n return arg === undefined;\n};\n/**\n * Assert is Undefined\n */\n\n\nvar isUndef = function isUndef(arg) {\n return arg === undefined;\n};\n/**\n * Assert is Nullish\n */\n\n\nvar isNullish = function isNullish(arg) {\n return arg === null || arg === undefined;\n};\n/**\n * Assert is an objectLike\n * TODO: Assert the return type\n */\n\n\nvar isObjectLike = function isObjectLike(arg) {\n return !!arg && _typeof(arg) === 'object';\n};\n/**\n * Assert is an object\n */\n\n\nvar isObject = function isObject(arg) {\n return isObjectLike(arg) && arg.constructor === Object;\n};\n/**\n * Assert is a dom element\n */\n\n\nvar isElement = function isElement(arg) {\n return isObjectLike(arg) && arg.constructor !== Object && arg.nodeType === 1;\n};\n/**\n * Assert is an Promise\n */\n\n\nvar isPromise = function isPromise(arg) {\n return isObjectLike(arg) && isFunction(arg.then);\n};\n/**\n * Assert is an array\n */\n\n\nvar isArray = Array.isArray;\n/**\n * Assert is an array and `array.length > 0`\n */\n\nvar isArrayNonEmpty = function isArrayNonEmpty(arg) {\n return isArray(arg) && arg.length > 0;\n};\n/**\n * Assert is numeric\n */\n\n\nvar isNumeric = function isNumeric(arg) {\n return !Number.isNaN(Number(arg));\n};\n/**\n * Assert is function\n */\n\n\nvar isFunction = function isFunction(arg) {\n return typeof arg === 'function';\n};\n\nvar toString = Object.prototype.toString;\n/**\n * Assert is string\n */\n\nvar isString = function isString(arg) {\n return toString.call(arg) === '[object String]';\n};\n/**\n * Assert is positive number\n */\n\n\nvar isPlus = function isPlus(arg) {\n return typeof arg === 'number' && Math.sign(arg) === 1;\n};\n\nexport { isArray, isArrayNonEmpty, isElement, isFunction, isNullish, isNumeric, isObject, isObjectLike, isPlus, isPromise, isString, isUndef, isUndefined };\n//# sourceMappingURL=index.js.map\n"],"names":["isNumeric","arg","Number"],"mappings":";;;;;;;;;;;;;;;;AAsDA;;;;;IAGaA,SAAS,GAAG,SAAZA,SAAY,CAAAC,GAAA,EAAA;SAA0C,CAACC,MAAM,CAANA,KAAAA,CAAaA,MAAM,CAAnBA,GAAmB,CAAnBA;;;"}
|
package/lib/esm/Grid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.js","sources":["../../src/Grid.tsx"],"sourcesContent":[null],"names":["rowPrefix","getPrefixCls","gutterNameVar","getPrefixStyleVar","gapNameVar","DEFAULT_ROW_GAP","DEFAULT_GUTTER_GAP","Row","forwardRef","_a","ref","prefixCls","className","children","styleProp","style","justifyContent","justify","columns","rowGap","gutter","gutterProp","rest","useMemo","isNumeric","gap","Number","console","info","Object","assign","display","cls","cx","providedContext","React","GridProvider","value","__DEV__","displayName","colPrefix","spanNameVar","offsetNameVar","Col","spanProp","span","offset","offsetProp","useGridContext","brPrefix","Br","height"],"mappings":";;;;;;;;;;;;;;;AAOA,IAAMA,SAAS,GAAGC,YAAY,CAAC,UAAD,CAA9B;AACA,IAAMC,aAAa,GAAGC,iBAAiB,CAAC,iBAAD,CAAvC;AACA,IAAMC,UAAU,GAAGD,iBAAiB,CAAC,cAAD,CAApC;;AAGA,IAAME,eAAe,GAAG,EAAxB;;AAEA,IAAMC,kBAAkB,GAAG,EAA3B;AAEA;;;;IAGaC,GAAG,gBAAGC,UAAU,CAC3B,UACEC,EADF,EAYEC,GAZF;;;wBAEIC;MAAAA,sCAAYX;MACZY,eAAAA;MACAC,cAAAA;MACOC,eAAPC;MACSC,oBAATC;sBACAC;MAAAA,kCAAU;qBACVC;MAAAA,gCAASd;qBACTe;MAAQC,oCAAa;MAClBC,kBATL,YAAA,aAAA,YAAA,SAAA,WAAA,WAAA,UAAA,UAAA;;MAaMF,MAAM,GAAGG,OAAO,CAAC;QACjB,OAAOF,UAAP,KAAsB,WAAW;aAC5BA,UAAU,GAAGf,kBAAH,GAAwB;;;QAGvCkB,SAAS,CAACH,UAAD,GAAc;UACrBI,GAAG,GAAGC,MAAM,CAACL,UAAD;;UACZI,GAAG,GAAG,GAAG;AACXE,QAAAA,OAAO,CAACC,IAARD,CAAa,kDAAbA;AACAF,QAAAA,GAAG,GAAGnB,kBAANmB;;;aAEKA;;;WAGF;AAda,GAAA,EAenB,CAACJ,UAAD,CAfmB;MAiBhBN,KAAK,GAAGc,MAAM,CAACC,MAAPD,CACZb,cAAc,GACV;AACEe,IAAAA,OAAO,EAAE,MADX;AAEEf,IAAAA,cAAc,EAAdA;AAFF,GADU,GAKV,EANQa,EAOZf,SAPYe,uCAST3B,iBAAmBkB,MATV,wBAUThB,cAAgBe,MAVP,uBAAAU;MAcRG,GAAG,GAAGC,EAAE,CAACtB,SAAD,EAAYC,SAAZ;MAERsB,eAAe,GAAGX,OAAO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AAAA,cAAc,EAAdA;IAJQ,GAMV,EAPQa,EAQZf,SARYe,yCAUTY,eAAcI,IAAI,KAAK,IAATA,GAAgB,OAAhBA,aAAkCA,eAAU3B,sCAC1DwB,2BAAwBI,iBAAY5B,qCAX3BW;MAeRG,GAAG,GAAGC,EAAE,CAACtB,SAAD,EAAYC,SAAZ;sBAGZuB,mBAAAA,MAAAA;AAAKzB,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,SAAS,EAAEoB;AAAKjB,IAAAA,KAAK,EAAEA;KAAWO,KAAjDa,EACGtB,QADHsB;AAtCuB,CAAA;;AA4D7B,IAAIG,OAAJ,EAAa;AACXK,EAAAA,GAAG,CAACJ,WAAJI,GAAkB,KAAlBA;;;AAGF,IAAMM,QAAQ,GAAGhD,YAAY,CAAC,SAAD,CAA7B;AAEA;;;;IAGaiD,EAAE,gBAAG1C,UAAU,CAC1B,UAACC,EAAD,EAAyEC,GAAzE;yBAAGC;MAAAA,uCAAYsC;MAAUrC,eAAAA;MAAkBE,eAAPC;MAAkBoC,YAAAA;MAAW7B,kBAAhE,YAAA,aAAA,SAAA,UAAA;;MACOU,GAAG,GAAGC,EAAE,CAACtB,SAAD,EAAYC,SAAZ;MAERG,KAAK,GAAGoC,MAAM,mCAAQrC;AAAWqC,IAAAA,MAAM,EAANA;IAAnB,GAA8BrC;sBAE3CqB,mBAAAA,MAAAA;AAAKzB,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,SAAS,EAAEoB;AAAKjB,IAAAA,KAAK,EAAEA;KAAWO,KAAjDa;AANiB,CAAA;;AAiB5B,IAAIG,OAAJ,EAAa;AACXY,EAAAA,EAAE,CAACX,WAAHW,GAAiB,IAAjBA;;;"}
|
package/lib/esm/context.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../src/context.ts"],"sourcesContent":[null],"names":["gridContext","createContext","GridProvider","Provider","useGridContext","context","useContext","Error"],"mappings":";;;;;;;;;;AAMA,IAAMA,WAAW,gBAAGC,aAAa,CAAc,EAAd,CAAjC;IAEaC,YAAY,GAAGF,WAAW,CAACG;;IAE3BC,cAAc,GAAG,SAAjBA,cAAiB;MACtBC,OAAO,GAAGC,UAAU,CAACN,WAAD;;MAEtB,CAACK,SAAS;UACN,IAAIE,KAAJ,CAAU,4EAAV;;;SAGDF;;;"}
|
package/lib/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Grid","Row","Col","Br"],"mappings":";;;;;;;;;;;;IAIMA,IAAI,GAAG;AACXC,EAAAA,GAAG,EAAHA,GADW;AAEXC,EAAAA,GAAG,EAAHA,GAFW;AAGXC,EAAAA,EAAE,EAAFA;AAHW;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1,20 +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 };
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../utils/type-assertion/lib/esm/index.js"],"sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/** @LICENSE\n * @hi-ui/type-assertion\n * https://github.com/XiaoMi/hiui/tree/master/packages/utils/type-assertion#readme\n *\n * Copyright (c) HIUI <mi-hiui@xiaomi.com>.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Assert is undefined\n */\nvar isUndefined = function isUndefined(arg) {\n return arg === undefined;\n};\n/**\n * Assert is Undefined\n */\n\n\nvar isUndef = function isUndef(arg) {\n return arg === undefined;\n};\n/**\n * Assert is Nullish\n */\n\n\nvar isNullish = function isNullish(arg) {\n return arg === null || arg === undefined;\n};\n/**\n * Assert is an objectLike\n * TODO: Assert the return type\n */\n\n\nvar isObjectLike = function isObjectLike(arg) {\n return !!arg && _typeof(arg) === 'object';\n};\n/**\n * Assert is an object\n */\n\n\nvar isObject = function isObject(arg) {\n return isObjectLike(arg) && arg.constructor === Object;\n};\n/**\n * Assert is a dom element\n */\n\n\nvar isElement = function isElement(arg) {\n return isObjectLike(arg) && arg.constructor !== Object && arg.nodeType === 1;\n};\n/**\n * Assert is an Promise\n */\n\n\nvar isPromise = function isPromise(arg) {\n return isObjectLike(arg) && isFunction(arg.then);\n};\n/**\n * Assert is an array\n */\n\n\nvar isArray = Array.isArray;\n/**\n * Assert is an array and `array.length > 0`\n */\n\nvar isArrayNonEmpty = function isArrayNonEmpty(arg) {\n return isArray(arg) && arg.length > 0;\n};\n/**\n * Assert is numeric\n */\n\n\nvar isNumeric = function isNumeric(arg) {\n return !Number.isNaN(Number(arg));\n};\n/**\n * Assert is function\n */\n\n\nvar isFunction = function isFunction(arg) {\n return typeof arg === 'function';\n};\n\nvar toString = Object.prototype.toString;\n/**\n * Assert is string\n */\n\nvar isString = function isString(arg) {\n return toString.call(arg) === '[object String]';\n};\n/**\n * Assert is positive number\n */\n\n\nvar isPlus = function isPlus(arg) {\n return typeof arg === 'number' && Math.sign(arg) === 1;\n};\n\nexport { isArray, isArrayNonEmpty, isElement, isFunction, isNullish, isNumeric, isObject, isObjectLike, isPlus, isPromise, isString, isUndef, isUndefined };\n//# sourceMappingURL=index.js.map\n"],"names":["isNumeric","arg","Number"],"mappings":";;;;;;;;;;AAsDA;;;;IAGaA,SAAS,GAAG,SAAZA,SAAY,CAAAC,GAAA,EAAA;SAA0C,CAACC,MAAM,CAANA,KAAAA,CAAaA,MAAM,CAAnBA,GAAmB,CAAnBA;;;"}
|