@dxos/react-ui-grid 0.6.10 → 0.6.11-staging.30cf5ba
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/dist/lib/browser/index.mjs +4 -1
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/Grid.d.ts +4 -2
- package/dist/types/src/Grid.d.ts.map +1 -1
- package/dist/types/src/Grid.stories.d.ts +3 -1
- package/dist/types/src/Grid.stories.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/Grid.stories.tsx +9 -7
- package/src/Grid.tsx +8 -3
|
@@ -6,7 +6,10 @@ import { DxGrid as NaturalDxGrid } from "@dxos/lit-grid";
|
|
|
6
6
|
var DxGrid = createComponent({
|
|
7
7
|
tagName: "dx-grid",
|
|
8
8
|
elementClass: NaturalDxGrid,
|
|
9
|
-
react: React
|
|
9
|
+
react: React,
|
|
10
|
+
events: {
|
|
11
|
+
onAxisResize: "dx-axis-resize"
|
|
12
|
+
}
|
|
10
13
|
});
|
|
11
14
|
var Grid = (props) => {
|
|
12
15
|
return /* @__PURE__ */ React.createElement(DxGrid, props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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,
|
|
6
|
-
"names": ["createComponent", "React", "DxGrid", "NaturalDxGrid", "DxGrid", "createComponent", "tagName", "elementClass", "NaturalDxGrid", "react", "React", "Grid", "props"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\nimport '@dxos/lit-grid/dx-grid.pcss';\n\nimport { createComponent, type EventName } from '@lit/react';\nimport React from 'react';\n\nimport { type DxAxisResize, DxGrid as NaturalDxGrid, type DxGridProps } from '@dxos/lit-grid';\n\nconst DxGrid = createComponent({\n tagName: 'dx-grid',\n elementClass: NaturalDxGrid,\n react: React,\n events: {\n onAxisResize: 'dx-axis-resize' as EventName<DxAxisResize>,\n },\n});\n\nexport type GridProps = DxGridProps & {\n onAxisResize: (event: DxAxisResize) => void;\n};\n\nexport const Grid = (props: GridProps) => {\n return <DxGrid {...props} />;\n};\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO;AAEP,SAASA,uBAAuC;AAChD,OAAOC,WAAW;AAElB,SAA4BC,UAAUC,qBAAuC;AAE7E,IAAMC,SAASC,gBAAgB;EAC7BC,SAAS;EACTC,cAAcC;EACdC,OAAOC;EACPC,QAAQ;IACNC,cAAc;EAChB;AACF,CAAA;AAMO,IAAMC,OAAO,CAACC,UAAAA;AACnB,SAAO,sBAAA,cAACV,QAAWU,KAAAA;AACrB;",
|
|
6
|
+
"names": ["createComponent", "React", "DxGrid", "NaturalDxGrid", "DxGrid", "createComponent", "tagName", "elementClass", "NaturalDxGrid", "react", "React", "events", "onAxisResize", "Grid", "props"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-grid/src/Grid.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-grid/src/Grid.tsx":{"bytes":2180,"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":1186},"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":412},"packages/ui/react-ui-grid/src/index.ts":{"bytesInOutput":0}},"bytes":508}}}
|
package/dist/types/src/Grid.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import '@dxos/lit-grid/dx-grid.pcss';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type DxGridProps } from '@dxos/lit-grid';
|
|
4
|
-
export type GridProps = DxGridProps
|
|
3
|
+
import { type DxAxisResize, type DxGridProps } from '@dxos/lit-grid';
|
|
4
|
+
export type GridProps = DxGridProps & {
|
|
5
|
+
onAxisResize: (event: DxAxisResize) => void;
|
|
6
|
+
};
|
|
5
7
|
export declare const Grid: (props: GridProps) => React.JSX.Element;
|
|
6
8
|
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -1 +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;
|
|
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,EAAE,KAAK,YAAY,EAA2B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAW9F,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IACpC,YAAY,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,SAAS,sBAEpC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type GridProps } from './Grid';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
title: string;
|
|
3
|
-
component: (props:
|
|
4
|
+
component: (props: GridProps) => import("react").JSX.Element;
|
|
4
5
|
decorators: import("@storybook/react/*").Decorator[];
|
|
5
6
|
};
|
|
6
7
|
export default _default;
|
|
@@ -36,6 +37,7 @@ export declare const Basic: {
|
|
|
36
37
|
size: number;
|
|
37
38
|
};
|
|
38
39
|
};
|
|
40
|
+
onAxisResize: (event: import("packages/ui/lit-grid/dist/types/src").DxAxisResize) => void;
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
43
|
//# sourceMappingURL=Grid.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.stories.d.ts","sourceRoot":"","sources":["../../../src/Grid.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Grid.stories.d.ts","sourceRoot":"","sources":["../../../src/Grid.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;;AAE9C,wBAIE;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-grid",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11-staging.30cf5ba",
|
|
4
4
|
"description": "React component which manages a `dx-grid` Lit web component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@lit/react": "^1.0.5",
|
|
25
|
-
"@dxos/lit-grid": "0.6.
|
|
26
|
-
"@dxos/react-ui": "0.6.
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
25
|
+
"@dxos/lit-grid": "0.6.11-staging.30cf5ba",
|
|
26
|
+
"@dxos/react-ui": "0.6.11-staging.30cf5ba",
|
|
27
|
+
"@dxos/react-ui-theme": "0.6.11-staging.30cf5ba",
|
|
28
|
+
"@dxos/util": "0.6.11-staging.30cf5ba"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/react": "~18.2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"react": "~18.2.0",
|
|
34
34
|
"react-dom": "~18.2.0",
|
|
35
35
|
"vite": "^5.3.4",
|
|
36
|
-
"@dxos/storybook-utils": "0.6.
|
|
36
|
+
"@dxos/storybook-utils": "0.6.11-staging.30cf5ba"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "^18.0.0",
|
package/src/Grid.stories.tsx
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import type { DxGridProps } from '@dxos/lit-grid';
|
|
6
5
|
import { withTheme } from '@dxos/storybook-utils';
|
|
7
6
|
|
|
8
|
-
import { Grid } from './Grid';
|
|
7
|
+
import { Grid, type GridProps } from './Grid';
|
|
9
8
|
|
|
10
9
|
export default {
|
|
11
10
|
title: 'react-ui-grid/Grid',
|
|
@@ -20,21 +19,24 @@ export const Basic = {
|
|
|
20
19
|
// end: '8,1',
|
|
21
20
|
value: 'Weekly sales report',
|
|
22
21
|
},
|
|
23
|
-
}
|
|
22
|
+
},
|
|
24
23
|
columnDefault: {
|
|
25
24
|
size: 180,
|
|
26
25
|
resizeable: true,
|
|
27
|
-
}
|
|
26
|
+
},
|
|
28
27
|
rowDefault: {
|
|
29
28
|
size: 32,
|
|
30
29
|
resizeable: true,
|
|
31
|
-
}
|
|
30
|
+
},
|
|
32
31
|
columns: {
|
|
33
32
|
0: { size: 200 },
|
|
34
33
|
1: { size: 210 },
|
|
35
34
|
2: { size: 230 },
|
|
36
35
|
3: { size: 250 },
|
|
37
36
|
4: { size: 270 },
|
|
38
|
-
}
|
|
39
|
-
|
|
37
|
+
},
|
|
38
|
+
onAxisResize: (event) => {
|
|
39
|
+
console.log('[axis resize]', event);
|
|
40
|
+
},
|
|
41
|
+
} satisfies GridProps,
|
|
40
42
|
};
|
package/src/Grid.tsx
CHANGED
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
//
|
|
4
4
|
import '@dxos/lit-grid/dx-grid.pcss';
|
|
5
5
|
|
|
6
|
-
import { createComponent } from '@lit/react';
|
|
6
|
+
import { createComponent, type EventName } from '@lit/react';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { DxGrid as NaturalDxGrid, type DxGridProps } from '@dxos/lit-grid';
|
|
9
|
+
import { type DxAxisResize, DxGrid as NaturalDxGrid, type DxGridProps } from '@dxos/lit-grid';
|
|
10
10
|
|
|
11
11
|
const DxGrid = createComponent({
|
|
12
12
|
tagName: 'dx-grid',
|
|
13
13
|
elementClass: NaturalDxGrid,
|
|
14
14
|
react: React,
|
|
15
|
+
events: {
|
|
16
|
+
onAxisResize: 'dx-axis-resize' as EventName<DxAxisResize>,
|
|
17
|
+
},
|
|
15
18
|
});
|
|
16
19
|
|
|
17
|
-
export type GridProps = DxGridProps
|
|
20
|
+
export type GridProps = DxGridProps & {
|
|
21
|
+
onAxisResize: (event: DxAxisResize) => void;
|
|
22
|
+
};
|
|
18
23
|
|
|
19
24
|
export const Grid = (props: GridProps) => {
|
|
20
25
|
return <DxGrid {...props} />;
|