@cniot/mdd-editor 0.2.0-beta.43 → 0.2.0-beta.45
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 +7 -0
- package/build/index.cjs.js +15 -15
- package/build/index.es.js +141 -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
|
|
@@ -24212,6 +24212,19 @@ var cncardSchema = {
|
|
|
24212
24212
|
name: "icon",
|
|
24213
24213
|
"x-designable-id": "hso2ft3bll3"
|
|
24214
24214
|
},
|
|
24215
|
+
cardTitleExtra: {
|
|
24216
|
+
type: "string",
|
|
24217
|
+
title: "\u5361\u7247\u6807\u9898\u989D\u5916\u5185\u5BB9",
|
|
24218
|
+
"x-decorator": "CnFormItem",
|
|
24219
|
+
"x-component": "Input",
|
|
24220
|
+
"x-component-props": {
|
|
24221
|
+
placeholder: "\u4EE5\u81EA\u5B9A\u4E49\u6E32\u67D3\u6A21\u5F0F\u5B9A\u4E49"
|
|
24222
|
+
},
|
|
24223
|
+
"x-decorator-props": {
|
|
24224
|
+
tip: "\u4EE5\u81EA\u5B9A\u4E49\u6E32\u67D3\u6A21\u5F0F \u5B9A\u4E49"
|
|
24225
|
+
},
|
|
24226
|
+
name: "cardTitleExtra"
|
|
24227
|
+
},
|
|
24215
24228
|
transparent: {
|
|
24216
24229
|
type: "string",
|
|
24217
24230
|
title: "\u80CC\u666F\u900F\u660E",
|
|
@@ -24251,6 +24264,19 @@ var cncardSubSchema = {
|
|
|
24251
24264
|
name: "icon",
|
|
24252
24265
|
"x-designable-id": "hso2ft3bll3"
|
|
24253
24266
|
},
|
|
24267
|
+
cardTitleExtra: {
|
|
24268
|
+
type: "string",
|
|
24269
|
+
title: "\u5361\u7247\u6807\u9898\u989D\u5916\u5185\u5BB9",
|
|
24270
|
+
"x-decorator": "CnFormItem",
|
|
24271
|
+
"x-component": "Input",
|
|
24272
|
+
"x-component-props": {
|
|
24273
|
+
placeholder: "\u4EE5\u81EA\u5B9A\u4E49\u6E32\u67D3\u6A21\u5F0F\u5B9A\u4E49"
|
|
24274
|
+
},
|
|
24275
|
+
"x-decorator-props": {
|
|
24276
|
+
tip: "\u4EE5\u81EA\u5B9A\u4E49\u6E32\u67D3\u6A21\u5F0F \u5B9A\u4E49"
|
|
24277
|
+
},
|
|
24278
|
+
name: "cardTitleExtra"
|
|
24279
|
+
},
|
|
24254
24280
|
transparent: {
|
|
24255
24281
|
type: "string",
|
|
24256
24282
|
title: "\u80CC\u666F\u900F\u660E",
|
|
@@ -24558,14 +24584,14 @@ const formItems = Object.keys(copyFields).reduce((result, key) => {
|
|
|
24558
24584
|
};
|
|
24559
24585
|
}, {});
|
|
24560
24586
|
function fillFormSchema(field) {
|
|
24561
|
-
var _a2, _b2,
|
|
24587
|
+
var _a2, _b2, _c2;
|
|
24562
24588
|
if ((_a2 = field == null ? void 0 : field.schema) == null ? void 0 : _a2.properties) {
|
|
24563
24589
|
field.schema.properties = {
|
|
24564
24590
|
...CnFormItem,
|
|
24565
24591
|
...field.schema.properties
|
|
24566
24592
|
};
|
|
24567
24593
|
}
|
|
24568
|
-
if ((
|
|
24594
|
+
if ((_c2 = (_b2 = field == null ? void 0 : field.formilySchema) == null ? void 0 : _b2.schema) == null ? void 0 : _c2.properties) {
|
|
24569
24595
|
field.formilySchema.schema.properties = {
|
|
24570
24596
|
...CnFormItem,
|
|
24571
24597
|
...field.formilySchema.schema.properties
|
|
@@ -24649,10 +24675,10 @@ const TitleRender$2 = (props) => {
|
|
|
24649
24675
|
customRender
|
|
24650
24676
|
} = props;
|
|
24651
24677
|
const [value, setValue] = useState(data);
|
|
24652
|
-
const { label, name, type, groupKey } = value || {};
|
|
24678
|
+
const { label, name: name2, type, groupKey } = value || {};
|
|
24653
24679
|
useEffect(() => {
|
|
24654
24680
|
setValue(data);
|
|
24655
|
-
}, [label,
|
|
24681
|
+
}, [label, name2, type, groupKey, data]);
|
|
24656
24682
|
const [{ isOver }, drop] = useDrop({
|
|
24657
24683
|
accept: DRAG_KEY$2,
|
|
24658
24684
|
collect(monitor) {
|
|
@@ -24729,7 +24755,7 @@ const TitleRender$2 = (props) => {
|
|
|
24729
24755
|
style: { width: "200px" },
|
|
24730
24756
|
size: "small",
|
|
24731
24757
|
dataSource: swaggerFieldDataSource,
|
|
24732
|
-
value:
|
|
24758
|
+
value: name2,
|
|
24733
24759
|
onChange: (v2) => titleChange("name", v2),
|
|
24734
24760
|
placeholder: "\u8BF7\u9009\u62E9\u6216\u8005\u8F93\u5165\u53D8\u91CF\u540D"
|
|
24735
24761
|
}), titleType.includes("groupKey") && /* @__PURE__ */ React$1.createElement("div", {
|
|
@@ -24751,7 +24777,7 @@ const TitleRender$2 = (props) => {
|
|
|
24751
24777
|
const ContentRender$2 = (props) => {
|
|
24752
24778
|
var _a2, _b2;
|
|
24753
24779
|
const { values, effects, onChange, schema, index: index2, extraFieldSchema: extraFieldSchema2, updateForceFLag, listSchema } = props;
|
|
24754
|
-
const { type, label, name } = values;
|
|
24780
|
+
const { type, label, name: name2 } = values;
|
|
24755
24781
|
const { formilySchema: formilySchema2, dataAdaptor: dataAdaptor2 } = schema || {};
|
|
24756
24782
|
const [uuid, setUuid] = useState(uuidv4());
|
|
24757
24783
|
const { dataMap, getModule } = useModule$1();
|
|
@@ -24893,7 +24919,7 @@ function MddTableForm(props, ref) {
|
|
|
24893
24919
|
index: idx,
|
|
24894
24920
|
draggable,
|
|
24895
24921
|
onChange: (record, invokeType) => {
|
|
24896
|
-
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24922
|
+
const { type, name: name2, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24897
24923
|
const newRecord = { ...record, ...otherProps };
|
|
24898
24924
|
onTableFormChange({ index: idx, record: newRecord });
|
|
24899
24925
|
},
|
|
@@ -24915,8 +24941,8 @@ function MddTableForm(props, ref) {
|
|
|
24915
24941
|
effects,
|
|
24916
24942
|
listSchema: dataRef.current,
|
|
24917
24943
|
onChange: ({ record }) => {
|
|
24918
|
-
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24919
|
-
const newRecord = { ...record, label, name, groupKey };
|
|
24944
|
+
const { type, name: name2, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24945
|
+
const newRecord = { ...record, label, name: name2, groupKey };
|
|
24920
24946
|
if (penetrateType) {
|
|
24921
24947
|
newRecord[type] = otherProps[type];
|
|
24922
24948
|
}
|
|
@@ -25487,7 +25513,7 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25487
25513
|
const treeLinkageCheck = schema.get("treeLinkageCheck");
|
|
25488
25514
|
const loadChildrenDataApiPanel = schema.getLoadChildrenDataApiPanel();
|
|
25489
25515
|
const onAddHandle = (key) => {
|
|
25490
|
-
var _a3, _b2,
|
|
25516
|
+
var _a3, _b2, _c2, _d;
|
|
25491
25517
|
switch (key) {
|
|
25492
25518
|
case "bulkActions":
|
|
25493
25519
|
schema.add(
|
|
@@ -25535,7 +25561,7 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25535
25561
|
"actionColumns",
|
|
25536
25562
|
true
|
|
25537
25563
|
);
|
|
25538
|
-
(
|
|
25564
|
+
(_c2 = operateMddFormRef.current) == null ? void 0 : _c2.updateData(schema.get("actionColumns"));
|
|
25539
25565
|
break;
|
|
25540
25566
|
case "rowDoubleClick":
|
|
25541
25567
|
schema.add(
|
|
@@ -25556,14 +25582,14 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25556
25582
|
}
|
|
25557
25583
|
};
|
|
25558
25584
|
const onRemoveHandle = (index2, key) => {
|
|
25559
|
-
var _a3, _b2,
|
|
25585
|
+
var _a3, _b2, _c2, _d;
|
|
25560
25586
|
schema.remove(index2, key, true);
|
|
25561
25587
|
if (key === "bulkActions") {
|
|
25562
25588
|
(_a3 = bulkMddFormRef.current) == null ? void 0 : _a3.updateData(schema.get("bulkActions"));
|
|
25563
25589
|
} else if (key === "columns") {
|
|
25564
25590
|
(_b2 = columnMddFormRef.current) == null ? void 0 : _b2.updateData(schema.get("columns"));
|
|
25565
25591
|
} else if (key === "actionColumns") {
|
|
25566
|
-
(
|
|
25592
|
+
(_c2 = operateMddFormRef.current) == null ? void 0 : _c2.updateData(schema.get("actionColumns"));
|
|
25567
25593
|
} else if (key === "rowDoubleClick") {
|
|
25568
25594
|
(_d = rowDoubleClickRef.current) == null ? void 0 : _d.updateData(schema.get("rowDoubleClick"));
|
|
25569
25595
|
}
|
|
@@ -27073,12 +27099,12 @@ function DetailImageView(props) {
|
|
|
27073
27099
|
wrapperCol: { span: 19 },
|
|
27074
27100
|
size: "small",
|
|
27075
27101
|
onChange: (values, item) => {
|
|
27076
|
-
const { name, value } = item;
|
|
27102
|
+
const { name: name2, value } = item;
|
|
27077
27103
|
let realValue = value;
|
|
27078
|
-
if (["itemWidth", "itemHeight"].includes(
|
|
27104
|
+
if (["itemWidth", "itemHeight"].includes(name2)) {
|
|
27079
27105
|
realValue = Number(value);
|
|
27080
27106
|
}
|
|
27081
|
-
data.set(
|
|
27107
|
+
data.set(name2, realValue);
|
|
27082
27108
|
onChange({ index: idx, record: data });
|
|
27083
27109
|
}
|
|
27084
27110
|
}, /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
@@ -28454,7 +28480,7 @@ function FtpBuild({ schema }) {
|
|
|
28454
28480
|
}))));
|
|
28455
28481
|
}
|
|
28456
28482
|
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;
|
|
28483
|
+
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
28484
|
function Toolbar(props) {
|
|
28459
28485
|
const { schema, scriptInfo = { script: "", style: "" }, showScript, scriptTopButtons } = props;
|
|
28460
28486
|
const [fullscreen, setFullscreen] = React$1.useState(false);
|
|
@@ -28934,4 +28960,63 @@ function getDefaultIndexStyle() {
|
|
|
28934
28960
|
// }
|
|
28935
28961
|
`;
|
|
28936
28962
|
}
|
|
28963
|
+
const name = "@cniot/mdd-editor";
|
|
28964
|
+
const version = "0.2.0-beta.45";
|
|
28965
|
+
const description = "\u6A21\u578B\u9A71\u52A8\u7F16\u8F91\u5668";
|
|
28966
|
+
const scripts = {
|
|
28967
|
+
build: "vite build"
|
|
28968
|
+
};
|
|
28969
|
+
const main = "./build/index.es.js";
|
|
28970
|
+
const author = "";
|
|
28971
|
+
const license = "ISC";
|
|
28972
|
+
const dependencies = {
|
|
28973
|
+
"@cainiaofe/cn-ui": "0.12.34",
|
|
28974
|
+
"@cniot/mdd-render-engine": "^0.1.1-beta.12",
|
|
28975
|
+
"@monaco-editor/react": "^4.5.1",
|
|
28976
|
+
EventEmitter: "^1.0.0",
|
|
28977
|
+
ahooks: "^3.2.0",
|
|
28978
|
+
classnames: "^2.3.1",
|
|
28979
|
+
"cn-address-select-pro": "^0.1.5",
|
|
28980
|
+
hox: "^1.1.6",
|
|
28981
|
+
"immutability-helper": "^3.1.1",
|
|
28982
|
+
"js-cookie": "^3.0.5",
|
|
28983
|
+
lodash: "^4.17.21",
|
|
28984
|
+
react: "^17.0.2",
|
|
28985
|
+
"react-dnd": "^16.0.0",
|
|
28986
|
+
"react-dnd-html5-backend": "^16.0.0",
|
|
28987
|
+
"react-dom": "^17.0.2"
|
|
28988
|
+
};
|
|
28989
|
+
const devDependencies = {
|
|
28990
|
+
vite: "^2.9.0"
|
|
28991
|
+
};
|
|
28992
|
+
const peerDependencies = {
|
|
28993
|
+
react: ">=16.0.0",
|
|
28994
|
+
"react-dom": ">=16.0.0",
|
|
28995
|
+
"@cainiaofe/cn-ui": "*",
|
|
28996
|
+
ahooks: "*",
|
|
28997
|
+
classnames: "*",
|
|
28998
|
+
"cn-address-select-pro": "*",
|
|
28999
|
+
lodash: "*",
|
|
29000
|
+
"@monaco-editor/react": "*"
|
|
29001
|
+
};
|
|
29002
|
+
const repository = "git@gitlab.alibaba-inc.com:one-code/mdd.git";
|
|
29003
|
+
var pkg = {
|
|
29004
|
+
name,
|
|
29005
|
+
version,
|
|
29006
|
+
description,
|
|
29007
|
+
scripts,
|
|
29008
|
+
main,
|
|
29009
|
+
author,
|
|
29010
|
+
license,
|
|
29011
|
+
dependencies,
|
|
29012
|
+
devDependencies,
|
|
29013
|
+
peerDependencies,
|
|
29014
|
+
repository
|
|
29015
|
+
};
|
|
29016
|
+
console.log(
|
|
29017
|
+
`%cmdd-editor %c@${pkg.version} %c=====`,
|
|
29018
|
+
"color:#000;font-weight:bold;",
|
|
29019
|
+
"color:green;font-weight:bold;",
|
|
29020
|
+
"color:#000;font-weight:bold;"
|
|
29021
|
+
);
|
|
28937
29022
|
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
|
* 顶部操作区
|