@cronocode/react-box 1.5.5 → 1.5.6
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/README.md +90 -0
- package/baseSvg.module.css.cjs +1 -1
- package/baseSvg.module.css.mjs +1 -1
- package/box.module.css.cjs +1 -1
- package/box.module.css.mjs +1 -1
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.mjs +15 -15
- package/package.json +4 -2
- package/src/index.d.ts +0 -0
- package/style.css +1 -1
- /package/{box.d.ts → src/box.d.ts} +0 -0
- /package/{components → src/components}/baseSvg.d.ts +0 -0
- /package/{components → src/components}/button.d.ts +0 -0
- /package/{components → src/components}/checkbox.d.ts +0 -0
- /package/{components → src/components}/dataGrid.d.ts +0 -0
- /package/{components → src/components}/flex.d.ts +0 -0
- /package/{components → src/components}/form.d.ts +0 -0
- /package/{components → src/components}/radioButton.d.ts +0 -0
- /package/{components → src/components}/textarea.d.ts +0 -0
- /package/{components → src/components}/textbox.d.ts +0 -0
- /package/{components → src/components}/tooltip.d.ts +0 -0
- /package/{hooks → src/hooks}/usePortalContainer.d.ts +0 -0
- /package/{plugins.d.ts → src/plugins.d.ts} +0 -0
- /package/{theme.d.ts → src/theme.d.ts} +0 -0
- /package/{types.d.ts → src/types.d.ts} +0 -0
- /package/{utils → src/utils}/className/classNameUtils.d.ts +0 -0
- /package/{utils → src/utils}/form/formUtils.d.ts +0 -0
- /package/{utils → src/utils}/object/objectUtils.d.ts +0 -0
package/components/dataGrid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("../box.cjs");require("react");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function o(r){if(!(r!=null&&r.length))return{rows:[],columns:[]};const i=Object.keys(r[0]);return{rows:r.map(e=>({dataRow:e,cells:i.map(n=>({key:n,value:e[n]}))})),columns:i.map(e=>({key:e}))}}function c(r){const{data:i}=r,e=o(i);return t.jsx(u.default,{display:"grid",b:1,borderRadius:1,children:e.columns.length===0?t.jsx(t.Fragment,{children:"empty grid"}):t.jsxs(t.Fragment,{children:[e.columns.map((n,s)=>t.jsx(u.default,{style:{gridColumn:s+1},children:n.key.toString()},n.key.toString())),e.rows.map((n,s)=>n.cells.map(l=>t.jsx(u.default,{children:l.value},l.key.toString()+s)))]})})}exports.default=c;
|
package/components/dataGrid.mjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as o, Fragment as l, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import s from "../box.mjs";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../box.module.css.mjs";
|
|
5
5
|
import "../utils/utils.mjs";
|
|
6
6
|
import "../theme.mjs";
|
|
7
|
-
function
|
|
8
|
-
if (!(
|
|
7
|
+
function c(e) {
|
|
8
|
+
if (!(e != null && e.length))
|
|
9
9
|
return {
|
|
10
10
|
rows: [],
|
|
11
11
|
columns: []
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const i = Object.keys(e[0]);
|
|
14
14
|
return {
|
|
15
|
-
rows:
|
|
15
|
+
rows: e.map((r) => ({
|
|
16
16
|
dataRow: r,
|
|
17
|
-
cells:
|
|
17
|
+
cells: i.map((n) => ({
|
|
18
18
|
key: n,
|
|
19
19
|
value: r[n]
|
|
20
20
|
}))
|
|
21
21
|
})),
|
|
22
|
-
columns:
|
|
22
|
+
columns: i.map((r) => ({
|
|
23
23
|
key: r
|
|
24
24
|
}))
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const { data:
|
|
29
|
-
return r.columns.length === 0 ? /* @__PURE__ */
|
|
30
|
-
r.columns.map((n,
|
|
31
|
-
r.rows.map((n,
|
|
32
|
-
] });
|
|
27
|
+
function k(e) {
|
|
28
|
+
const { data: i } = e, r = c(i);
|
|
29
|
+
return /* @__PURE__ */ o(s, { display: "grid", b: 1, borderRadius: 1, children: r.columns.length === 0 ? /* @__PURE__ */ o(l, { children: "empty grid" }) : /* @__PURE__ */ u(l, { children: [
|
|
30
|
+
r.columns.map((n, t) => /* @__PURE__ */ o(s, { style: { gridColumn: t + 1 }, children: n.key.toString() }, n.key.toString())),
|
|
31
|
+
r.rows.map((n, t) => n.cells.map((m) => /* @__PURE__ */ o(s, { children: m.value }, m.key.toString() + t)))
|
|
32
|
+
] }) });
|
|
33
33
|
}
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
k as default
|
|
36
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronocode/react-box",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"main": "./box.cjs",
|
|
5
5
|
"module": "./box.mjs",
|
|
6
6
|
"types": "./box.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"preview": "vite preview",
|
|
37
37
|
"build": "vite build",
|
|
38
38
|
"build:dev": "vite build --mode dev",
|
|
39
|
-
"postbuild": "cp package.json dist & cp LICENSE dist & rm ./dist/index.d.ts & rm ./dist/index.js",
|
|
39
|
+
"postbuild": "cp package.json dist & cp LICENSE dist & cp README.md dist & cp docs -r dist & rm ./dist/index.d.ts & rm ./dist/index.js",
|
|
40
40
|
"compile": "tsc --noEmit --skipLibCheck",
|
|
41
41
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
42
42
|
},
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@rollup/pluginutils": "^5.0.2",
|
|
61
61
|
"@types/node": "^18.15.7",
|
|
62
62
|
"@types/postcss-mixins": "^9.0.0",
|
|
63
|
+
"@types/prismjs": "^1.26.3",
|
|
63
64
|
"@types/react": "^18.0.27",
|
|
64
65
|
"@types/react-dom": "^18.0.10",
|
|
65
66
|
"@vitejs/plugin-react": "^3.1.0",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"postcss-nested": "^6.0.1",
|
|
71
72
|
"postcss-simple-vars": "^7.0.1",
|
|
72
73
|
"prettier": "^2.8.7",
|
|
74
|
+
"prismjs": "^1.29.0",
|
|
73
75
|
"react": "^18.1.0",
|
|
74
76
|
"react-dom": "^18.2.0",
|
|
75
77
|
"react-router-dom": "^6.16.0",
|
package/src/index.d.ts
ADDED
|
File without changes
|