@dxos/react-ui-grid 0.8.4-main.e098934 → 0.8.4-main.ead640a
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 +2 -2
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/CellEditor/CellEditor.stories.d.ts +0 -1
- package/dist/types/src/CellEditor/CellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/Grid/Grid.d.ts +1 -1
- package/dist/types/src/Grid/Grid.d.ts.map +1 -1
- package/dist/types/src/Grid/Grid.stories.d.ts +0 -1
- package/dist/types/src/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -21
- package/src/CellEditor/CellEditor.stories.tsx +1 -3
- package/src/CellEditor/CellEditor.tsx +2 -2
- package/src/Grid/Grid.stories.tsx +16 -16
- package/src/Grid/Grid.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-grid",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ead640a",
|
|
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",
|
|
@@ -24,35 +24,35 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@codemirror/autocomplete": "^6.
|
|
27
|
+
"@codemirror/autocomplete": "^6.19.0",
|
|
28
28
|
"@codemirror/state": "^6.5.2",
|
|
29
|
-
"@codemirror/view": "^6.38.
|
|
30
|
-
"@lit/react": "^1.0.
|
|
29
|
+
"@codemirror/view": "^6.38.4",
|
|
30
|
+
"@lit/react": "^1.0.8",
|
|
31
31
|
"@preact-signals/safe-react": "^0.9.0",
|
|
32
32
|
"@radix-ui/react-context": "1.1.1",
|
|
33
33
|
"@radix-ui/react-popper": "1.2.2",
|
|
34
34
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
35
|
-
"@dxos/lit-grid": "0.8.4-main.
|
|
36
|
-
"@dxos/react-ui-editor": "0.8.4-main.
|
|
37
|
-
"@dxos/util": "0.8.4-main.
|
|
35
|
+
"@dxos/lit-grid": "0.8.4-main.ead640a",
|
|
36
|
+
"@dxos/react-ui-editor": "0.8.4-main.ead640a",
|
|
37
|
+
"@dxos/util": "0.8.4-main.ead640a"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/react": "~
|
|
41
|
-
"@types/react-dom": "~
|
|
42
|
-
"react": "~
|
|
43
|
-
"react-dom": "~
|
|
44
|
-
"vite": "7.1.
|
|
45
|
-
"@dxos/react-ui-searchlist": "0.8.4-main.
|
|
46
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
40
|
+
"@types/react": "~19.2.2",
|
|
41
|
+
"@types/react-dom": "~19.2.1",
|
|
42
|
+
"react": "~19.2.0",
|
|
43
|
+
"react-dom": "~19.2.0",
|
|
44
|
+
"vite": "7.1.9",
|
|
45
|
+
"@dxos/react-ui-searchlist": "0.8.4-main.ead640a",
|
|
46
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
47
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a",
|
|
48
|
+
"@dxos/storybook-utils": "0.8.4-main.ead640a",
|
|
49
|
+
"@dxos/random": "0.8.4-main.ead640a"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"react": "
|
|
53
|
-
"react-dom": "
|
|
54
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
52
|
+
"react": "^19.0.0",
|
|
53
|
+
"react-dom": "^19.0.0",
|
|
54
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
55
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import { withTheme } from '@dxos/
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { CellEditor, type CellEditorProps, type EditorKeyEvent, editorKeys } from './CellEditor';
|
|
13
11
|
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type UseTextEditorProps,
|
|
14
14
|
createBasicExtensions,
|
|
15
15
|
createThemeExtensions,
|
|
16
|
-
|
|
16
|
+
filterChars,
|
|
17
17
|
useTextEditor,
|
|
18
18
|
} from '@dxos/react-ui-editor';
|
|
19
19
|
import { mx } from '@dxos/react-ui-theme';
|
|
@@ -132,7 +132,7 @@ export const CellEditor = ({ value, extensions, box, gridId, onBlur, autoFocus,
|
|
|
132
132
|
selection: { anchor: value?.length ?? 0 },
|
|
133
133
|
extensions: [
|
|
134
134
|
extensions ?? [],
|
|
135
|
-
|
|
135
|
+
filterChars(/[\n\r]+/),
|
|
136
136
|
EditorView.focusChangeEffect.of((state, focusing) => {
|
|
137
137
|
if (!focusing) {
|
|
138
138
|
onBlur?.(state.doc.toString());
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { type MouseEvent, type MutableRefObject, useCallback, useRef, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { defaultRowSize } from '@dxos/lit-grid';
|
|
11
9
|
import { faker } from '@dxos/random';
|
|
12
10
|
import { DropdownMenu } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
|
+
import { Combobox, type ComboboxRootProps } from '@dxos/react-ui-searchlist';
|
|
15
13
|
|
|
16
14
|
import { Grid, type GridContentProps, type GridEditing, type GridRootProps } from './Grid';
|
|
17
15
|
|
|
@@ -33,7 +31,7 @@ const GridStory = ({ initialCells, ...props }: GridStoryProps) => {
|
|
|
33
31
|
// Multiselect
|
|
34
32
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
35
33
|
const [multiSelectValue, setInternalMultiselectValue] = useState('');
|
|
36
|
-
const setMultiselectValue = useCallback<NonNullable<
|
|
34
|
+
const setMultiselectValue = useCallback<NonNullable<ComboboxRootProps['onValueChange']>>((nextValue) => {
|
|
37
35
|
setInternalMultiselectValue(nextValue);
|
|
38
36
|
setCells((cells) => {
|
|
39
37
|
// TODO(burdon): How can we get the cell address to update?
|
|
@@ -80,23 +78,23 @@ const GridStory = ({ initialCells, ...props }: GridStoryProps) => {
|
|
|
80
78
|
</DropdownMenu.Root>
|
|
81
79
|
|
|
82
80
|
{/* Multiselect */}
|
|
83
|
-
<
|
|
81
|
+
<Combobox.Root
|
|
84
82
|
open={popoverOpen}
|
|
85
83
|
onOpenChange={setPopoverOpen}
|
|
86
84
|
value={multiSelectValue}
|
|
87
85
|
onValueChange={setMultiselectValue}
|
|
88
86
|
>
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
<
|
|
87
|
+
<Combobox.VirtualTrigger virtualRef={triggerRef} />
|
|
88
|
+
<Combobox.Content filter={(value, search) => (value.includes(search) ? 1 : 0)}>
|
|
89
|
+
<Combobox.Input placeholder='Search...' />
|
|
90
|
+
<Combobox.List>
|
|
93
91
|
{storybookItems.map((value) => (
|
|
94
|
-
<
|
|
92
|
+
<Combobox.Item key={value}>{value}</Combobox.Item>
|
|
95
93
|
))}
|
|
96
|
-
</
|
|
97
|
-
<
|
|
98
|
-
</
|
|
99
|
-
</
|
|
94
|
+
</Combobox.List>
|
|
95
|
+
<Combobox.Arrow />
|
|
96
|
+
</Combobox.Content>
|
|
97
|
+
</Combobox.Root>
|
|
100
98
|
</div>
|
|
101
99
|
);
|
|
102
100
|
};
|
|
@@ -105,7 +103,9 @@ const meta = {
|
|
|
105
103
|
title: 'ui/react-ui-grid/Grid',
|
|
106
104
|
component: GridStory,
|
|
107
105
|
decorators: [withTheme],
|
|
108
|
-
parameters: {
|
|
106
|
+
parameters: {
|
|
107
|
+
layout: 'fullscreen',
|
|
108
|
+
},
|
|
109
109
|
} satisfies Meta<typeof GridStory>;
|
|
110
110
|
|
|
111
111
|
export default meta;
|
package/src/Grid/Grid.tsx
CHANGED
|
@@ -102,13 +102,13 @@ const GridRoot = ({
|
|
|
102
102
|
|
|
103
103
|
GridRoot.displayName = GRID_NAME;
|
|
104
104
|
|
|
105
|
+
const GRID_CONTENT_NAME = 'GridContent';
|
|
106
|
+
|
|
105
107
|
type GridContentProps = Omit<ComponentProps<typeof DxGrid>, 'onEdit'> & {
|
|
106
108
|
getCells?: NaturalDxGrid['getCells'];
|
|
107
109
|
activeRefs?: string;
|
|
108
110
|
};
|
|
109
111
|
|
|
110
|
-
const GRID_CONTENT_NAME = 'GridContent';
|
|
111
|
-
|
|
112
112
|
const GridContent = forwardRef<NaturalDxGrid, GridScopedProps<GridContentProps>>((props, forwardedRef) => {
|
|
113
113
|
const { id, editing, setEditBox, setEditing } = useGridContext(GRID_CONTENT_NAME, props.__gridScope);
|
|
114
114
|
const [dxGrid, setDxGridInternal] = useState<NaturalDxGrid | null>(null);
|
|
@@ -166,7 +166,7 @@ export const Grid = {
|
|
|
166
166
|
Content: GridContent,
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
export { GridRoot, GridContent,
|
|
169
|
+
export { GridRoot, GridContent, createGridScope, gridSeparatorInlineEnd, gridSeparatorBlockEnd, useGridContext };
|
|
170
170
|
|
|
171
171
|
export type { GridRootProps, GridContentProps, GridEditing, GridEditBox, GridScopedProps, DxGridElement };
|
|
172
172
|
|