@cniot/mdd-editor 0.2.0-beta.43 → 0.2.0-beta.44
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 +4 -0
- package/build/index.cjs.js +15 -15
- package/build/index.es.js +115 -56
- package/package.json +1 -1
- package/src/toolbar.jsx +4 -1
package/build/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
var _a, _b;
|
|
7
|
+
var _a, _b, _c;
|
|
8
8
|
import React$1, { createContext, memo, useEffect, useLayoutEffect, useState, useCallback, useMemo, isValidElement, cloneElement, useContext, useRef, forwardRef, useImperativeHandle } from "react";
|
|
9
9
|
import EventEmitter from "EventEmitter";
|
|
10
10
|
import { Message, Radio, Select as Select$2, Checkbox, Grid, Button, Table, Input as Input$1, formilyReact, Icon, TimePicker2, ConfigProvider, formilyCore, CnForm, Range, Rating, componentMap, Card, Form, Dialog, CnAsyncSelect, Box, Collapse, Balloon, Switch, NumberPicker, CnSwitch, CnTooltip, Tab, CnNumberPicker, CnRadioGroup, CnRadio, CnMessage, CnButton, CnIcon, CnDrawer, CnCard, CnTab, CnTabItem } from "@cainiaofe/cn-ui";
|
|
@@ -1589,7 +1589,7 @@ var defaultConverter = {
|
|
|
1589
1589
|
}
|
|
1590
1590
|
};
|
|
1591
1591
|
function init$1(converter, defaultAttributes) {
|
|
1592
|
-
function set(
|
|
1592
|
+
function set(name2, value, attributes) {
|
|
1593
1593
|
if (typeof document === "undefined") {
|
|
1594
1594
|
return;
|
|
1595
1595
|
}
|
|
@@ -1600,7 +1600,7 @@ function init$1(converter, defaultAttributes) {
|
|
|
1600
1600
|
if (attributes.expires) {
|
|
1601
1601
|
attributes.expires = attributes.expires.toUTCString();
|
|
1602
1602
|
}
|
|
1603
|
-
|
|
1603
|
+
name2 = encodeURIComponent(name2).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
1604
1604
|
var stringifiedAttributes = "";
|
|
1605
1605
|
for (var attributeName in attributes) {
|
|
1606
1606
|
if (!attributes[attributeName]) {
|
|
@@ -1612,10 +1612,10 @@ function init$1(converter, defaultAttributes) {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
1614
1614
|
}
|
|
1615
|
-
return document.cookie =
|
|
1615
|
+
return document.cookie = name2 + "=" + converter.write(value, name2) + stringifiedAttributes;
|
|
1616
1616
|
}
|
|
1617
|
-
function get2(
|
|
1618
|
-
if (typeof document === "undefined" || arguments.length && !
|
|
1617
|
+
function get2(name2) {
|
|
1618
|
+
if (typeof document === "undefined" || arguments.length && !name2) {
|
|
1619
1619
|
return;
|
|
1620
1620
|
}
|
|
1621
1621
|
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
@@ -1626,21 +1626,21 @@ function init$1(converter, defaultAttributes) {
|
|
|
1626
1626
|
try {
|
|
1627
1627
|
var found = decodeURIComponent(parts[0]);
|
|
1628
1628
|
jar[found] = converter.read(value, found);
|
|
1629
|
-
if (
|
|
1629
|
+
if (name2 === found) {
|
|
1630
1630
|
break;
|
|
1631
1631
|
}
|
|
1632
1632
|
} catch (e) {
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
|
-
return
|
|
1635
|
+
return name2 ? jar[name2] : jar;
|
|
1636
1636
|
}
|
|
1637
1637
|
return Object.create(
|
|
1638
1638
|
{
|
|
1639
1639
|
set,
|
|
1640
1640
|
get: get2,
|
|
1641
|
-
remove: function(
|
|
1641
|
+
remove: function(name2, attributes) {
|
|
1642
1642
|
set(
|
|
1643
|
-
|
|
1643
|
+
name2,
|
|
1644
1644
|
"",
|
|
1645
1645
|
assign({}, attributes, {
|
|
1646
1646
|
expires: -1
|
|
@@ -2130,11 +2130,11 @@ const disabled = (key) => {
|
|
|
2130
2130
|
const Default_Column_Type = "text";
|
|
2131
2131
|
const Default_Edit_Column_Type = "edit-input";
|
|
2132
2132
|
const buildCompProps = (key, obj, buildType, templateType) => {
|
|
2133
|
-
const { title: title2, description, required, nullable, type, items, enum: enumVal, format, properties, ...more2 } = obj;
|
|
2133
|
+
const { title: title2, description: description2, required, nullable, type, items, enum: enumVal, format, properties, ...more2 } = obj;
|
|
2134
2134
|
if (REMOVE_FIELDS_NAME.includes(key)) {
|
|
2135
2135
|
return null;
|
|
2136
2136
|
}
|
|
2137
|
-
const label = title2 ||
|
|
2137
|
+
const label = title2 || description2 || key;
|
|
2138
2138
|
const isReq = buildType === "parameters";
|
|
2139
2139
|
let result = null;
|
|
2140
2140
|
if (isReq) {
|
|
@@ -2297,7 +2297,7 @@ const getFlatFieldsFormInitRetPath = (swaggerParams, initRetPath) => {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
};
|
|
2299
2299
|
const buildFtpFieldsToCompJson = (swaggerParams, type = "parameters", initRetPath, templateType) => {
|
|
2300
|
-
var _a2, _b2,
|
|
2300
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
2301
2301
|
if (!swaggerParams) {
|
|
2302
2302
|
throw Error("mdd-tool core complier error: swaggerParams is null");
|
|
2303
2303
|
}
|
|
@@ -2309,7 +2309,7 @@ const buildFtpFieldsToCompJson = (swaggerParams, type = "parameters", initRetPat
|
|
|
2309
2309
|
}
|
|
2310
2310
|
} else if (!Array.isArray(swaggerParams) && type === "responses") {
|
|
2311
2311
|
let resData = ((_a2 = swaggerParams == null ? void 0 : swaggerParams.properties) == null ? void 0 : _a2.data) || ((_b2 = swaggerParams == null ? void 0 : swaggerParams.properties) == null ? void 0 : _b2.module);
|
|
2312
|
-
if (!((
|
|
2312
|
+
if (!((_c2 = swaggerParams == null ? void 0 : swaggerParams.properties) == null ? void 0 : _c2.success)) {
|
|
2313
2313
|
resData = swaggerParams;
|
|
2314
2314
|
}
|
|
2315
2315
|
if ((resData == null ? void 0 : resData.type) === "array") {
|
|
@@ -2328,12 +2328,12 @@ const buildFtpFieldsToCompJson = (swaggerParams, type = "parameters", initRetPat
|
|
|
2328
2328
|
}
|
|
2329
2329
|
const result = [];
|
|
2330
2330
|
swaggerFields.forEach((param) => {
|
|
2331
|
-
const { name, schema } = param;
|
|
2331
|
+
const { name: name2, schema } = param;
|
|
2332
2332
|
if (schema) {
|
|
2333
2333
|
const objInfo = schema.properties || schema;
|
|
2334
2334
|
buildFieldsAndColumns(objInfo, result, type, [], templateType);
|
|
2335
2335
|
} else {
|
|
2336
|
-
result.push(buildCompProps(
|
|
2336
|
+
result.push(buildCompProps(name2, param, type, templateType));
|
|
2337
2337
|
}
|
|
2338
2338
|
});
|
|
2339
2339
|
return result.filter(Boolean);
|
|
@@ -2359,12 +2359,12 @@ const buildDetailFieldsToCompJson = (responses, type, initRetPath, templateType)
|
|
|
2359
2359
|
}
|
|
2360
2360
|
const result = [];
|
|
2361
2361
|
swaggerFields.forEach((param) => {
|
|
2362
|
-
const { name, schema } = param;
|
|
2362
|
+
const { name: name2, schema } = param;
|
|
2363
2363
|
if (schema) {
|
|
2364
2364
|
const objInfo = schema.properties || schema;
|
|
2365
2365
|
buildFieldsAndColumns(objInfo, result, type, [], templateType);
|
|
2366
2366
|
} else {
|
|
2367
|
-
result.push(buildCompProps(
|
|
2367
|
+
result.push(buildCompProps(name2, param, type, templateType));
|
|
2368
2368
|
}
|
|
2369
2369
|
});
|
|
2370
2370
|
return result.filter(Boolean);
|
|
@@ -2646,9 +2646,9 @@ const getLocalProjectSwaggerOpts = () => {
|
|
|
2646
2646
|
url: IdeaSwaggerListHost,
|
|
2647
2647
|
method: "GET"
|
|
2648
2648
|
}).then((res) => {
|
|
2649
|
-
var _a2, _b2,
|
|
2649
|
+
var _a2, _b2, _c2;
|
|
2650
2650
|
if (((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.success) === true && Array.isArray((_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.data)) {
|
|
2651
|
-
const realOpts = (
|
|
2651
|
+
const realOpts = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.data.map((item) => {
|
|
2652
2652
|
const realUrl = IdeaSwaggerHost + item;
|
|
2653
2653
|
return {
|
|
2654
2654
|
value: realUrl,
|
|
@@ -7827,9 +7827,9 @@ function Oe({ original: e, modified: r, language: n2, originalLanguage: t, modif
|
|
|
7827
7827
|
!T && !M && U();
|
|
7828
7828
|
}, [T, M, U]);
|
|
7829
7829
|
function I() {
|
|
7830
|
-
var _a2, _b2,
|
|
7830
|
+
var _a2, _b2, _c2, _d;
|
|
7831
7831
|
let i = (_a2 = u.current) == null ? void 0 : _a2.getModel();
|
|
7832
|
-
g2 || ((_b2 = i == null ? void 0 : i.original) == null ? void 0 : _b2.dispose()), N || ((
|
|
7832
|
+
g2 || ((_b2 = i == null ? void 0 : i.original) == null ? void 0 : _b2.dispose()), N || ((_c2 = i == null ? void 0 : i.modified) == null ? void 0 : _c2.dispose()), (_d = u.current) == null ? void 0 : _d.dispose();
|
|
7833
7833
|
}
|
|
7834
7834
|
return React$1.createElement(H, { width: z, height: V, isEditorReady: M, loading: P, _ref: w, className: F, wrapperProps: j });
|
|
7835
7835
|
}
|
|
@@ -7849,9 +7849,9 @@ function Ve({ defaultValue: e, defaultLanguage: r, defaultPath: n2, value: t, la
|
|
|
7849
7849
|
let p2 = loader.init();
|
|
7850
7850
|
return p2.then((R) => (d.current = R) && w(false)).catch((R) => (R == null ? void 0 : R.type) !== "cancelation" && console.error("Monaco initialization: error:", R)), () => o.current ? pe() : p2.cancel();
|
|
7851
7851
|
}), l(() => {
|
|
7852
|
-
var _a2, _b2,
|
|
7852
|
+
var _a2, _b2, _c2, _d;
|
|
7853
7853
|
let p2 = h(d.current, e || t || "", r || a || "", m2 || n2 || "");
|
|
7854
|
-
p2 !== ((_a2 = o.current) == null ? void 0 : _a2.getModel()) && (y && _.set(f2, (_b2 = o.current) == null ? void 0 : _b2.saveViewState()), (
|
|
7854
|
+
p2 !== ((_a2 = o.current) == null ? void 0 : _a2.getModel()) && (y && _.set(f2, (_b2 = o.current) == null ? void 0 : _b2.saveViewState()), (_c2 = o.current) == null ? void 0 : _c2.setModel(p2), y && ((_d = o.current) == null ? void 0 : _d.restoreViewState(_.get(m2))));
|
|
7855
7855
|
}, [m2], s), l(() => {
|
|
7856
7856
|
var _a2;
|
|
7857
7857
|
(_a2 = o.current) == null ? void 0 : _a2.updateOptions(x);
|
|
@@ -8017,15 +8017,15 @@ var Container = function() {
|
|
|
8017
8017
|
Container2.prototype.notify = function() {
|
|
8018
8018
|
var e_1, _a2;
|
|
8019
8019
|
try {
|
|
8020
|
-
for (var _b2 = __values$1(this.subscribers),
|
|
8021
|
-
var subscriber =
|
|
8020
|
+
for (var _b2 = __values$1(this.subscribers), _c2 = _b2.next(); !_c2.done; _c2 = _b2.next()) {
|
|
8021
|
+
var subscriber = _c2.value;
|
|
8022
8022
|
subscriber(this.data);
|
|
8023
8023
|
}
|
|
8024
8024
|
} catch (e_1_1) {
|
|
8025
8025
|
e_1 = { error: e_1_1 };
|
|
8026
8026
|
} finally {
|
|
8027
8027
|
try {
|
|
8028
|
-
if (
|
|
8028
|
+
if (_c2 && !_c2.done && (_a2 = _b2.return))
|
|
8029
8029
|
_a2.call(_b2);
|
|
8030
8030
|
} finally {
|
|
8031
8031
|
if (e_1)
|
|
@@ -14045,14 +14045,14 @@ class FormilyFormSchema extends Schema {
|
|
|
14045
14045
|
this.willDetach = this.initChangeListener();
|
|
14046
14046
|
}
|
|
14047
14047
|
async initFromSwagger(swaggerInfo) {
|
|
14048
|
-
var _a2, _b2,
|
|
14048
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
14049
14049
|
const url = this.api.getApiUrl();
|
|
14050
14050
|
if (!url)
|
|
14051
14051
|
return;
|
|
14052
14052
|
const apiInfo = buildSwaggerApiJson(url, swaggerInfo);
|
|
14053
14053
|
const { parameters } = apiInfo || {};
|
|
14054
14054
|
const formList = formatFieldsJson(buildFieldsToCompJson(parameters) || []);
|
|
14055
|
-
const metadataId = (_f = (_e = (_d = (
|
|
14055
|
+
const metadataId = (_f = (_e = (_d = (_c2 = (_b2 = (_a2 = buildSwaggerApiJson(url, swaggerInfo)) == null ? void 0 : _a2.parameters) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.schema) == null ? void 0 : _d.properties) == null ? void 0 : _e.metadataId) == null ? void 0 : _f.value;
|
|
14056
14056
|
let finalSchema = list2Schema(formList);
|
|
14057
14057
|
if (metadataId) {
|
|
14058
14058
|
try {
|
|
@@ -16136,14 +16136,14 @@ const FormilyForm = (props) => {
|
|
|
16136
16136
|
readPretty,
|
|
16137
16137
|
validateFirst
|
|
16138
16138
|
};
|
|
16139
|
-
const { name, label, type } = values;
|
|
16139
|
+
const { name: name2, label, type } = values;
|
|
16140
16140
|
const finalForm = useMemo(() => {
|
|
16141
16141
|
return {
|
|
16142
16142
|
createForm: createForm({
|
|
16143
16143
|
effects() {
|
|
16144
16144
|
onFormValuesChange((form2) => {
|
|
16145
16145
|
const getValuesFromForm = form2.getFormState().values;
|
|
16146
|
-
onChange({ record: { ...getValuesFromForm, ...{ name, label, type } } });
|
|
16146
|
+
onChange({ record: { ...getValuesFromForm, ...{ name: name2, label, type } } });
|
|
16147
16147
|
}), (effects == null ? void 0 : effects.onFieldValueChange) && onFieldValueChange(...effects.onFieldValueChange);
|
|
16148
16148
|
},
|
|
16149
16149
|
...CreateFormProps
|
|
@@ -16366,8 +16366,8 @@ function TableFormProxy(props) {
|
|
|
16366
16366
|
setDataSource(list);
|
|
16367
16367
|
onChange(array2Object(list));
|
|
16368
16368
|
},
|
|
16369
|
-
onItemChange: (index2,
|
|
16370
|
-
dataSource[index2][
|
|
16369
|
+
onItemChange: (index2, name2, _value) => {
|
|
16370
|
+
dataSource[index2][name2] = _value;
|
|
16371
16371
|
setDataSource([...dataSource]);
|
|
16372
16372
|
onChange(array2Object(dataSource));
|
|
16373
16373
|
},
|
|
@@ -16680,11 +16680,11 @@ function AjaxFormDialog({ title: title2 = "\u6570\u636E\u6E90\u914D\u7F6E", sche
|
|
|
16680
16680
|
size: "small",
|
|
16681
16681
|
labelAlign: "top",
|
|
16682
16682
|
onChange: (values, item) => {
|
|
16683
|
-
const { name, value } = item;
|
|
16684
|
-
if (
|
|
16685
|
-
schema.set(
|
|
16683
|
+
const { name: name2, value } = item;
|
|
16684
|
+
if (name2 && name2 !== "type") {
|
|
16685
|
+
schema.set(name2, value);
|
|
16686
16686
|
}
|
|
16687
|
-
if (
|
|
16687
|
+
if (name2 === "params.processDefKey") {
|
|
16688
16688
|
setParamFormatKey(Math.random());
|
|
16689
16689
|
}
|
|
16690
16690
|
}
|
|
@@ -23955,7 +23955,7 @@ const fields = {
|
|
|
23955
23955
|
};
|
|
23956
23956
|
const copyFields$1 = cloneDeep_1(fields);
|
|
23957
23957
|
const filterItems = Object.keys(copyFields$1).reduce((result, key) => {
|
|
23958
|
-
var _a2, _b2,
|
|
23958
|
+
var _a2, _b2, _c2;
|
|
23959
23959
|
const field = copyFields$1[key];
|
|
23960
23960
|
if ((_a2 = field == null ? void 0 : field.schema) == null ? void 0 : _a2.properties) {
|
|
23961
23961
|
field.schema.properties = {
|
|
@@ -23963,7 +23963,7 @@ const filterItems = Object.keys(copyFields$1).reduce((result, key) => {
|
|
|
23963
23963
|
...field.schema.properties
|
|
23964
23964
|
};
|
|
23965
23965
|
}
|
|
23966
|
-
if ((
|
|
23966
|
+
if ((_c2 = (_b2 = field == null ? void 0 : field.formilySchema) == null ? void 0 : _b2.schema) == null ? void 0 : _c2.properties) {
|
|
23967
23967
|
field.formilySchema.schema.properties = {
|
|
23968
23968
|
...filterCommon,
|
|
23969
23969
|
...field.formilySchema.schema.properties
|
|
@@ -24558,14 +24558,14 @@ const formItems = Object.keys(copyFields).reduce((result, key) => {
|
|
|
24558
24558
|
};
|
|
24559
24559
|
}, {});
|
|
24560
24560
|
function fillFormSchema(field) {
|
|
24561
|
-
var _a2, _b2,
|
|
24561
|
+
var _a2, _b2, _c2;
|
|
24562
24562
|
if ((_a2 = field == null ? void 0 : field.schema) == null ? void 0 : _a2.properties) {
|
|
24563
24563
|
field.schema.properties = {
|
|
24564
24564
|
...CnFormItem,
|
|
24565
24565
|
...field.schema.properties
|
|
24566
24566
|
};
|
|
24567
24567
|
}
|
|
24568
|
-
if ((
|
|
24568
|
+
if ((_c2 = (_b2 = field == null ? void 0 : field.formilySchema) == null ? void 0 : _b2.schema) == null ? void 0 : _c2.properties) {
|
|
24569
24569
|
field.formilySchema.schema.properties = {
|
|
24570
24570
|
...CnFormItem,
|
|
24571
24571
|
...field.formilySchema.schema.properties
|
|
@@ -24649,10 +24649,10 @@ const TitleRender$2 = (props) => {
|
|
|
24649
24649
|
customRender
|
|
24650
24650
|
} = props;
|
|
24651
24651
|
const [value, setValue] = useState(data);
|
|
24652
|
-
const { label, name, type, groupKey } = value || {};
|
|
24652
|
+
const { label, name: name2, type, groupKey } = value || {};
|
|
24653
24653
|
useEffect(() => {
|
|
24654
24654
|
setValue(data);
|
|
24655
|
-
}, [label,
|
|
24655
|
+
}, [label, name2, type, groupKey, data]);
|
|
24656
24656
|
const [{ isOver }, drop] = useDrop({
|
|
24657
24657
|
accept: DRAG_KEY$2,
|
|
24658
24658
|
collect(monitor) {
|
|
@@ -24729,7 +24729,7 @@ const TitleRender$2 = (props) => {
|
|
|
24729
24729
|
style: { width: "200px" },
|
|
24730
24730
|
size: "small",
|
|
24731
24731
|
dataSource: swaggerFieldDataSource,
|
|
24732
|
-
value:
|
|
24732
|
+
value: name2,
|
|
24733
24733
|
onChange: (v2) => titleChange("name", v2),
|
|
24734
24734
|
placeholder: "\u8BF7\u9009\u62E9\u6216\u8005\u8F93\u5165\u53D8\u91CF\u540D"
|
|
24735
24735
|
}), titleType.includes("groupKey") && /* @__PURE__ */ React$1.createElement("div", {
|
|
@@ -24751,7 +24751,7 @@ const TitleRender$2 = (props) => {
|
|
|
24751
24751
|
const ContentRender$2 = (props) => {
|
|
24752
24752
|
var _a2, _b2;
|
|
24753
24753
|
const { values, effects, onChange, schema, index: index2, extraFieldSchema: extraFieldSchema2, updateForceFLag, listSchema } = props;
|
|
24754
|
-
const { type, label, name } = values;
|
|
24754
|
+
const { type, label, name: name2 } = values;
|
|
24755
24755
|
const { formilySchema: formilySchema2, dataAdaptor: dataAdaptor2 } = schema || {};
|
|
24756
24756
|
const [uuid, setUuid] = useState(uuidv4());
|
|
24757
24757
|
const { dataMap, getModule } = useModule$1();
|
|
@@ -24893,7 +24893,7 @@ function MddTableForm(props, ref) {
|
|
|
24893
24893
|
index: idx,
|
|
24894
24894
|
draggable,
|
|
24895
24895
|
onChange: (record, invokeType) => {
|
|
24896
|
-
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24896
|
+
const { type, name: name2, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24897
24897
|
const newRecord = { ...record, ...otherProps };
|
|
24898
24898
|
onTableFormChange({ index: idx, record: newRecord });
|
|
24899
24899
|
},
|
|
@@ -24915,8 +24915,8 @@ function MddTableForm(props, ref) {
|
|
|
24915
24915
|
effects,
|
|
24916
24916
|
listSchema: dataRef.current,
|
|
24917
24917
|
onChange: ({ record }) => {
|
|
24918
|
-
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24919
|
-
const newRecord = { ...record, label, name, groupKey };
|
|
24918
|
+
const { type, name: name2, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24919
|
+
const newRecord = { ...record, label, name: name2, groupKey };
|
|
24920
24920
|
if (penetrateType) {
|
|
24921
24921
|
newRecord[type] = otherProps[type];
|
|
24922
24922
|
}
|
|
@@ -25487,7 +25487,7 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25487
25487
|
const treeLinkageCheck = schema.get("treeLinkageCheck");
|
|
25488
25488
|
const loadChildrenDataApiPanel = schema.getLoadChildrenDataApiPanel();
|
|
25489
25489
|
const onAddHandle = (key) => {
|
|
25490
|
-
var _a3, _b2,
|
|
25490
|
+
var _a3, _b2, _c2, _d;
|
|
25491
25491
|
switch (key) {
|
|
25492
25492
|
case "bulkActions":
|
|
25493
25493
|
schema.add(
|
|
@@ -25535,7 +25535,7 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25535
25535
|
"actionColumns",
|
|
25536
25536
|
true
|
|
25537
25537
|
);
|
|
25538
|
-
(
|
|
25538
|
+
(_c2 = operateMddFormRef.current) == null ? void 0 : _c2.updateData(schema.get("actionColumns"));
|
|
25539
25539
|
break;
|
|
25540
25540
|
case "rowDoubleClick":
|
|
25541
25541
|
schema.add(
|
|
@@ -25556,14 +25556,14 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25556
25556
|
}
|
|
25557
25557
|
};
|
|
25558
25558
|
const onRemoveHandle = (index2, key) => {
|
|
25559
|
-
var _a3, _b2,
|
|
25559
|
+
var _a3, _b2, _c2, _d;
|
|
25560
25560
|
schema.remove(index2, key, true);
|
|
25561
25561
|
if (key === "bulkActions") {
|
|
25562
25562
|
(_a3 = bulkMddFormRef.current) == null ? void 0 : _a3.updateData(schema.get("bulkActions"));
|
|
25563
25563
|
} else if (key === "columns") {
|
|
25564
25564
|
(_b2 = columnMddFormRef.current) == null ? void 0 : _b2.updateData(schema.get("columns"));
|
|
25565
25565
|
} else if (key === "actionColumns") {
|
|
25566
|
-
(
|
|
25566
|
+
(_c2 = operateMddFormRef.current) == null ? void 0 : _c2.updateData(schema.get("actionColumns"));
|
|
25567
25567
|
} else if (key === "rowDoubleClick") {
|
|
25568
25568
|
(_d = rowDoubleClickRef.current) == null ? void 0 : _d.updateData(schema.get("rowDoubleClick"));
|
|
25569
25569
|
}
|
|
@@ -27073,12 +27073,12 @@ function DetailImageView(props) {
|
|
|
27073
27073
|
wrapperCol: { span: 19 },
|
|
27074
27074
|
size: "small",
|
|
27075
27075
|
onChange: (values, item) => {
|
|
27076
|
-
const { name, value } = item;
|
|
27076
|
+
const { name: name2, value } = item;
|
|
27077
27077
|
let realValue = value;
|
|
27078
|
-
if (["itemWidth", "itemHeight"].includes(
|
|
27078
|
+
if (["itemWidth", "itemHeight"].includes(name2)) {
|
|
27079
27079
|
realValue = Number(value);
|
|
27080
27080
|
}
|
|
27081
|
-
data.set(
|
|
27081
|
+
data.set(name2, realValue);
|
|
27082
27082
|
onChange({ index: idx, record: data });
|
|
27083
27083
|
}
|
|
27084
27084
|
}, /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
@@ -28454,7 +28454,7 @@ function FtpBuild({ schema }) {
|
|
|
28454
28454
|
}))));
|
|
28455
28455
|
}
|
|
28456
28456
|
var index = "";
|
|
28457
|
-
const isDebug = ((_b = (_a = window == null ? void 0 : window.location) == null ? void 0 : _a.search) == null ? void 0 : _b.indexOf("debug")) >= 0;
|
|
28457
|
+
const isDebug = ((_b = (_a = window == null ? void 0 : window.location) == null ? void 0 : _a.search) == null ? void 0 : _b.indexOf("debug")) >= 0 || ((_c = window.localStorage) == null ? void 0 : _c.__l4_location_search_debug__) === "true";
|
|
28458
28458
|
function Toolbar(props) {
|
|
28459
28459
|
const { schema, scriptInfo = { script: "", style: "" }, showScript, scriptTopButtons } = props;
|
|
28460
28460
|
const [fullscreen, setFullscreen] = React$1.useState(false);
|
|
@@ -28934,4 +28934,63 @@ function getDefaultIndexStyle() {
|
|
|
28934
28934
|
// }
|
|
28935
28935
|
`;
|
|
28936
28936
|
}
|
|
28937
|
+
const name = "@cniot/mdd-editor";
|
|
28938
|
+
const version = "0.2.0-beta.44";
|
|
28939
|
+
const description = "\u6A21\u578B\u9A71\u52A8\u7F16\u8F91\u5668";
|
|
28940
|
+
const scripts = {
|
|
28941
|
+
build: "vite build"
|
|
28942
|
+
};
|
|
28943
|
+
const main = "./build/index.es.js";
|
|
28944
|
+
const author = "";
|
|
28945
|
+
const license = "ISC";
|
|
28946
|
+
const dependencies = {
|
|
28947
|
+
"@cainiaofe/cn-ui": "0.12.34",
|
|
28948
|
+
"@cniot/mdd-render-engine": "^0.1.1-beta.12",
|
|
28949
|
+
"@monaco-editor/react": "^4.5.1",
|
|
28950
|
+
EventEmitter: "^1.0.0",
|
|
28951
|
+
ahooks: "^3.2.0",
|
|
28952
|
+
classnames: "^2.3.1",
|
|
28953
|
+
"cn-address-select-pro": "^0.1.5",
|
|
28954
|
+
hox: "^1.1.6",
|
|
28955
|
+
"immutability-helper": "^3.1.1",
|
|
28956
|
+
"js-cookie": "^3.0.5",
|
|
28957
|
+
lodash: "^4.17.21",
|
|
28958
|
+
react: "^17.0.2",
|
|
28959
|
+
"react-dnd": "^16.0.0",
|
|
28960
|
+
"react-dnd-html5-backend": "^16.0.0",
|
|
28961
|
+
"react-dom": "^17.0.2"
|
|
28962
|
+
};
|
|
28963
|
+
const devDependencies = {
|
|
28964
|
+
vite: "^2.9.0"
|
|
28965
|
+
};
|
|
28966
|
+
const peerDependencies = {
|
|
28967
|
+
react: ">=16.0.0",
|
|
28968
|
+
"react-dom": ">=16.0.0",
|
|
28969
|
+
"@cainiaofe/cn-ui": "*",
|
|
28970
|
+
ahooks: "*",
|
|
28971
|
+
classnames: "*",
|
|
28972
|
+
"cn-address-select-pro": "*",
|
|
28973
|
+
lodash: "*",
|
|
28974
|
+
"@monaco-editor/react": "*"
|
|
28975
|
+
};
|
|
28976
|
+
const repository = "git@gitlab.alibaba-inc.com:one-code/mdd.git";
|
|
28977
|
+
var pkg = {
|
|
28978
|
+
name,
|
|
28979
|
+
version,
|
|
28980
|
+
description,
|
|
28981
|
+
scripts,
|
|
28982
|
+
main,
|
|
28983
|
+
author,
|
|
28984
|
+
license,
|
|
28985
|
+
dependencies,
|
|
28986
|
+
devDependencies,
|
|
28987
|
+
peerDependencies,
|
|
28988
|
+
repository
|
|
28989
|
+
};
|
|
28990
|
+
console.log(
|
|
28991
|
+
`%cmdd-editor %c@${pkg.version} %c=====`,
|
|
28992
|
+
"color:#000;font-weight:bold;",
|
|
28993
|
+
"color:green;font-weight:bold;",
|
|
28994
|
+
"color:#000;font-weight:bold;"
|
|
28995
|
+
);
|
|
28937
28996
|
export { DetailBuild, DetailSchema, EVENT_KEY, FtpBuild as EditTableBuild, EditTableSchema, FormBuild, FormilyFormV2Schema, FtpBuild$1 as FtpBuild, FtpSchema, MDD_SCHEMA_LS_KEY, PERSISTENT_STORE_LS_KEY, SWAGGER_DT, SWAGGER_FT, SimpleFtp, api2SchemaFromSwagger, api2SchemaFromSwaggerApiInfo, buildFieldsToCompJson, buildSwaggerApiJson, calcWordWidth, MDDEditor as default, getApiInfo, getDefaultFomrLabelAlign, getDefaultIndexScript, getDefaultIndexStyle, getGlobalSizeFromCookie, getLocalProjectSwaggerOpts, getSwaggerInfoFromJson, upperFirst$1 as upperFirst, useModule$1 as useModule, useSchema$1 as useSchema, useSwagger$1 as useSwagger };
|
package/package.json
CHANGED
package/src/toolbar.jsx
CHANGED
|
@@ -7,7 +7,10 @@ import { EVENT_KEY } from '$src/common/const';
|
|
|
7
7
|
|
|
8
8
|
import './index.less';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// window.localStorage.__l4_location_search_debug__ = true; // 调试使用
|
|
11
|
+
// window.localStorage.__l4_ftp_filter_expand__ = true; // 调试使用
|
|
12
|
+
const isDebug =
|
|
13
|
+
window?.location?.search?.indexOf('debug') >= 0 || window.localStorage?.__l4_location_search_debug__ === 'true';
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
* 顶部操作区
|