@neo4j-ndl/react 4.14.5 → 4.15.0
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/lib/cjs/ai/preview/Preview.js +5 -0
- package/lib/cjs/ai/preview/Preview.js.map +1 -1
- package/lib/cjs/ai/preview/stories/index.js +9 -1
- package/lib/cjs/ai/preview/stories/index.js.map +1 -1
- package/lib/cjs/ai/preview/stories/preview-simple-with-content.story.js +34 -0
- package/lib/cjs/ai/preview/stories/preview-simple-with-content.story.js.map +1 -0
- package/lib/cjs/ai/preview/stories/preview-simple.story.js +33 -0
- package/lib/cjs/ai/preview/stories/preview-simple.story.js.map +1 -0
- package/lib/cjs/ai/prompt/Prompt.js +4 -14
- package/lib/cjs/ai/prompt/Prompt.js.map +1 -1
- package/lib/cjs/ai/prompt/stories/index.js +5 -1
- package/lib/cjs/ai/prompt/stories/index.js.map +1 -1
- package/lib/cjs/ai/prompt/stories/prompt-advanced.story.js +1 -1
- package/lib/cjs/ai/prompt/stories/prompt-advanced.story.js.map +1 -1
- package/lib/cjs/ai/prompt/stories/prompt-header.story.js +39 -0
- package/lib/cjs/ai/prompt/stories/prompt-header.story.js.map +1 -0
- package/lib/cjs/ai/response/Response.js +23 -22
- package/lib/cjs/ai/response/Response.js.map +1 -1
- package/lib/cjs/ai/response/stories/response-all-components.story.js +2 -0
- package/lib/cjs/ai/response/stories/response-all-components.story.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +25 -10
- package/lib/cjs/data-grid/Components.js.map +1 -1
- package/lib/cjs/data-grid/datagrid-types.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js +1 -0
- package/lib/cjs/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-using-editable-cells.story.js +145 -52
- package/lib/cjs/data-grid/stories/datagrid-using-editable-cells.story.js.map +1 -1
- package/lib/esm/ai/preview/Preview.js +5 -0
- package/lib/esm/ai/preview/Preview.js.map +1 -1
- package/lib/esm/ai/preview/stories/index.js +6 -0
- package/lib/esm/ai/preview/stories/index.js.map +1 -1
- package/lib/esm/ai/preview/stories/preview-simple-with-content.story.js +32 -0
- package/lib/esm/ai/preview/stories/preview-simple-with-content.story.js.map +1 -0
- package/lib/esm/ai/preview/stories/preview-simple.story.js +31 -0
- package/lib/esm/ai/preview/stories/preview-simple.story.js.map +1 -0
- package/lib/esm/ai/prompt/Prompt.js +6 -16
- package/lib/esm/ai/prompt/Prompt.js.map +1 -1
- package/lib/esm/ai/prompt/stories/index.js +3 -0
- package/lib/esm/ai/prompt/stories/index.js.map +1 -1
- package/lib/esm/ai/prompt/stories/prompt-advanced.story.js +1 -1
- package/lib/esm/ai/prompt/stories/prompt-advanced.story.js.map +1 -1
- package/lib/esm/ai/prompt/stories/prompt-header.story.js +37 -0
- package/lib/esm/ai/prompt/stories/prompt-header.story.js.map +1 -0
- package/lib/esm/ai/response/Response.js +23 -22
- package/lib/esm/ai/response/Response.js.map +1 -1
- package/lib/esm/ai/response/stories/response-all-components.story.js +2 -0
- package/lib/esm/ai/response/stories/response-all-components.story.js.map +1 -1
- package/lib/esm/data-grid/Components.js +25 -10
- package/lib/esm/data-grid/Components.js.map +1 -1
- package/lib/esm/data-grid/datagrid-types.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js +1 -0
- package/lib/esm/data-grid/stories/datagrid-in-dialog.story.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-using-editable-cells.story.js +147 -54
- package/lib/esm/data-grid/stories/datagrid-using-editable-cells.story.js.map +1 -1
- package/lib/types/ai/preview/Preview.d.ts +4 -0
- package/lib/types/ai/preview/Preview.d.ts.map +1 -1
- package/lib/types/ai/preview/stories/index.d.ts +4 -0
- package/lib/types/ai/preview/stories/index.d.ts.map +1 -1
- package/lib/types/ai/preview/stories/preview-simple-with-content.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-simple-with-content.story.d.ts.map +1 -0
- package/lib/types/ai/preview/stories/preview-simple.story.d.ts +24 -0
- package/lib/types/ai/preview/stories/preview-simple.story.d.ts.map +1 -0
- package/lib/types/ai/prompt/Prompt.d.ts +6 -2
- package/lib/types/ai/prompt/Prompt.d.ts.map +1 -1
- package/lib/types/ai/prompt/stories/index.d.ts +2 -0
- package/lib/types/ai/prompt/stories/index.d.ts.map +1 -1
- package/lib/types/ai/prompt/stories/prompt-advanced.story.d.ts.map +1 -1
- package/lib/types/ai/prompt/stories/prompt-header.story.d.ts +24 -0
- package/lib/types/ai/prompt/stories/prompt-header.story.d.ts.map +1 -0
- package/lib/types/ai/response/Response.d.ts.map +1 -1
- package/lib/types/ai/response/stories/response-all-components.story.d.ts.map +1 -1
- package/lib/types/data-grid/Components.d.ts +16 -1
- package/lib/types/data-grid/Components.d.ts.map +1 -1
- package/lib/types/data-grid/DataGrid.d.ts +10 -1
- package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
- package/lib/types/data-grid/datagrid-types.d.ts +11 -1
- package/lib/types/data-grid/datagrid-types.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-in-dialog.story.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +10 -1
- package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +10 -1
- package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-using-editable-cells.story.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) "Neo4j"
|
|
@@ -20,93 +20,186 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
-
import {
|
|
23
|
+
import { tokens } from '@neo4j-ndl/base';
|
|
24
|
+
import { DataGrid, GraphLabel } from '@neo4j-ndl/react';
|
|
25
|
+
import { ExclamationTriangleIconSolid } from '@neo4j-ndl/react/icons';
|
|
24
26
|
import { createColumnHelper, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
|
|
25
27
|
import { useState } from 'react';
|
|
26
|
-
|
|
28
|
+
const ROLE_OPTIONS = [
|
|
29
|
+
{ label: 'Admin', value: 'admin' },
|
|
30
|
+
{ label: 'Editor', value: 'editor' },
|
|
31
|
+
{ label: 'Viewer', value: 'viewer' },
|
|
32
|
+
];
|
|
33
|
+
const PERMISSION_OPTIONS = [
|
|
34
|
+
{ label: 'Read', value: 'read' },
|
|
35
|
+
{ label: 'Write', value: 'write' },
|
|
36
|
+
{ label: 'Delete', value: 'delete' },
|
|
37
|
+
];
|
|
38
|
+
const LABEL_OPTIONS = [
|
|
39
|
+
{ label: 'Person', value: 'person' },
|
|
40
|
+
{ label: 'Movie', value: 'movie' },
|
|
41
|
+
{ label: 'Director', value: 'director' },
|
|
42
|
+
{ label: 'Actor', value: 'actor' },
|
|
43
|
+
];
|
|
44
|
+
const STATUS_OPTIONS = [
|
|
45
|
+
{ label: 'Active', value: 'active' },
|
|
46
|
+
{ label: 'Inactive', value: 'inactive' },
|
|
47
|
+
{ label: 'Pending', value: 'pending' },
|
|
48
|
+
];
|
|
49
|
+
const VALID_STATUSES = STATUS_OPTIONS.map((option) => option.value);
|
|
50
|
+
const LABEL_COLORS = {
|
|
51
|
+
actor: tokens.graph['7'],
|
|
52
|
+
director: tokens.graph['4'],
|
|
53
|
+
movie: tokens.graph['3'],
|
|
54
|
+
person: tokens.graph['1'],
|
|
55
|
+
};
|
|
56
|
+
// Render each selected value as a non-interactive GraphLabel (as a span)
|
|
57
|
+
// instead of the default Tag chip, demonstrating the components override.
|
|
58
|
+
const LabelMultiValue = (props) => (_jsx(GraphLabel, { as: "span", type: "node", size: "small", color: LABEL_COLORS[props.data.value], children: props.data.label }));
|
|
59
|
+
// The "Dallas Kuhn" row has a status that is not part of the available
|
|
60
|
+
// options, so its dropdown cell renders in the error state.
|
|
61
|
+
const DEMO_DATA = [
|
|
62
|
+
{
|
|
63
|
+
labels: ['person', 'actor'],
|
|
64
|
+
name: 'Alicia Sanford',
|
|
65
|
+
permissions: ['read', 'write'],
|
|
66
|
+
role: 'admin',
|
|
67
|
+
status: 'active',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
labels: ['movie'],
|
|
71
|
+
name: 'Dallas Kuhn',
|
|
72
|
+
permissions: ['read'],
|
|
73
|
+
role: 'editor',
|
|
74
|
+
status: 'unknown',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
labels: ['director'],
|
|
78
|
+
name: 'Susan Daugherty MD',
|
|
79
|
+
permissions: ['read', 'write', 'delete'],
|
|
80
|
+
role: 'viewer',
|
|
81
|
+
status: 'pending',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
labels: ['person'],
|
|
85
|
+
name: 'Karen Huel',
|
|
86
|
+
permissions: ['read'],
|
|
87
|
+
role: 'editor',
|
|
88
|
+
status: 'inactive',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
labels: ['movie', 'director'],
|
|
92
|
+
name: 'Ken Kessler',
|
|
93
|
+
permissions: ['write', 'delete'],
|
|
94
|
+
role: 'admin',
|
|
95
|
+
status: 'active',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
labels: [],
|
|
99
|
+
name: 'Courtney McClure',
|
|
100
|
+
permissions: [],
|
|
101
|
+
role: 'viewer',
|
|
102
|
+
status: 'pending',
|
|
103
|
+
},
|
|
104
|
+
];
|
|
27
105
|
const columnHelper = createColumnHelper();
|
|
28
106
|
const Component = () => {
|
|
29
|
-
const [data, setData] = useState(
|
|
107
|
+
const [data, setData] = useState(DEMO_DATA);
|
|
108
|
+
const updateRow = (name, update) => {
|
|
109
|
+
setData((oldData) => oldData.map((row) => (row.name === name ? Object.assign(Object.assign({}, row), update) : row)));
|
|
110
|
+
};
|
|
30
111
|
const COMMON_COLUMNS = [
|
|
112
|
+
// Editable inline text cell.
|
|
31
113
|
columnHelper.accessor('name', {
|
|
32
114
|
cell: (cell) => (_jsx(DataGrid.InlineEditCell, { cell: cell, value: cell.getValue(), ariaLabel: "edit name" })),
|
|
33
115
|
meta: {
|
|
34
116
|
isInlineEditCell: {
|
|
35
117
|
onEditChange: (newValue, cell) => {
|
|
36
|
-
|
|
37
|
-
return oldData.map((row) => {
|
|
38
|
-
if (row.name === cell.row.original.name) {
|
|
39
|
-
return Object.assign(Object.assign({}, row), { name: newValue });
|
|
40
|
-
}
|
|
41
|
-
return row;
|
|
42
|
-
});
|
|
43
|
-
});
|
|
118
|
+
updateRow(cell.row.original.name, { name: newValue });
|
|
44
119
|
},
|
|
45
120
|
},
|
|
46
121
|
},
|
|
47
122
|
minSize: 180,
|
|
48
123
|
size: 220,
|
|
49
124
|
}),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
label: '37',
|
|
62
|
-
value: '37',
|
|
125
|
+
// Default single-select dropdown.
|
|
126
|
+
columnHelper.accessor('role', {
|
|
127
|
+
cell: (info) => (_jsx(DataGrid.DropDownCell, { cell: info, options: ROLE_OPTIONS, ariaLabel: "select role" })),
|
|
128
|
+
meta: {
|
|
129
|
+
isDropDownCell: {
|
|
130
|
+
onChange: (newValue, cell) => {
|
|
131
|
+
if (newValue === undefined) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
updateRow(cell.row.original.name, { role: newValue });
|
|
63
135
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
minSize: 160,
|
|
139
|
+
size: 180,
|
|
140
|
+
}),
|
|
141
|
+
// Default multi-select dropdown (default Tag chips).
|
|
142
|
+
columnHelper.accessor('permissions', {
|
|
143
|
+
cell: (info) => (_jsx(DataGrid.DropDownCell, { cell: info, options: PERMISSION_OPTIONS, ariaLabel: "select permissions" })),
|
|
144
|
+
enableSorting: false,
|
|
145
|
+
meta: {
|
|
146
|
+
isDropDownCell: {
|
|
147
|
+
isMulti: true,
|
|
148
|
+
onChange: (newValue, cell) => {
|
|
149
|
+
updateRow(cell.row.original.name, { permissions: newValue });
|
|
67
150
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
minSize: 220,
|
|
154
|
+
size: 260,
|
|
155
|
+
}),
|
|
156
|
+
// Multi-select dropdown with a custom MultiValue (GraphLabel chips).
|
|
157
|
+
columnHelper.accessor('labels', {
|
|
158
|
+
cell: (info) => (_jsx(DataGrid.DropDownCell, { cell: info, options: LABEL_OPTIONS, ariaLabel: "select labels", components: { MultiValue: LabelMultiValue } })),
|
|
159
|
+
enableSorting: false,
|
|
160
|
+
meta: {
|
|
161
|
+
isDropDownCell: {
|
|
162
|
+
isMulti: true,
|
|
163
|
+
onChange: (newValue, cell) => {
|
|
164
|
+
updateRow(cell.row.original.name, { labels: newValue });
|
|
71
165
|
},
|
|
72
|
-
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
minSize: 240,
|
|
169
|
+
size: 280,
|
|
170
|
+
}),
|
|
171
|
+
// Single-select dropdown in an error state.
|
|
172
|
+
columnHelper.accessor('status', {
|
|
173
|
+
cell: (info) => {
|
|
174
|
+
const isInvalid = !VALID_STATUSES.includes(info.getValue());
|
|
175
|
+
const isPending = info.getValue() === 'pending';
|
|
176
|
+
const isInactive = info.getValue() === 'inactive';
|
|
177
|
+
const warningHelpText = (_jsxs("span", { className: "n-flex n-items-center n-gap-token-2 n-text-warning-text", children: [_jsx(ExclamationTriangleIconSolid, { className: "n-size-token-16 n-text-warning-icon" }), "Inactive users cannot sign in"] }));
|
|
178
|
+
return (_jsx(DataGrid.DropDownCell, { cell: info, options: STATUS_OPTIONS, ariaLabel: "select status", errorText: isInvalid ? 'Please select a valid status' : undefined, helpText: isInactive
|
|
179
|
+
? warningHelpText
|
|
180
|
+
: isPending
|
|
181
|
+
? 'Waiting for admin approval'
|
|
182
|
+
: undefined }));
|
|
183
|
+
},
|
|
73
184
|
meta: {
|
|
74
185
|
isDropDownCell: {
|
|
75
186
|
onChange: (newValue, cell) => {
|
|
76
187
|
if (newValue === undefined) {
|
|
77
|
-
// No change
|
|
78
188
|
return;
|
|
79
189
|
}
|
|
80
|
-
|
|
81
|
-
if (isNaN(parsedValue)) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
setData((oldData) => {
|
|
85
|
-
return oldData.map((row) => {
|
|
86
|
-
if (row.name === cell.row.original.name) {
|
|
87
|
-
return Object.assign(Object.assign({}, row), { age: parsedValue });
|
|
88
|
-
}
|
|
89
|
-
return row;
|
|
90
|
-
});
|
|
91
|
-
});
|
|
190
|
+
updateRow(cell.row.original.name, { status: newValue });
|
|
92
191
|
},
|
|
93
192
|
},
|
|
94
193
|
},
|
|
95
|
-
minSize:
|
|
96
|
-
|
|
97
|
-
columnHelper.accessor('cypherCommand', {
|
|
98
|
-
cell: (info) => info.getValue(),
|
|
99
|
-
minSize: 400,
|
|
100
|
-
size: 400,
|
|
194
|
+
minSize: 200,
|
|
195
|
+
size: 240,
|
|
101
196
|
}),
|
|
102
197
|
];
|
|
103
198
|
const table = useReactTable({
|
|
199
|
+
autoResetPageIndex: false,
|
|
104
200
|
columnResizeMode: 'onChange',
|
|
105
201
|
columns: COMMON_COLUMNS,
|
|
106
202
|
data: data,
|
|
107
|
-
debugColumns: true,
|
|
108
|
-
debugHeaders: true,
|
|
109
|
-
debugTable: true,
|
|
110
203
|
defaultColumn: {
|
|
111
204
|
maxSize: 800,
|
|
112
205
|
minSize: 80,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datagrid-using-editable-cells.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-using-editable-cells.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,MAAM,YAAY,GAAG,kBAAkB,EAAkB,CAAC;AAE1D,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAElD,MAAM,cAAc,GAAG;QACrB,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CACd,KAAC,QAAQ,CAAC,cAAc,IACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,EACtB,SAAS,EAAC,WAAW,GACrB,CACH;YACD,IAAI,EAAE;gBACJ,gBAAgB,EAAE;oBAChB,YAAY,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;wBAC/B,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;4BAClB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;gCACzB,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC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4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\nimport { useState } from 'react';\n\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nconst columnHelper = createColumnHelper<TestDataFormat>();\n\nconst Component = () => {\n const [data, setData] = useState(TABLE_DEMO_DATA);\n\n const COMMON_COLUMNS = [\n columnHelper.accessor('name', {\n cell: (cell) => (\n <DataGrid.InlineEditCell\n cell={cell}\n value={cell.getValue()}\n ariaLabel=\"edit name\"\n />\n ),\n meta: {\n isInlineEditCell: {\n onEditChange: (newValue, cell) => {\n setData((oldData) => {\n return oldData.map((row) => {\n if (row.name === cell.row.original.name) {\n return {\n ...row,\n name: newValue,\n };\n }\n return row;\n });\n });\n },\n },\n },\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => (\n <DataGrid.DropDownCell\n cell={info}\n options={[\n {\n label: '12',\n value: '12',\n },\n {\n label: '32',\n value: '32',\n },\n {\n label: '37',\n value: '37',\n },\n {\n label: '39',\n value: '39',\n },\n {\n label: '51',\n value: '51',\n },\n ]}\n ariaLabel=\"select age\"\n />\n ),\n meta: {\n isDropDownCell: {\n onChange: (newValue, cell) => {\n if (newValue === undefined) {\n // No change\n return;\n }\n\n const parsedValue = parseInt(newValue, 10);\n\n if (isNaN(parsedValue)) {\n return;\n }\n\n setData((oldData) => {\n return oldData.map((row) => {\n if (row.name === cell.row.original.name) {\n return {\n ...row,\n age: parsedValue,\n };\n }\n return row;\n });\n });\n },\n },\n },\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 400,\n size: 400,\n }),\n ];\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns: COMMON_COLUMNS,\n data: data,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n });\n\n return (\n <div className=\"n-w-full n-bg-light-neutral-text-weakest\">\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={true}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
1
|
+
{"version":3,"file":"datagrid-using-editable-cells.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-using-editable-cells.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAWjC,MAAM,YAAY,GAAG;IACnB,EAAE,KAAK,EAAE,OAAO,E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YACJ,CAAC;YACD,IAAI,EAAE;gBACJ,cAAc,EAAE;oBACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;wBAC3B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;4BAC3B,OAAO;wBACT,CAAC;wBACD,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;oBAC1D,CAAC;iBACF;aACF;YACD,OAAO,EAAE,GAAG;YACZ,IAAI,EAAE,GAAG;SACV,CAAC;KACH,CAAC;IACF,MAAM,KAAK,GAAG,aAAa,CAAC;QAC1B,kBAAkB,EAAE,KAAK;QACzB,gBAAgB,EAAE,UAAU;QAC5B,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,IAAI;QACV,aAAa,EAAE;YACb,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,aAAa,EAAE,IAAI;QACnB,eAAe,EAAE,eAAe,EAAE;QAClC,qBAAqB,EAAE,qBAAqB,EAAE;QAC9C,iBAAiB,EAAE,iBAAiB,EAAE;QACtC,YAAY,EAAE;YACZ,UAAU,EAAE;gBACV,QAAQ,EAAE,CAAC;aACZ;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,0CAA0C,YACvD,KAAC,QAAQ,IACP,mBAAmB,EAAE,IAAI,EACzB,WAAW,EAAE,IAAI,EACjB,OAAO,EAAE;gBACP,WAAW,EAAE,WAAW;gBACxB,gBAAgB,EAAE,KAAK;aACxB,EACD,aAAa,EAAE,KAAK,GACpB,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { tokens } from '@neo4j-ndl/base';\nimport { DataGrid, GraphLabel } from '@neo4j-ndl/react';\nimport { ExclamationTriangleIconSolid } from '@neo4j-ndl/react/icons';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\nimport { useState } from 'react';\nimport { type MultiValueProps } from 'react-select';\n\ntype TestDataFormat = {\n name: string;\n role: string;\n permissions: string[];\n labels: string[];\n status: string;\n};\n\nconst ROLE_OPTIONS = [\n { label: 'Admin', value: 'admin' },\n { label: 'Editor', value: 'editor' },\n { label: 'Viewer', value: 'viewer' },\n];\n\nconst PERMISSION_OPTIONS = [\n { label: 'Read', value: 'read' },\n { label: 'Write', value: 'write' },\n { label: 'Delete', value: 'delete' },\n];\n\nconst LABEL_OPTIONS = [\n { label: 'Person', value: 'person' },\n { label: 'Movie', value: 'movie' },\n { label: 'Director', value: 'director' },\n { label: 'Actor', value: 'actor' },\n];\n\nconst STATUS_OPTIONS = [\n { label: 'Active', value: 'active' },\n { label: 'Inactive', value: 'inactive' },\n { label: 'Pending', value: 'pending' },\n];\n\nconst VALID_STATUSES = STATUS_OPTIONS.map((option) => option.value);\n\ntype DropDownOption = { value: string; label: string };\n\nconst LABEL_COLORS: Record<string, string> = {\n actor: tokens.graph['7'],\n director: tokens.graph['4'],\n movie: tokens.graph['3'],\n person: tokens.graph['1'],\n};\n\n// Render each selected value as a non-interactive GraphLabel (as a span)\n// instead of the default Tag chip, demonstrating the components override.\nconst LabelMultiValue = (props: MultiValueProps<DropDownOption, boolean>) => (\n <GraphLabel\n as=\"span\"\n type=\"node\"\n size=\"small\"\n color={LABEL_COLORS[props.data.value]}\n >\n {props.data.label}\n </GraphLabel>\n);\n\n// The \"Dallas Kuhn\" row has a status that is not part of the available\n// options, so its dropdown cell renders in the error state.\nconst DEMO_DATA: TestDataFormat[] = [\n {\n labels: ['person', 'actor'],\n name: 'Alicia Sanford',\n permissions: ['read', 'write'],\n role: 'admin',\n status: 'active',\n },\n {\n labels: ['movie'],\n name: 'Dallas Kuhn',\n permissions: ['read'],\n role: 'editor',\n status: 'unknown',\n },\n {\n labels: ['director'],\n name: 'Susan Daugherty MD',\n permissions: ['read', 'write', 'delete'],\n role: 'viewer',\n status: 'pending',\n },\n {\n labels: ['person'],\n name: 'Karen Huel',\n permissions: ['read'],\n role: 'editor',\n status: 'inactive',\n },\n {\n labels: ['movie', 'director'],\n name: 'Ken Kessler',\n permissions: ['write', 'delete'],\n role: 'admin',\n status: 'active',\n },\n {\n labels: [],\n name: 'Courtney McClure',\n permissions: [],\n role: 'viewer',\n status: 'pending',\n },\n];\n\nconst columnHelper = createColumnHelper<TestDataFormat>();\n\nconst Component = () => {\n const [data, setData] = useState(DEMO_DATA);\n\n const updateRow = (name: string, update: Partial<TestDataFormat>): void => {\n setData((oldData) =>\n oldData.map((row) => (row.name === name ? { ...row, ...update } : row)),\n );\n };\n\n const COMMON_COLUMNS = [\n // Editable inline text cell.\n columnHelper.accessor('name', {\n cell: (cell) => (\n <DataGrid.InlineEditCell\n cell={cell}\n value={cell.getValue()}\n ariaLabel=\"edit name\"\n />\n ),\n meta: {\n isInlineEditCell: {\n onEditChange: (newValue, cell) => {\n updateRow(cell.row.original.name, { name: newValue });\n },\n },\n },\n minSize: 180,\n size: 220,\n }),\n // Default single-select dropdown.\n columnHelper.accessor('role', {\n cell: (info) => (\n <DataGrid.DropDownCell\n cell={info}\n options={ROLE_OPTIONS}\n ariaLabel=\"select role\"\n />\n ),\n meta: {\n isDropDownCell: {\n onChange: (newValue, cell) => {\n if (newValue === undefined) {\n return;\n }\n updateRow(cell.row.original.name, { role: newValue });\n },\n },\n },\n minSize: 160,\n size: 180,\n }),\n // Default multi-select dropdown (default Tag chips).\n columnHelper.accessor('permissions', {\n cell: (info) => (\n <DataGrid.DropDownCell\n cell={info}\n options={PERMISSION_OPTIONS}\n ariaLabel=\"select permissions\"\n />\n ),\n enableSorting: false,\n meta: {\n isDropDownCell: {\n isMulti: true,\n onChange: (newValue, cell) => {\n updateRow(cell.row.original.name, { permissions: newValue });\n },\n },\n },\n minSize: 220,\n size: 260,\n }),\n // Multi-select dropdown with a custom MultiValue (GraphLabel chips).\n columnHelper.accessor('labels', {\n cell: (info) => (\n <DataGrid.DropDownCell\n cell={info}\n options={LABEL_OPTIONS}\n ariaLabel=\"select labels\"\n components={{ MultiValue: LabelMultiValue }}\n />\n ),\n enableSorting: false,\n meta: {\n isDropDownCell: {\n isMulti: true,\n onChange: (newValue, cell) => {\n updateRow(cell.row.original.name, { labels: newValue });\n },\n },\n },\n minSize: 240,\n size: 280,\n }),\n // Single-select dropdown in an error state.\n columnHelper.accessor('status', {\n cell: (info) => {\n const isInvalid = !VALID_STATUSES.includes(info.getValue());\n\n const isPending = info.getValue() === 'pending';\n const isInactive = info.getValue() === 'inactive';\n\n const warningHelpText = (\n <span className=\"n-flex n-items-center n-gap-token-2 n-text-warning-text\">\n <ExclamationTriangleIconSolid className=\"n-size-token-16 n-text-warning-icon\" />\n Inactive users cannot sign in\n </span>\n );\n\n return (\n <DataGrid.DropDownCell\n cell={info}\n options={STATUS_OPTIONS}\n ariaLabel=\"select status\"\n errorText={isInvalid ? 'Please select a valid status' : undefined}\n helpText={\n isInactive\n ? warningHelpText\n : isPending\n ? 'Waiting for admin approval'\n : undefined\n }\n />\n );\n },\n meta: {\n isDropDownCell: {\n onChange: (newValue, cell) => {\n if (newValue === undefined) {\n return;\n }\n updateRow(cell.row.original.name, { status: newValue });\n },\n },\n },\n minSize: 200,\n size: 240,\n }),\n ];\n const table = useReactTable({\n autoResetPageIndex: false,\n columnResizeMode: 'onChange',\n columns: COMMON_COLUMNS,\n data: data,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n });\n\n return (\n <div className=\"n-w-full n-bg-light-neutral-text-weakest\">\n <DataGrid\n isKeyboardNavigable={true}\n isResizable={true}\n styling={{\n borderStyle: 'all-sides',\n hasZebraStriping: false,\n }}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -55,9 +55,13 @@ type PreviewCodeProps = {
|
|
|
55
55
|
/** The theme of the code block */
|
|
56
56
|
theme?: 'ndl-code-dark' | 'ndl-code-light';
|
|
57
57
|
};
|
|
58
|
+
type PreviewContentProps = {
|
|
59
|
+
children?: React.ReactNode;
|
|
60
|
+
};
|
|
58
61
|
export declare const Preview: (({ children, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewProps>) => import("react/jsx-runtime").JSX.Element) & {
|
|
59
62
|
Code: ({ code, language, label, isLoading, headerActions, theme, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewCodeProps>) => import("react/jsx-runtime").JSX.Element;
|
|
60
63
|
Confirmation: ({ children, actions, isFooter, status, confirmedActionText, rejectedActionText, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewConfirmationProps>) => import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
Content: ({ children, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewContentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
61
65
|
Header: ({ children, actions, ref, style, className, htmlAttributes, ...restProps }: CommonProps<"div", PreviewHeaderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
62
66
|
};
|
|
63
67
|
export {};
|
|
@@ -1 +1 @@
|
|
|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AC1F,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,kCAAkC;IAClC,KAAK,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAAC;CAC5C,CAAC;AAoHF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAuBF,eAAO,MAAM,OAAO,uEArRjB,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC;4HAsJhC,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC;0JAxEpC,WAAW,CAAC,KAAK,EAAE,wBAAwB,CAAC;iFAyL5C,WAAW,CAAC,KAAK,EAAE,mBAAmB,CAAC;yFA5OvC,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC;CA+PvC,CAAC"}
|
|
@@ -25,6 +25,8 @@ export { default as PreviewCodeLoading } from './preview-code-loading.story';
|
|
|
25
25
|
export { default as PreviewCodeRead } from './preview-code-read.story';
|
|
26
26
|
export { default as PreviewCodeWrite } from './preview-code-write.story';
|
|
27
27
|
export { default as PreviewCodeLanguages } from './preview-code-languages.story';
|
|
28
|
+
export { default as PreviewSimple } from './preview-simple.story';
|
|
29
|
+
export { default as PreviewSimpleWithContent } from './preview-simple-with-content.story';
|
|
28
30
|
export declare const PreviewDataGridSrc: string;
|
|
29
31
|
export declare const PreviewConfirmationStandaloneSrc: string;
|
|
30
32
|
export declare const PreviewCodeConfirmationSrc: string;
|
|
@@ -32,4 +34,6 @@ export declare const PreviewCodeLoadingSrc: string;
|
|
|
32
34
|
export declare const PreviewCodeReadSrc: string;
|
|
33
35
|
export declare const PreviewCodeWriteSrc: string;
|
|
34
36
|
export declare const PreviewCodeLanguagesSrc: string;
|
|
37
|
+
export declare const PreviewSimpleSrc: string;
|
|
38
|
+
export declare const PreviewSimpleWithContentSrc: string;
|
|
35
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAa1F,eAAO,MAAM,kBAAkB,QAA6C,CAAC;AAC7E,eAAO,MAAM,gCAAgC,QAE5C,CAAC;AACF,eAAO,MAAM,0BAA0B,QAEtC,CAAC;AACF,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AACF,eAAO,MAAM,kBAAkB,QAA6C,CAAC;AAC7E,eAAO,MAAM,mBAAmB,QAA8C,CAAC;AAC/E,eAAO,MAAM,uBAAuB,QAEnC,CAAC;AACF,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AACzE,eAAO,MAAM,2BAA2B,QAEvC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
24
|
+
//# sourceMappingURL=preview-simple-with-content.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-simple-with-content.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-simple-with-content.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAOjD,QAAA,MAAM,SAAS,+CAwCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
24
|
+
//# sourceMappingURL=preview-simple.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-simple.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/preview/stories/preview-simple.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAMjD,QAAA,MAAM,SAAS,+CAmCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -36,10 +36,14 @@ type PromptProps = {
|
|
|
36
36
|
onSubmitPrompt?: (e: React.KeyboardEvent<HTMLTextAreaElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
37
37
|
/** Callback function called when the cancel button is clicked */
|
|
38
38
|
onCancelPrompt?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
39
|
+
/** Content to display above the input card, e.g. a status message while a prompt is running */
|
|
40
|
+
headerContent?: React.ReactNode;
|
|
39
41
|
/** Content to display above the textarea */
|
|
40
42
|
topContent?: React.ReactNode;
|
|
41
|
-
/** Content to display below the textarea */
|
|
43
|
+
/** Content to display below the textarea, on the leading side */
|
|
42
44
|
bottomContent?: React.ReactNode;
|
|
45
|
+
/** Content to display below the textarea, on the trailing side next to the submit button */
|
|
46
|
+
bottomTrailingContent?: React.ReactNode;
|
|
43
47
|
/** Disclaimer to display below the component */
|
|
44
48
|
disclaimer?: React.ReactNode;
|
|
45
49
|
/** Props for the textarea element */
|
|
@@ -63,7 +67,7 @@ type ContextTagProps = {
|
|
|
63
67
|
children?: string;
|
|
64
68
|
onClose: () => void;
|
|
65
69
|
};
|
|
66
|
-
declare const Prompt: (({ value, onChange, maxRows, isDisabled, isRunningPrompt, onSubmitPrompt, onCancelPrompt, isSubmitDisabled, topContent, bottomContent, disclaimer, className, style, htmlAttributes, ref, textareaProps, ...restProps }: CommonProps<"div", PromptProps>) => import("react/jsx-runtime").JSX.Element) & {
|
|
70
|
+
declare const Prompt: (({ value, onChange, maxRows, isDisabled, isRunningPrompt, onSubmitPrompt, onCancelPrompt, isSubmitDisabled, headerContent, topContent, bottomContent, bottomTrailingContent, disclaimer, className, style, htmlAttributes, ref, textareaProps, ...restProps }: CommonProps<"div", PromptProps>) => import("react/jsx-runtime").JSX.Element) & {
|
|
67
71
|
ContextTag: ({ children, onClose }: ContextTagProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
72
|
Select: ({ value, options, onChange }: AgentSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai/prompt/Prompt.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai/prompt/Prompt.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEvE,KAAK,WAAW,GAAG;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5D,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC/D,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iEAAiE;IACjE,cAAc,CAAC,EAAE,CACf,CAAC,EACG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,GACxC,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAChD,IAAI,CAAC;IACV,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC9E,+FAA+F;IAC/F,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,iEAAiE;IACjE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,4FAA4F;IAC5F,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,gDAAgD;IAChD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,qCAAqC;IACrC,aAAa,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CAC5C,CAAC;AAgOF,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACvE,CAAC;AA8CF,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAmDF,QAAA,MAAM,MAAM,kQA3ST,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;wCA0PS,eAAe;2CAjDF,gBAAgB;CAqGtE,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -23,9 +23,11 @@ export { default as PromptAdvanced } from './prompt-advanced.story';
|
|
|
23
23
|
export { default as PromptLoading } from './prompt-loading.story';
|
|
24
24
|
export { default as PromptContext } from './prompt-context.story';
|
|
25
25
|
export { default as PromptDisabled } from './prompt-disabled.story';
|
|
26
|
+
export { default as PromptHeader } from './prompt-header.story';
|
|
26
27
|
export declare const PromptDefaultSrc: string;
|
|
27
28
|
export declare const PromptAdvancedSrc: string;
|
|
28
29
|
export declare const PromptLoadingSrc: string;
|
|
29
30
|
export declare const PromptContextSrc: string;
|
|
30
31
|
export declare const PromptDisabledSrc: string;
|
|
32
|
+
export declare const PromptHeaderSrc: string;
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAUhE,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AACzE,eAAO,MAAM,iBAAiB,QAA4C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AACzE,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AACzE,eAAO,MAAM,iBAAiB,QAA4C,CAAC;AAC3E,eAAO,MAAM,eAAe,QAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-advanced.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/prompt-advanced.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAOjD,QAAA,MAAM,SAAS,+
|
|
1
|
+
{"version":3,"file":"prompt-advanced.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/prompt-advanced.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAOjD,QAAA,MAAM,SAAS,+CAmFd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
22
|
+
declare const Component: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Component;
|
|
24
|
+
//# sourceMappingURL=prompt-header.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-header.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/prompt/stories/prompt-header.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAOjD,QAAA,MAAM,SAAS,+CAuCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../../src/ai/response/Response.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"Response.d.ts","sourceRoot":"","sources":["../../../../src/ai/response/Response.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,KAAK,aAAa,GAAG;IACnB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC;CACtE,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,QAAQ,uHAST,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,6CA+QrC,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-all-components.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/response/stories/response-all-components.story.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response-all-components.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/response/stories/response-all-components.story.tsx"],"names":[],"mappings":"AA+NA,eAAO,MAAM,SAAS,+CAMrB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
import { type Cell, type CellContext, type Header as HeaderType, type Row, type RowData, type SortDirection } from '@tanstack/react-table';
|
|
23
23
|
import type React from 'react';
|
|
24
|
+
import type { GroupBase, SelectComponentsConfig } from 'react-select';
|
|
24
25
|
import { type CommonProps, type PolymorphicCommonProps } from '../_common/types';
|
|
25
26
|
import { CleanIconButton } from '../clean-icon-button';
|
|
26
27
|
import { DataGridCrossIcon } from '../icons';
|
|
@@ -162,8 +163,22 @@ type DropDownCellProps<T extends RowData> = {
|
|
|
162
163
|
ariaLabel: string;
|
|
163
164
|
/** Whether the select component is disabled */
|
|
164
165
|
isDisabled?: boolean;
|
|
166
|
+
/** Error message. If it exists the select will be in error state. */
|
|
167
|
+
errorText?: string | React.ReactNode;
|
|
168
|
+
/** Help text of the select component. */
|
|
169
|
+
helpText?: string | React.ReactNode;
|
|
170
|
+
/**
|
|
171
|
+
* Override the underlying react-select components (e.g. `Option`, `SingleValue`,
|
|
172
|
+
* `MultiValue`). Merged over the Needle defaults, so only the components you
|
|
173
|
+
* pass are replaced.
|
|
174
|
+
*/
|
|
175
|
+
components?: SelectComponentsConfig<DropDownCellOption, boolean, GroupBase<DropDownCellOption>>;
|
|
176
|
+
};
|
|
177
|
+
type DropDownCellOption = {
|
|
178
|
+
value: string;
|
|
179
|
+
label: string;
|
|
165
180
|
};
|
|
166
|
-
declare const DropDownCell: <T extends RowData>({ cell, options, portalTarget: portalTargetProp, ariaLabel, className, style, htmlAttributes, ref: forwardRef, isDisabled, ...restProps }: CommonProps<"div", DropDownCellProps<T>>) => import("react/jsx-runtime").JSX.Element | null;
|
|
181
|
+
declare const DropDownCell: <T extends RowData>({ cell, options, portalTarget: portalTargetProp, ariaLabel, className, style, htmlAttributes, ref: forwardRef, isDisabled, errorText, helpText, components, ...restProps }: CommonProps<"div", DropDownCellProps<T>>) => import("react/jsx-runtime").JSX.Element | null;
|
|
167
182
|
declare const NoDataIcon: ({ className, ...restProps }: React.ComponentPropsWithoutRef<typeof DataGridCrossIcon>) => import("react/jsx-runtime").JSX.Element;
|
|
168
183
|
export { ResizingBar, Header, Body, BodyCell, BodyRow, InlineEditCell, DropDownCell, ActionCell, HeaderCell, HeaderTitle, Navigation, TableResults, RowsPerPage, Pagination, PaginationNumericButtons, PaginationArrowButton, PaginationNumericButton, NoDataPlaceholder, NoDataIcon, LoadingPlaceholder, Scrollable, };
|
|
169
184
|
//# sourceMappingURL=Components.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Components.d.ts","sourceRoot":"","sources":["../../../src/data-grid/Components.tsx"],"names":[],"mappings":"AAqBA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,WAAW,EAEhB,KAAK,MAAM,IAAI,UAAU,EACzB,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Components.d.ts","sourceRoot":"","sources":["../../../src/data-grid/Components.tsx"],"names":[],"mappings":"AAqBA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,WAAW,EAEhB,KAAK,MAAM,IAAI,UAAU,EACzB,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC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I,CAAC;IAClC,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACrC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC;;;;OAIG;IACH,UAAU,CAAC,EAAE,sBAAsB,CACjC,kBAAkB,EAClB,OAAO,EACP,SAAS,CAAC,kBAAkB,CAAC,CAC9B,CAAC;CACH,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,YAAY,GAAI,CAAC,SAAS,OAAO,EAAE,4KActC,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,mDA+E1C,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,6BAGjB,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,4CAG1D,CAAC;AAEF,OAAO,EACL,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,UAAU,GACX,CAAC"}
|
|
@@ -108,7 +108,7 @@ declare const DataGrid: (<T extends RowData = unknown>({ isResizable, isLoading,
|
|
|
108
108
|
cell: import("@tanstack/react-table").Header<T, unknown>;
|
|
109
109
|
children?: React.ReactNode;
|
|
110
110
|
}>) => import("react/jsx-runtime").JSX.Element | null;
|
|
111
|
-
DropDownCell: <T extends RowData>({ cell, options, portalTarget: portalTargetProp, ariaLabel, className, style, htmlAttributes, ref: forwardRef, isDisabled, ...restProps }: CommonProps<"div", {
|
|
111
|
+
DropDownCell: <T extends RowData>({ cell, options, portalTarget: portalTargetProp, ariaLabel, className, style, htmlAttributes, ref: forwardRef, isDisabled, errorText, helpText, components, ...restProps }: CommonProps<"div", {
|
|
112
112
|
cell: import("@tanstack/react-table").CellContext<T, unknown>;
|
|
113
113
|
options: {
|
|
114
114
|
value: string;
|
|
@@ -117,6 +117,15 @@ declare const DataGrid: (<T extends RowData = unknown>({ isResizable, isLoading,
|
|
|
117
117
|
portalTarget?: HTMLElement | null;
|
|
118
118
|
ariaLabel: string;
|
|
119
119
|
isDisabled?: boolean;
|
|
120
|
+
errorText?: string | React.ReactNode;
|
|
121
|
+
helpText?: string | React.ReactNode;
|
|
122
|
+
components?: import("react-select").SelectComponentsConfig<{
|
|
123
|
+
value: string;
|
|
124
|
+
label: string;
|
|
125
|
+
}, boolean, import("react-select").GroupBase<{
|
|
126
|
+
value: string;
|
|
127
|
+
label: string;
|
|
128
|
+
}>>;
|
|
120
129
|
}>) => import("react/jsx-runtime").JSX.Element | null;
|
|
121
130
|
Header: ({ children, className, style, htmlAttributes, ref, ...restProps }: CommonProps<"div", {
|
|
122
131
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,IAAI,YAAY,EAC3B,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2B5C,OAAO,EACL,KAAK,2BAA2B,EAGjC,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,iBA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