@solidxai/core-ui 0.1.7-beta.10 → 0.1.7-beta.11
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/README.md +215 -0
- package/dist/components/auth/SolidOTPVerify.d.ts +3 -0
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -0
- package/dist/components/auth/SolidOTPVerify.js +67 -0
- package/dist/components/auth/SolidOTPVerify.js.map +1 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/common/AuthBanner.js.map +1 -1
- package/dist/components/common/GeneralSettings.js +31 -29
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +51 -41
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts +18 -14
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +130 -26
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
- package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +319 -80
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +2 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js +50 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +2 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +10 -21
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +10 -18
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +6 -3
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +24 -30
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +2 -2
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js +7 -6
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +10 -9
- package/dist/components/shad-cn-ui/SolidTabs.d.ts +2 -1
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +5 -5
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +6 -0
- package/dist/nextAuth/authProviders.d.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -0
- package/dist/nextAuth/authProviders.js +198 -0
- package/dist/nextAuth/authProviders.js.map +1 -0
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.d.ts +2 -0
- package/dist/nextAuth/handleLogout.d.ts.map +1 -0
- package/dist/nextAuth/handleLogout.js +36 -0
- package/dist/nextAuth/handleLogout.js.map +1 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
- package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
- package/dist/nextAuth/refreshAccessToken.js +24 -0
- package/dist/nextAuth/refreshAccessToken.js.map +1 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/features/settingsSlice.d.ts +20 -0
- package/dist/redux/features/settingsSlice.d.ts.map +1 -0
- package/dist/redux/features/settingsSlice.js +39 -0
- package/dist/redux/features/settingsSlice.js.map +1 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/package.json +1 -1
- package/dist/components/core/list/SolidDataTablePagination.d.ts +0 -15
- package/dist/components/core/list/SolidDataTablePagination.d.ts.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.js +0 -22
- package/dist/components/core/list/SolidDataTablePagination.js.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.tsx +0 -71
- package/dist/components/solid-ui/SolidButton.d.ts +0 -14
- package/dist/components/solid-ui/SolidButton.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidButton.js +0 -36
- package/dist/components/solid-ui/SolidButton.js.map +0 -1
- package/dist/components/solid-ui/SolidButton.tsx +0 -54
- package/dist/components/solid-ui/SolidTabs.d.ts +0 -18
- package/dist/components/solid-ui/SolidTabs.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidTabs.js +0 -22
- package/dist/components/solid-ui/SolidTabs.js.map +0 -1
- package/dist/components/solid-ui/SolidTabs.tsx +0 -73
- package/dist/components/solid-ui/index.d.ts +0 -3
- package/dist/components/solid-ui/index.d.ts.map +0 -1
- package/dist/components/solid-ui/index.js +0 -3
- package/dist/components/solid-ui/index.js.map +0 -1
- package/dist/components/solid-ui/index.ts +0 -2
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
SolidButton,
|
|
4
|
+
SolidDialog,
|
|
5
|
+
SolidDialogBody,
|
|
6
|
+
SolidDialogFooter,
|
|
7
|
+
SolidDialogHeader,
|
|
8
|
+
SolidDialogTitle,
|
|
9
|
+
SolidInput,
|
|
10
|
+
SolidSelect,
|
|
11
|
+
SolidSwitch,
|
|
12
|
+
SolidTextarea,
|
|
13
|
+
} from "../../../shad-cn-ui";
|
|
14
|
+
|
|
3
15
|
|
|
4
16
|
export interface ModelBehavior {
|
|
5
17
|
streaming: boolean;
|
|
6
18
|
custom: string;
|
|
7
19
|
}
|
|
8
20
|
|
|
9
|
-
export interface
|
|
10
|
-
|
|
21
|
+
export interface ProviderEntry {
|
|
22
|
+
type: string;
|
|
11
23
|
apiKey: string;
|
|
12
|
-
model: string;
|
|
13
24
|
baseUrl?: string;
|
|
14
25
|
}
|
|
15
26
|
|
|
16
27
|
export interface ModelEntry {
|
|
17
|
-
|
|
28
|
+
providerId: string;
|
|
29
|
+
model: string;
|
|
18
30
|
behavior: ModelBehavior;
|
|
19
31
|
}
|
|
20
32
|
|
|
@@ -23,125 +35,353 @@ export interface SolidAiConfig {
|
|
|
23
35
|
default: ModelEntry;
|
|
24
36
|
fast: ModelEntry;
|
|
25
37
|
};
|
|
26
|
-
providers: Record<string,
|
|
38
|
+
providers: Record<string, ProviderEntry>;
|
|
27
39
|
}
|
|
28
40
|
|
|
29
|
-
interface Props {
|
|
30
|
-
providerKey: string;
|
|
31
|
-
providerConfig: ProviderConfig;
|
|
32
|
-
behavior: ModelBehavior;
|
|
33
|
-
allProviders: Record<string, ProviderConfig>;
|
|
34
|
-
onProviderKeyChange: (newProviderKey: string, config: ProviderConfig) => void;
|
|
35
|
-
onProviderConfigChange: (providerKey: string, config: ProviderConfig) => void;
|
|
36
|
-
onBehaviorChange: (behavior: ModelBehavior) => void;
|
|
37
|
-
}
|
|
38
41
|
|
|
39
|
-
const
|
|
42
|
+
const PROVIDER_TYPE_OPTIONS = [
|
|
40
43
|
{ label: "OpenAI", value: "openai" },
|
|
41
44
|
{ label: "Anthropic", value: "anthropic" },
|
|
42
45
|
{ label: "OpenAI Compatible", value: "openai-compatible" },
|
|
43
46
|
{ label: "Anthropic Compatible", value: "anthropic-compatible" },
|
|
44
47
|
];
|
|
45
48
|
|
|
46
|
-
const
|
|
49
|
+
const COMPATIBLE_TYPES = ["openai-compatible", "anthropic-compatible"];
|
|
47
50
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const BUILT_IN_TYPES = ["openai", "anthropic"];
|
|
52
|
+
|
|
53
|
+
const DEFAULT_BUILT_IN_PROVIDERS: Record<string, ProviderEntry> = {
|
|
54
|
+
openai: { type: "openai", apiKey: "" },
|
|
55
|
+
anthropic: { type: "anthropic", apiKey: "" },
|
|
53
56
|
};
|
|
54
57
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
export const ensureBuiltInProviders = (providers: Record<string, ProviderEntry>): Record<string, ProviderEntry> => ({
|
|
59
|
+
...DEFAULT_BUILT_IN_PROVIDERS,
|
|
60
|
+
...providers,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const cardStyle: React.CSSProperties = {
|
|
64
|
+
border: "1px solid var(--solid-border-color, #e2e8f0)",
|
|
65
|
+
borderRadius: "0.5rem",
|
|
66
|
+
padding: "1.25rem",
|
|
67
|
+
background: "var(--solid-card-bg, var(--solid-surface-bg, transparent))",
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
interface ProviderModalProps {
|
|
72
|
+
visible: boolean;
|
|
73
|
+
onHide: () => void;
|
|
74
|
+
providers: Record<string, ProviderEntry>;
|
|
75
|
+
onProvidersChange: (providers: Record<string, ProviderEntry>) => void;
|
|
76
|
+
editKey?: string | null; // null = add mode, string = edit mode
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const ProviderModal = ({ visible, onHide, providers, onProvidersChange, editKey }: ProviderModalProps) => {
|
|
80
|
+
const isEdit = !!editKey;
|
|
81
|
+
const existingEntry = isEdit ? providers[editKey] : null;
|
|
82
|
+
|
|
83
|
+
const [providerType, setProviderType] = useState(existingEntry?.type ?? "");
|
|
84
|
+
const [providerName, setProviderName] = useState(editKey && !BUILT_IN_TYPES.includes(editKey) ? editKey : "");
|
|
85
|
+
const [providerBaseUrl, setProviderBaseUrl] = useState(existingEntry?.baseUrl ?? "");
|
|
86
|
+
const [providerApiKey, setProviderApiKey] = useState(existingEntry?.apiKey ?? "");
|
|
87
|
+
|
|
88
|
+
const isCompatible = COMPATIBLE_TYPES.includes(providerType);
|
|
89
|
+
|
|
90
|
+
// Reset state when modal opens with new data
|
|
91
|
+
React.useEffect(() => {
|
|
92
|
+
if (visible) {
|
|
93
|
+
const entry = editKey ? providers[editKey] : null;
|
|
94
|
+
setProviderType(entry?.type ?? "");
|
|
95
|
+
setProviderName(editKey && !BUILT_IN_TYPES.includes(editKey) ? editKey : "");
|
|
96
|
+
setProviderBaseUrl(entry?.baseUrl ?? "");
|
|
97
|
+
setProviderApiKey(entry?.apiKey ?? "");
|
|
98
|
+
}
|
|
99
|
+
}, [visible, editKey]);
|
|
100
|
+
|
|
101
|
+
// In add mode, only show compatible types (built-ins are always pre-added)
|
|
102
|
+
// In edit mode, show all types but lock the value
|
|
103
|
+
const typeOptions = isEdit
|
|
104
|
+
? PROVIDER_TYPE_OPTIONS
|
|
105
|
+
: PROVIDER_TYPE_OPTIONS.filter((opt) => COMPATIBLE_TYPES.includes(opt.value));
|
|
106
|
+
|
|
107
|
+
const handleSave = () => {
|
|
108
|
+
if (!providerType) return;
|
|
71
109
|
|
|
72
|
-
|
|
73
|
-
|
|
110
|
+
let key: string;
|
|
111
|
+
const entry: ProviderEntry = { type: providerType, apiKey: providerApiKey };
|
|
112
|
+
|
|
113
|
+
if (isCompatible) {
|
|
114
|
+
if (!providerName.trim()) return;
|
|
115
|
+
key = providerName.trim();
|
|
116
|
+
entry.baseUrl = providerBaseUrl;
|
|
117
|
+
} else {
|
|
118
|
+
key = providerType;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// In add mode, don't overwrite existing
|
|
122
|
+
if (!isEdit && providers[key]) return;
|
|
123
|
+
|
|
124
|
+
const next = { ...providers };
|
|
125
|
+
|
|
126
|
+
// If editing and key changed (shouldn't happen for built-in), remove old
|
|
127
|
+
if (isEdit && editKey !== key) {
|
|
128
|
+
delete next[editKey!];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
next[key] = entry;
|
|
132
|
+
onProvidersChange(next);
|
|
133
|
+
onHide();
|
|
74
134
|
};
|
|
75
135
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
136
|
+
const handleRemove = () => {
|
|
137
|
+
if (!editKey) return;
|
|
138
|
+
const next = { ...providers };
|
|
139
|
+
delete next[editKey];
|
|
140
|
+
onProvidersChange(next);
|
|
141
|
+
onHide();
|
|
81
142
|
};
|
|
82
143
|
|
|
144
|
+
const canSave = providerType && (isCompatible ? providerName.trim() : true);
|
|
145
|
+
|
|
83
146
|
return (
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
{isCompatible && (
|
|
99
|
-
<div className="flex flex-column gap-2">
|
|
100
|
-
<label className="form-field-label">Base URL</label>
|
|
101
|
-
<SolidInput
|
|
102
|
-
placeholder="http://localhost:8000"
|
|
103
|
-
value={providerConfig?.baseUrl || ""}
|
|
104
|
-
onChange={(e) => handleConfigUpdate("baseUrl", e.target.value)}
|
|
147
|
+
<SolidDialog open={visible} onOpenChange={(open) => !open && onHide()} style={{ width: "500px" }}>
|
|
148
|
+
<SolidDialogHeader>
|
|
149
|
+
<SolidDialogTitle>
|
|
150
|
+
{isEdit
|
|
151
|
+
? `Edit Provider — ${BUILT_IN_TYPES.includes(editKey!) ? PROVIDER_TYPE_OPTIONS.find((o) => o.value === editKey)?.label : editKey}`
|
|
152
|
+
: "Add Provider"}
|
|
153
|
+
</SolidDialogTitle>
|
|
154
|
+
</SolidDialogHeader>
|
|
155
|
+
<SolidDialogBody>
|
|
156
|
+
<div className="flex flex-column gap-3">
|
|
157
|
+
{!(isEdit && BUILT_IN_TYPES.includes(editKey!)) && (
|
|
158
|
+
<div>
|
|
159
|
+
<label className="form-field-label">Provider Type</label>
|
|
160
|
+
<SolidSelect
|
|
105
161
|
className="w-full"
|
|
162
|
+
value={providerType}
|
|
163
|
+
options={typeOptions}
|
|
164
|
+
onChange={(e) => {
|
|
165
|
+
setProviderType(e.value);
|
|
166
|
+
if (!isEdit) {
|
|
167
|
+
setProviderName("");
|
|
168
|
+
setProviderBaseUrl("");
|
|
169
|
+
}
|
|
170
|
+
}}
|
|
171
|
+
placeholder="Select Provider Type"
|
|
172
|
+
disabled={isEdit}
|
|
106
173
|
/>
|
|
107
174
|
</div>
|
|
108
175
|
)}
|
|
109
|
-
|
|
176
|
+
{isCompatible && (
|
|
177
|
+
<>
|
|
178
|
+
{!isEdit && (
|
|
179
|
+
<div>
|
|
180
|
+
<label className="form-field-label">Name (unique identifier)</label>
|
|
181
|
+
<SolidInput
|
|
182
|
+
placeholder="e.g. openrouter, together-ai"
|
|
183
|
+
value={providerName}
|
|
184
|
+
onChange={(e) => setProviderName(e.target.value)}
|
|
185
|
+
className="w-full"
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
)}
|
|
189
|
+
<div>
|
|
190
|
+
<label className="form-field-label">Base URL</label>
|
|
191
|
+
<SolidInput
|
|
192
|
+
placeholder="https://openrouter.ai/api/v1"
|
|
193
|
+
value={providerBaseUrl}
|
|
194
|
+
onChange={(e) => setProviderBaseUrl(e.target.value)}
|
|
195
|
+
className="w-full"
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
</>
|
|
199
|
+
)}
|
|
200
|
+
<div>
|
|
110
201
|
<label className="form-field-label">API Key</label>
|
|
111
202
|
<SolidInput
|
|
112
203
|
type="password"
|
|
204
|
+
value={providerApiKey}
|
|
205
|
+
onChange={(e) => setProviderApiKey(e.target.value)}
|
|
206
|
+
className="w-full"
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</SolidDialogBody>
|
|
211
|
+
<SolidDialogFooter>
|
|
212
|
+
<div className="flex justify-content-between w-full">
|
|
213
|
+
<div>
|
|
214
|
+
{isEdit && !BUILT_IN_TYPES.includes(editKey!) && (
|
|
215
|
+
<SolidButton variant="ghost" onClick={handleRemove} style={{ color: "var(--solid-danger-color, #ef4444)" }}>
|
|
216
|
+
Remove
|
|
217
|
+
</SolidButton>
|
|
218
|
+
)}
|
|
219
|
+
</div>
|
|
220
|
+
<div className="flex gap-2">
|
|
221
|
+
<SolidButton variant="outline" onClick={onHide}>
|
|
222
|
+
Cancel
|
|
223
|
+
</SolidButton>
|
|
224
|
+
<SolidButton onClick={handleSave} disabled={!canSave}>
|
|
225
|
+
{isEdit ? "Save" : "Add"}
|
|
226
|
+
</SolidButton>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</SolidDialogFooter>
|
|
230
|
+
</SolidDialog>
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// --- Providers Tab (List View) ---
|
|
235
|
+
|
|
236
|
+
interface ProvidersTabProps {
|
|
237
|
+
providers: Record<string, ProviderEntry>;
|
|
238
|
+
onProvidersChange: (providers: Record<string, ProviderEntry>) => void;
|
|
239
|
+
showAddModal?: boolean;
|
|
240
|
+
onAddModalClose?: () => void;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export const ProvidersTab = ({ providers, onProvidersChange, showAddModal, onAddModalClose }: ProvidersTabProps) => {
|
|
244
|
+
const [editKey, setEditKey] = useState<string | null>(null);
|
|
245
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
246
|
+
|
|
247
|
+
// Ensure built-in providers are always present
|
|
248
|
+
const allProviders = ensureBuiltInProviders(providers);
|
|
249
|
+
|
|
250
|
+
// Open modal when parent triggers add
|
|
251
|
+
React.useEffect(() => {
|
|
252
|
+
if (showAddModal) {
|
|
253
|
+
setEditKey(null);
|
|
254
|
+
setModalVisible(true);
|
|
255
|
+
}
|
|
256
|
+
}, [showAddModal]);
|
|
257
|
+
|
|
258
|
+
const providerEntries = Object.entries(allProviders);
|
|
259
|
+
|
|
260
|
+
const handleRowClick = (key: string) => {
|
|
261
|
+
setEditKey(key);
|
|
262
|
+
setModalVisible(true);
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
return (
|
|
266
|
+
<>
|
|
267
|
+
<div className="solid-simple-table">
|
|
268
|
+
<table style={{ width: "100%" }}>
|
|
269
|
+
<thead>
|
|
270
|
+
<tr>
|
|
271
|
+
<th style={{ textAlign: "left", padding: "0.75rem 1rem" }}>Name</th>
|
|
272
|
+
<th style={{ textAlign: "left", padding: "0.75rem 1rem" }}>Type</th>
|
|
273
|
+
<th style={{ textAlign: "left", padding: "0.75rem 1rem" }}>API Key</th>
|
|
274
|
+
<th style={{ textAlign: "left", padding: "0.75rem 1rem" }}>Base URL</th>
|
|
275
|
+
</tr>
|
|
276
|
+
</thead>
|
|
277
|
+
<tbody>
|
|
278
|
+
{providerEntries.length === 0 && (
|
|
279
|
+
<tr>
|
|
280
|
+
<td colSpan={4} style={{ textAlign: "center", padding: "2rem 1rem", opacity: 0.5 }}>
|
|
281
|
+
No providers configured.
|
|
282
|
+
</td>
|
|
283
|
+
</tr>
|
|
284
|
+
)}
|
|
285
|
+
{providerEntries.map(([key, entry]) => {
|
|
286
|
+
const typeLabel = PROVIDER_TYPE_OPTIONS.find((o) => o.value === entry.type)?.label ?? entry.type;
|
|
287
|
+
const isBuiltIn = BUILT_IN_TYPES.includes(key);
|
|
288
|
+
const displayName = isBuiltIn ? typeLabel : key;
|
|
289
|
+
const maskedKey = entry.apiKey ? "\u2022".repeat(Math.min(entry.apiKey.length, 8)) : "-";
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<tr
|
|
293
|
+
key={key}
|
|
294
|
+
onClick={() => handleRowClick(key)}
|
|
295
|
+
style={{ cursor: "pointer" }}
|
|
296
|
+
className="solid-table-row-hover"
|
|
297
|
+
>
|
|
298
|
+
<td style={{ padding: "0.75rem 1rem", fontWeight: 500 }}>{displayName}</td>
|
|
299
|
+
<td style={{ padding: "0.75rem 1rem" }}>{typeLabel}</td>
|
|
300
|
+
<td style={{ padding: "0.75rem 1rem" }}>{maskedKey}</td>
|
|
301
|
+
<td style={{ padding: "0.75rem 1rem" }}>{entry.baseUrl || "-"}</td>
|
|
302
|
+
</tr>
|
|
303
|
+
);
|
|
304
|
+
})}
|
|
305
|
+
</tbody>
|
|
306
|
+
</table>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<ProviderModal
|
|
310
|
+
visible={modalVisible}
|
|
311
|
+
onHide={() => {
|
|
312
|
+
setModalVisible(false);
|
|
313
|
+
setEditKey(null);
|
|
314
|
+
onAddModalClose?.();
|
|
315
|
+
}}
|
|
316
|
+
providers={allProviders}
|
|
317
|
+
onProvidersChange={onProvidersChange}
|
|
318
|
+
editKey={editKey}
|
|
319
|
+
/>
|
|
320
|
+
</>
|
|
321
|
+
);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
// --- Model Config Tab (used for Intelligent Model & Fast Model) ---
|
|
325
|
+
|
|
326
|
+
interface ModelConfigTabProps {
|
|
327
|
+
modelEntry: ModelEntry;
|
|
328
|
+
providers: Record<string, ProviderEntry>;
|
|
329
|
+
onModelEntryChange: (entry: ModelEntry) => void;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export const ModelConfigTab = ({ modelEntry, providers, onModelEntryChange }: ModelConfigTabProps) => {
|
|
333
|
+
const providerOptions = Object.entries(providers).map(([key, entry]) => {
|
|
334
|
+
const typeLabel = PROVIDER_TYPE_OPTIONS.find((o) => o.value === entry.type)?.label ?? entry.type;
|
|
335
|
+
const label = BUILT_IN_TYPES.includes(key) ? typeLabel : `${key} (${typeLabel})`;
|
|
336
|
+
return { label, value: key };
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
return (
|
|
340
|
+
<div className="flex flex-column gap-4">
|
|
341
|
+
<div style={{ ...cardStyle, width: "50%" }}>
|
|
342
|
+
<p className="solid-settings-subheading">Model Config</p>
|
|
343
|
+
<div className="flex flex-column gap-3 mt-3">
|
|
344
|
+
<div>
|
|
345
|
+
<label className="form-field-label">Provider</label>
|
|
346
|
+
<SolidSelect
|
|
113
347
|
className="w-full"
|
|
114
|
-
value={
|
|
115
|
-
|
|
348
|
+
value={modelEntry.providerId}
|
|
349
|
+
options={providerOptions}
|
|
350
|
+
onChange={(e) => onModelEntryChange({ ...modelEntry, providerId: e.value })}
|
|
351
|
+
placeholder="Select Provider"
|
|
116
352
|
/>
|
|
117
353
|
</div>
|
|
118
|
-
<div
|
|
354
|
+
<div>
|
|
119
355
|
<label className="form-field-label">Model</label>
|
|
120
356
|
<SolidInput
|
|
121
357
|
placeholder="e.g. gpt-4o-mini"
|
|
122
|
-
value={
|
|
123
|
-
onChange={(e) =>
|
|
358
|
+
value={modelEntry.model || ""}
|
|
359
|
+
onChange={(e) => onModelEntryChange({ ...modelEntry, model: e.target.value })}
|
|
124
360
|
className="w-full"
|
|
125
361
|
/>
|
|
126
362
|
</div>
|
|
127
363
|
</div>
|
|
128
364
|
</div>
|
|
129
365
|
|
|
130
|
-
<div style={cardStyle}>
|
|
366
|
+
<div style={{ ...cardStyle, width: "50%" }}>
|
|
131
367
|
<p className="solid-settings-subheading">Behavior</p>
|
|
132
368
|
<div className="flex flex-column gap-3 mt-3">
|
|
133
369
|
<div className="flex align-items-center gap-2">
|
|
134
370
|
<SolidSwitch
|
|
135
|
-
checked={behavior.streaming}
|
|
136
|
-
onChange={(val) =>
|
|
371
|
+
checked={modelEntry.behavior.streaming}
|
|
372
|
+
onChange={(val) =>
|
|
373
|
+
onModelEntryChange({ ...modelEntry, behavior: { ...modelEntry.behavior, streaming: val } })
|
|
374
|
+
}
|
|
137
375
|
/>
|
|
138
376
|
<label className="form-field-label" style={{ marginBottom: 0 }}>Streaming</label>
|
|
139
377
|
</div>
|
|
140
|
-
<div
|
|
378
|
+
<div>
|
|
141
379
|
<label className="form-field-label">Custom Params (JSON)</label>
|
|
142
380
|
<SolidTextarea
|
|
143
|
-
value={behavior.custom}
|
|
144
|
-
onChange={(e) =>
|
|
381
|
+
value={modelEntry.behavior.custom}
|
|
382
|
+
onChange={(e) =>
|
|
383
|
+
onModelEntryChange({ ...modelEntry, behavior: { ...modelEntry.behavior, custom: e.target.value } })
|
|
384
|
+
}
|
|
145
385
|
placeholder='{ "temperature": 0.7, "maxTokens": 1000 }'
|
|
146
386
|
rows={4}
|
|
147
387
|
className="w-full"
|
|
@@ -149,7 +389,6 @@ export const AiModelConfigTab = ({
|
|
|
149
389
|
</div>
|
|
150
390
|
</div>
|
|
151
391
|
</div>
|
|
152
|
-
|
|
153
392
|
</div>
|
|
154
393
|
);
|
|
155
394
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadDynamicJsxComponent.d.ts","sourceRoot":"./","sources":["components/core/common/LoadDynamicJsxComponent.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,uBAAuB,gBAAiB,GAAG,4CAoDvD,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
4
|
+
import dynamic from "next/dynamic";
|
|
5
|
+
import { useState, useEffect } from "react";
|
|
6
|
+
// Fallback component for missing components
|
|
7
|
+
const FallbackComponent = ({ componentName }) => (_jsxs("div", { style: { color: "red" }, children: ["Could not load ", _jsx("strong", { children: componentName })] }));
|
|
8
|
+
export const LoadDynamicJsxComponent = ({ context }) => {
|
|
9
|
+
// const Component = dynamic<Props>(
|
|
10
|
+
// async () => {
|
|
11
|
+
// try {
|
|
12
|
+
// const componentName = context?.rowAction?.action?.customComponent.split('/').pop();
|
|
13
|
+
// const mod = await import();
|
|
14
|
+
// // Return the default export or a named export matching the componentName
|
|
15
|
+
// return mod.default || mod[componentName];
|
|
16
|
+
// } catch (error) {
|
|
17
|
+
// console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
18
|
+
// // Return a fallback component if the import fails
|
|
19
|
+
// return () => <GenerateModelCodeRowAction context={context} />;
|
|
20
|
+
// }
|
|
21
|
+
// },
|
|
22
|
+
// { ssr: false } // Disable server-side rendering
|
|
23
|
+
// );
|
|
24
|
+
const [Component, setComponent] = useState(null);
|
|
25
|
+
const componentPath = context?.rowAction?.action?.customComponent;
|
|
26
|
+
const componentKey = componentPath?.split("/")?.pop();
|
|
27
|
+
const componentMap = {
|
|
28
|
+
"GenerateModelCodeRowAction": dynamic(() => import("../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction"), { ssr: false }),
|
|
29
|
+
"GenerateModuleCodeRowAction": dynamic(() => import("../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction"), { ssr: false }),
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!componentKey)
|
|
33
|
+
return;
|
|
34
|
+
if (componentMap[componentKey]) {
|
|
35
|
+
setComponent(() => () => setComponent(() => componentMap[componentKey]));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
import(componentPath)
|
|
39
|
+
.then((mod) => setComponent(() => mod.default || mod))
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);
|
|
42
|
+
setComponent(() => () => _jsx(FallbackComponent, { componentName: componentKey }));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, [componentKey]);
|
|
46
|
+
if (!Component)
|
|
47
|
+
return _jsx("p", { children: "Loading..." });
|
|
48
|
+
return _jsx(Component, { context: context });
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=LoadDynamicJsxComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadDynamicJsxComponent.js","sourceRoot":"./","sources":["components/core/common/LoadDynamicJsxComponent.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,CAAC,EAAE,aAAa,EAAO,EAAE,EAAE,CAAC,CAClD,eAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gCACT,2BAAS,aAAa,GAAU,IAC7C,CACT,CAAC;AAMF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,OAAO,EAAO,EAAE,EAAE;IAGxD,oCAAoC;IACpC,oBAAoB;IACpB,gBAAgB;IAEhB,kGAAkG;IAClG,0CAA0C;IAC1C,wFAAwF;IACxF,wDAAwD;IACxD,4BAA4B;IAC5B,kHAAkH;IAClH,iEAAiE;IACjE,6EAA6E;IAC7E,YAAY;IACZ,SAAS;IACT,sDAAsD;IACtD,KAAK;IACL,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAM,IAAI,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC;IAClE,MAAM,YAAY,GAAG,aAAa,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IAEtD,MAAM,YAAY,GAAwB;QACtC,4BAA4B,EAAE,OAAO,CACnC,GAAG,EAAE,CAAC,MAAM,CAAC,uEAAuE,CAAC,EACrF,EAAE,GAAG,EAAE,KAAK,EAAE,CACf;QACD,6BAA6B,EAAE,OAAO,CAClC,GAAG,EAAE,CAAC,MAAM,CAAC,yEAAyE,CAAC,EACvF,EAAE,GAAG,EAAE,KAAK,EAAE,CACjB;KACJ,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1B,IAAI,YAAY,CAAC,YAAY,CAAC,EAAE;YAC5B,YAAY,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;SAC5E;aAAM;YACP,MAAM,CAAC,aAAa,CAAC;iBAChB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;iBACrD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,iBAAiB,IAAI,aAAa,GAAG,EAAE,GAAG,CAAC,CAAC;gBAC7E,YAAY,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAC,iBAAiB,IAAC,aAAa,EAAE,YAAY,GAAI,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;SACN;IACL,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,IAAI,CAAC,SAAS;QAAE,OAAO,qCAAiB,CAAC;IAEzC,OAAO,KAAC,SAAS,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC;AAC3C,CAAC,CAAA","sourcesContent":["'use client';\nimport { ERROR_MESSAGES } from \"../../../constants/error-messages\";\nimport dynamic from \"next/dynamic\";\nimport { useState, useEffect } from \"react\";\n// Fallback component for missing components\nconst FallbackComponent = ({ componentName }: any) => (\n <div style={{ color: \"red\" }}>\n Could not load <strong>{componentName}</strong>\n </div>\n);\n\ntype Props = {\n context: any;\n};\n\nexport const LoadDynamicJsxComponent = ({ context }: any) => {\n\n \n // const Component = dynamic<Props>(\n // async () => {\n // try {\n \n // const componentName = context?.rowAction?.action?.customComponent.split('/').pop();\n // const mod = await import();\n // // Return the default export or a named export matching the componentName\n // return mod.default || mod[componentName];\n // } catch (error) {\n // console.error(`Failed to load component \"${context?.rowAction?.action?.customComponent}\":`, error);\n // // Return a fallback component if the import fails\n // return () => <GenerateModelCodeRowAction context={context} />;\n // }\n // },\n // { ssr: false } // Disable server-side rendering\n // );\n const [Component, setComponent] = useState<any>(null);\n const componentPath = context?.rowAction?.action?.customComponent;\n const componentKey = componentPath?.split(\"/\")?.pop();\n\n const componentMap: Record<string, any> = {\n \"GenerateModelCodeRowAction\": dynamic(\n () => import(\"../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction\"),\n { ssr: false }\n ),\n \"GenerateModuleCodeRowAction\": dynamic(\n () => import(\"../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction\"),\n { ssr: false }\n ),\n };\n\n useEffect(() => {\n if (!componentKey) return;\n\n if (componentMap[componentKey]) {\n setComponent(() => () => setComponent(() => componentMap[componentKey]));\n } else {\n import(componentPath)\n .then((mod) => setComponent(() => mod.default || mod))\n .catch((err) => {\n console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);\n setComponent(() => () => <FallbackComponent componentName={componentKey} />);\n });\n }\n }, [componentKey]);\n\n if (!Component) return <p>Loading...</p>;\n\n return <Component context={context} />;\n}\n\n\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
3
|
+
import dynamic from "next/dynamic";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
// Fallback component for missing components
|
|
6
|
+
const FallbackComponent = ({ componentName }: any) => (
|
|
7
|
+
<div style={{ color: "red" }}>
|
|
8
|
+
Could not load <strong>{componentName}</strong>
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
context: any;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const LoadDynamicJsxComponent = ({ context }: any) => {
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// const Component = dynamic<Props>(
|
|
20
|
+
// async () => {
|
|
21
|
+
// try {
|
|
22
|
+
|
|
23
|
+
// const componentName = context?.rowAction?.action?.customComponent.split('/').pop();
|
|
24
|
+
// const mod = await import();
|
|
25
|
+
// // Return the default export or a named export matching the componentName
|
|
26
|
+
// return mod.default || mod[componentName];
|
|
27
|
+
// } catch (error) {
|
|
28
|
+
// console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
29
|
+
// // Return a fallback component if the import fails
|
|
30
|
+
// return () => <GenerateModelCodeRowAction context={context} />;
|
|
31
|
+
// }
|
|
32
|
+
// },
|
|
33
|
+
// { ssr: false } // Disable server-side rendering
|
|
34
|
+
// );
|
|
35
|
+
const [Component, setComponent] = useState<any>(null);
|
|
36
|
+
const componentPath = context?.rowAction?.action?.customComponent;
|
|
37
|
+
const componentKey = componentPath?.split("/")?.pop();
|
|
38
|
+
|
|
39
|
+
const componentMap: Record<string, any> = {
|
|
40
|
+
"GenerateModelCodeRowAction": dynamic(
|
|
41
|
+
() => import("../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction"),
|
|
42
|
+
{ ssr: false }
|
|
43
|
+
),
|
|
44
|
+
"GenerateModuleCodeRowAction": dynamic(
|
|
45
|
+
() => import("../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction"),
|
|
46
|
+
{ ssr: false }
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!componentKey) return;
|
|
52
|
+
|
|
53
|
+
if (componentMap[componentKey]) {
|
|
54
|
+
setComponent(() => () => setComponent(() => componentMap[componentKey]));
|
|
55
|
+
} else {
|
|
56
|
+
import(componentPath)
|
|
57
|
+
.then((mod) => setComponent(() => mod.default || mod))
|
|
58
|
+
.catch((err) => {
|
|
59
|
+
console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);
|
|
60
|
+
setComponent(() => () => <FallbackComponent componentName={componentKey} />);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [componentKey]);
|
|
64
|
+
|
|
65
|
+
if (!Component) return <p>Loading...</p>;
|
|
66
|
+
|
|
67
|
+
return <Component context={context} />;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidManyToOneFilterElement.d.ts","sourceRoot":"","sources":["../../../../src/components/core/kanban/SolidManyToOneFilterElement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidManyToOneFilterElement.d.ts","sourceRoot":"","sources":["../../../../src/components/core/kanban/SolidManyToOneFilterElement.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,2BAA2B,kDAAmD,GAAG,4CAmD7F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidManyToOneFilterElement.js","sourceRoot":"","sources":["../../../../src/components/core/kanban/SolidManyToOneFilterElement.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidManyToOneFilterElement.js","sourceRoot":"","sources":["../../../../src/components/core/kanban/SolidManyToOneFilterElement.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAA6B,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,MAAM,CAAC,IAAM,2BAA2B,GAAG,UAAC,EAAkD;QAAhD,KAAK,WAAA,EAAE,YAAY,kBAAA,EAAE,KAAK,WAAA,EAAE,aAAa,mBAAA;IAEnF,IAAM,SAAS,GAAG,oBAAoB,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;IAC1E,IAAA,4BAA4B,GAAK,SAAS,6BAAd,CAAe;IAC5C,IAAA,uBAAuB,GAAI,4BAA4B,EAAE,GAAlC,CAAmC;IAE3D,IAAA,KAA4C,QAAQ,CAAC,EAAE,CAAC,EAAvD,iBAAiB,QAAA,EAAE,oBAAoB,QAAgB,CAAC;IAC/D,IAAM,kBAAkB,GAAG,UAAO,KAAgC;;;;;;;oBAGxD,SAAS,GAAG;wBACd,MAAM,EAAE,CAAC;wBACT,KAAK,EAAE,EAAE;wBACT,OAAO;4BACH,GAAC,MAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,aAAa,0CAAE,YAAY,0CAAE,IAAI,IAAG;gCAChD,UAAU,EAAE,KAAK,CAAC,KAAK;6BAC1B;+BACJ;qBACJ,CAAC;oBAEI,cAAc,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE;wBAC3C,gBAAgB,EAAE,IAAI;qBACzB,CAAC,CAAC;oBAG0B,qBAAM,uBAAuB,CAAC,cAAc,CAAC,EAAA;;oBAApE,oBAAoB,GAAG,SAA6C;oBAGpE,gBAAgB,GAAG,oBAAoB,CAAC,IAAI,CAAC;oBAEnD,IAAI,gBAAgB,EAAE;wBACZ,sBAAoB,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,UAAC,IAAS;;4BAC7D,OAAO;gCACH,KAAK,EAAE,IAAI,CAAC,MAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,aAAa,0CAAE,YAAY,0CAAE,IAAI,CAAC;gCAC7D,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC;6BACpB,CAAA;wBACL,CAAC,CAAC,CAAC;wBACH,oBAAoB,CAAC,mBAAiB,CAAC,CAAC;qBAC3C;;;;SACJ,CAAA;IAED,OAAO,CACH,KAAC,YAAY,IACT,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,iBAAiB,EAC9B,cAAc,EAAE,kBAAkB,EAClC,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAA5B,CAA4B,EAC7C,SAAS,EAAC,6BAA6B,GACzC,CACL,CAAA;AACL,CAAC,CAAA","sourcesContent":["import { createSolidEntityApi } from \"../../../redux/api/solidEntityApi\";\nimport { InputTypes } from \"./SolidVarInputsFilterElement\"\nimport { AutoComplete, AutoCompleteCompleteEvent } from \"primereact/autocomplete\";\nimport { useState } from \"react\";\nimport qs from \"qs\";\n\n\nexport const SolidManyToOneFilterElement = ({ value, updateInputs, index, fieldMetadata }: any) => {\n\n const entityApi = createSolidEntityApi(fieldMetadata.relationCoModelSingularName);\n const { useLazyGetSolidEntitiesQuery } = entityApi;\n const [triggerGetSolidEntities] = useLazyGetSolidEntitiesQuery();\n\n const [autoCompleteItems, setAutoCompleteItems] = useState([]);\n const autoCompleteSearch = async (event: AutoCompleteCompleteEvent) => {\n\n // Get the list view layout & metadata first. \n const queryData = {\n offset: 0,\n limit: 10,\n filters: {\n [fieldMetadata?.relationModel?.userKeyField?.name]: {\n $containsi: event.query\n }\n }\n };\n\n const autocompleteQs = qs.stringify(queryData, {\n encodeValuesOnly: true,\n });\n\n // TODO: do error handling here, possible errors like modelname is incorrect etc...\n const autocompleteResponse = await triggerGetSolidEntities(autocompleteQs);\n\n // TODO: if no data found then can we show no matching \"entities\", where entities can be replaced with the model plural name,\n const autocompleteData = autocompleteResponse.data;\n\n if (autocompleteData) {\n const autoCompleteItems = autocompleteData.records.map((item: any) => {\n return {\n label: item[fieldMetadata?.relationModel?.userKeyField?.name],\n value: item['id']\n }\n });\n setAutoCompleteItems(autoCompleteItems);\n }\n }\n\n return (\n <AutoComplete\n field=\"label\"\n value={value}\n suggestions={autoCompleteItems}\n completeMethod={autoCompleteSearch}\n onChange={(e) => updateInputs(index, e.value)}\n className=\"solid-standard-autocomplete\"\n />\n )\n}"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createSolidEntityApi } from "../../../redux/api/solidEntityApi";
|
|
2
|
+
import { InputTypes } from "./SolidVarInputsFilterElement"
|
|
2
3
|
import { AutoComplete, AutoCompleteCompleteEvent } from "primereact/autocomplete";
|
|
3
4
|
import { useState } from "react";
|
|
4
5
|
import qs from "qs";
|
|
@@ -55,4 +56,4 @@ export const SolidManyToOneFilterElement = ({ value, updateInputs, index, fieldM
|
|
|
55
56
|
className="solid-standard-autocomplete"
|
|
56
57
|
/>
|
|
57
58
|
)
|
|
58
|
-
}
|
|
59
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidMediaMultipleKanbanField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidMediaMultipleKanbanField.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAOvE,QAAA,MAAM,6BAA6B,oGAAqG,2BAA2B,4CA+HlK,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|