@micromag/element-grid 0.3.832 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +18 -0
- package/es/index.js +19 -36
- package/es/styles.css +1 -0
- package/package.json +12 -11
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{position:relative}.container .items{height:100%;-ms-flex-align:stretch;align-items:stretch}.container .cross,.container .items{display:-ms-flexbox;display:flex;position:relative}.container .axis{position:relative}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { GridLayout } from '@micromag/core';
|
|
4
|
+
|
|
5
|
+
interface GridProps {
|
|
6
|
+
layout?: GridLayout | null;
|
|
7
|
+
items?: React.ReactNode[];
|
|
8
|
+
width?: number | null;
|
|
9
|
+
height?: number | null;
|
|
10
|
+
spacing?: number;
|
|
11
|
+
vertical?: boolean;
|
|
12
|
+
className?: string | null;
|
|
13
|
+
axisClassName?: string | null;
|
|
14
|
+
crossClassName?: string | null;
|
|
15
|
+
}
|
|
16
|
+
declare function Grid({ items, layout, width, height, spacing, vertical, className, axisClassName, crossClassName, }: GridProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Grid as default };
|
package/es/index.js
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import isArray from 'lodash/isArray';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
7
5
|
|
|
8
|
-
var styles = {"container":"
|
|
6
|
+
var styles = {"container":"container","items":"items","cross":"cross","axis":"axis"};
|
|
9
7
|
|
|
10
|
-
var propTypes = {
|
|
11
|
-
layout: PropTypes$1.gridLayout,
|
|
12
|
-
items: PropTypes.arrayOf(PropTypes.node),
|
|
13
|
-
width: PropTypes.number,
|
|
14
|
-
height: PropTypes.number,
|
|
15
|
-
spacing: PropTypes.number,
|
|
16
|
-
vertical: PropTypes.bool,
|
|
17
|
-
className: PropTypes.string,
|
|
18
|
-
axisClassName: PropTypes.string,
|
|
19
|
-
crossClassName: PropTypes.string
|
|
20
|
-
};
|
|
21
|
-
var defaultProps = {
|
|
22
|
-
layout: null,
|
|
23
|
-
items: [],
|
|
24
|
-
width: null,
|
|
25
|
-
height: null,
|
|
26
|
-
spacing: 0,
|
|
27
|
-
vertical: false,
|
|
28
|
-
className: null,
|
|
29
|
-
axisClassName: null,
|
|
30
|
-
crossClassName: null
|
|
31
|
-
};
|
|
32
8
|
function Grid(_ref) {
|
|
33
|
-
var items = _ref.items,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
9
|
+
var _ref$items = _ref.items,
|
|
10
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
11
|
+
_ref$layout = _ref.layout,
|
|
12
|
+
layout = _ref$layout === void 0 ? null : _ref$layout,
|
|
13
|
+
_ref$width = _ref.width,
|
|
14
|
+
width = _ref$width === void 0 ? null : _ref$width,
|
|
15
|
+
_ref$height = _ref.height,
|
|
16
|
+
height = _ref$height === void 0 ? null : _ref$height,
|
|
17
|
+
_ref$spacing = _ref.spacing,
|
|
18
|
+
spacing = _ref$spacing === void 0 ? 0 : _ref$spacing,
|
|
19
|
+
_ref$vertical = _ref.vertical,
|
|
20
|
+
vertical = _ref$vertical === void 0 ? false : _ref$vertical,
|
|
21
|
+
_ref$className = _ref.className,
|
|
22
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
23
|
+
_ref$axisClassName = _ref.axisClassName,
|
|
24
|
+
axisClassName = _ref$axisClassName === void 0 ? null : _ref$axisClassName,
|
|
25
|
+
_ref$crossClassName = _ref.crossClassName,
|
|
26
|
+
crossClassName = _ref$crossClassName === void 0 ? null : _ref$crossClassName;
|
|
42
27
|
var itemIndex = 0;
|
|
43
28
|
var finalLayout = isArray(layout) ? layout : [{
|
|
44
29
|
rows: vertical ? items.map(function () {
|
|
@@ -102,7 +87,5 @@ function Grid(_ref) {
|
|
|
102
87
|
}));
|
|
103
88
|
})));
|
|
104
89
|
}
|
|
105
|
-
Grid.propTypes = propTypes;
|
|
106
|
-
Grid.defaultProps = defaultProps;
|
|
107
90
|
|
|
108
91
|
export { Grid as default };
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{position:relative}.container .items{height:100%;-ms-flex-align:stretch;align-items:stretch}.container .cross,.container .items{display:-ms-flexbox;display:flex;position:relative}.container .axis{position:relative}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-grid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -47,28 +48,28 @@
|
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
49
50
|
"prepublishOnly": "npm run build",
|
|
50
|
-
"build": "../../scripts/prepare-package.sh"
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"react": "^
|
|
58
|
-
"react-dom": "^
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"@babel/runtime": "^7.13.10",
|
|
62
|
-
"@micromag/core": "^0.
|
|
63
|
+
"@micromag/core": "^0.4.4",
|
|
63
64
|
"classnames": "^2.2.6",
|
|
64
|
-
"lodash": "^4.17.
|
|
65
|
-
"
|
|
66
|
-
"react-intl": "^6.6.4",
|
|
65
|
+
"lodash": "^4.17.23",
|
|
66
|
+
"react-intl": "^8.1.3",
|
|
67
67
|
"uuid": "^9.0.0"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public",
|
|
71
71
|
"registry": "https://registry.npmjs.org/"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
74
|
+
"types": "es/index.d.ts"
|
|
74
75
|
}
|