@health-samurai/react-components 0.0.0-alpha.5 → 0.0.0-alpha.7
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/bundle.css +318 -31
- package/dist/src/components/button-dropdown.d.ts +10 -0
- package/dist/src/components/button-dropdown.d.ts.map +1 -0
- package/dist/src/components/button-dropdown.js +70 -0
- package/dist/src/components/button-dropdown.js.map +1 -0
- package/dist/src/components/button-dropdown.stories.d.ts +11 -0
- package/dist/src/components/button-dropdown.stories.d.ts.map +1 -0
- package/dist/src/components/button-dropdown.stories.js +48 -0
- package/dist/src/components/button-dropdown.stories.js.map +1 -0
- package/dist/src/components/code-editor/index.d.ts +3 -2
- package/dist/src/components/code-editor/index.d.ts.map +1 -1
- package/dist/src/components/code-editor/index.js +152 -4
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor.stories.d.ts +1 -0
- package/dist/src/components/code-editor.stories.d.ts.map +1 -1
- package/dist/src/components/code-editor.stories.js +252 -1
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/copy-icon.d.ts +5 -1
- package/dist/src/components/copy-icon.d.ts.map +1 -1
- package/dist/src/components/copy-icon.js +41 -3
- package/dist/src/components/copy-icon.js.map +1 -1
- package/dist/src/components/data-table.d.ts +9 -0
- package/dist/src/components/data-table.d.ts.map +1 -0
- package/dist/src/components/data-table.js +66 -0
- package/dist/src/components/data-table.js.map +1 -0
- package/dist/src/components/data-table.stories.d.ts +7 -0
- package/dist/src/components/data-table.stories.d.ts.map +1 -0
- package/dist/src/components/data-table.stories.js +240 -0
- package/dist/src/components/data-table.stories.js.map +1 -0
- package/dist/src/components/fhir-structure-view.d.ts +34 -0
- package/dist/src/components/fhir-structure-view.d.ts.map +1 -0
- package/dist/src/components/fhir-structure-view.js +226 -0
- package/dist/src/components/fhir-structure-view.js.map +1 -0
- package/dist/src/components/fhir-structure-view.stories.d.ts +7 -0
- package/dist/src/components/fhir-structure-view.stories.d.ts.map +1 -0
- package/dist/src/components/fhir-structure-view.stories.js +447 -0
- package/dist/src/components/fhir-structure-view.stories.js.map +1 -0
- package/dist/src/components/request-line-editor.d.ts +3 -1
- package/dist/src/components/request-line-editor.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.js +26 -5
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/segment-control.d.ts +16 -0
- package/dist/src/components/segment-control.d.ts.map +1 -0
- package/dist/src/components/segment-control.js +48 -0
- package/dist/src/components/segment-control.js.map +1 -0
- package/dist/src/components/segment-control.stories.d.ts +15 -0
- package/dist/src/components/segment-control.stories.d.ts.map +1 -0
- package/dist/src/components/segment-control.stories.js +33 -0
- package/dist/src/components/segment-control.stories.js.map +1 -0
- package/dist/src/components/split-button.d.ts +5 -0
- package/dist/src/components/split-button.d.ts.map +1 -0
- package/dist/src/components/split-button.js +12 -0
- package/dist/src/components/split-button.js.map +1 -0
- package/dist/src/components/split-button.stories.d.ts +7 -0
- package/dist/src/components/split-button.stories.d.ts.map +1 -0
- package/dist/src/components/split-button.stories.js +57 -0
- package/dist/src/components/split-button.stories.js.map +1 -0
- package/dist/src/components/tree-view.d.ts +16 -7
- package/dist/src/components/tree-view.d.ts.map +1 -1
- package/dist/src/components/tree-view.js +75 -19
- package/dist/src/components/tree-view.js.map +1 -1
- package/dist/src/components/tree-view.stories.d.ts +3 -3
- package/dist/src/components/tree-view.stories.d.ts.map +1 -1
- package/dist/src/components/tree-view.stories.js +14 -5
- package/dist/src/components/tree-view.stories.js.map +1 -1
- package/dist/src/icons.d.ts +6 -0
- package/dist/src/icons.d.ts.map +1 -1
- package/dist/src/icons.js +235 -3
- package/dist/src/icons.js.map +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts +3 -1
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.js +5 -2
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts +1 -1
- package/dist/src/shadcn/components/ui/card.d.ts +5 -1
- package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +21 -8
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.stories.d.ts +302 -1
- package/dist/src/shadcn/components/ui/card.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/card.stories.js +23 -2
- package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/combobox.d.ts +13 -0
- package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/combobox.js +102 -0
- package/dist/src/shadcn/components/ui/combobox.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.d.ts +3 -1
- package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +39 -1
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.d.ts +8 -1
- package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +36 -19
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.stories.js +44 -37
- package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +1 -1
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +1 -0
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tree.d.ts +10 -2
- package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tree.js +31 -8
- package/dist/src/shadcn/components/ui/tree.js.map +1 -1
- package/dist/src/typography.css +36 -8
- package/package.json +5 -1
- package/src/components/button-dropdown.stories.tsx +41 -0
- package/src/components/button-dropdown.tsx +95 -0
- package/src/components/code-editor/index.tsx +129 -4
- package/src/components/code-editor.stories.tsx +294 -0
- package/src/components/copy-icon.tsx +57 -3
- package/src/components/data-table.stories.tsx +89 -0
- package/src/components/data-table.tsx +120 -0
- package/src/components/fhir-structure-view.stories.tsx +439 -0
- package/src/components/fhir-structure-view.tsx +229 -0
- package/src/components/request-line-editor.tsx +30 -4
- package/src/components/segment-control.stories.tsx +29 -0
- package/src/components/segment-control.tsx +81 -0
- package/src/components/split-button.stories.tsx +49 -0
- package/src/components/split-button.tsx +17 -0
- package/src/components/tree-view.stories.tsx +20 -15
- package/src/components/tree-view.tsx +118 -15
- package/src/icons.tsx +245 -3
- package/src/index.tsx +10 -2
- package/src/shadcn/components/ui/alert-dialog.tsx +6 -2
- package/src/shadcn/components/ui/card.stories.tsx +17 -3
- package/src/shadcn/components/ui/card.tsx +52 -8
- package/src/shadcn/components/ui/combobox.tsx +127 -0
- package/src/shadcn/components/ui/dropdown-menu.tsx +1 -2
- package/src/shadcn/components/ui/input.tsx +119 -0
- package/src/shadcn/components/ui/pagination.stories.tsx +8 -2
- package/src/shadcn/components/ui/pagination.tsx +54 -3
- package/src/shadcn/components/ui/table.tsx +6 -1
- package/src/shadcn/components/ui/tabs.tsx +1 -0
- package/src/shadcn/components/ui/tree.tsx +63 -10
- package/src/typography.css +36 -8
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Input } from "../shadcn/components/ui/input.js";
|
|
2
4
|
import { CodeEditor } from "./code-editor/index.js";
|
|
3
5
|
const meta = {
|
|
4
6
|
title: "Component/Editor",
|
|
@@ -36,5 +38,254 @@ export const Default = {
|
|
|
36
38
|
})
|
|
37
39
|
})
|
|
38
40
|
};
|
|
41
|
+
function parse(query) {
|
|
42
|
+
let hi = 0;
|
|
43
|
+
let lo = 0;
|
|
44
|
+
const res = {
|
|
45
|
+
method: "",
|
|
46
|
+
methodTrivia: "",
|
|
47
|
+
path: "",
|
|
48
|
+
pathTrivia: "",
|
|
49
|
+
headers: [],
|
|
50
|
+
headersTrivia: ""
|
|
51
|
+
};
|
|
52
|
+
// Note that we iterate by code units, but it doesn't change correctness.
|
|
53
|
+
// method
|
|
54
|
+
for(hi = 0; hi < query.length; ++hi){
|
|
55
|
+
const c = query[hi];
|
|
56
|
+
if (c === " " || c === "\t" || c === "\n") {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
res.method = query.substring(lo, hi);
|
|
61
|
+
lo = hi;
|
|
62
|
+
if (lo >= query.length) {
|
|
63
|
+
return res;
|
|
64
|
+
}
|
|
65
|
+
// method trivia
|
|
66
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
67
|
+
const c = query[hi];
|
|
68
|
+
if (!(c === " " || c === "\t")) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
res.methodTrivia = query.substring(lo, hi);
|
|
73
|
+
lo = hi;
|
|
74
|
+
if (lo >= query.length) {
|
|
75
|
+
return res;
|
|
76
|
+
}
|
|
77
|
+
// path
|
|
78
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
79
|
+
const c = query[hi];
|
|
80
|
+
if (c === "\n") {
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
res.path = query.substring(lo, hi);
|
|
85
|
+
lo = hi;
|
|
86
|
+
if (lo >= query.length) {
|
|
87
|
+
return res;
|
|
88
|
+
}
|
|
89
|
+
// path trivia
|
|
90
|
+
if (query[hi] === "\n") {
|
|
91
|
+
hi += 1;
|
|
92
|
+
res.pathTrivia = query.substring(lo, hi);
|
|
93
|
+
}
|
|
94
|
+
lo = hi;
|
|
95
|
+
if (lo >= query.length) {
|
|
96
|
+
return res;
|
|
97
|
+
}
|
|
98
|
+
// headers
|
|
99
|
+
let header = {
|
|
100
|
+
name: "",
|
|
101
|
+
nameTrivia: "",
|
|
102
|
+
value: "",
|
|
103
|
+
valueTrivia: ""
|
|
104
|
+
};
|
|
105
|
+
let headerReady = false;
|
|
106
|
+
// SAFETY: don't decrease hi inside this loop.
|
|
107
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
108
|
+
if (headerReady) {
|
|
109
|
+
res.headers.push(header);
|
|
110
|
+
}
|
|
111
|
+
header = {
|
|
112
|
+
name: "",
|
|
113
|
+
nameTrivia: "",
|
|
114
|
+
value: "",
|
|
115
|
+
valueTrivia: ""
|
|
116
|
+
};
|
|
117
|
+
headerReady = false;
|
|
118
|
+
if (query[hi] === "\n") {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
// header name
|
|
122
|
+
for(lo = hi; hi <= query.length; ++hi){
|
|
123
|
+
const c = query[hi];
|
|
124
|
+
if (c === " " || c === "\t" || c === "\n" || c === ":") {
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
headerReady = true;
|
|
129
|
+
header.name = query.substring(lo, hi);
|
|
130
|
+
lo = hi;
|
|
131
|
+
if (lo >= query.length) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
// header name trivia
|
|
135
|
+
let colonFound = false;
|
|
136
|
+
for(lo = hi; hi <= query.length; ++hi){
|
|
137
|
+
const c = query[hi];
|
|
138
|
+
if (c === ":" && !colonFound) {
|
|
139
|
+
colonFound = true;
|
|
140
|
+
} else if (!(c === " " || c === "\t")) {
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
header.nameTrivia = query.substring(lo, hi);
|
|
145
|
+
lo = hi;
|
|
146
|
+
if (lo >= query.length) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
// header value
|
|
150
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
151
|
+
const c = query[hi];
|
|
152
|
+
if (c === "\n") {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
header.value = query.substring(lo, hi);
|
|
157
|
+
lo = hi;
|
|
158
|
+
if (lo >= query.length) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
// header value trivia
|
|
162
|
+
if (query[hi] === "\n") {
|
|
163
|
+
header.valueTrivia = query.substring(lo, hi + 1);
|
|
164
|
+
}
|
|
165
|
+
lo = hi + 1;
|
|
166
|
+
if (lo >= query.length) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (headerReady) {
|
|
171
|
+
res.headers.push(header);
|
|
172
|
+
}
|
|
173
|
+
if (query[hi] === "\n") {
|
|
174
|
+
res.headersTrivia = query.substring(lo, hi + 1);
|
|
175
|
+
}
|
|
176
|
+
return res;
|
|
177
|
+
}
|
|
178
|
+
const MethodInput = /*#__PURE__*/ React.memo(function MethodInput({ method, onMethodChange }) {
|
|
179
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
180
|
+
className: "flex justify-center items-baseline",
|
|
181
|
+
children: [
|
|
182
|
+
"Method:",
|
|
183
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
184
|
+
type: "text",
|
|
185
|
+
className: "inline",
|
|
186
|
+
value: method,
|
|
187
|
+
onChange: onMethodChange
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
const PathInput = /*#__PURE__*/ React.memo(function PathInput({ path, onPathChange }) {
|
|
193
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
194
|
+
className: "flex justify-center items-baseline",
|
|
195
|
+
children: [
|
|
196
|
+
"Path: ",
|
|
197
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
198
|
+
type: "text",
|
|
199
|
+
className: "inline",
|
|
200
|
+
value: path,
|
|
201
|
+
onChange: onPathChange
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
function ComplexComp() {
|
|
207
|
+
const [rawQuery, setRawQuery] = React.useState("");
|
|
208
|
+
const parsed = React.useMemo(()=>parse(rawQuery), [
|
|
209
|
+
rawQuery
|
|
210
|
+
]);
|
|
211
|
+
const parsedRef = React.useRef(parsed);
|
|
212
|
+
React.useEffect(()=>{
|
|
213
|
+
parsedRef.current = parsed;
|
|
214
|
+
}, [
|
|
215
|
+
parsed
|
|
216
|
+
]);
|
|
217
|
+
const method = React.useMemo(()=>parsed.method, [
|
|
218
|
+
parsed.method
|
|
219
|
+
]);
|
|
220
|
+
const path = React.useMemo(()=>parsed.path, [
|
|
221
|
+
parsed.path
|
|
222
|
+
]);
|
|
223
|
+
const viewRef = React.useRef(null);
|
|
224
|
+
const onMethodChange = React.useCallback((ev)=>{
|
|
225
|
+
let newVal = ev.target.value;
|
|
226
|
+
if (newVal.indexOf(" ") !== -1) {
|
|
227
|
+
newVal = newVal.replaceAll(" ", "").replaceAll("\t", "");
|
|
228
|
+
}
|
|
229
|
+
const view = viewRef.current;
|
|
230
|
+
if (view === null) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const from = 0;
|
|
234
|
+
const to = parsedRef.current.method.length;
|
|
235
|
+
view.dispatch({
|
|
236
|
+
changes: {
|
|
237
|
+
from: from,
|
|
238
|
+
to: to,
|
|
239
|
+
insert: newVal
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}, []);
|
|
243
|
+
const onPathChange = React.useCallback((ev)=>{
|
|
244
|
+
const newVal = ev.target.value;
|
|
245
|
+
const view = viewRef.current;
|
|
246
|
+
if (view === null) {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
const from = parsedRef.current.method.length + parsedRef.current.methodTrivia.length;
|
|
250
|
+
const to = from + parsedRef.current.path.length;
|
|
251
|
+
console.log(from, to);
|
|
252
|
+
view.dispatch({
|
|
253
|
+
changes: {
|
|
254
|
+
from: from,
|
|
255
|
+
to: to,
|
|
256
|
+
insert: newVal
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}, []);
|
|
260
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
261
|
+
children: [
|
|
262
|
+
/*#__PURE__*/ _jsx(MethodInput, {
|
|
263
|
+
method: method,
|
|
264
|
+
onMethodChange: onMethodChange
|
|
265
|
+
}),
|
|
266
|
+
/*#__PURE__*/ _jsx(PathInput, {
|
|
267
|
+
path: path,
|
|
268
|
+
onPathChange: onPathChange
|
|
269
|
+
}),
|
|
270
|
+
/*#__PURE__*/ _jsx("div", {
|
|
271
|
+
className: "h-[500px] w-[500px] border-black border-2",
|
|
272
|
+
children: /*#__PURE__*/ _jsx(CodeEditor, {
|
|
273
|
+
mode: "http",
|
|
274
|
+
onUpdate: (update)=>{
|
|
275
|
+
if (update.docChanged) {
|
|
276
|
+
setRawQuery(update.state.doc.toString());
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
viewCallback: (view)=>{
|
|
280
|
+
viewRef.current = view;
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
export const Complex = {
|
|
288
|
+
render: ()=>ComplexComp()
|
|
289
|
+
};
|
|
39
290
|
|
|
40
291
|
//# sourceMappingURL=code-editor.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/code-editor.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { CodeEditor } from \"./code-editor\";\n\nconst meta: Meta<typeof CodeEditor> = {\n\ttitle: \"Component/Editor\",\n\tcomponent: CodeEditor,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof CodeEditor>;\n\nexport const Default: Story = {\n\targs: {\n\t\tdefaultValue: JSON.stringify(\n\t\t\t{\n\t\t\t\tresourceType: \"Patient\",\n\t\t\t\tmeta: { versionId: 10 },\n\t\t\t\tgender: \"male\",\n\t\t\t\tname: [{ family: \"Doe\", given: [\"John\"] }],\n\t\t\t},\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t},\n\trender: () => (\n\t\t<div className=\"h-[500px] w-[500px]\">\n\t\t\t<CodeEditor mode=\"http\" />\n\t\t</div>\n\t),\n};\n"],"names":["CodeEditor","meta","title","component","parameters","layout","tags","Default","args","defaultValue","JSON","stringify","resourceType","versionId","gender","name","family","given","render","div","className","mode"],"mappings":";AACA,SAASA,UAAU,QAAQ,yBAAgB;AAE3C,MAAMC,OAAgC;IACrCC,OAAO;IACPC,WAAWH;IACXI,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC;KAAW;AACnB;AAEA,eAAeL,KAAK;AAGpB,OAAO,MAAMM,UAAiB;IAC7BC,MAAM;QACLC,cAAcC,KAAKC,SAAS,CAC3B;YACCC,cAAc;YACdX,MAAM;gBAAEY,WAAW;YAAG;YACtBC,QAAQ;YACRC,MAAM;gBAAC;oBAAEC,QAAQ;oBAAOC,OAAO;wBAAC;qBAAO;gBAAC;aAAE;QAC3C,GACA,MACA;IAEF;IACAC,QAAQ,kBACP,KAACC;YAAIC,WAAU;sBACd,cAAA,KAACpB;gBAAWqB,MAAK;;;AAGpB,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/code-editor.stories.tsx"],"sourcesContent":["import type { EditorView } from \"@codemirror/view\";\nimport type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport React from \"react\";\nimport { Input } from \"#shadcn/components/ui/input.js\";\nimport { CodeEditor } from \"./code-editor\";\n\nconst meta: Meta<typeof CodeEditor> = {\n\ttitle: \"Component/Editor\",\n\tcomponent: CodeEditor,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof CodeEditor>;\n\nexport const Default: Story = {\n\targs: {\n\t\tdefaultValue: JSON.stringify(\n\t\t\t{\n\t\t\t\tresourceType: \"Patient\",\n\t\t\t\tmeta: { versionId: 10 },\n\t\t\t\tgender: \"male\",\n\t\t\t\tname: [{ family: \"Doe\", given: [\"John\"] }],\n\t\t\t},\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t},\n\trender: () => (\n\t\t<div className=\"h-[500px] w-[500px]\">\n\t\t\t<CodeEditor mode=\"http\" />\n\t\t</div>\n\t),\n};\n\ntype ParsedHeader = {\n\tname: string;\n\tnameTrivia: string;\n\tvalue: string;\n\tvalueTrivia: string;\n};\n\ntype Parsed = {\n\tmethod: string;\n\tmethodTrivia: string;\n\tpath: string;\n\tpathTrivia: string;\n\theaders: ParsedHeader[];\n\theadersTrivia: string;\n};\n\nfunction parse(query: string): Parsed {\n\tlet hi = 0;\n\tlet lo = 0;\n\tconst res: Parsed = {\n\t\tmethod: \"\",\n\t\tmethodTrivia: \"\",\n\t\tpath: \"\",\n\t\tpathTrivia: \"\",\n\t\theaders: [],\n\t\theadersTrivia: \"\",\n\t};\n\n\t// Note that we iterate by code units, but it doesn't change correctness.\n\t// method\n\tfor (hi = 0; hi < query.length; ++hi) {\n\t\tconst c = query[hi];\n\t\tif (c === \" \" || c === \"\\t\" || c === \"\\n\") {\n\t\t\tbreak;\n\t\t}\n\t}\n\tres.method = query.substring(lo, hi);\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// method trivia\n\tfor (hi = lo; hi < query.length; ++hi) {\n\t\tconst c = query[hi];\n\t\tif (!(c === \" \" || c === \"\\t\")) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tres.methodTrivia = query.substring(lo, hi);\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// path\n\tfor (hi = lo; hi < query.length; ++hi) {\n\t\tconst c = query[hi];\n\t\tif (c === \"\\n\") {\n\t\t\tbreak;\n\t\t}\n\t}\n\tres.path = query.substring(lo, hi);\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// path trivia\n\tif (query[hi] === \"\\n\") {\n\t\thi += 1;\n\t\tres.pathTrivia = query.substring(lo, hi);\n\t}\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// headers\n\tlet header: ParsedHeader = {\n\t\tname: \"\",\n\t\tnameTrivia: \"\",\n\t\tvalue: \"\",\n\t\tvalueTrivia: \"\",\n\t};\n\tlet headerReady = false;\n\t// SAFETY: don't decrease hi inside this loop.\n\tfor (hi = lo; hi < query.length; ++hi) {\n\t\tif (headerReady) {\n\t\t\tres.headers.push(header);\n\t\t}\n\t\theader = { name: \"\", nameTrivia: \"\", value: \"\", valueTrivia: \"\" };\n\t\theaderReady = false;\n\n\t\tif (query[hi] === \"\\n\") {\n\t\t\t// end of headers\n\t\t\tbreak;\n\t\t}\n\n\t\t// header name\n\t\tfor (lo = hi; hi <= query.length; ++hi) {\n\t\t\tconst c = query[hi];\n\t\t\tif (c === \" \" || c === \"\\t\" || c === \"\\n\" || c === \":\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\theaderReady = true;\n\t\theader.name = query.substring(lo, hi);\n\t\tlo = hi;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// header name trivia\n\t\tlet colonFound = false;\n\t\tfor (lo = hi; hi <= query.length; ++hi) {\n\t\t\tconst c = query[hi];\n\t\t\tif (c === \":\" && !colonFound) {\n\t\t\t\tcolonFound = true;\n\t\t\t} else if (!(c === \" \" || c === \"\\t\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\theader.nameTrivia = query.substring(lo, hi);\n\t\tlo = hi;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// header value\n\t\tfor (hi = lo; hi < query.length; ++hi) {\n\t\t\tconst c = query[hi];\n\t\t\tif (c === \"\\n\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\theader.value = query.substring(lo, hi);\n\t\tlo = hi;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// header value trivia\n\t\tif (query[hi] === \"\\n\") {\n\t\t\theader.valueTrivia = query.substring(lo, hi + 1);\n\t\t}\n\t\tlo = hi + 1;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (headerReady) {\n\t\tres.headers.push(header);\n\t}\n\n\tif (query[hi] === \"\\n\") {\n\t\tres.headersTrivia = query.substring(lo, hi + 1);\n\t}\n\n\treturn res;\n}\n\nconst MethodInput = React.memo(function MethodInput({\n\tmethod,\n\tonMethodChange,\n}: {\n\tmethod: string;\n\tonMethodChange: (ev: React.ChangeEvent<HTMLInputElement>) => void;\n}) {\n\treturn (\n\t\t<div className=\"flex justify-center items-baseline\">\n\t\t\tMethod:\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tclassName=\"inline\"\n\t\t\t\tvalue={method}\n\t\t\t\tonChange={onMethodChange}\n\t\t\t/>\n\t\t</div>\n\t);\n});\n\nconst PathInput = React.memo(function PathInput({\n\tpath,\n\tonPathChange,\n}: {\n\tpath: string;\n\tonPathChange: (ev: React.ChangeEvent<HTMLInputElement>) => void;\n}) {\n\treturn (\n\t\t<div className=\"flex justify-center items-baseline\">\n\t\t\t{\"Path: \"}\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tclassName=\"inline\"\n\t\t\t\tvalue={path}\n\t\t\t\tonChange={onPathChange}\n\t\t\t/>\n\t\t</div>\n\t);\n});\n\nfunction ComplexComp() {\n\tconst [rawQuery, setRawQuery] = React.useState(\"\");\n\tconst parsed = React.useMemo(() => parse(rawQuery), [rawQuery]);\n\tconst parsedRef = React.useRef(parsed);\n\tReact.useEffect(() => {\n\t\tparsedRef.current = parsed;\n\t}, [parsed]);\n\tconst method = React.useMemo(() => parsed.method, [parsed.method]);\n\tconst path = React.useMemo(() => parsed.path, [parsed.path]);\n\n\tconst viewRef = React.useRef<EditorView | null>(null);\n\n\tconst onMethodChange = React.useCallback(\n\t\t(ev: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tlet newVal = ev.target.value;\n\n\t\t\tif (newVal.indexOf(\" \") !== -1) {\n\t\t\t\tnewVal = newVal.replaceAll(\" \", \"\").replaceAll(\"\\t\", \"\");\n\t\t\t}\n\n\t\t\tconst view = viewRef.current;\n\t\t\tif (view === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst from = 0;\n\t\t\tconst to = parsedRef.current.method.length;\n\n\t\t\tview.dispatch({\n\t\t\t\tchanges: {\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: to,\n\t\t\t\t\tinsert: newVal,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst onPathChange = React.useCallback(\n\t\t(ev: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst newVal = ev.target.value;\n\n\t\t\tconst view = viewRef.current;\n\t\t\tif (view === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst from =\n\t\t\t\tparsedRef.current.method.length + parsedRef.current.methodTrivia.length;\n\t\t\tconst to = from + parsedRef.current.path.length;\n\t\t\tconsole.log(from, to);\n\n\t\t\tview.dispatch({\n\t\t\t\tchanges: {\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: to,\n\t\t\t\t\tinsert: newVal,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<MethodInput method={method} onMethodChange={onMethodChange} />\n\t\t\t<PathInput path={path} onPathChange={onPathChange} />\n\t\t\t<div className=\"h-[500px] w-[500px] border-black border-2\">\n\t\t\t\t<CodeEditor\n\t\t\t\t\tmode=\"http\"\n\t\t\t\t\tonUpdate={(update) => {\n\t\t\t\t\t\tif (update.docChanged) {\n\t\t\t\t\t\t\tsetRawQuery(update.state.doc.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tviewCallback={(view) => {\n\t\t\t\t\t\tviewRef.current = view;\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport const Complex: Story = {\n\trender: () => ComplexComp(),\n};\n"],"names":["React","Input","CodeEditor","meta","title","component","parameters","layout","tags","Default","args","defaultValue","JSON","stringify","resourceType","versionId","gender","name","family","given","render","div","className","mode","parse","query","hi","lo","res","method","methodTrivia","path","pathTrivia","headers","headersTrivia","length","c","substring","header","nameTrivia","value","valueTrivia","headerReady","push","colonFound","MethodInput","memo","onMethodChange","type","onChange","PathInput","onPathChange","ComplexComp","rawQuery","setRawQuery","useState","parsed","useMemo","parsedRef","useRef","useEffect","current","viewRef","useCallback","ev","newVal","target","indexOf","replaceAll","view","from","to","dispatch","changes","insert","console","log","onUpdate","update","docChanged","state","doc","toString","viewCallback","Complex"],"mappings":";AAEA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,KAAK,QAAQ,mCAAiC;AACvD,SAASC,UAAU,QAAQ,yBAAgB;AAE3C,MAAMC,OAAgC;IACrCC,OAAO;IACPC,WAAWH;IACXI,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC;KAAW;AACnB;AAEA,eAAeL,KAAK;AAGpB,OAAO,MAAMM,UAAiB;IAC7BC,MAAM;QACLC,cAAcC,KAAKC,SAAS,CAC3B;YACCC,cAAc;YACdX,MAAM;gBAAEY,WAAW;YAAG;YACtBC,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AAC/B,YAAY,CAACK,MAAM;QACxE,MAAMoC,KAAKD,OAAOZ,UAAUG,OAAO,CAAC9B,IAAI,CAACI,MAAM;QAC/CwC,QAAQC,GAAG,CAACN,MAAMC;QAElBF,KAAKG,QAAQ,CAAC;YACbC,SAAS;gBACRH,MAAMA;gBACNC,IAAIA;gBACJG,QAAQT;YACT;QACD;IACD,GACA,EAAE;IAGH,qBACC;;0BACC,KAACpB;gBAAYhB,QAAQA;gBAAQkB,gBAAgBA;;0BAC7C,KAACG;gBAAUnB,MAAMA;gBAAMoB,cAAcA;;0BACrC,KAAC9B;gBAAIC,WAAU;0BACd,cAAA,KAACpB;oBACAqB,MAAK;oBACLsD,UAAU,CAACC;wBACV,IAAIA,OAAOC,UAAU,EAAE;4BACtBzB,YAAYwB,OAAOE,KAAK,CAACC,GAAG,CAACC,QAAQ;wBACtC;oBACD;oBACAC,cAAc,CAACd;wBACdP,QAAQD,OAAO,GAAGQ;oBACnB;;;;;AAKL;AAEA,OAAO,MAAMe,UAAiB;IAC7BhE,QAAQ,IAAMgC;AACf,EAAE"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
interface CopyIconProps {
|
|
2
2
|
text: string;
|
|
3
|
+
showTooltip?: boolean;
|
|
4
|
+
tooltipText?: string;
|
|
5
|
+
showToast?: boolean;
|
|
6
|
+
onCopy?: (text: string) => void;
|
|
3
7
|
}
|
|
4
|
-
declare function CopyIcon({ text }: CopyIconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CopyIcon({ text, showTooltip, tooltipText, showToast, onCopy, ...props }: CopyIconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
9
|
export { CopyIcon };
|
|
6
10
|
//# sourceMappingURL=copy-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-icon.d.ts","sourceRoot":"","sources":["../../../src/components/copy-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-icon.d.ts","sourceRoot":"","sources":["../../../src/components/copy-icon.tsx"],"names":[],"mappings":"AASA,UAAU,aAAa;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,iBAAS,QAAQ,CAAC,EACjB,IAAI,EACJ,WAAkB,EAClB,WAAoB,EACpB,SAAgB,EAChB,MAAM,EACN,GAAG,KAAK,EACR,EAAE,aAAa,2CAyDf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Check, Copy } from "lucide-react";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../shadcn/components/ui/tooltip.js";
|
|
6
|
+
function CopyIcon({ text, showTooltip = true, tooltipText = "Copy", showToast = true, onCopy, ...props }) {
|
|
5
7
|
const [isActive, setIsActive] = React.useState(false);
|
|
6
8
|
async function handleClick() {
|
|
7
9
|
try {
|
|
8
10
|
await navigator.clipboard.writeText(text);
|
|
9
11
|
setIsActive(true);
|
|
12
|
+
if (showToast) {
|
|
13
|
+
const truncatedText = text.length > 30 ? `${text.slice(0, 30)}...` : text;
|
|
14
|
+
toast(/*#__PURE__*/ _jsxs("div", {
|
|
15
|
+
className: "flex flex-col gap-1",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ _jsx("span", {
|
|
18
|
+
className: "typo-body",
|
|
19
|
+
children: "Successfully copied"
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ _jsx("span", {
|
|
22
|
+
className: "typo-code text-text-secondary",
|
|
23
|
+
children: truncatedText
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
}), {
|
|
27
|
+
duration: 2000
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
onCopy?.(text);
|
|
10
31
|
setTimeout(()=>{
|
|
11
32
|
setIsActive(false);
|
|
12
33
|
}, 1000);
|
|
@@ -14,7 +35,8 @@ function CopyIcon({ text }) {
|
|
|
14
35
|
console.error("Failed to copy to clipboard:", error);
|
|
15
36
|
}
|
|
16
37
|
}
|
|
17
|
-
|
|
38
|
+
const button = /*#__PURE__*/ _jsx("button", {
|
|
39
|
+
...props,
|
|
18
40
|
type: "button",
|
|
19
41
|
onClick: handleClick,
|
|
20
42
|
style: {
|
|
@@ -22,6 +44,22 @@ function CopyIcon({ text }) {
|
|
|
22
44
|
},
|
|
23
45
|
children: isActive ? /*#__PURE__*/ _jsx(Check, {}) : /*#__PURE__*/ _jsx(Copy, {})
|
|
24
46
|
});
|
|
47
|
+
if (!showTooltip) {
|
|
48
|
+
return button;
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
53
|
+
asChild: true,
|
|
54
|
+
children: button
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
57
|
+
children: /*#__PURE__*/ _jsx("p", {
|
|
58
|
+
children: tooltipText
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
25
63
|
}
|
|
26
64
|
export { CopyIcon };
|
|
27
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copy-icon.tsx"],"sourcesContent":["import { Check, Copy } from \"lucide-react\";\nimport * as React from \"react\";\n\ninterface CopyIconProps {\n\ttext: string;\n}\n\nfunction CopyIcon({
|
|
1
|
+
{"version":3,"sources":["../../../src/components/copy-icon.tsx"],"sourcesContent":["import { Check, Copy } from \"lucide-react\";\nimport * as React from \"react\";\nimport { toast } from \"sonner\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"#shadcn/components/ui/tooltip\";\n\ninterface CopyIconProps {\n\ttext: string;\n\tshowTooltip?: boolean;\n\ttooltipText?: string;\n\tshowToast?: boolean;\n\tonCopy?: (text: string) => void;\n}\n\nfunction CopyIcon({\n\ttext,\n\tshowTooltip = true,\n\ttooltipText = \"Copy\",\n\tshowToast = true,\n\tonCopy,\n\t...props\n}: CopyIconProps) {\n\tconst [isActive, setIsActive] = React.useState(false);\n\n\tasync function handleClick() {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\tsetIsActive(true);\n\n\t\t\tif (showToast) {\n\t\t\t\tconst truncatedText =\n\t\t\t\t\ttext.length > 30 ? `${text.slice(0, 30)}...` : text;\n\t\t\t\ttoast(\n\t\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t\t<span className=\"typo-body\">Successfully copied</span>\n\t\t\t\t\t\t<span className=\"typo-code text-text-secondary\">\n\t\t\t\t\t\t\t{truncatedText}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>,\n\t\t\t\t\t{\n\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tonCopy?.(text);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetIsActive(false);\n\t\t\t}, 1000);\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Failed to copy to clipboard:\", error);\n\t\t}\n\t}\n\n\tconst button = (\n\t\t<button\n\t\t\t{...props}\n\t\t\ttype=\"button\"\n\t\t\tonClick={handleClick}\n\t\t\tstyle={{ cursor: \"pointer\" }}\n\t\t>\n\t\t\t{isActive ? <Check /> : <Copy />}\n\t\t</button>\n\t);\n\n\tif (!showTooltip) {\n\t\treturn button;\n\t}\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>{button}</TooltipTrigger>\n\t\t\t<TooltipContent>\n\t\t\t\t<p>{tooltipText}</p>\n\t\t\t</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n\nexport { CopyIcon };\n"],"names":["Check","Copy","React","toast","Tooltip","TooltipContent","TooltipTrigger","CopyIcon","text","showTooltip","tooltipText","showToast","onCopy","props","isActive","setIsActive","useState","handleClick","navigator","clipboard","writeText","truncatedText","length","slice","div","className","span","duration","setTimeout","error","console","button","type","onClick","style","cursor","asChild","p"],"mappings":";AAAA,SAASA,KAAK,EAAEC,IAAI,QAAQ,eAAe;AAC3C,YAAYC,WAAW,QAAQ;AAC/B,SAASC,KAAK,QAAQ,SAAS;AAC/B,SACCC,OAAO,EACPC,cAAc,EACdC,cAAc,QACR,qCAAgC;AAUvC,SAASC,SAAS,EACjBC,IAAI,EACJC,cAAc,IAAI,EAClBC,cAAc,MAAM,EACpBC,YAAY,IAAI,EAChBC,MAAM,EACN,GAAGC,OACY;IACf,MAAM,CAACC,UAAUC,YAAY,GAAGb,MAAMc,QAAQ,CAAC;IAE/C,eAAeC;QACd,IAAI;YACH,MAAMC,UAAUC,SAAS,CAACC,SAAS,CAACZ;YACpCO,YAAY;YAEZ,IAAIJ,WAAW;gBACd,MAAMU,gBACLb,KAAKc,MAAM,GAAG,KAAK,GAAGd,KAAKe,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAGf;gBAChDL,oBACC,MAACqB;oBAAIC,WAAU;;sCACd,KAACC;4BAAKD,WAAU;sCAAY;;sCAC5B,KAACC;4BAAKD,WAAU;sCACdJ;;;oBAGH;oBACCM,UAAU;gBACX;YAEF;YAEAf,SAASJ;YAEToB,WAAW;gBACVb,YAAY;YACb,GAAG;QACJ,EAAE,OAAOc,OAAO;YACfC,QAAQD,KAAK,CAAC,gCAAgCA;QAC/C;IACD;IAEA,MAAME,uBACL,KAACA;QACC,GAAGlB,KAAK;QACTmB,MAAK;QACLC,SAAShB;QACTiB,OAAO;YAAEC,QAAQ;QAAU;kBAE1BrB,yBAAW,KAACd,2BAAW,KAACC;;IAI3B,IAAI,CAACQ,aAAa;QACjB,OAAOsB;IACR;IAEA,qBACC,MAAC3B;;0BACA,KAACE;gBAAe8B,OAAO;0BAAEL;;0BACzB,KAAC1B;0BACA,cAAA,KAACgC;8BAAG3B;;;;;AAIR;AAEA,SAASH,QAAQ,GAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
export interface DataTableProps<TData, TValue> {
|
|
3
|
+
columns: ColumnDef<TData, TValue>[];
|
|
4
|
+
data: TData[];
|
|
5
|
+
stickyHeader?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function DataTable<TData, TValue>({ columns, data, stickyHeader, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type { ColumnDef };
|
|
9
|
+
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,SAAS,EAId,MAAM,uBAAuB,CAAC;AAW/B,MAAM,WAAW,cAAc,CAAC,KAAK,EAAE,MAAM;IAC5C,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IACpC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EACxC,OAAO,EACP,IAAI,EACJ,YAAoB,GACpB,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,2CAyF/B;AAED,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
|
4
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../shadcn/components/ui/table.js";
|
|
5
|
+
export function DataTable({ columns, data, stickyHeader = false }) {
|
|
6
|
+
"use no memo";
|
|
7
|
+
const table = useReactTable({
|
|
8
|
+
data,
|
|
9
|
+
columns,
|
|
10
|
+
getCoreRowModel: getCoreRowModel(),
|
|
11
|
+
columnResizeMode: "onChange",
|
|
12
|
+
enableColumnResizing: true
|
|
13
|
+
});
|
|
14
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
15
|
+
className: "overflow-hidden w-full h-full",
|
|
16
|
+
children: /*#__PURE__*/ _jsxs(Table, {
|
|
17
|
+
className: "relative border-spacing-0 border-separate w-full",
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ _jsx(TableHeader, {
|
|
20
|
+
children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ _jsx(TableRow, {
|
|
21
|
+
children: headerGroup.headers.map((header)=>{
|
|
22
|
+
return /*#__PURE__*/ _jsxs(TableHead, {
|
|
23
|
+
className: `relative group border ${stickyHeader ? "sticky top-0 z-10 bg-bg-secondary text-elements-assistive" : ""}`,
|
|
24
|
+
style: {
|
|
25
|
+
width: header.column.getIndex() === headerGroup.headers.length - 1 ? "w-full" : header.getSize()
|
|
26
|
+
},
|
|
27
|
+
children: [
|
|
28
|
+
header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()),
|
|
29
|
+
header.column.getCanResize() && /*#__PURE__*/ _jsx("div", {
|
|
30
|
+
onMouseDown: header.getResizeHandler(),
|
|
31
|
+
onTouchStart: header.getResizeHandler(),
|
|
32
|
+
className: `hidden group-hover:block absolute top-0 right-0 h-full w-1 bg-border-secondary cursor-col-resize hover:bg-border-secondary`,
|
|
33
|
+
style: {
|
|
34
|
+
userSelect: "none",
|
|
35
|
+
touchAction: "none"
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
}, header.id);
|
|
40
|
+
})
|
|
41
|
+
}, headerGroup.id))
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
44
|
+
children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row)=>/*#__PURE__*/ _jsx(TableRow, {
|
|
45
|
+
"data-state": row.getIsSelected() && "selected",
|
|
46
|
+
children: row.getVisibleCells().map((cell)=>/*#__PURE__*/ _jsx(TableCell, {
|
|
47
|
+
className: "border",
|
|
48
|
+
style: {
|
|
49
|
+
width: cell.column.getIndex() === row.getVisibleCells().length - 1 ? "w-full" : cell.column.getSize()
|
|
50
|
+
},
|
|
51
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
52
|
+
}, cell.id))
|
|
53
|
+
}, row.id)) : /*#__PURE__*/ _jsx(TableRow, {
|
|
54
|
+
children: /*#__PURE__*/ _jsx(TableCell, {
|
|
55
|
+
colSpan: columns.length,
|
|
56
|
+
className: "h-24 text-center",
|
|
57
|
+
children: "No results."
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=data-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n\ttype ColumnDef,\n\tflexRender,\n\tgetCoreRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\n\nimport {\n\tTable,\n\tTableBody,\n\tTableCell,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n} from \"../shadcn/components/ui/table\";\n\nexport interface DataTableProps<TData, TValue> {\n\tcolumns: ColumnDef<TData, TValue>[];\n\tdata: TData[];\n\tstickyHeader?: boolean;\n}\n\nexport function DataTable<TData, TValue>({\n\tcolumns,\n\tdata,\n\tstickyHeader = false,\n}: DataTableProps<TData, TValue>) {\n\t\"use no memo\";\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns,\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tcolumnResizeMode: \"onChange\",\n\t\tenableColumnResizing: true,\n\t});\n\n\treturn (\n\t\t<div className=\"overflow-hidden w-full h-full\">\n\t\t\t<Table className=\"relative border-spacing-0 border-separate w-full\">\n\t\t\t\t<TableHeader>\n\t\t\t\t\t{table.getHeaderGroups().map((headerGroup) => (\n\t\t\t\t\t\t<TableRow key={headerGroup.id}>\n\t\t\t\t\t\t\t{headerGroup.headers.map((header) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<TableHead\n\t\t\t\t\t\t\t\t\t\tkey={header.id}\n\t\t\t\t\t\t\t\t\t\tclassName={`relative group border ${stickyHeader ? \"sticky top-0 z-10 bg-bg-secondary text-elements-assistive\" : \"\"}`}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\theader.column.getIndex() ===\n\t\t\t\t\t\t\t\t\t\t\t\theaderGroup.headers.length - 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? \"w-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t: header.getSize(),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{header.isPlaceholder\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: flexRender(\n\t\t\t\t\t\t\t\t\t\t\t\t\theader.column.columnDef.header,\n\t\t\t\t\t\t\t\t\t\t\t\t\theader.getContext(),\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{header.column.getCanResize() && (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t{...{\n\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseDown: header.getResizeHandler(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tonTouchStart: header.getResizeHandler(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName: `hidden group-hover:block absolute top-0 right-0 h-full w-1 bg-border-secondary cursor-col-resize hover:bg-border-secondary`,\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tuserSelect: \"none\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttouchAction: \"none\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</TableHead>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t))}\n\t\t\t\t</TableHeader>\n\t\t\t\t<TableBody>\n\t\t\t\t\t{table.getRowModel().rows?.length ? (\n\t\t\t\t\t\ttable.getRowModel().rows.map((row) => (\n\t\t\t\t\t\t\t<TableRow\n\t\t\t\t\t\t\t\tkey={row.id}\n\t\t\t\t\t\t\t\tdata-state={row.getIsSelected() && \"selected\"}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{row.getVisibleCells().map((cell) => (\n\t\t\t\t\t\t\t\t\t<TableCell\n\t\t\t\t\t\t\t\t\t\tclassName=\"border\"\n\t\t\t\t\t\t\t\t\t\tkey={cell.id}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\tcell.column.getIndex() ===\n\t\t\t\t\t\t\t\t\t\t\t\trow.getVisibleCells().length - 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? \"w-full\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t: cell.column.getSize(),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{flexRender(cell.column.columnDef.cell, cell.getContext())}\n\t\t\t\t\t\t\t\t\t</TableCell>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t\t))\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TableRow>\n\t\t\t\t\t\t\t<TableCell colSpan={columns.length} className=\"h-24 text-center\">\n\t\t\t\t\t\t\t\tNo results.\n\t\t\t\t\t\t\t</TableCell>\n\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t)}\n\t\t\t\t</TableBody>\n\t\t\t</Table>\n\t\t</div>\n\t);\n}\n\nexport type { ColumnDef };\n"],"names":["flexRender","getCoreRowModel","useReactTable","Table","TableBody","TableCell","TableHead","TableHeader","TableRow","DataTable","columns","data","stickyHeader","table","columnResizeMode","enableColumnResizing","div","className","getHeaderGroups","map","headerGroup","headers","header","style","width","column","getIndex","length","getSize","isPlaceholder","columnDef","getContext","getCanResize","onMouseDown","getResizeHandler","onTouchStart","userSelect","touchAction","id","getRowModel","rows","row","data-state","getIsSelected","getVisibleCells","cell","colSpan"],"mappings":"AAAA;;AAEA,SAECA,UAAU,EACVC,eAAe,EACfC,aAAa,QACP,wBAAwB;AAE/B,SACCC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,WAAW,EACXC,QAAQ,QACF,mCAAgC;AAQvC,OAAO,SAASC,UAAyB,EACxCC,OAAO,EACPC,IAAI,EACJC,eAAe,KAAK,EACW;IAC/B;IACA,MAAMC,QAAQX,cAAc;QAC3BS;QACAD;QACAT,iBAAiBA;QACjBa,kBAAkB;QAClBC,sBAAsB;IACvB;IAEA,qBACC,KAACC;QAAIC,WAAU;kBACd,cAAA,MAACd;YAAMc,WAAU;;8BAChB,KAACV;8BACCM,MAAMK,eAAe,GAAGC,GAAG,CAAC,CAACC,4BAC7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ASxE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { DataTable } from "./data-table";
|
|
3
|
+
declare const meta: Meta<typeof DataTable>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataTable>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=data-table.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.stories.d.ts","sourceRoot":"","sources":["../../../src/components/data-table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;AAE9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAIhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AASxC,eAAO,MAAM,OAAO,EAAE,KAqErB,CAAC"}
|