@dxos/react-ui-grid 0.6.10-main.3cfcc89
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/LICENSE +8 -0
- package/README.md +3 -0
- package/dist/lib/browser/index.mjs +17 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/types/src/Grid.d.ts +6 -0
- package/dist/types/src/Grid.d.ts.map +1 -0
- package/dist/types/src/Grid.stories.d.ts +41 -0
- package/dist/types/src/Grid.stories.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/package.json +45 -0
- package/src/Grid.stories.tsx +40 -0
- package/src/Grid.tsx +21 -0
- package/src/index.ts +5 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2022 DXOS
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// packages/ui/react-ui-grid/src/Grid.tsx
|
|
2
|
+
import "@dxos/lit-grid/dx-grid.pcss";
|
|
3
|
+
import { createComponent } from "@lit/react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { DxGrid as NaturalDxGrid } from "@dxos/lit-grid";
|
|
6
|
+
var DxGrid = createComponent({
|
|
7
|
+
tagName: "dx-grid",
|
|
8
|
+
elementClass: NaturalDxGrid,
|
|
9
|
+
react: React
|
|
10
|
+
});
|
|
11
|
+
var Grid = (props) => {
|
|
12
|
+
return /* @__PURE__ */ React.createElement(DxGrid, props);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
Grid
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/Grid.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\nimport '@dxos/lit-grid/dx-grid.pcss';\n\nimport { createComponent } from '@lit/react';\nimport React from 'react';\n\nimport { DxGrid as NaturalDxGrid, type DxGridProps } from '@dxos/lit-grid';\n\nconst DxGrid = createComponent({\n tagName: 'dx-grid',\n elementClass: NaturalDxGrid,\n react: React,\n});\n\nexport type GridProps = DxGridProps;\n\nexport const Grid = (props: GridProps) => {\n return <DxGrid {...props} />;\n};\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO;AAEP,SAASA,uBAAuB;AAChC,OAAOC,WAAW;AAElB,SAASC,UAAUC,qBAAuC;AAE1D,IAAMC,SAASC,gBAAgB;EAC7BC,SAAS;EACTC,cAAcC;EACdC,OAAOC;AACT,CAAA;AAIO,IAAMC,OAAO,CAACC,UAAAA;AACnB,SAAO,sBAAA,cAACR,QAAWQ,KAAAA;AACrB;",
|
|
6
|
+
"names": ["createComponent", "React", "DxGrid", "NaturalDxGrid", "DxGrid", "createComponent", "tagName", "elementClass", "NaturalDxGrid", "react", "React", "Grid", "props"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-grid/src/Grid.tsx":{"bytes":1812,"imports":[{"path":"@dxos/lit-grid/dx-grid.pcss","kind":"import-statement","external":true},{"path":"@lit/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-grid","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-grid/src/index.ts":{"bytes":489,"imports":[{"path":"packages/ui/react-ui-grid/src/Grid.tsx","kind":"import-statement","original":"./Grid"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-grid/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":958},"packages/ui/react-ui-grid/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/lit-grid/dx-grid.pcss","kind":"import-statement","external":true},{"path":"@lit/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/lit-grid","kind":"import-statement","external":true}],"exports":["Grid"],"entryPoint":"packages/ui/react-ui-grid/src/index.ts","inputs":{"packages/ui/react-ui-grid/src/Grid.tsx":{"bytesInOutput":360},"packages/ui/react-ui-grid/src/index.ts":{"bytesInOutput":0}},"bytes":456}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/Grid.tsx"],"names":[],"mappings":"AAGA,OAAO,6BAA6B,CAAC;AAGrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQ3E,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AAEpC,eAAO,MAAM,IAAI,UAAW,SAAS,sBAEpC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: (props: import("./Grid").GridProps) => import("react").JSX.Element;
|
|
4
|
+
decorators: import("@storybook/react/*").Decorator[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Basic: {
|
|
8
|
+
args: {
|
|
9
|
+
cells: {
|
|
10
|
+
'1,1': {
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
columnDefault: {
|
|
15
|
+
size: number;
|
|
16
|
+
resizeable: true;
|
|
17
|
+
};
|
|
18
|
+
rowDefault: {
|
|
19
|
+
size: number;
|
|
20
|
+
resizeable: true;
|
|
21
|
+
};
|
|
22
|
+
columns: {
|
|
23
|
+
0: {
|
|
24
|
+
size: number;
|
|
25
|
+
};
|
|
26
|
+
1: {
|
|
27
|
+
size: number;
|
|
28
|
+
};
|
|
29
|
+
2: {
|
|
30
|
+
size: number;
|
|
31
|
+
};
|
|
32
|
+
3: {
|
|
33
|
+
size: number;
|
|
34
|
+
};
|
|
35
|
+
4: {
|
|
36
|
+
size: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Grid.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.stories.d.ts","sourceRoot":"","sources":["../../../src/Grid.stories.tsx"],"names":[],"mappings":";;;;;AASA,wBAIE;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dxos/react-ui-grid",
|
|
3
|
+
"version": "0.6.10-main.3cfcc89",
|
|
4
|
+
"description": "React component which manages a `dx-grid` Lit web component.",
|
|
5
|
+
"homepage": "https://dxos.org",
|
|
6
|
+
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "DXOS.org",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
12
|
+
"types": "./dist/types/src/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"types": "dist/types/src/index.d.ts",
|
|
16
|
+
"typesVersions": {
|
|
17
|
+
"*": {}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"src"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@lit/react": "^1.0.5",
|
|
25
|
+
"@dxos/lit-grid": "0.6.10-main.3cfcc89",
|
|
26
|
+
"@dxos/react-ui": "0.6.10-main.3cfcc89",
|
|
27
|
+
"@dxos/util": "0.6.10-main.3cfcc89",
|
|
28
|
+
"@dxos/react-ui-theme": "0.6.10-main.3cfcc89"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "~18.2.0",
|
|
32
|
+
"@types/react-dom": "~18.2.0",
|
|
33
|
+
"react": "~18.2.0",
|
|
34
|
+
"react-dom": "~18.2.0",
|
|
35
|
+
"vite": "^5.3.4",
|
|
36
|
+
"@dxos/storybook-utils": "0.6.10-main.3cfcc89"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "^18.0.0",
|
|
40
|
+
"react-dom": "^18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type { DxGridProps } from '@dxos/lit-grid';
|
|
6
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
7
|
+
|
|
8
|
+
import { Grid } from './Grid';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'react-ui-grid/Grid',
|
|
12
|
+
component: Grid,
|
|
13
|
+
decorators: [withTheme],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Basic = {
|
|
17
|
+
args: {
|
|
18
|
+
cells: {
|
|
19
|
+
'1,1': {
|
|
20
|
+
// end: '8,1',
|
|
21
|
+
value: 'Weekly sales report',
|
|
22
|
+
},
|
|
23
|
+
} satisfies DxGridProps['cells'],
|
|
24
|
+
columnDefault: {
|
|
25
|
+
size: 180,
|
|
26
|
+
resizeable: true,
|
|
27
|
+
} satisfies DxGridProps['columnDefault'],
|
|
28
|
+
rowDefault: {
|
|
29
|
+
size: 32,
|
|
30
|
+
resizeable: true,
|
|
31
|
+
} satisfies DxGridProps['rowDefault'],
|
|
32
|
+
columns: {
|
|
33
|
+
0: { size: 200 },
|
|
34
|
+
1: { size: 210 },
|
|
35
|
+
2: { size: 230 },
|
|
36
|
+
3: { size: 250 },
|
|
37
|
+
4: { size: 270 },
|
|
38
|
+
} satisfies DxGridProps['columns'],
|
|
39
|
+
},
|
|
40
|
+
};
|
package/src/Grid.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import '@dxos/lit-grid/dx-grid.pcss';
|
|
5
|
+
|
|
6
|
+
import { createComponent } from '@lit/react';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { DxGrid as NaturalDxGrid, type DxGridProps } from '@dxos/lit-grid';
|
|
10
|
+
|
|
11
|
+
const DxGrid = createComponent({
|
|
12
|
+
tagName: 'dx-grid',
|
|
13
|
+
elementClass: NaturalDxGrid,
|
|
14
|
+
react: React,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type GridProps = DxGridProps;
|
|
18
|
+
|
|
19
|
+
export const Grid = (props: GridProps) => {
|
|
20
|
+
return <DxGrid {...props} />;
|
|
21
|
+
};
|