@sdata-plugin-adapter/react 0.0.0-alpha.3 → 0.0.0-alpha.5
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/export-IdFffdaq.js +2 -0
- package/dist/export-IdFffdaq.js.map +1 -0
- package/dist/index-BTEOz66V.js +59 -0
- package/dist/index-BTEOz66V.js.map +1 -0
- package/dist/index-CPRh7huJ.js +4586 -0
- package/dist/index-CPRh7huJ.js.map +1 -0
- package/dist/index-D4XI9Up9.js +9 -0
- package/dist/index-D4XI9Up9.js.map +1 -0
- package/dist/index-DOjL63ZZ.js +92 -0
- package/dist/index-DOjL63ZZ.js.map +1 -0
- package/dist/index-DYH8RTH4.js +56 -0
- package/dist/index-DYH8RTH4.js.map +1 -0
- package/dist/index-bwVa5yZu.js +24 -0
- package/dist/index-bwVa5yZu.js.map +1 -0
- package/dist/index-uvW2tp_u.js +71 -0
- package/dist/index-uvW2tp_u.js.map +1 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +18 -5557
- package/dist/index.js.map +1 -1
- package/dist/start-rmMDvB0v.js +704 -0
- package/dist/start-rmMDvB0v.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-D4XI9Up9.js","sources":["../src/common/index.ts"],"sourcesContent":["import type { CommonProps, CreatePluginOptions } from '@sdata-plugin-adapter/types';\nimport { createPlugin, setAttributesDefault } from './start';\n\nexport const start = async <P extends CommonProps, R extends P>(\n options: CreatePluginOptions<P, R>,\n) => {\n const { adapter } = options;\n const setAttributes = async (dom: Element, props: P) => setAttributesDefault(dom, props, adapter);\n createPlugin({ ...options, setAttributes });\n};\n"],"names":["start","options","adapter","createPlugin","dom","props","setAttributesDefault"],"mappings":";AAGO,MAAMA,IAAQ,OACnBC,MACG;AACH,QAAM,EAAE,SAAAC,MAAYD;AAEpB,EAAAE,EAAa,EAAE,GAAGF,GAAS,eADL,OAAOG,GAAcC,MAAaC,EAAqBF,GAAKC,GAAOH,CAAO,GACtD;AAC5C;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { generateUUID as R, setDomAttributes as $ } from "@sdata-plugin-adapter/utils";
|
|
2
|
+
import j from "configJson";
|
|
3
|
+
import { S as B } from "./index-bwVa5yZu.js";
|
|
4
|
+
import "./export-IdFffdaq.js";
|
|
5
|
+
import { c as L } from "./start-rmMDvB0v.js";
|
|
6
|
+
const U = !0, { "online-development-mode": _, "requirement-number": G } = j ?? {}, E = (n) => {
|
|
7
|
+
var I, w;
|
|
8
|
+
const { useEffect: g, useRef: h } = window.React, S = !!(_ != null && _.open), { type: v, formConfig: a, parent: p, component: m, configuration: P, changeConfiguration: y } = n, t = { ...n };
|
|
9
|
+
if (t.formId = a == null ? void 0 : a.id, t.formName = a == null ? void 0 : a.form_name, t.isInChildTable = (p == null ? void 0 : p.componentGroup) === "表格组件", t.componentName = (I = m == null ? void 0 : m.columnStyle) == null ? void 0 : I.title, t.componentId = m == null ? void 0 : m.id, (U || S) && (t.customConfig = P ? JSON.parse(n.configuration) : {}, y && (t.changeCustomConfig = y), v === "query" && (t.customConfig = JSON.parse(((w = n.component) == null ? void 0 : w.customPluginConfig) || "{}"))), v === "query") {
|
|
10
|
+
const { queryProps: r, queryData: i } = n;
|
|
11
|
+
t.onSearch = r.onSearch, t.queryData = r.data, t.componentName = i == null ? void 0 : i.title, t.onSearchChange = (s, c = 0) => {
|
|
12
|
+
r.onChange([
|
|
13
|
+
{
|
|
14
|
+
colId: r.queryConfig.componentId,
|
|
15
|
+
colName: r.data.componentBusinessConfigList[0].businessName,
|
|
16
|
+
value: s,
|
|
17
|
+
type: c
|
|
18
|
+
}
|
|
19
|
+
]);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return t.triggerEvent = (r, i = {}) => {
|
|
23
|
+
var f;
|
|
24
|
+
const { formConfig: s, componentId: c, index: C } = t;
|
|
25
|
+
(f = window == null ? void 0 : window.eventCenter) == null || f.triggerEventNew({
|
|
26
|
+
objectId: s == null ? void 0 : s.id,
|
|
27
|
+
componentId: c,
|
|
28
|
+
type: "report",
|
|
29
|
+
event: r,
|
|
30
|
+
payload: { ...i, childIndex: C }
|
|
31
|
+
});
|
|
32
|
+
}, t.useRegisterComponent = (r) => {
|
|
33
|
+
const { actions: i = {}, eventActionDefinitions: s } = r, {
|
|
34
|
+
instance: c,
|
|
35
|
+
componentId: C,
|
|
36
|
+
customConfig: f,
|
|
37
|
+
component: d,
|
|
38
|
+
isDesign: T = !1,
|
|
39
|
+
child_id: q,
|
|
40
|
+
index: u,
|
|
41
|
+
componentName: x
|
|
42
|
+
} = t, N = Object.keys(i).reduce((e, o) => (o.includes("do_EventCenter_") ? e[o] = i[o] : e[`do_EventCenter_${o}`] = i[o], e), {}), A = (e) => B.includes(e), D = () => {
|
|
43
|
+
var o;
|
|
44
|
+
const e = (c == null ? void 0 : c.parent) || d.parent;
|
|
45
|
+
if (e) {
|
|
46
|
+
const l = {
|
|
47
|
+
id: e == null ? void 0 : e.id,
|
|
48
|
+
name: (o = e == null ? void 0 : e.columnStyle) == null ? void 0 : o.title,
|
|
49
|
+
showType: e == null ? void 0 : e.showType
|
|
50
|
+
};
|
|
51
|
+
return A(l.showType) ? l : void 0;
|
|
52
|
+
}
|
|
53
|
+
}, b = () => x || f.id || G || R(), O = () => {
|
|
54
|
+
var e;
|
|
55
|
+
return (e = d == null ? void 0 : d.parent) == null ? void 0 : e.id;
|
|
56
|
+
};
|
|
57
|
+
let J = d != null && d.parentId && D() && n.type === "set" ? (
|
|
58
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
59
|
+
h({
|
|
60
|
+
Event_Center_getName: b,
|
|
61
|
+
...N,
|
|
62
|
+
Event_Center_getParentId: O
|
|
63
|
+
})
|
|
64
|
+
) : (
|
|
65
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
66
|
+
h({ Event_Center_getName: b, ...N })
|
|
67
|
+
);
|
|
68
|
+
g(() => {
|
|
69
|
+
var o;
|
|
70
|
+
let e = C;
|
|
71
|
+
return T || (typeof u == "string" && u || Number(u) > -1) && (e = `${e}_childtable_${u}`), (o = window.componentCenter) == null || o.register(
|
|
72
|
+
e,
|
|
73
|
+
"comp",
|
|
74
|
+
J.current,
|
|
75
|
+
s
|
|
76
|
+
), () => {
|
|
77
|
+
var l;
|
|
78
|
+
(l = window.componentCenter) == null || l.removeInstance(e);
|
|
79
|
+
};
|
|
80
|
+
}, [n, i, s, q, u]);
|
|
81
|
+
}, t;
|
|
82
|
+
}, H = async (n, g) => {
|
|
83
|
+
$(n, g, E);
|
|
84
|
+
}, Q = async (n) => {
|
|
85
|
+
L({ ...n, setAttributes: H, adapter: M });
|
|
86
|
+
}, M = (n) => E(n);
|
|
87
|
+
export {
|
|
88
|
+
M as adapter,
|
|
89
|
+
H as setAttributes,
|
|
90
|
+
Q as start
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=index-DOjL63ZZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DOjL63ZZ.js","sources":["../src/plugins/report/adapter.ts","../src/plugins/report/index.ts"],"sourcesContent":["import { generateUUID } from '@sdata-plugin-adapter/utils';\r\nimport configJson from 'configJson';\r\nimport type {\r\n UseRegisterComponentParams,\r\n BaseReportProps,\r\n ReportAdapterProps,\r\n ActionsFunction,\r\n EventActionDefinitions,\r\n} from '@sdata-plugin-adapter/types';\r\nimport { SHOW_TYPE_TABLES } from '@/enmu';\r\nimport type { ShowType } from '@/enmu';\r\n\r\nconst isEnvProd = import.meta.env.PROD;\r\n\r\nconst { 'online-development-mode': onlineDevMode, 'requirement-number': requirMNumber } =\r\n configJson ?? {};\r\n\r\nconst adapterProps = (props: BaseReportProps): ReportAdapterProps => {\r\n const { useEffect, useRef } = window.React;\r\n const onlineDevelopmentMode: boolean = !!onlineDevMode?.open;\r\n const { type, formConfig, parent, component, configuration, changeConfiguration } = props;\r\n // 透传给二开的props\r\n const adapterProps = { ...props } as ReportAdapterProps;\r\n\r\n // alias\r\n adapterProps.formId = formConfig?.id;\r\n adapterProps.formName = formConfig?.form_name;\r\n adapterProps.isInChildTable = parent?.componentGroup === '表格组件';\r\n\r\n adapterProps.componentName = component?.columnStyle?.title;\r\n adapterProps.componentId = component?.id;\r\n\r\n /**\r\n * 扩展 props API: 仅限在宿主环境为smdata平台\r\n */\r\n if (isEnvProd || onlineDevelopmentMode) {\r\n adapterProps.customConfig = configuration ? JSON.parse(props.configuration) : {};\r\n // 重命名 changeConfiguration\r\n if (changeConfiguration) {\r\n adapterProps.changeCustomConfig = changeConfiguration;\r\n }\r\n\r\n if (type === 'query') {\r\n adapterProps.customConfig = JSON.parse(props.component?.customPluginConfig || '{}');\r\n }\r\n }\r\n\r\n // type === ‘query’\r\n if (type === 'query') {\r\n const { queryProps, queryData } = props;\r\n adapterProps.onSearch = queryProps.onSearch;\r\n adapterProps.queryData = queryProps.data;\r\n adapterProps.componentName = queryData?.title;\r\n adapterProps.onSearchChange = (value: unknown, type = 0) => {\r\n queryProps.onChange([\r\n {\r\n colId: queryProps.queryConfig.componentId,\r\n colName: queryProps.data.componentBusinessConfigList[0].businessName,\r\n value: value,\r\n type: type,\r\n },\r\n ]);\r\n };\r\n }\r\n /**\r\n * 逻辑控制通信API\r\n * 1、triggerEvent: 用来触发组件事件\r\n * @param {String} eventName 事件名\r\n * @param {Object} payload 事件传参\r\n * @example\r\n * triggerEvent(\"click\",{value:\"123\"})\r\n *\r\n * 2、useRegisterComponent: 用来注册组件的动作和事件\r\n */\r\n adapterProps.triggerEvent = (eventName: string, payload: Record<string, any> = {}) => {\r\n const { formConfig, componentId, index } = adapterProps;\r\n window?.eventCenter?.triggerEventNew({\r\n objectId: formConfig?.id,\r\n componentId: componentId,\r\n type: 'report',\r\n event: eventName,\r\n payload: { ...payload, childIndex: index },\r\n });\r\n };\r\n adapterProps.useRegisterComponent = (params: UseRegisterComponentParams) => {\r\n const { actions = {}, eventActionDefinitions } = params;\r\n const {\r\n instance,\r\n componentId,\r\n customConfig,\r\n component,\r\n isDesign = false,\r\n child_id,\r\n index,\r\n componentName,\r\n } = adapterProps;\r\n\r\n const _actions = Object.keys(actions).reduce((acc, key) => {\r\n if (key.includes('do_EventCenter_')) {\r\n acc[key] = actions[key];\r\n } else {\r\n acc[`do_EventCenter_${key}`] = actions[key];\r\n }\r\n return acc;\r\n }, {} as ActionsFunction);\r\n\r\n const isChildTableComponent = (showType: ShowType): boolean => {\r\n return SHOW_TYPE_TABLES.includes(showType);\r\n };\r\n\r\n const _getParent = () => {\r\n const parent = instance?.parent || component.parent;\r\n if (parent) {\r\n const result = {\r\n id: parent?.id,\r\n name: parent?.columnStyle?.title,\r\n showType: parent?.showType,\r\n };\r\n return isChildTableComponent(result.showType) ? result : undefined;\r\n }\r\n return undefined;\r\n };\r\n\r\n const Event_Center_getName = () => {\r\n return componentName || customConfig.id || requirMNumber || generateUUID();\r\n };\r\n const Event_Center_getParentId = () => component?.parent?.id;\r\n let ref =\r\n component?.parentId && _getParent() && props.type === 'set'\r\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\r\n useRef({\r\n Event_Center_getName,\r\n ..._actions,\r\n Event_Center_getParentId,\r\n })\r\n : // eslint-disable-next-line react-hooks/rules-of-hooks\r\n useRef({ Event_Center_getName, ..._actions });\r\n useEffect(() => {\r\n let initId = componentId;\r\n if (!isDesign) {\r\n if ((typeof index === 'string' && index) || Number(index) > -1) {\r\n initId = `${initId}_childtable_${index}`;\r\n }\r\n }\r\n window.componentCenter?.register(\r\n initId,\r\n 'comp',\r\n ref.current,\r\n eventActionDefinitions as EventActionDefinitions,\r\n );\r\n return () => {\r\n window.componentCenter?.removeInstance(initId);\r\n };\r\n }, [props, actions, eventActionDefinitions, child_id, index]);\r\n };\r\n\r\n return adapterProps as ReportAdapterProps;\r\n};\r\n\r\nexport { adapterProps };\r\n","import { setDomAttributes } from '@sdata-plugin-adapter/utils';\r\nimport { adapterProps } from './adapter';\r\nimport { createPlugin } from '@/common/export';\r\nimport type {\r\n BaseReportProps,\r\n ReportAdapterProps,\r\n SetAttributes,\r\n StartOptions,\r\n} from '@sdata-plugin-adapter/types';\r\n\r\nexport const setAttributes: SetAttributes<BaseReportProps> = async (dom, props) => {\r\n setDomAttributes(dom, props, adapterProps);\r\n};\r\n\r\nexport const start = async (options: StartOptions<ReportAdapterProps>) => {\r\n createPlugin<BaseReportProps, ReportAdapterProps>({ ...options, setAttributes, adapter });\r\n};\r\n\r\nexport const adapter = (props: BaseReportProps) => {\r\n return adapterProps(props);\r\n};\r\n"],"names":["isEnvProd","onlineDevMode","requirMNumber","configJson","adapterProps","props","useEffect","useRef","onlineDevelopmentMode","type","formConfig","parent","component","configuration","changeConfiguration","_a","_b","queryProps","queryData","value","eventName","payload","componentId","index","params","actions","eventActionDefinitions","instance","customConfig","isDesign","child_id","componentName","_actions","acc","key","isChildTableComponent","showType","SHOW_TYPE_TABLES","_getParent","result","Event_Center_getName","generateUUID","Event_Center_getParentId","ref","initId","setAttributes","dom","setDomAttributes","start","options","createPlugin","adapter"],"mappings":";;;;;AAYA,MAAMA,IAAY,IAEZ,EAAE,2BAA2BC,GAAe,sBAAsBC,EAAA,IACtEC,KAAc,CAAA,GAEVC,IAAe,CAACC,MAA+C;;AACnE,QAAM,EAAE,WAAAC,GAAW,QAAAC,EAAA,IAAW,OAAO,OAC/BC,IAAiC,CAAC,EAACP,KAAA,QAAAA,EAAe,OAClD,EAAE,MAAAQ,GAAM,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,eAAAC,GAAe,qBAAAC,MAAwBT,GAE9ED,IAAe,EAAE,GAAGC,EAAA;AA0B1B,MAvBAD,EAAa,SAASM,KAAA,gBAAAA,EAAY,IAClCN,EAAa,WAAWM,KAAA,gBAAAA,EAAY,WACpCN,EAAa,kBAAiBO,KAAA,gBAAAA,EAAQ,oBAAmB,QAEzDP,EAAa,iBAAgBW,IAAAH,KAAA,gBAAAA,EAAW,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CAAK,IAAI,QAC1DqB,IAAS,GAAGA,CAAM,eAAerB,CAAK,MAG1CR,IAAA,OAAO,oBAAP,QAAAA,EAAwB;AAAA,QACtB6B;AAAA,QACA;AAAA,QACAD,EAAI;AAAA,QACJjB;AAAA,SAEK,MAAM;;AACX,SAAAX,IAAA,OAAO,oBAAP,QAAAA,EAAwB,eAAe6B;AAAA,MACzC;AAAA,IACF,GAAG,CAACvC,GAAOoB,GAASC,GAAwBI,GAAUP,CAAK,CAAC;AAAA,EAC9D,GAEOnB;AACT,GCnJayC,IAAgD,OAAOC,GAAKzC,MAAU;AACjF,EAAA0C,EAAiBD,GAAKzC,GAAOD,CAAY;AAC3C,GAEa4C,IAAQ,OAAOC,MAA8C;AACxE,EAAAC,EAAkD,EAAE,GAAGD,GAAS,eAAAJ,GAAe,SAAAM,GAAS;AAC1F,GAEaA,IAAU,CAAC9C,MACfD,EAAaC,CAAK;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { generateUUID as h, setDomAttributes as D } from "@sdata-plugin-adapter/utils";
|
|
2
|
+
import N from "configJson";
|
|
3
|
+
import { D as d } from "./index-bwVa5yZu.js";
|
|
4
|
+
import "./export-IdFffdaq.js";
|
|
5
|
+
import { c as P } from "./start-rmMDvB0v.js";
|
|
6
|
+
const A = !0, { "online-development-mode": C, "requirement-number": J } = N ?? {}, y = (e) => {
|
|
7
|
+
const { useEffect: p, useRef: l } = window.React, E = !!(C != null && C.open), { isConfig: w, customConfig: m, configType: g, onConfigChange: I, appTriggerEvent: f } = e, n = { ...e }, o = n.componentId = m.componentId;
|
|
8
|
+
return (A || E) && (w && (n.changeCustomConfig = (t) => {
|
|
9
|
+
if (typeof t == "string")
|
|
10
|
+
try {
|
|
11
|
+
t = JSON.parse(t);
|
|
12
|
+
} catch (r) {
|
|
13
|
+
throw new Error(`changeCustomConfig 时 customConfig JSON.parse失败 ${r}`);
|
|
14
|
+
}
|
|
15
|
+
I(t);
|
|
16
|
+
}), g ? d[g] ? n.type = d[g] : n.type = d.default : n.type = w ? "designConfiguration" : "main"), n.triggerEvent = (t, r = {}) => {
|
|
17
|
+
var s, c;
|
|
18
|
+
typeof f == "function" ? f == null || f({
|
|
19
|
+
componentId: o,
|
|
20
|
+
event: t,
|
|
21
|
+
payload: r
|
|
22
|
+
}) : o && ((c = (s = window.eventCenter) == null ? void 0 : s.triggerEventNew) == null || c.call(s, {
|
|
23
|
+
objectId: m == null ? void 0 : m.appId,
|
|
24
|
+
componentId: o,
|
|
25
|
+
type: "app",
|
|
26
|
+
event: t,
|
|
27
|
+
payload: r
|
|
28
|
+
}));
|
|
29
|
+
}, n.useRegisterComponent = (t) => {
|
|
30
|
+
const { actions: r = {}, eventActionDefinitions: s } = t, { customConfig: c } = e, _ = Object.keys(r).reduce((i, a) => (i[`do_EventCenter_${a}`] = r[a], i), {}) || {};
|
|
31
|
+
let b = l({ Event_Center_getName: () => c.id || J || h(), ..._ });
|
|
32
|
+
p(() => {
|
|
33
|
+
var i, a;
|
|
34
|
+
return o && ((a = (i = window.componentCenter) == null ? void 0 : i.register) == null || a.call(
|
|
35
|
+
i,
|
|
36
|
+
o,
|
|
37
|
+
"comp",
|
|
38
|
+
b.current,
|
|
39
|
+
s ?? {}
|
|
40
|
+
)), () => {
|
|
41
|
+
var u, v;
|
|
42
|
+
o && ((v = (u = window.componentCenter) == null ? void 0 : u.removeInstance) == null || v.call(u, o));
|
|
43
|
+
};
|
|
44
|
+
}, [o, c, r, s]);
|
|
45
|
+
}, n;
|
|
46
|
+
}, O = async (e, p) => {
|
|
47
|
+
D(e, p, y);
|
|
48
|
+
}, x = async (e) => {
|
|
49
|
+
P({ ...e, setAttributes: O, adapter: R });
|
|
50
|
+
}, R = (e) => y(e);
|
|
51
|
+
export {
|
|
52
|
+
R as adapter,
|
|
53
|
+
O as setAttributes,
|
|
54
|
+
x as start
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=index-DYH8RTH4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DYH8RTH4.js","sources":["../src/plugins/app/adapter.ts","../src/plugins/app/index.ts"],"sourcesContent":["import { generateUUID } from '@sdata-plugin-adapter/utils';\r\nimport configJson from 'configJson';\r\nimport type {\r\n UseRegisterComponentParams,\r\n BaseAppProps,\r\n AppAdapterProps,\r\n CustomConfig,\r\n ActionsFunction,\r\n EventActionDefinitions,\r\n} from '@sdata-plugin-adapter/types';\r\nimport { DesignConfigurationMap } from '@/enmu';\r\n\r\nconst isEnvProd = import.meta.env.PROD;\r\n\r\nconst { 'online-development-mode': onlineDevMode, 'requirement-number': requirMNumber } =\r\n configJson ?? {};\r\n\r\nconst adapterProps = (props: BaseAppProps): AppAdapterProps => {\r\n const { useEffect, useRef } = window.React;\r\n const onlineDevelopmentMode: boolean = !!onlineDevMode?.open;\r\n const { isConfig, customConfig, configType, onConfigChange, appTriggerEvent } = props;\r\n // 透传给二开的props\r\n const adapterProps = { ...props } as AppAdapterProps;\r\n /**\r\n * 扩展 props API: 仅限在宿主环境为smdata平台\r\n */\r\n const componentId = (adapterProps.componentId = customConfig.componentId as string);\r\n if (isEnvProd || onlineDevelopmentMode) {\r\n if (isConfig) {\r\n // 配置态下 配置项扩展API\r\n adapterProps.changeCustomConfig = (cmptConfig: string | CustomConfig) => {\r\n if (typeof cmptConfig === 'string') {\r\n try {\r\n cmptConfig = JSON.parse(cmptConfig);\r\n } catch (e) {\r\n throw new Error(`changeCustomConfig 时 customConfig JSON.parse失败 ${e}`);\r\n }\r\n }\r\n onConfigChange(cmptConfig as CustomConfig);\r\n };\r\n }\r\n\r\n // 渲染不同的二开配置类型\r\n if (configType) {\r\n if (DesignConfigurationMap[configType]) {\r\n adapterProps.type = DesignConfigurationMap[configType];\r\n } else {\r\n adapterProps.type = DesignConfigurationMap.default;\r\n }\r\n } else {\r\n adapterProps.type = isConfig ? 'designConfiguration' : 'main';\r\n }\r\n /**\r\n * 封装smardaten触发事件的方法\r\n * @param {String} eventName 事件名\r\n * @param {Object} payload 事件传参\r\n * @example\r\n * triggerEvent(\"click\",{value:\"123\"})\r\n *\r\n */\r\n }\r\n /**\r\n * 逻辑控制通信API\r\n * 1、triggerEvent: 用来触发组件事件\r\n * @param {String} eventName 事件名\r\n * @param {Object} payload 事件传参\r\n * @example\r\n * triggerEvent(\"click\",{value:\"123\"})\r\n *\r\n * 2、useRegisterComponent: 用来注册组件的动作和事件\r\n */\r\n adapterProps.triggerEvent = (eventName: string, payload: Record<string, any> = {}) => {\r\n if (typeof appTriggerEvent === 'function') {\r\n appTriggerEvent?.({\r\n componentId: componentId,\r\n event: eventName,\r\n payload,\r\n });\r\n } else {\r\n componentId &&\r\n window.eventCenter?.triggerEventNew?.({\r\n objectId: customConfig?.appId,\r\n componentId: componentId,\r\n type: 'app',\r\n event: eventName,\r\n payload,\r\n });\r\n }\r\n };\r\n adapterProps.useRegisterComponent = (params: UseRegisterComponentParams) => {\r\n const { actions = {}, eventActionDefinitions } = params;\r\n const { customConfig } = props;\r\n\r\n const _actions =\r\n Object.keys(actions).reduce((acc, key: string) => {\r\n acc[`do_EventCenter_${key}`] = actions[key];\r\n return acc;\r\n }, {} as ActionsFunction) || {};\r\n\r\n const Event_Center_getName = () => {\r\n return customConfig.id || requirMNumber || generateUUID();\r\n };\r\n let ref = useRef({ Event_Center_getName, ..._actions });\r\n useEffect(() => {\r\n componentId &&\r\n window.componentCenter?.register?.(\r\n componentId,\r\n 'comp',\r\n ref.current,\r\n eventActionDefinitions ?? ({} as EventActionDefinitions),\r\n );\r\n return () => {\r\n componentId && window.componentCenter?.removeInstance?.(componentId);\r\n };\r\n }, [componentId, customConfig, actions, eventActionDefinitions]);\r\n };\r\n\r\n // return\r\n return adapterProps as AppAdapterProps;\r\n};\r\n\r\nexport { adapterProps };\r\n","import { setDomAttributes } from '@sdata-plugin-adapter/utils';\r\nimport { adapterProps } from './adapter';\r\nimport { createPlugin } from '@/common/export';\r\nimport type {\r\n AppAdapterProps,\r\n BaseAppProps,\r\n SetAttributes,\r\n StartOptions,\r\n} from '@sdata-plugin-adapter/types';\r\n\r\nexport const setAttributes: SetAttributes<BaseAppProps> = async (dom, props) => {\r\n setDomAttributes(dom, props, adapterProps);\r\n};\r\n\r\nexport const start = async (options: StartOptions<AppAdapterProps>) => {\r\n createPlugin<BaseAppProps, AppAdapterProps>({ ...options, setAttributes, adapter });\r\n};\r\n\r\nexport const adapter = (props: BaseAppProps): AppAdapterProps => {\r\n return adapterProps(props);\r\n};\r\n"],"names":["isEnvProd","onlineDevMode","requirMNumber","configJson","adapterProps","props","useEffect","useRef","onlineDevelopmentMode","isConfig","customConfig","configType","onConfigChange","appTriggerEvent","componentId","cmptConfig","e","DesignConfigurationMap","eventName","payload","_b","_a","params","actions","eventActionDefinitions","_actions","acc","key","ref","generateUUID","setAttributes","dom","setDomAttributes","start","options","createPlugin","adapter"],"mappings":";;;;;AAYA,MAAMA,IAAY,IAEZ,EAAE,2BAA2BC,GAAe,sBAAsBC,EAAA,IACtEC,KAAc,CAAA,GAEVC,IAAe,CAACC,MAAyC;AAC7D,QAAM,EAAE,WAAAC,GAAW,QAAAC,EAAA,IAAW,OAAO,OAC/BC,IAAiC,CAAC,EAACP,KAAA,QAAAA,EAAe,OAClD,EAAE,UAAAQ,GAAU,cAAAC,GAAc,YAAAC,GAAY,gBAAAC,GAAgB,iBAAAC,MAAoBR,GAE1ED,IAAe,EAAE,GAAGC,EAAA,GAIpBS,IAAeV,EAAa,cAAcM,EAAa;AAC7D,UAAIV,KAAaQ,OACXC,MAEFL,EAAa,qBAAqB,CAACW,MAAsC;AACvE,QAAI,OAAOA,KAAe;AACxB,UAAI;AACF,QAAAA,IAAa,KAAK,MAAMA,CAAU;AAAA,MACpC,SAASC,GAAG;AACV,cAAM,IAAI,MAAM,kDAAkDA,CAAC,EAAE;AAAA,MACvE;AAEF,IAAAJ,EAAeG,CAA0B;AAAA,EAC3C,IAIEJ,IACEM,EAAuBN,CAAU,IACnCP,EAAa,OAAOa,EAAuBN,CA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AAAA,EACjE,GAGOpB;AACT,GC7Ga0B,IAA6C,OAAOC,GAAK1B,MAAU;AAC9E,EAAA2B,EAAiBD,GAAK1B,GAAOD,CAAY;AAC3C,GAEa6B,IAAQ,OAAOC,MAA2C;AACrE,EAAAC,EAA4C,EAAE,GAAGD,GAAS,eAAAJ,GAAe,SAAAM,GAAS;AACpF,GAEaA,IAAU,CAAC/B,MACfD,EAAaC,CAAK;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
default: "designConfiguration",
|
|
3
|
+
data: "designConfigurationForData",
|
|
4
|
+
style: "designConfigurationForStyle",
|
|
5
|
+
interaction: "designConfigurationForInteraction"
|
|
6
|
+
}, t = [
|
|
7
|
+
"childtable",
|
|
8
|
+
// 普通子表
|
|
9
|
+
"controlled_child_table",
|
|
10
|
+
// 受控子表
|
|
11
|
+
"pop_up_copy_child_table",
|
|
12
|
+
// 弹窗复制子表
|
|
13
|
+
"pop_up_selection_child_table",
|
|
14
|
+
// 弹窗选择子表
|
|
15
|
+
"correlation_child_table",
|
|
16
|
+
// 弹窗编辑子表
|
|
17
|
+
"loop_table"
|
|
18
|
+
// 弹窗编辑子表
|
|
19
|
+
];
|
|
20
|
+
export {
|
|
21
|
+
o as D,
|
|
22
|
+
t as S
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index-bwVa5yZu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-bwVa5yZu.js","sources":["../src/enmu/index.ts"],"sourcesContent":["// 枚举 app\nexport const DesignConfigurationMap = {\n default: 'designConfiguration',\n data: 'designConfigurationForData',\n style: 'designConfigurationForStyle',\n interaction: 'designConfigurationForInteraction',\n} as const;\n\n// 枚举 report\nexport const SHOW_TYPE_TABLES = [\n 'childtable', // 普通子表\n 'controlled_child_table', // 受控子表\n 'pop_up_copy_child_table', // 弹窗复制子表\n 'pop_up_selection_child_table', // 弹窗选择子表\n 'correlation_child_table', // 弹窗编辑子表\n 'loop_table', // 弹窗编辑子表\n] as const;\n\nexport type ShowType = (typeof SHOW_TYPE_TABLES)[number];\n"],"names":["DesignConfigurationMap","SHOW_TYPE_TABLES"],"mappings":"AACO,MAAMA,IAAyB;AAAA,EACpC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AACf,GAGaC,IAAmB;AAAA,EAC9B;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { generateUUID as E, setDomAttributes as z } from "@sdata-plugin-adapter/utils";
|
|
2
|
+
import N from "configJson";
|
|
3
|
+
import "./export-IdFffdaq.js";
|
|
4
|
+
import { c as J } from "./start-rmMDvB0v.js";
|
|
5
|
+
const O = !0, { "online-development-mode": g, "requirement-number": S } = N ?? {}, _ = (t) => {
|
|
6
|
+
const { useEffect: f, useRef: l } = window.React, y = !!(g != null && g.open), { type: d, componentId: i, options: a, configuration: s, changeConfiguration: C } = t, r = { ...t };
|
|
7
|
+
if (O || y) {
|
|
8
|
+
if (r.type = d || "main", d === "designConfiguration") {
|
|
9
|
+
let n = s == null ? void 0 : s.analyzer_secondary_configuration;
|
|
10
|
+
n || (n = "{}");
|
|
11
|
+
try {
|
|
12
|
+
const e = JSON.parse(n);
|
|
13
|
+
r.customConfig = e;
|
|
14
|
+
} catch {
|
|
15
|
+
throw new Error(
|
|
16
|
+
"analyzer类型,JSON.parse解析失败,analyzer_secondary_configuration不是JSON字符串"
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
r.changeCustomConfig = (e) => {
|
|
20
|
+
s.analyzer_secondary_configuration = e, C(s);
|
|
21
|
+
};
|
|
22
|
+
} else {
|
|
23
|
+
let n = a == null ? void 0 : a.analyzer_secondary_configuration;
|
|
24
|
+
n || (n = "{}");
|
|
25
|
+
try {
|
|
26
|
+
const e = JSON.parse(n);
|
|
27
|
+
r.customConfig = e;
|
|
28
|
+
} catch {
|
|
29
|
+
throw new Error(
|
|
30
|
+
"analyzer类型,JSON.parse解析失败,analyzer_secondary_configuration不是JSON字符串"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
r.customOptions = (a == null ? void 0 : a.externalVariables) || {};
|
|
34
|
+
}
|
|
35
|
+
r.data = t.dataSource || t.data;
|
|
36
|
+
}
|
|
37
|
+
return r.triggerEvent = (n, e = {}) => {
|
|
38
|
+
var u;
|
|
39
|
+
i && ((u = window.eventCenter) == null || u.triggerEvent(
|
|
40
|
+
i,
|
|
41
|
+
n,
|
|
42
|
+
//payload需为一个object
|
|
43
|
+
e
|
|
44
|
+
));
|
|
45
|
+
}, r.useRegisterComponent = (n) => {
|
|
46
|
+
const { actions: e = {}, eventActionDefinitions: u } = n, { customOptions: m, customConfig: p } = r, w = Object.keys(e).reduce((c, o) => (o.includes("do_EventCenter_") ? c[o] = e[o] : c[`do_EventCenter_${o}`] = e[o], c), {});
|
|
47
|
+
let v = l({ Event_Center_getName: () => (m == null ? void 0 : m.id) || S || E(), ...w });
|
|
48
|
+
f(() => {
|
|
49
|
+
var c;
|
|
50
|
+
return (c = window.componentCenter) == null || c.register(
|
|
51
|
+
i,
|
|
52
|
+
"comp",
|
|
53
|
+
v.current,
|
|
54
|
+
u
|
|
55
|
+
), () => {
|
|
56
|
+
var o;
|
|
57
|
+
(o = window.componentCenter) == null || o.removeInstance(i);
|
|
58
|
+
};
|
|
59
|
+
}, [i, p, e, u]);
|
|
60
|
+
}, r;
|
|
61
|
+
}, b = async (t, f) => {
|
|
62
|
+
z(t, f, _);
|
|
63
|
+
}, q = async (t) => {
|
|
64
|
+
J({ ...t, setAttributes: b, adapter: h });
|
|
65
|
+
}, h = (t) => _(t);
|
|
66
|
+
export {
|
|
67
|
+
h as adapter,
|
|
68
|
+
b as setAttributes,
|
|
69
|
+
q as start
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=index-uvW2tp_u.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-uvW2tp_u.js","sources":["../src/plugins/analyzer/adapter.ts","../src/plugins/analyzer/index.ts"],"sourcesContent":["import { generateUUID } from '@sdata-plugin-adapter/utils';\r\nimport configJson from 'configJson';\r\nimport type {\r\n UseRegisterComponentParams,\r\n BaseAnalyzerProps,\r\n AnalyzerAdapterProps,\r\n ActionsFunction,\r\n EventActionDefinitions,\r\n} from '@sdata-plugin-adapter/types';\r\n\r\nconst isEnvProd = import.meta.env.PROD;\r\n\r\nconst { 'online-development-mode': onlineDevMode, 'requirement-number': requirMNumber } =\r\n configJson ?? {};\r\n\r\nconst adapterProps = (props: BaseAnalyzerProps): AnalyzerAdapterProps => {\r\n const { useEffect, useRef } = window.React;\r\n const onlineDevelopmentMode: boolean = !!onlineDevMode?.open;\r\n const { type, componentId, options, configuration, changeConfiguration } = props;\r\n // 透传给二开的props\r\n const adapterProps = { ...props } as AnalyzerAdapterProps;\r\n /**\r\n * 扩展 props API: 仅限在宿主环境为smdata平台\r\n */\r\n if (isEnvProd || onlineDevelopmentMode) {\r\n adapterProps.type = type || 'main';\r\n if (type === 'designConfiguration') {\r\n let analyzer_secondary_configuration = configuration?.analyzer_secondary_configuration;\r\n if (!analyzer_secondary_configuration) {\r\n analyzer_secondary_configuration = '{}';\r\n }\r\n try {\r\n const customConfig = JSON.parse(analyzer_secondary_configuration);\r\n adapterProps.customConfig = customConfig;\r\n } catch (e) {\r\n throw new Error(\r\n 'analyzer类型,JSON.parse解析失败,analyzer_secondary_configuration不是JSON字符串',\r\n );\r\n }\r\n adapterProps.changeCustomConfig = (customConfig) => {\r\n configuration.analyzer_secondary_configuration = customConfig;\r\n changeConfiguration(configuration);\r\n };\r\n } else {\r\n let analyzer_secondary_configuration = options?.analyzer_secondary_configuration;\r\n if (!analyzer_secondary_configuration) {\r\n analyzer_secondary_configuration = '{}';\r\n }\r\n try {\r\n const customConfig = JSON.parse(analyzer_secondary_configuration);\r\n adapterProps.customConfig = customConfig;\r\n } catch (e) {\r\n throw new Error(\r\n 'analyzer类型,JSON.parse解析失败,analyzer_secondary_configuration不是JSON字符串',\r\n );\r\n }\r\n adapterProps.customOptions = options?.externalVariables || {};\r\n }\r\n adapterProps.data = props.dataSource || props.data;\r\n }\r\n\r\n /**\r\n * 逻辑控制通信API\r\n * 1、triggerEvent: 用来触发组件事件\r\n * @param {String} eventName 事件名\r\n * @param {Object} payload 事件传参\r\n * @example\r\n * triggerEvent(\"click\",{value:\"123\"})\r\n *\r\n * 2、useRegisterComponent: 用来注册组件的动作和事件\r\n */\r\n adapterProps.triggerEvent = (eventName: string, payload: Record<string, any> = {}) => {\r\n if (componentId) {\r\n window.eventCenter?.triggerEvent(\r\n componentId,\r\n eventName,\r\n //payload需为一个object\r\n payload,\r\n );\r\n }\r\n };\r\n\r\n adapterProps.useRegisterComponent = (params: UseRegisterComponentParams) => {\r\n const { actions = {}, eventActionDefinitions } = params;\r\n const { customOptions, customConfig } = adapterProps;\r\n\r\n const _actions = Object.keys(actions).reduce((acc, key) => {\r\n if (key.includes('do_EventCenter_')) {\r\n acc[key] = actions[key];\r\n } else {\r\n acc[`do_EventCenter_${key}`] = actions[key];\r\n }\r\n return acc;\r\n }, {} as ActionsFunction);\r\n\r\n const Event_Center_getName = () => {\r\n return customOptions?.id || requirMNumber || generateUUID();\r\n };\r\n let ref = useRef({ Event_Center_getName, ..._actions });\r\n useEffect(() => {\r\n window.componentCenter?.register(\r\n componentId,\r\n 'comp',\r\n ref.current,\r\n eventActionDefinitions as EventActionDefinitions,\r\n );\r\n return () => {\r\n window.componentCenter?.removeInstance(componentId);\r\n };\r\n }, [componentId, customConfig, actions, eventActionDefinitions]);\r\n };\r\n\r\n // return\r\n return adapterProps;\r\n};\r\n\r\nexport { adapterProps };\r\n","import { setDomAttributes } from '@sdata-plugin-adapter/utils';\r\nimport { adapterProps } from './adapter';\r\nimport { createPlugin } from '@/common/export';\r\nimport type {\r\n AnalyzerAdapterProps,\r\n BaseAnalyzerProps,\r\n SetAttributes,\r\n StartOptions,\r\n} from '@sdata-plugin-adapter/types';\r\n\r\nexport const setAttributes: SetAttributes<BaseAnalyzerProps> = async (dom, props) => {\r\n setDomAttributes(dom, props, adapterProps);\r\n};\r\n\r\nexport const start = async (options: StartOptions<AnalyzerAdapterProps>) => {\r\n createPlugin<BaseAnalyzerProps, AnalyzerAdapterProps>({ ...options, setAttributes, adapter });\r\n};\r\n\r\nexport const adapter = (props: BaseAnalyzerProps): AnalyzerAdapterProps => {\r\n return adapterProps(props);\r\n};\r\n"],"names":["isEnvProd","onlineDevMode","requirMNumber","configJson","adapterProps","props","useEffect","useRef","onlineDevelopmentMode","type","componentId","options","configuration","changeConfiguration","analyzer_secondary_configuration","customConfig","eventName","payload","_a","params","actions","eventActionDefinitions","customOptions","_actions","acc","key","ref","generateUUID","setAttributes","dom","setDomAttributes","start","createPlugin","adapter"],"mappings":";;;;AAUA,MAAMA,IAAY,IAEZ,EAAE,2BAA2BC,GAAe,sBAAsBC,EAAA,IACtEC,KAAc,CAAA,GAEVC,IAAe,CAACC,MAAmD;AACvE,QAAM,EAAE,WAAAC,GAAW,QAAAC,EAAA,IAAW,OAAO,OAC/BC,IAAiC,CAAC,EAACP,KAAA,QAAAA,EAAe,OAClD,EAAE,MAAAQ,GAAM,aAAAC,GAAa,SAAAC,GAAS,eAAAC,GAAe,qBAAAC,MAAwBR,GAErED,IAAe,EAAE,GAAGC,EAAA;AAI1B,MAAIL,KAAaQ,GAAuB;AAEtC,QADAJ,EAAa,OAAOK,KAAQ,QACxBA,MAAS,uBAAuB;AAClC,UAAIK,IAAmCF,KAAA,gBAAAA,EAAe;AACtD,MAAKE,MACHA,IAAmC;AAErC,UAAI;AACF,cAAMC,IAAe,KAAK,MAAMD,CAAgC;AAChEV,QAAAA,EAAa,eAAeW;AAAA,MAC9B,QAAY;AACV,cAAM,IAAI;AAAA,UACR;AAAA,QAAA;AAAA,MAEJ;AACAX,M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L;AAAA,SAEK,MAAM;;AACX,SAAAH,IAAA,OAAO,oBAAP,QAAAA,EAAwB,eAAeR;AAAA,MACzC;AAAA,IACF,GAAG,CAACA,GAAaK,GAAcK,GAASC,CAAsB,CAAC;AAAA,EACjE,GAGOjB;AACT,GCxGawB,IAAkD,OAAOC,GAAKxB,MAAU;AACnF,EAAAyB,EAAiBD,GAAKxB,GAAOD,CAAY;AAC3C,GAEa2B,IAAQ,OAAOpB,MAAgD;AAC1E,EAAAqB,EAAsD,EAAE,GAAGrB,GAAS,eAAAiB,GAAe,SAAAK,GAAS;AAC9F,GAEaA,IAAU,CAAC5B,MACfD,EAAaC,CAAK;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
import { AnalyzerAdapterProps } from '@sdata-plugin-adapter/types';
|
|
2
|
+
import { AppAdapterProps } from '@sdata-plugin-adapter/types';
|
|
3
|
+
import { BScreenAdapterProps } from '@sdata-plugin-adapter/types';
|
|
4
|
+
import { CommonProps } from '@sdata-plugin-adapter/types';
|
|
5
|
+
import { CreatePluginOptions } from '@sdata-plugin-adapter/types';
|
|
6
|
+
import { DFListAdapterProps } from '@sdata-plugin-adapter/types';
|
|
7
|
+
import { ReportAdapterProps } from '@sdata-plugin-adapter/types';
|
|
1
8
|
import { StartOptions } from '@sdata-plugin-adapter/types';
|
|
2
9
|
|
|
3
|
-
export declare const start: (options:
|
|
10
|
+
export declare const start: <P extends CommonProps, R extends P = P>(options: CreatePluginOptions<P, R>) => Promise<void>;
|
|
11
|
+
|
|
12
|
+
export declare const startAnalyzer: (options: StartOptions<AnalyzerAdapterProps>) => Promise<void>;
|
|
13
|
+
|
|
14
|
+
export declare const startApp: (options: StartOptions<AppAdapterProps>) => Promise<void>;
|
|
15
|
+
|
|
16
|
+
export declare const startBScreen: (options: StartOptions<BScreenAdapterProps>) => Promise<void>;
|
|
17
|
+
|
|
18
|
+
export declare const startDFList: (options: StartOptions<DFListAdapterProps>) => Promise<void>;
|
|
19
|
+
|
|
20
|
+
export declare const startReport: (options: StartOptions<ReportAdapterProps>) => Promise<void>;
|
|
4
21
|
|
|
5
22
|
export { }
|