bi-sdk-react 0.0.10 → 0.0.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/dist/es/js/bi-sdk.es.js +42 -38
- package/dist/umd/js/bi-sdk.umd.min.js +40 -36
- package/package.json +1 -1
- package/src/components/PageDesigner.tsx +43 -13
- package/src/components/panel/AiPanel.tsx +2 -21
- package/src/components/panel/CascadePanel.tsx +1 -1
- package/src/components/panel/ComponentPanel.tsx +1 -1
- package/src/components/panel/DatasetPanel.tsx +1 -1
- package/src/components/panel/DatasourcePanel.tsx +1 -1
- package/src/components/panel/LayerPanel.tsx +1 -1
- package/src/components/panel/PropertiesPanel.tsx +1 -1
- package/src/components/panel/ScriptPanel.tsx +1 -1
- package/src/components/panel/VariablesPanel.tsx +1 -1
- package/src/components/plugins/@antd/items/HtmlRender.tsx +1 -1
|
@@ -84,7 +84,7 @@ const Container = styled.div`
|
|
|
84
84
|
box-sizing: border-box;
|
|
85
85
|
}
|
|
86
86
|
& > div {
|
|
87
|
-
height: calc(100vh -
|
|
87
|
+
height: calc(100vh - 49px);
|
|
88
88
|
display: flex;
|
|
89
89
|
flex-direction: column;
|
|
90
90
|
}
|
|
@@ -167,6 +167,29 @@ const Container = styled.div`
|
|
|
167
167
|
border-right: solid 2px #1890ff;
|
|
168
168
|
background: linear-gradient(to left, #1890ff1a, #ffffff);
|
|
169
169
|
}
|
|
170
|
+
|
|
171
|
+
.beautified_scrollbar {
|
|
172
|
+
overflow: auto;
|
|
173
|
+
scrollbar-width: none;
|
|
174
|
+
&::-webkit-scrollbar {
|
|
175
|
+
width: 0;
|
|
176
|
+
height: 0;
|
|
177
|
+
}
|
|
178
|
+
&:hover {
|
|
179
|
+
scrollbar-width: thin;
|
|
180
|
+
}
|
|
181
|
+
&:hover::-webkit-scrollbar {
|
|
182
|
+
width: 8px;
|
|
183
|
+
height: 8px;
|
|
184
|
+
}
|
|
185
|
+
&:hover::-webkit-scrollbar-thumb {
|
|
186
|
+
background: var(--ant-color-border);
|
|
187
|
+
border-radius: 4px;
|
|
188
|
+
}
|
|
189
|
+
&:hover::-webkit-scrollbar-track {
|
|
190
|
+
background: transparent;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
170
193
|
`;
|
|
171
194
|
|
|
172
195
|
const ImportModal: React.FC<{
|
|
@@ -181,7 +204,7 @@ const ImportModal: React.FC<{
|
|
|
181
204
|
scripts: [],
|
|
182
205
|
variables: [],
|
|
183
206
|
items: [],
|
|
184
|
-
})
|
|
207
|
+
}),
|
|
185
208
|
);
|
|
186
209
|
return (
|
|
187
210
|
<Modal
|
|
@@ -227,7 +250,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
227
250
|
onSave,
|
|
228
251
|
loading = false,
|
|
229
252
|
},
|
|
230
|
-
ref
|
|
253
|
+
ref,
|
|
231
254
|
) => {
|
|
232
255
|
const pageCanvasRef = useRef<any>(null);
|
|
233
256
|
const datasetPanelRef = useRef<any>(null);
|
|
@@ -253,7 +276,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
253
276
|
const [showLeft, setShowLeft] = useState(true);
|
|
254
277
|
const [showRight, setShowRight] = useState(true);
|
|
255
278
|
const [selectedItem, setSelectedItem] = useState<SchemaItemType | null>(
|
|
256
|
-
null
|
|
279
|
+
null,
|
|
257
280
|
);
|
|
258
281
|
const [schema, setSchema] = useState<PageSchema>({
|
|
259
282
|
info: {},
|
|
@@ -272,11 +295,11 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
272
295
|
}, [showLeft, showRight]);
|
|
273
296
|
const leftStyle = useMemo(
|
|
274
297
|
() => ({ display: showLeft ? "flex" : "none" }),
|
|
275
|
-
[showLeft]
|
|
298
|
+
[showLeft],
|
|
276
299
|
);
|
|
277
300
|
const rightStyle = useMemo(
|
|
278
301
|
() => ({ display: showRight ? "flex" : "none" }),
|
|
279
|
-
[showRight]
|
|
302
|
+
[showRight],
|
|
280
303
|
);
|
|
281
304
|
useDeepCompareEffect(() => {
|
|
282
305
|
if (isReplaying) return;
|
|
@@ -310,7 +333,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
310
333
|
if (Array.isArray(item.children[k])) {
|
|
311
334
|
ensureIds(
|
|
312
335
|
item.children[k],
|
|
313
|
-
Math.random().toString(36).slice(2, 10)
|
|
336
|
+
Math.random().toString(36).slice(2, 10),
|
|
314
337
|
);
|
|
315
338
|
}
|
|
316
339
|
});
|
|
@@ -375,7 +398,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
375
398
|
setSchema(effect.schema);
|
|
376
399
|
} else if (effect.pageItems?.length) {
|
|
377
400
|
const effectItemMap = new Map(
|
|
378
|
-
effect.pageItems.map((item) => [item.id, item])
|
|
401
|
+
effect.pageItems.map((item) => [item.id, item]),
|
|
379
402
|
);
|
|
380
403
|
const cloneSchema = JSON.parse(JSON.stringify(schema));
|
|
381
404
|
const loop = (list: any[] = []) => {
|
|
@@ -640,7 +663,9 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
640
663
|
</Space>
|
|
641
664
|
}
|
|
642
665
|
/>
|
|
643
|
-
<div
|
|
666
|
+
<div
|
|
667
|
+
className={["body beautified_scrollbar", deviceType].join(" ")}
|
|
668
|
+
>
|
|
644
669
|
<div
|
|
645
670
|
style={{
|
|
646
671
|
transform: `scale(${zoom})`,
|
|
@@ -664,9 +689,14 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
664
689
|
width: "calc(100% - 47px)",
|
|
665
690
|
}}
|
|
666
691
|
>
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
692
|
+
<AiPanel
|
|
693
|
+
agentList={agentList}
|
|
694
|
+
onEffect={handleAiEffect}
|
|
695
|
+
style={{
|
|
696
|
+
display:
|
|
697
|
+
rightActiveKey === "ai" && fetch?.ai ? undefined : "none",
|
|
698
|
+
}}
|
|
699
|
+
/>
|
|
670
700
|
{rightActiveKey === "props" && (
|
|
671
701
|
<PropertiesPanel datasourceEnable={datasourceEnable} />
|
|
672
702
|
)}
|
|
@@ -782,7 +812,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
782
812
|
</Drawer>
|
|
783
813
|
</PageProvider>
|
|
784
814
|
);
|
|
785
|
-
}
|
|
815
|
+
},
|
|
786
816
|
);
|
|
787
817
|
|
|
788
818
|
export default PageDesigner;
|
|
@@ -473,26 +473,7 @@ const MessageRoot = styled.div`
|
|
|
473
473
|
flex-direction: column;
|
|
474
474
|
gap: 12px;
|
|
475
475
|
padding-right: 8px;
|
|
476
|
-
|
|
477
|
-
scrollbar-width: none;
|
|
478
|
-
&::-webkit-scrollbar {
|
|
479
|
-
width: 0;
|
|
480
|
-
height: 0;
|
|
481
|
-
}
|
|
482
|
-
&:hover {
|
|
483
|
-
scrollbar-width: thin;
|
|
484
|
-
}
|
|
485
|
-
&:hover::-webkit-scrollbar {
|
|
486
|
-
width: 8px;
|
|
487
|
-
height: 8px;
|
|
488
|
-
}
|
|
489
|
-
&:hover::-webkit-scrollbar-thumb {
|
|
490
|
-
background: var(--ant-color-border);
|
|
491
|
-
border-radius: 4px;
|
|
492
|
-
}
|
|
493
|
-
&:hover::-webkit-scrollbar-track {
|
|
494
|
-
background: transparent;
|
|
495
|
-
}
|
|
476
|
+
|
|
496
477
|
.msg {
|
|
497
478
|
display: flex;
|
|
498
479
|
flex-direction: column;
|
|
@@ -636,7 +617,7 @@ const MessageList = forwardRef<
|
|
|
636
617
|
}));
|
|
637
618
|
|
|
638
619
|
return (
|
|
639
|
-
<MessageRoot className="message-list" ref={ref}>
|
|
620
|
+
<MessageRoot className="message-list beautified_scrollbar" ref={ref}>
|
|
640
621
|
{list.map((msg) => (
|
|
641
622
|
<div className="msg" key={msg.id}>
|
|
642
623
|
<div className="user-message">
|
|
@@ -102,7 +102,7 @@ export const ComponentPanel: React.FC = () => {
|
|
|
102
102
|
return (
|
|
103
103
|
<Root className="component-panel">
|
|
104
104
|
<PaneHeader title="组件库" />
|
|
105
|
-
<div className="body">
|
|
105
|
+
<div className="body beautified_scrollbar">
|
|
106
106
|
{grouped.map((group) => (
|
|
107
107
|
<div className="plugin-group" key={group.group}>
|
|
108
108
|
<div className="group-title">{group.group}</div>
|