@cniot/mdd-editor 0.2.0-beta.42 → 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 +7 -0
- package/build/index.cjs.js +15 -21
- package/build/index.es.js +294 -242
- 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";
|
|
@@ -1564,132 +1564,103 @@ class HeaderToolbar$1 extends JSONWatch {
|
|
|
1564
1564
|
return this.data || [];
|
|
1565
1565
|
}
|
|
1566
1566
|
}
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
* Released under the MIT license
|
|
1574
|
-
*/
|
|
1575
|
-
(function(module, exports) {
|
|
1576
|
-
(function(factory) {
|
|
1577
|
-
var registeredInModuleLoader;
|
|
1578
|
-
{
|
|
1579
|
-
module.exports = factory();
|
|
1580
|
-
registeredInModuleLoader = true;
|
|
1581
|
-
}
|
|
1582
|
-
if (!registeredInModuleLoader) {
|
|
1583
|
-
var OldCookies = window.Cookies;
|
|
1584
|
-
var api = window.Cookies = factory();
|
|
1585
|
-
api.noConflict = function() {
|
|
1586
|
-
window.Cookies = OldCookies;
|
|
1587
|
-
return api;
|
|
1588
|
-
};
|
|
1567
|
+
/*! js-cookie v3.0.5 | MIT */
|
|
1568
|
+
function assign(target) {
|
|
1569
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1570
|
+
var source = arguments[i];
|
|
1571
|
+
for (var key in source) {
|
|
1572
|
+
target[key] = source[key];
|
|
1589
1573
|
}
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
result[key] = attributes[key];
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
return result;
|
|
1574
|
+
}
|
|
1575
|
+
return target;
|
|
1576
|
+
}
|
|
1577
|
+
var defaultConverter = {
|
|
1578
|
+
read: function(value) {
|
|
1579
|
+
if (value[0] === '"') {
|
|
1580
|
+
value = value.slice(1, -1);
|
|
1601
1581
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1582
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
1583
|
+
},
|
|
1584
|
+
write: function(value) {
|
|
1585
|
+
return encodeURIComponent(value).replace(
|
|
1586
|
+
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
1587
|
+
decodeURIComponent
|
|
1588
|
+
);
|
|
1589
|
+
}
|
|
1590
|
+
};
|
|
1591
|
+
function init$1(converter, defaultAttributes) {
|
|
1592
|
+
function set(name2, value, attributes) {
|
|
1593
|
+
if (typeof document === "undefined") {
|
|
1594
|
+
return;
|
|
1604
1595
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1596
|
+
attributes = assign({}, defaultAttributes, attributes);
|
|
1597
|
+
if (typeof attributes.expires === "number") {
|
|
1598
|
+
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
1599
|
+
}
|
|
1600
|
+
if (attributes.expires) {
|
|
1601
|
+
attributes.expires = attributes.expires.toUTCString();
|
|
1602
|
+
}
|
|
1603
|
+
name2 = encodeURIComponent(name2).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
1604
|
+
var stringifiedAttributes = "";
|
|
1605
|
+
for (var attributeName in attributes) {
|
|
1606
|
+
if (!attributes[attributeName]) {
|
|
1607
|
+
continue;
|
|
1607
1608
|
}
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
}
|
|
1612
|
-
attributes = extend({
|
|
1613
|
-
path: "/"
|
|
1614
|
-
}, api.defaults, attributes);
|
|
1615
|
-
if (typeof attributes.expires === "number") {
|
|
1616
|
-
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e5);
|
|
1617
|
-
}
|
|
1618
|
-
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : "";
|
|
1619
|
-
try {
|
|
1620
|
-
var result = JSON.stringify(value);
|
|
1621
|
-
if (/^[\{\[]/.test(result)) {
|
|
1622
|
-
value = result;
|
|
1623
|
-
}
|
|
1624
|
-
} catch (e) {
|
|
1625
|
-
}
|
|
1626
|
-
value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
|
1627
|
-
key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
|
|
1628
|
-
var stringifiedAttributes = "";
|
|
1629
|
-
for (var attributeName in attributes) {
|
|
1630
|
-
if (!attributes[attributeName]) {
|
|
1631
|
-
continue;
|
|
1632
|
-
}
|
|
1633
|
-
stringifiedAttributes += "; " + attributeName;
|
|
1634
|
-
if (attributes[attributeName] === true) {
|
|
1635
|
-
continue;
|
|
1636
|
-
}
|
|
1637
|
-
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
1638
|
-
}
|
|
1639
|
-
return document.cookie = key + "=" + value + stringifiedAttributes;
|
|
1609
|
+
stringifiedAttributes += "; " + attributeName;
|
|
1610
|
+
if (attributes[attributeName] === true) {
|
|
1611
|
+
continue;
|
|
1640
1612
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
cookie = JSON.parse(cookie);
|
|
1660
|
-
} catch (e) {
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
jar[name] = cookie;
|
|
1664
|
-
if (key === name) {
|
|
1665
|
-
break;
|
|
1666
|
-
}
|
|
1667
|
-
} catch (e) {
|
|
1668
|
-
}
|
|
1613
|
+
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
1614
|
+
}
|
|
1615
|
+
return document.cookie = name2 + "=" + converter.write(value, name2) + stringifiedAttributes;
|
|
1616
|
+
}
|
|
1617
|
+
function get2(name2) {
|
|
1618
|
+
if (typeof document === "undefined" || arguments.length && !name2) {
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
1622
|
+
var jar = {};
|
|
1623
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
1624
|
+
var parts = cookies[i].split("=");
|
|
1625
|
+
var value = parts.slice(1).join("=");
|
|
1626
|
+
try {
|
|
1627
|
+
var found = decodeURIComponent(parts[0]);
|
|
1628
|
+
jar[found] = converter.read(value, found);
|
|
1629
|
+
if (name2 === found) {
|
|
1630
|
+
break;
|
|
1669
1631
|
}
|
|
1670
|
-
|
|
1632
|
+
} catch (e) {
|
|
1671
1633
|
}
|
|
1672
|
-
api.set = set;
|
|
1673
|
-
api.get = function(key) {
|
|
1674
|
-
return get2(key, false);
|
|
1675
|
-
};
|
|
1676
|
-
api.getJSON = function(key) {
|
|
1677
|
-
return get2(key, true);
|
|
1678
|
-
};
|
|
1679
|
-
api.remove = function(key, attributes) {
|
|
1680
|
-
set(key, "", extend(attributes, {
|
|
1681
|
-
expires: -1
|
|
1682
|
-
}));
|
|
1683
|
-
};
|
|
1684
|
-
api.defaults = {};
|
|
1685
|
-
api.withConverter = init2;
|
|
1686
|
-
return api;
|
|
1687
1634
|
}
|
|
1688
|
-
return
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1635
|
+
return name2 ? jar[name2] : jar;
|
|
1636
|
+
}
|
|
1637
|
+
return Object.create(
|
|
1638
|
+
{
|
|
1639
|
+
set,
|
|
1640
|
+
get: get2,
|
|
1641
|
+
remove: function(name2, attributes) {
|
|
1642
|
+
set(
|
|
1643
|
+
name2,
|
|
1644
|
+
"",
|
|
1645
|
+
assign({}, attributes, {
|
|
1646
|
+
expires: -1
|
|
1647
|
+
})
|
|
1648
|
+
);
|
|
1649
|
+
},
|
|
1650
|
+
withAttributes: function(attributes) {
|
|
1651
|
+
return init$1(this.converter, assign({}, this.attributes, attributes));
|
|
1652
|
+
},
|
|
1653
|
+
withConverter: function(converter2) {
|
|
1654
|
+
return init$1(assign({}, this.converter, converter2), this.attributes);
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
attributes: { value: Object.freeze(defaultAttributes) },
|
|
1659
|
+
converter: { value: Object.freeze(converter) }
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1663
|
+
var api = init$1(defaultConverter, { path: "/" });
|
|
1693
1664
|
const calcWordWidth = (str) => {
|
|
1694
1665
|
const Min_Width = 50;
|
|
1695
1666
|
if (!str || typeof str !== "string")
|
|
@@ -1709,7 +1680,7 @@ const upperFirst$1 = (str) => {
|
|
|
1709
1680
|
return str.slice(0, 1).toUpperCase() + temp;
|
|
1710
1681
|
};
|
|
1711
1682
|
const getGlobalSizeFromCookie = () => {
|
|
1712
|
-
return
|
|
1683
|
+
return api == null ? void 0 : api.get("CNUICOOKIESIZE");
|
|
1713
1684
|
};
|
|
1714
1685
|
const getDefaultFomrLabelAlign = () => {
|
|
1715
1686
|
const globalSize = getGlobalSizeFromCookie();
|
|
@@ -2006,29 +1977,29 @@ const openApi3Support = (apiInfo) => {
|
|
|
2006
1977
|
responses: res
|
|
2007
1978
|
};
|
|
2008
1979
|
};
|
|
2009
|
-
var buildSwaggerApiJson = (
|
|
2010
|
-
if (!
|
|
1980
|
+
var buildSwaggerApiJson = (api2, apiMeta) => {
|
|
1981
|
+
if (!api2 || !apiMeta) {
|
|
2011
1982
|
throw Error("mdd-tool columns complier error: api or api meta is null");
|
|
2012
1983
|
}
|
|
2013
1984
|
const { paths, definitions } = apiMeta || {};
|
|
2014
|
-
if (!paths[
|
|
2015
|
-
throw Error(`mdd-tool columns complier error: api meta has not api: ${
|
|
1985
|
+
if (!paths[api2]) {
|
|
1986
|
+
throw Error(`mdd-tool columns complier error: api meta has not api: ${api2}`);
|
|
2016
1987
|
}
|
|
2017
1988
|
let method = "";
|
|
2018
1989
|
let apiInfo = null;
|
|
2019
|
-
if (Object.prototype.hasOwnProperty.call(paths[
|
|
1990
|
+
if (Object.prototype.hasOwnProperty.call(paths[api2], "post")) {
|
|
2020
1991
|
method = "post";
|
|
2021
|
-
apiInfo = paths[
|
|
2022
|
-
} else if (Object.prototype.hasOwnProperty.call(paths[
|
|
1992
|
+
apiInfo = paths[api2]["post"];
|
|
1993
|
+
} else if (Object.prototype.hasOwnProperty.call(paths[api2], "get")) {
|
|
2023
1994
|
method = "get";
|
|
2024
|
-
apiInfo = paths[
|
|
1995
|
+
apiInfo = paths[api2]["get"];
|
|
2025
1996
|
} else {
|
|
2026
1997
|
throw Error("mdd-tool columns complier error: api method not support");
|
|
2027
1998
|
}
|
|
2028
1999
|
const { summary } = apiInfo;
|
|
2029
2000
|
const { parameters = [], responses } = openApi3Support(apiInfo);
|
|
2030
2001
|
return {
|
|
2031
|
-
api,
|
|
2002
|
+
api: api2,
|
|
2032
2003
|
method,
|
|
2033
2004
|
summary,
|
|
2034
2005
|
parameters: transfer$refToJson("parameters", parameters, definitions),
|
|
@@ -2159,11 +2130,11 @@ const disabled = (key) => {
|
|
|
2159
2130
|
const Default_Column_Type = "text";
|
|
2160
2131
|
const Default_Edit_Column_Type = "edit-input";
|
|
2161
2132
|
const buildCompProps = (key, obj, buildType, templateType) => {
|
|
2162
|
-
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;
|
|
2163
2134
|
if (REMOVE_FIELDS_NAME.includes(key)) {
|
|
2164
2135
|
return null;
|
|
2165
2136
|
}
|
|
2166
|
-
const label = title2 ||
|
|
2137
|
+
const label = title2 || description2 || key;
|
|
2167
2138
|
const isReq = buildType === "parameters";
|
|
2168
2139
|
let result = null;
|
|
2169
2140
|
if (isReq) {
|
|
@@ -2326,7 +2297,7 @@ const getFlatFieldsFormInitRetPath = (swaggerParams, initRetPath) => {
|
|
|
2326
2297
|
}
|
|
2327
2298
|
};
|
|
2328
2299
|
const buildFtpFieldsToCompJson = (swaggerParams, type = "parameters", initRetPath, templateType) => {
|
|
2329
|
-
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;
|
|
2330
2301
|
if (!swaggerParams) {
|
|
2331
2302
|
throw Error("mdd-tool core complier error: swaggerParams is null");
|
|
2332
2303
|
}
|
|
@@ -2338,7 +2309,7 @@ const buildFtpFieldsToCompJson = (swaggerParams, type = "parameters", initRetPat
|
|
|
2338
2309
|
}
|
|
2339
2310
|
} else if (!Array.isArray(swaggerParams) && type === "responses") {
|
|
2340
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);
|
|
2341
|
-
if (!((
|
|
2312
|
+
if (!((_c2 = swaggerParams == null ? void 0 : swaggerParams.properties) == null ? void 0 : _c2.success)) {
|
|
2342
2313
|
resData = swaggerParams;
|
|
2343
2314
|
}
|
|
2344
2315
|
if ((resData == null ? void 0 : resData.type) === "array") {
|
|
@@ -2357,12 +2328,12 @@ const buildFtpFieldsToCompJson = (swaggerParams, type = "parameters", initRetPat
|
|
|
2357
2328
|
}
|
|
2358
2329
|
const result = [];
|
|
2359
2330
|
swaggerFields.forEach((param) => {
|
|
2360
|
-
const { name, schema } = param;
|
|
2331
|
+
const { name: name2, schema } = param;
|
|
2361
2332
|
if (schema) {
|
|
2362
2333
|
const objInfo = schema.properties || schema;
|
|
2363
2334
|
buildFieldsAndColumns(objInfo, result, type, [], templateType);
|
|
2364
2335
|
} else {
|
|
2365
|
-
result.push(buildCompProps(
|
|
2336
|
+
result.push(buildCompProps(name2, param, type, templateType));
|
|
2366
2337
|
}
|
|
2367
2338
|
});
|
|
2368
2339
|
return result.filter(Boolean);
|
|
@@ -2388,12 +2359,12 @@ const buildDetailFieldsToCompJson = (responses, type, initRetPath, templateType)
|
|
|
2388
2359
|
}
|
|
2389
2360
|
const result = [];
|
|
2390
2361
|
swaggerFields.forEach((param) => {
|
|
2391
|
-
const { name, schema } = param;
|
|
2362
|
+
const { name: name2, schema } = param;
|
|
2392
2363
|
if (schema) {
|
|
2393
2364
|
const objInfo = schema.properties || schema;
|
|
2394
2365
|
buildFieldsAndColumns(objInfo, result, type, [], templateType);
|
|
2395
2366
|
} else {
|
|
2396
|
-
result.push(buildCompProps(
|
|
2367
|
+
result.push(buildCompProps(name2, param, type, templateType));
|
|
2397
2368
|
}
|
|
2398
2369
|
});
|
|
2399
2370
|
return result.filter(Boolean);
|
|
@@ -2469,11 +2440,11 @@ function handleDefinitions(obj, map, depth) {
|
|
|
2469
2440
|
function getSwaggerInfoFromJson(swaggerJson) {
|
|
2470
2441
|
return jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerJson));
|
|
2471
2442
|
}
|
|
2472
|
-
function getApiInfo(
|
|
2443
|
+
function getApiInfo(api2, swaggerInfo) {
|
|
2473
2444
|
const realSwaggerInfo = jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerInfo));
|
|
2474
|
-
return buildSwaggerApiJson(
|
|
2445
|
+
return buildSwaggerApiJson(api2, realSwaggerInfo);
|
|
2475
2446
|
}
|
|
2476
|
-
function api2SchemaFromSwaggerApiInfo(
|
|
2447
|
+
function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {}) {
|
|
2477
2448
|
const { parameters = [], responses = [], method = "" } = apiInfo || {};
|
|
2478
2449
|
const methodUpperCase = method.toUpperCase();
|
|
2479
2450
|
const result = {
|
|
@@ -2496,8 +2467,8 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2496
2467
|
tableColumns: "$RET.data.tableColumns",
|
|
2497
2468
|
totalCount: "$RET.data.paging.totalCount"
|
|
2498
2469
|
},
|
|
2499
|
-
value:
|
|
2500
|
-
url:
|
|
2470
|
+
value: api2,
|
|
2471
|
+
url: api2
|
|
2501
2472
|
},
|
|
2502
2473
|
filter: {
|
|
2503
2474
|
maxVisibleRow: 2,
|
|
@@ -2542,8 +2513,8 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2542
2513
|
watch: [],
|
|
2543
2514
|
params: {},
|
|
2544
2515
|
formatResponseData: {},
|
|
2545
|
-
value:
|
|
2546
|
-
url:
|
|
2516
|
+
value: api2,
|
|
2517
|
+
url: api2
|
|
2547
2518
|
},
|
|
2548
2519
|
initApi: [],
|
|
2549
2520
|
effectApi: [],
|
|
@@ -2582,7 +2553,7 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2582
2553
|
label: "\u57FA\u7840\u4FE1\u606F",
|
|
2583
2554
|
source: [
|
|
2584
2555
|
{
|
|
2585
|
-
url:
|
|
2556
|
+
url: api2,
|
|
2586
2557
|
method: methodUpperCase,
|
|
2587
2558
|
type: "ajax",
|
|
2588
2559
|
formatResponseData: {
|
|
@@ -2615,8 +2586,8 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2615
2586
|
formatResponseData: {
|
|
2616
2587
|
tableData: "$RET.data.tableData"
|
|
2617
2588
|
},
|
|
2618
|
-
value:
|
|
2619
|
-
url:
|
|
2589
|
+
value: api2,
|
|
2590
|
+
url: api2
|
|
2620
2591
|
},
|
|
2621
2592
|
submitApi: {
|
|
2622
2593
|
type: "ajax",
|
|
@@ -2654,9 +2625,9 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2654
2625
|
}
|
|
2655
2626
|
return merge_1(result, extraSchema);
|
|
2656
2627
|
}
|
|
2657
|
-
function api2SchemaFromSwagger(
|
|
2658
|
-
const apiInfo = getApiInfo(
|
|
2659
|
-
return api2SchemaFromSwaggerApiInfo(
|
|
2628
|
+
function api2SchemaFromSwagger(api2, schemaType, swaggerInfo, extraSchema = {}) {
|
|
2629
|
+
const apiInfo = getApiInfo(api2, swaggerInfo);
|
|
2630
|
+
return api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema);
|
|
2660
2631
|
}
|
|
2661
2632
|
function transferOpenAPI3ToSwagger2$1(data) {
|
|
2662
2633
|
if (data && data.components && data.components.schemas) {
|
|
@@ -2675,9 +2646,9 @@ const getLocalProjectSwaggerOpts = () => {
|
|
|
2675
2646
|
url: IdeaSwaggerListHost,
|
|
2676
2647
|
method: "GET"
|
|
2677
2648
|
}).then((res) => {
|
|
2678
|
-
var _a2, _b2,
|
|
2649
|
+
var _a2, _b2, _c2;
|
|
2679
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)) {
|
|
2680
|
-
const realOpts = (
|
|
2651
|
+
const realOpts = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.data.map((item) => {
|
|
2681
2652
|
const realUrl = IdeaSwaggerHost + item;
|
|
2682
2653
|
return {
|
|
2683
2654
|
value: realUrl,
|
|
@@ -2792,10 +2763,10 @@ class MiddleItem extends JSONWatch {
|
|
|
2792
2763
|
}
|
|
2793
2764
|
class FtpSchema extends Schema {
|
|
2794
2765
|
constructor(props, isCompleteSchema = false) {
|
|
2795
|
-
const { api, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
|
|
2766
|
+
const { api: api2, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
|
|
2796
2767
|
super(more2);
|
|
2797
2768
|
this.type = "ftp";
|
|
2798
|
-
this.api = new AjaxSchema(
|
|
2769
|
+
this.api = new AjaxSchema(api2);
|
|
2799
2770
|
this.filter = new Filter(filter);
|
|
2800
2771
|
this.headerToolbar = new HeaderToolbar$1(headerToolbar);
|
|
2801
2772
|
this.table = new TableSchema$2(table);
|
|
@@ -2869,12 +2840,12 @@ class FtpSchema extends Schema {
|
|
|
2869
2840
|
}
|
|
2870
2841
|
initFromCache(schema) {
|
|
2871
2842
|
const { body, ...more2 } = schema;
|
|
2872
|
-
const { api, filter, headerToolbar, table, tabs, middleModules } = body;
|
|
2843
|
+
const { api: api2, filter, headerToolbar, table, tabs, middleModules } = body;
|
|
2873
2844
|
if (this.willDetach) {
|
|
2874
2845
|
this.willDetach();
|
|
2875
2846
|
}
|
|
2876
2847
|
this.init(more2);
|
|
2877
|
-
this.api.updateAll(
|
|
2848
|
+
this.api.updateAll(api2);
|
|
2878
2849
|
this.filter.updateAll(filter);
|
|
2879
2850
|
this.headerToolbar.updateAll(headerToolbar);
|
|
2880
2851
|
this.table.updateAll(this.compatTableHandle(table));
|
|
@@ -3347,11 +3318,11 @@ function getWatchByRequest(params) {
|
|
|
3347
3318
|
}
|
|
3348
3319
|
class FormilyFormV2Schema extends Schema {
|
|
3349
3320
|
constructor(props, isCompleteSchema = false) {
|
|
3350
|
-
const { api, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
|
|
3321
|
+
const { api: api2, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
|
|
3351
3322
|
super(more2);
|
|
3352
3323
|
this.type = "formily-form-v2";
|
|
3353
3324
|
this.baseInfo = new FormInfo(baseInfo);
|
|
3354
|
-
this.api = new AjaxSchema(
|
|
3325
|
+
this.api = new AjaxSchema(api2);
|
|
3355
3326
|
if (!initApi) {
|
|
3356
3327
|
this.initApi = new AjaxSchemaQueue([]);
|
|
3357
3328
|
} else {
|
|
@@ -3393,12 +3364,12 @@ class FormilyFormV2Schema extends Schema {
|
|
|
3393
3364
|
}
|
|
3394
3365
|
initFromCache(schema) {
|
|
3395
3366
|
const { body, ...more2 } = schema;
|
|
3396
|
-
const { api, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
|
|
3367
|
+
const { api: api2, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
|
|
3397
3368
|
if (this.willDetach) {
|
|
3398
3369
|
this.willDetach();
|
|
3399
3370
|
}
|
|
3400
3371
|
this.init(more2);
|
|
3401
|
-
this.api.updateAll(
|
|
3372
|
+
this.api.updateAll(api2);
|
|
3402
3373
|
if (!initApi) {
|
|
3403
3374
|
this.initApi.updateAll([]);
|
|
3404
3375
|
} else {
|
|
@@ -4124,7 +4095,7 @@ function shouldUseNative() {
|
|
|
4124
4095
|
return false;
|
|
4125
4096
|
}
|
|
4126
4097
|
}
|
|
4127
|
-
var
|
|
4098
|
+
var _objectAssign_4_1_1_objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
|
|
4128
4099
|
var from;
|
|
4129
4100
|
var to = toObject(target);
|
|
4130
4101
|
var symbols;
|
|
@@ -5516,7 +5487,7 @@ function createSingletonDndContext(backend, context = getGlobalContext(), option
|
|
|
5516
5487
|
function getGlobalContext() {
|
|
5517
5488
|
return typeof global !== "undefined" ? global : window;
|
|
5518
5489
|
}
|
|
5519
|
-
var
|
|
5490
|
+
var _fastDeepEqual_3_1_3_fastDeepEqual = function equal(a, b) {
|
|
5520
5491
|
if (a === b)
|
|
5521
5492
|
return true;
|
|
5522
5493
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
@@ -5561,7 +5532,7 @@ function useCollector(monitor, collect, onUpdate) {
|
|
|
5561
5532
|
);
|
|
5562
5533
|
const updateCollected = useCallback(() => {
|
|
5563
5534
|
const nextValue = collect(monitor);
|
|
5564
|
-
if (!
|
|
5535
|
+
if (!_fastDeepEqual_3_1_3_fastDeepEqual(collected, nextValue)) {
|
|
5565
5536
|
setCollected(nextValue);
|
|
5566
5537
|
if (onUpdate) {
|
|
5567
5538
|
onUpdate();
|
|
@@ -7578,7 +7549,7 @@ var index$2 = {
|
|
|
7578
7549
|
};
|
|
7579
7550
|
var config$1 = {
|
|
7580
7551
|
paths: {
|
|
7581
|
-
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.
|
|
7552
|
+
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
|
|
7582
7553
|
}
|
|
7583
7554
|
};
|
|
7584
7555
|
function curry(fn) {
|
|
@@ -7856,9 +7827,9 @@ function Oe({ original: e, modified: r, language: n2, originalLanguage: t, modif
|
|
|
7856
7827
|
!T && !M && U();
|
|
7857
7828
|
}, [T, M, U]);
|
|
7858
7829
|
function I() {
|
|
7859
|
-
var _a2, _b2,
|
|
7830
|
+
var _a2, _b2, _c2, _d;
|
|
7860
7831
|
let i = (_a2 = u.current) == null ? void 0 : _a2.getModel();
|
|
7861
|
-
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();
|
|
7862
7833
|
}
|
|
7863
7834
|
return React$1.createElement(H, { width: z, height: V, isEditorReady: M, loading: P, _ref: w, className: F, wrapperProps: j });
|
|
7864
7835
|
}
|
|
@@ -7878,9 +7849,9 @@ function Ve({ defaultValue: e, defaultLanguage: r, defaultPath: n2, value: t, la
|
|
|
7878
7849
|
let p2 = loader.init();
|
|
7879
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();
|
|
7880
7851
|
}), l(() => {
|
|
7881
|
-
var _a2, _b2,
|
|
7852
|
+
var _a2, _b2, _c2, _d;
|
|
7882
7853
|
let p2 = h(d.current, e || t || "", r || a || "", m2 || n2 || "");
|
|
7883
|
-
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))));
|
|
7884
7855
|
}, [m2], s), l(() => {
|
|
7885
7856
|
var _a2;
|
|
7886
7857
|
(_a2 = o.current) == null ? void 0 : _a2.updateOptions(x);
|
|
@@ -8020,7 +7991,7 @@ const schemaScenarioList = async (params) => {
|
|
|
8020
7991
|
return null;
|
|
8021
7992
|
return res;
|
|
8022
7993
|
};
|
|
8023
|
-
var
|
|
7994
|
+
var _hox_1_1_6_hox = {};
|
|
8024
7995
|
var createModel$2 = {};
|
|
8025
7996
|
var container$1 = {};
|
|
8026
7997
|
var __values$1 = commonjsGlobal && commonjsGlobal.__values || function(o) {
|
|
@@ -8046,15 +8017,15 @@ var Container = function() {
|
|
|
8046
8017
|
Container2.prototype.notify = function() {
|
|
8047
8018
|
var e_1, _a2;
|
|
8048
8019
|
try {
|
|
8049
|
-
for (var _b2 = __values$1(this.subscribers),
|
|
8050
|
-
var subscriber =
|
|
8020
|
+
for (var _b2 = __values$1(this.subscribers), _c2 = _b2.next(); !_c2.done; _c2 = _b2.next()) {
|
|
8021
|
+
var subscriber = _c2.value;
|
|
8051
8022
|
subscriber(this.data);
|
|
8052
8023
|
}
|
|
8053
8024
|
} catch (e_1_1) {
|
|
8054
8025
|
e_1 = { error: e_1_1 };
|
|
8055
8026
|
} finally {
|
|
8056
8027
|
try {
|
|
8057
|
-
if (
|
|
8028
|
+
if (_c2 && !_c2.done && (_a2 = _b2.return))
|
|
8058
8029
|
_a2.call(_b2);
|
|
8059
8030
|
} finally {
|
|
8060
8031
|
if (e_1)
|
|
@@ -8085,9 +8056,9 @@ function Executor(props) {
|
|
|
8085
8056
|
}
|
|
8086
8057
|
executor.Executor = Executor;
|
|
8087
8058
|
var renderer = {};
|
|
8088
|
-
var
|
|
8059
|
+
var _reactReconciler_0_26_2_reactReconciler = { exports: {} };
|
|
8089
8060
|
var reactReconciler_production_min = { exports: {} };
|
|
8090
|
-
var
|
|
8061
|
+
var _scheduler_0_20_2_scheduler = { exports: {} };
|
|
8091
8062
|
var scheduler_production_min = {};
|
|
8092
8063
|
/** @license React v0.20.2
|
|
8093
8064
|
* scheduler.production.min.js
|
|
@@ -8371,7 +8342,7 @@ var scheduler_production_min = {};
|
|
|
8371
8342
|
};
|
|
8372
8343
|
})(scheduler_production_min);
|
|
8373
8344
|
{
|
|
8374
|
-
|
|
8345
|
+
_scheduler_0_20_2_scheduler.exports = scheduler_production_min;
|
|
8375
8346
|
}
|
|
8376
8347
|
/** @license React v0.26.2
|
|
8377
8348
|
* react-reconciler.production.min.js
|
|
@@ -8384,7 +8355,7 @@ var scheduler_production_min = {};
|
|
|
8384
8355
|
(function(module) {
|
|
8385
8356
|
module.exports = function $$$reconciler($$$hostConfig) {
|
|
8386
8357
|
var exports = {};
|
|
8387
|
-
var aa =
|
|
8358
|
+
var aa = _objectAssign_4_1_1_objectAssign, ba = React$1, m2 = _scheduler_0_20_2_scheduler.exports;
|
|
8388
8359
|
function q2(a) {
|
|
8389
8360
|
for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++)
|
|
8390
8361
|
b += "&args[]=" + encodeURIComponent(arguments[c]);
|
|
@@ -13027,13 +12998,13 @@ var scheduler_production_min = {};
|
|
|
13027
12998
|
};
|
|
13028
12999
|
})(reactReconciler_production_min);
|
|
13029
13000
|
{
|
|
13030
|
-
|
|
13001
|
+
_reactReconciler_0_26_2_reactReconciler.exports = reactReconciler_production_min.exports;
|
|
13031
13002
|
}
|
|
13032
13003
|
var __importDefault$1 = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
|
13033
13004
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
13034
13005
|
};
|
|
13035
13006
|
Object.defineProperty(renderer, "__esModule", { value: true });
|
|
13036
|
-
var react_reconciler_1 = __importDefault$1(
|
|
13007
|
+
var react_reconciler_1 = __importDefault$1(_reactReconciler_0_26_2_reactReconciler.exports);
|
|
13037
13008
|
var reconciler = react_reconciler_1.default({
|
|
13038
13009
|
now: Date.now,
|
|
13039
13010
|
getRootHostContext: function() {
|
|
@@ -13278,12 +13249,12 @@ function withModel(useModelOrUseModels, mapModelToProps) {
|
|
|
13278
13249
|
};
|
|
13279
13250
|
}
|
|
13280
13251
|
withModel$1.withModel = withModel;
|
|
13281
|
-
Object.defineProperty(
|
|
13252
|
+
Object.defineProperty(_hox_1_1_6_hox, "__esModule", { value: true });
|
|
13282
13253
|
var create_model_1 = createModel$2;
|
|
13283
|
-
var createModel =
|
|
13284
|
-
|
|
13254
|
+
var createModel = _hox_1_1_6_hox.createModel = create_model_1.createModel;
|
|
13255
|
+
_hox_1_1_6_hox.createLazyModel = create_model_1.createLazyModel;
|
|
13285
13256
|
var with_model_1 = withModel$1;
|
|
13286
|
-
|
|
13257
|
+
_hox_1_1_6_hox.withModel = with_model_1.withModel;
|
|
13287
13258
|
function useSwagger() {
|
|
13288
13259
|
const [apiList, setApiList] = useState([]);
|
|
13289
13260
|
const [swaggerInfo, setSwaggerInfo] = useState(null);
|
|
@@ -13344,23 +13315,23 @@ function useSwagger() {
|
|
|
13344
13315
|
}
|
|
13345
13316
|
};
|
|
13346
13317
|
}
|
|
13347
|
-
function createApiSelectItem(summary,
|
|
13318
|
+
function createApiSelectItem(summary, api2, method, request = []) {
|
|
13348
13319
|
return {
|
|
13349
13320
|
summary,
|
|
13350
|
-
label: `${summary} - ${method} ${
|
|
13351
|
-
value:
|
|
13352
|
-
url:
|
|
13321
|
+
label: `${summary} - ${method} ${api2}`,
|
|
13322
|
+
value: api2,
|
|
13323
|
+
url: api2,
|
|
13353
13324
|
method,
|
|
13354
13325
|
request,
|
|
13355
|
-
parameters:
|
|
13326
|
+
parameters: api2.parameters
|
|
13356
13327
|
};
|
|
13357
13328
|
}
|
|
13358
13329
|
const getDataSourceArray$1 = (paths = {}) => {
|
|
13359
13330
|
try {
|
|
13360
13331
|
return Object.keys(paths).map((key) => {
|
|
13361
|
-
const
|
|
13362
|
-
const apiPost =
|
|
13363
|
-
const apiGet =
|
|
13332
|
+
const api2 = paths[key];
|
|
13333
|
+
const apiPost = api2.post || api2.POST;
|
|
13334
|
+
const apiGet = api2.get || api2.GET;
|
|
13364
13335
|
if (apiPost) {
|
|
13365
13336
|
return createApiSelectItem(apiPost.summary, key, "POST");
|
|
13366
13337
|
} else if (apiGet) {
|
|
@@ -13433,8 +13404,8 @@ class PersistentStorage {
|
|
|
13433
13404
|
}
|
|
13434
13405
|
var storage = new PersistentStorage();
|
|
13435
13406
|
class DataSourceSchema extends JSONWatch {
|
|
13436
|
-
constructor(
|
|
13437
|
-
const { url, method = "get", ...more2 } =
|
|
13407
|
+
constructor(api2) {
|
|
13408
|
+
const { url, method = "get", ...more2 } = api2 || {};
|
|
13438
13409
|
super({
|
|
13439
13410
|
url,
|
|
13440
13411
|
method,
|
|
@@ -14074,14 +14045,14 @@ class FormilyFormSchema extends Schema {
|
|
|
14074
14045
|
this.willDetach = this.initChangeListener();
|
|
14075
14046
|
}
|
|
14076
14047
|
async initFromSwagger(swaggerInfo) {
|
|
14077
|
-
var _a2, _b2,
|
|
14048
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
14078
14049
|
const url = this.api.getApiUrl();
|
|
14079
14050
|
if (!url)
|
|
14080
14051
|
return;
|
|
14081
14052
|
const apiInfo = buildSwaggerApiJson(url, swaggerInfo);
|
|
14082
14053
|
const { parameters } = apiInfo || {};
|
|
14083
14054
|
const formList = formatFieldsJson(buildFieldsToCompJson(parameters) || []);
|
|
14084
|
-
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;
|
|
14085
14056
|
let finalSchema = list2Schema(formList);
|
|
14086
14057
|
if (metadataId) {
|
|
14087
14058
|
try {
|
|
@@ -14146,10 +14117,10 @@ function emitterVSCodeMessage(action, content2) {
|
|
|
14146
14117
|
function emitSave(fileMapContent) {
|
|
14147
14118
|
emitterVSCodeMessage(EMIT_EVENT_ACTION_SAVE, fileMapContent);
|
|
14148
14119
|
}
|
|
14149
|
-
const buildSchema = (schemaType,
|
|
14120
|
+
const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
|
|
14150
14121
|
let schemaObj = null;
|
|
14151
14122
|
if (schemaType === "ftp") {
|
|
14152
|
-
schemaObj = new FtpSchema({ host:
|
|
14123
|
+
schemaObj = new FtpSchema({ host: api2, title: "" });
|
|
14153
14124
|
const realDataSource = {
|
|
14154
14125
|
...mainDataSource,
|
|
14155
14126
|
type: "ajax",
|
|
@@ -14162,14 +14133,14 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14162
14133
|
};
|
|
14163
14134
|
schemaObj.getDataSourcePanel().update(realDataSource);
|
|
14164
14135
|
} else if (schemaType === "formily-form") {
|
|
14165
|
-
schemaObj = new FormilyFormSchema({ host:
|
|
14136
|
+
schemaObj = new FormilyFormSchema({ host: api2, title: "" });
|
|
14166
14137
|
const realDataSource = {
|
|
14167
14138
|
...mainDataSource,
|
|
14168
14139
|
type: "ajax"
|
|
14169
14140
|
};
|
|
14170
14141
|
schemaObj.getDataSourcePanel().update(realDataSource);
|
|
14171
14142
|
} else if (schemaType === "formily-form-v2") {
|
|
14172
|
-
schemaObj = new FormilyFormV2Schema({ host:
|
|
14143
|
+
schemaObj = new FormilyFormV2Schema({ host: api2, title: "" });
|
|
14173
14144
|
const realDataSource = {
|
|
14174
14145
|
...mainDataSource,
|
|
14175
14146
|
type: "ajax"
|
|
@@ -14177,7 +14148,7 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14177
14148
|
schemaObj.getApiPanel().update(realDataSource);
|
|
14178
14149
|
} else if (schemaType === "detail") {
|
|
14179
14150
|
if (moreProps == null ? void 0 : moreProps.children) {
|
|
14180
|
-
schemaObj = new DetailSchema({ host:
|
|
14151
|
+
schemaObj = new DetailSchema({ host: api2, title: "", ...moreProps });
|
|
14181
14152
|
} else {
|
|
14182
14153
|
const realDataSource = {
|
|
14183
14154
|
...mainDataSource,
|
|
@@ -14186,10 +14157,10 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14186
14157
|
detailData: "$RET.data"
|
|
14187
14158
|
}
|
|
14188
14159
|
};
|
|
14189
|
-
schemaObj = new DetailSchema({ host:
|
|
14160
|
+
schemaObj = new DetailSchema({ host: api2, title: "", initDataSource: realDataSource });
|
|
14190
14161
|
}
|
|
14191
14162
|
} else if (schemaType === "edit-table") {
|
|
14192
|
-
schemaObj = new EditTableSchema({ host:
|
|
14163
|
+
schemaObj = new EditTableSchema({ host: api2, title: "", ...moreProps });
|
|
14193
14164
|
const realDataSource = {
|
|
14194
14165
|
...mainDataSource,
|
|
14195
14166
|
type: "ajax",
|
|
@@ -14216,8 +14187,8 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14216
14187
|
}
|
|
14217
14188
|
}, 500)
|
|
14218
14189
|
);
|
|
14219
|
-
if (
|
|
14220
|
-
axios.defaults.baseURL =
|
|
14190
|
+
if (api2.indexOf("?") === -1 && api2.indexOf("mocks") === -1) {
|
|
14191
|
+
axios.defaults.baseURL = api2;
|
|
14221
14192
|
}
|
|
14222
14193
|
return schemaObj;
|
|
14223
14194
|
};
|
|
@@ -14226,11 +14197,11 @@ const buildSchemaObjFromSchema = (schema) => {
|
|
|
14226
14197
|
return null;
|
|
14227
14198
|
}
|
|
14228
14199
|
const { host, body } = schema;
|
|
14229
|
-
const { type, api, ...more2 } = body || {};
|
|
14200
|
+
const { type, api: api2, ...more2 } = body || {};
|
|
14230
14201
|
if (!host || !type) {
|
|
14231
14202
|
return null;
|
|
14232
14203
|
}
|
|
14233
|
-
return buildSchema(type, host,
|
|
14204
|
+
return buildSchema(type, host, api2, more2);
|
|
14234
14205
|
};
|
|
14235
14206
|
function useSchema() {
|
|
14236
14207
|
const { fetchSwaggerInfo } = useSwagger$1();
|
|
@@ -16165,14 +16136,14 @@ const FormilyForm = (props) => {
|
|
|
16165
16136
|
readPretty,
|
|
16166
16137
|
validateFirst
|
|
16167
16138
|
};
|
|
16168
|
-
const { name, label, type } = values;
|
|
16139
|
+
const { name: name2, label, type } = values;
|
|
16169
16140
|
const finalForm = useMemo(() => {
|
|
16170
16141
|
return {
|
|
16171
16142
|
createForm: createForm({
|
|
16172
16143
|
effects() {
|
|
16173
16144
|
onFormValuesChange((form2) => {
|
|
16174
16145
|
const getValuesFromForm = form2.getFormState().values;
|
|
16175
|
-
onChange({ record: { ...getValuesFromForm, ...{ name, label, type } } });
|
|
16146
|
+
onChange({ record: { ...getValuesFromForm, ...{ name: name2, label, type } } });
|
|
16176
16147
|
}), (effects == null ? void 0 : effects.onFieldValueChange) && onFieldValueChange(...effects.onFieldValueChange);
|
|
16177
16148
|
},
|
|
16178
16149
|
...CreateFormProps
|
|
@@ -16395,8 +16366,8 @@ function TableFormProxy(props) {
|
|
|
16395
16366
|
setDataSource(list);
|
|
16396
16367
|
onChange(array2Object(list));
|
|
16397
16368
|
},
|
|
16398
|
-
onItemChange: (index2,
|
|
16399
|
-
dataSource[index2][
|
|
16369
|
+
onItemChange: (index2, name2, _value) => {
|
|
16370
|
+
dataSource[index2][name2] = _value;
|
|
16400
16371
|
setDataSource([...dataSource]);
|
|
16401
16372
|
onChange(array2Object(dataSource));
|
|
16402
16373
|
},
|
|
@@ -16709,11 +16680,11 @@ function AjaxFormDialog({ title: title2 = "\u6570\u636E\u6E90\u914D\u7F6E", sche
|
|
|
16709
16680
|
size: "small",
|
|
16710
16681
|
labelAlign: "top",
|
|
16711
16682
|
onChange: (values, item) => {
|
|
16712
|
-
const { name, value } = item;
|
|
16713
|
-
if (
|
|
16714
|
-
schema.set(
|
|
16683
|
+
const { name: name2, value } = item;
|
|
16684
|
+
if (name2 && name2 !== "type") {
|
|
16685
|
+
schema.set(name2, value);
|
|
16715
16686
|
}
|
|
16716
|
-
if (
|
|
16687
|
+
if (name2 === "params.processDefKey") {
|
|
16717
16688
|
setParamFormatKey(Math.random());
|
|
16718
16689
|
}
|
|
16719
16690
|
}
|
|
@@ -16754,9 +16725,9 @@ function AjaxFormDialog({ title: title2 = "\u6570\u636E\u6E90\u914D\u7F6E", sche
|
|
|
16754
16725
|
dataSource: swagger.apiList,
|
|
16755
16726
|
defaultValue: schema.get("url"),
|
|
16756
16727
|
onChange: (value) => {
|
|
16757
|
-
const
|
|
16758
|
-
if (
|
|
16759
|
-
schema.setAjaxRequest(value,
|
|
16728
|
+
const api2 = swagger.getApi(value);
|
|
16729
|
+
if (api2) {
|
|
16730
|
+
schema.setAjaxRequest(value, api2.method);
|
|
16760
16731
|
} else {
|
|
16761
16732
|
schema.set("url", value);
|
|
16762
16733
|
}
|
|
@@ -19683,6 +19654,17 @@ var cnGraphicsPercent = (params) => {
|
|
|
19683
19654
|
var formCommon = () => {
|
|
19684
19655
|
var _a2;
|
|
19685
19656
|
return {
|
|
19657
|
+
shouldRender: {
|
|
19658
|
+
title: "\u6761\u4EF6\u6E32\u67D3",
|
|
19659
|
+
"x-decorator": "CnFormItem",
|
|
19660
|
+
"x-component": "Input",
|
|
19661
|
+
"x-validator": [],
|
|
19662
|
+
"x-component-props": {
|
|
19663
|
+
placeholder: "\u6839\u636E\u6761\u4EF6\u5224\u65AD\u662F\u5426\u6E32\u67D3"
|
|
19664
|
+
},
|
|
19665
|
+
"x-decorator-props": {},
|
|
19666
|
+
name: "shouldRender"
|
|
19667
|
+
},
|
|
19686
19668
|
hasClear: {
|
|
19687
19669
|
type: "boolean",
|
|
19688
19670
|
title: "\u6709\u6E05\u9664\u6309\u94AE",
|
|
@@ -21419,6 +21401,17 @@ var filterCommon = {
|
|
|
21419
21401
|
},
|
|
21420
21402
|
default: 1,
|
|
21421
21403
|
"x-designable-id": "r52k327v2zu"
|
|
21404
|
+
},
|
|
21405
|
+
shouldRender: {
|
|
21406
|
+
title: "\u6761\u4EF6\u6E32\u67D3",
|
|
21407
|
+
"x-decorator": "CnFormItem",
|
|
21408
|
+
"x-component": "Input",
|
|
21409
|
+
"x-validator": [],
|
|
21410
|
+
"x-component-props": {
|
|
21411
|
+
placeholder: "\u6839\u636E\u6761\u4EF6\u5224\u65AD\u662F\u5426\u6E32\u67D3"
|
|
21412
|
+
},
|
|
21413
|
+
"x-decorator-props": {},
|
|
21414
|
+
name: "shouldRender"
|
|
21422
21415
|
}
|
|
21423
21416
|
};
|
|
21424
21417
|
var formValidator = {
|
|
@@ -23962,7 +23955,7 @@ const fields = {
|
|
|
23962
23955
|
};
|
|
23963
23956
|
const copyFields$1 = cloneDeep_1(fields);
|
|
23964
23957
|
const filterItems = Object.keys(copyFields$1).reduce((result, key) => {
|
|
23965
|
-
var _a2, _b2,
|
|
23958
|
+
var _a2, _b2, _c2;
|
|
23966
23959
|
const field = copyFields$1[key];
|
|
23967
23960
|
if ((_a2 = field == null ? void 0 : field.schema) == null ? void 0 : _a2.properties) {
|
|
23968
23961
|
field.schema.properties = {
|
|
@@ -23970,7 +23963,7 @@ const filterItems = Object.keys(copyFields$1).reduce((result, key) => {
|
|
|
23970
23963
|
...field.schema.properties
|
|
23971
23964
|
};
|
|
23972
23965
|
}
|
|
23973
|
-
if ((
|
|
23966
|
+
if ((_c2 = (_b2 = field == null ? void 0 : field.formilySchema) == null ? void 0 : _b2.schema) == null ? void 0 : _c2.properties) {
|
|
23974
23967
|
field.formilySchema.schema.properties = {
|
|
23975
23968
|
...filterCommon,
|
|
23976
23969
|
...field.formilySchema.schema.properties
|
|
@@ -24565,14 +24558,14 @@ const formItems = Object.keys(copyFields).reduce((result, key) => {
|
|
|
24565
24558
|
};
|
|
24566
24559
|
}, {});
|
|
24567
24560
|
function fillFormSchema(field) {
|
|
24568
|
-
var _a2, _b2,
|
|
24561
|
+
var _a2, _b2, _c2;
|
|
24569
24562
|
if ((_a2 = field == null ? void 0 : field.schema) == null ? void 0 : _a2.properties) {
|
|
24570
24563
|
field.schema.properties = {
|
|
24571
24564
|
...CnFormItem,
|
|
24572
24565
|
...field.schema.properties
|
|
24573
24566
|
};
|
|
24574
24567
|
}
|
|
24575
|
-
if ((
|
|
24568
|
+
if ((_c2 = (_b2 = field == null ? void 0 : field.formilySchema) == null ? void 0 : _b2.schema) == null ? void 0 : _c2.properties) {
|
|
24576
24569
|
field.formilySchema.schema.properties = {
|
|
24577
24570
|
...CnFormItem,
|
|
24578
24571
|
...field.formilySchema.schema.properties
|
|
@@ -24656,10 +24649,10 @@ const TitleRender$2 = (props) => {
|
|
|
24656
24649
|
customRender
|
|
24657
24650
|
} = props;
|
|
24658
24651
|
const [value, setValue] = useState(data);
|
|
24659
|
-
const { label, name, type, groupKey } = value || {};
|
|
24652
|
+
const { label, name: name2, type, groupKey } = value || {};
|
|
24660
24653
|
useEffect(() => {
|
|
24661
24654
|
setValue(data);
|
|
24662
|
-
}, [label,
|
|
24655
|
+
}, [label, name2, type, groupKey, data]);
|
|
24663
24656
|
const [{ isOver }, drop] = useDrop({
|
|
24664
24657
|
accept: DRAG_KEY$2,
|
|
24665
24658
|
collect(monitor) {
|
|
@@ -24736,7 +24729,7 @@ const TitleRender$2 = (props) => {
|
|
|
24736
24729
|
style: { width: "200px" },
|
|
24737
24730
|
size: "small",
|
|
24738
24731
|
dataSource: swaggerFieldDataSource,
|
|
24739
|
-
value:
|
|
24732
|
+
value: name2,
|
|
24740
24733
|
onChange: (v2) => titleChange("name", v2),
|
|
24741
24734
|
placeholder: "\u8BF7\u9009\u62E9\u6216\u8005\u8F93\u5165\u53D8\u91CF\u540D"
|
|
24742
24735
|
}), titleType.includes("groupKey") && /* @__PURE__ */ React$1.createElement("div", {
|
|
@@ -24758,7 +24751,7 @@ const TitleRender$2 = (props) => {
|
|
|
24758
24751
|
const ContentRender$2 = (props) => {
|
|
24759
24752
|
var _a2, _b2;
|
|
24760
24753
|
const { values, effects, onChange, schema, index: index2, extraFieldSchema: extraFieldSchema2, updateForceFLag, listSchema } = props;
|
|
24761
|
-
const { type, label, name } = values;
|
|
24754
|
+
const { type, label, name: name2 } = values;
|
|
24762
24755
|
const { formilySchema: formilySchema2, dataAdaptor: dataAdaptor2 } = schema || {};
|
|
24763
24756
|
const [uuid, setUuid] = useState(uuidv4());
|
|
24764
24757
|
const { dataMap, getModule } = useModule$1();
|
|
@@ -24900,7 +24893,7 @@ function MddTableForm(props, ref) {
|
|
|
24900
24893
|
index: idx,
|
|
24901
24894
|
draggable,
|
|
24902
24895
|
onChange: (record, invokeType) => {
|
|
24903
|
-
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24896
|
+
const { type, name: name2, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24904
24897
|
const newRecord = { ...record, ...otherProps };
|
|
24905
24898
|
onTableFormChange({ index: idx, record: newRecord });
|
|
24906
24899
|
},
|
|
@@ -24922,8 +24915,8 @@ function MddTableForm(props, ref) {
|
|
|
24922
24915
|
effects,
|
|
24923
24916
|
listSchema: dataRef.current,
|
|
24924
24917
|
onChange: ({ record }) => {
|
|
24925
|
-
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
24926
|
-
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 };
|
|
24927
24920
|
if (penetrateType) {
|
|
24928
24921
|
newRecord[type] = otherProps[type];
|
|
24929
24922
|
}
|
|
@@ -25494,7 +25487,7 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25494
25487
|
const treeLinkageCheck = schema.get("treeLinkageCheck");
|
|
25495
25488
|
const loadChildrenDataApiPanel = schema.getLoadChildrenDataApiPanel();
|
|
25496
25489
|
const onAddHandle = (key) => {
|
|
25497
|
-
var _a3, _b2,
|
|
25490
|
+
var _a3, _b2, _c2, _d;
|
|
25498
25491
|
switch (key) {
|
|
25499
25492
|
case "bulkActions":
|
|
25500
25493
|
schema.add(
|
|
@@ -25542,7 +25535,7 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25542
25535
|
"actionColumns",
|
|
25543
25536
|
true
|
|
25544
25537
|
);
|
|
25545
|
-
(
|
|
25538
|
+
(_c2 = operateMddFormRef.current) == null ? void 0 : _c2.updateData(schema.get("actionColumns"));
|
|
25546
25539
|
break;
|
|
25547
25540
|
case "rowDoubleClick":
|
|
25548
25541
|
schema.add(
|
|
@@ -25563,14 +25556,14 @@ function TablePanel$3({ schema, swaggerFields = [] }) {
|
|
|
25563
25556
|
}
|
|
25564
25557
|
};
|
|
25565
25558
|
const onRemoveHandle = (index2, key) => {
|
|
25566
|
-
var _a3, _b2,
|
|
25559
|
+
var _a3, _b2, _c2, _d;
|
|
25567
25560
|
schema.remove(index2, key, true);
|
|
25568
25561
|
if (key === "bulkActions") {
|
|
25569
25562
|
(_a3 = bulkMddFormRef.current) == null ? void 0 : _a3.updateData(schema.get("bulkActions"));
|
|
25570
25563
|
} else if (key === "columns") {
|
|
25571
25564
|
(_b2 = columnMddFormRef.current) == null ? void 0 : _b2.updateData(schema.get("columns"));
|
|
25572
25565
|
} else if (key === "actionColumns") {
|
|
25573
|
-
(
|
|
25566
|
+
(_c2 = operateMddFormRef.current) == null ? void 0 : _c2.updateData(schema.get("actionColumns"));
|
|
25574
25567
|
} else if (key === "rowDoubleClick") {
|
|
25575
25568
|
(_d = rowDoubleClickRef.current) == null ? void 0 : _d.updateData(schema.get("rowDoubleClick"));
|
|
25576
25569
|
}
|
|
@@ -25841,7 +25834,7 @@ function hackRowDetail$1(schema) {
|
|
|
25841
25834
|
schema.set("rowDetail", void 0);
|
|
25842
25835
|
}
|
|
25843
25836
|
}
|
|
25844
|
-
var
|
|
25837
|
+
var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
25845
25838
|
(function(module, exports) {
|
|
25846
25839
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25847
25840
|
function stringifiable(obj) {
|
|
@@ -25863,7 +25856,7 @@ var immutabilityHelper = { exports: {} };
|
|
|
25863
25856
|
function type(obj) {
|
|
25864
25857
|
return toString2.call(obj).slice(8, -1);
|
|
25865
25858
|
}
|
|
25866
|
-
var
|
|
25859
|
+
var assign2 = Object.assign || function(target, source) {
|
|
25867
25860
|
getAllKeys2(source).forEach(function(key) {
|
|
25868
25861
|
if (hasOwnProperty2.call(source, key)) {
|
|
25869
25862
|
target[key] = source[key];
|
|
@@ -25877,11 +25870,11 @@ var immutabilityHelper = { exports: {} };
|
|
|
25877
25870
|
return Object.keys(obj);
|
|
25878
25871
|
};
|
|
25879
25872
|
function copy(object) {
|
|
25880
|
-
return Array.isArray(object) ?
|
|
25873
|
+
return Array.isArray(object) ? assign2(object.constructor(object.length), object) : type(object) === "Map" ? new Map(object) : type(object) === "Set" ? new Set(object) : object && typeof object === "object" ? assign2(Object.create(Object.getPrototypeOf(object)), object) : object;
|
|
25881
25874
|
}
|
|
25882
25875
|
var Context = function() {
|
|
25883
25876
|
function Context2() {
|
|
25884
|
-
this.commands =
|
|
25877
|
+
this.commands = assign2({}, defaultCommands);
|
|
25885
25878
|
this.update = this.update.bind(this);
|
|
25886
25879
|
this.update.extend = this.extend = this.extend.bind(this);
|
|
25887
25880
|
this.update.isEquals = function(x, y) {
|
|
@@ -26040,7 +26033,7 @@ var immutabilityHelper = { exports: {} };
|
|
|
26040
26033
|
exports.isEquals = defaultContext.update.isEquals;
|
|
26041
26034
|
exports.extend = defaultContext.extend;
|
|
26042
26035
|
exports.default = defaultContext.update;
|
|
26043
|
-
exports.default.default = module.exports =
|
|
26036
|
+
exports.default.default = module.exports = assign2(exports.default, exports);
|
|
26044
26037
|
function invariantPushAndUnshift(value, spec, command) {
|
|
26045
26038
|
invariant2(Array.isArray(value), function() {
|
|
26046
26039
|
return "update(): expected target of " + stringifiable(command) + " to be an array; got " + stringifiable(value) + ".";
|
|
@@ -26087,8 +26080,8 @@ var immutabilityHelper = { exports: {} };
|
|
|
26087
26080
|
return "update(): " + stringifiable(command) + " expects a target of type Set or Map; got " + stringifiable(typeOfTarget);
|
|
26088
26081
|
});
|
|
26089
26082
|
}
|
|
26090
|
-
})(
|
|
26091
|
-
var update = /* @__PURE__ */ getDefaultExportFromCjs(
|
|
26083
|
+
})(_immutabilityHelper_3_1_1_immutabilityHelper, _immutabilityHelper_3_1_1_immutabilityHelper.exports);
|
|
26084
|
+
var update = /* @__PURE__ */ getDefaultExportFromCjs(_immutabilityHelper_3_1_1_immutabilityHelper.exports);
|
|
26092
26085
|
const mddTableArray$1 = "_mddTableArray_16ght_1";
|
|
26093
26086
|
const tableArrayTitle$1 = "_tableArrayTitle_16ght_14";
|
|
26094
26087
|
const tableArrayContent$1 = "_tableArrayContent_16ght_18";
|
|
@@ -27080,12 +27073,12 @@ function DetailImageView(props) {
|
|
|
27080
27073
|
wrapperCol: { span: 19 },
|
|
27081
27074
|
size: "small",
|
|
27082
27075
|
onChange: (values, item) => {
|
|
27083
|
-
const { name, value } = item;
|
|
27076
|
+
const { name: name2, value } = item;
|
|
27084
27077
|
let realValue = value;
|
|
27085
|
-
if (["itemWidth", "itemHeight"].includes(
|
|
27078
|
+
if (["itemWidth", "itemHeight"].includes(name2)) {
|
|
27086
27079
|
realValue = Number(value);
|
|
27087
27080
|
}
|
|
27088
|
-
data.set(
|
|
27081
|
+
data.set(name2, realValue);
|
|
27089
27082
|
onChange({ index: idx, record: data });
|
|
27090
27083
|
}
|
|
27091
27084
|
}, /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
@@ -28461,7 +28454,7 @@ function FtpBuild({ schema }) {
|
|
|
28461
28454
|
}))));
|
|
28462
28455
|
}
|
|
28463
28456
|
var index = "";
|
|
28464
|
-
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";
|
|
28465
28458
|
function Toolbar(props) {
|
|
28466
28459
|
const { schema, scriptInfo = { script: "", style: "" }, showScript, scriptTopButtons } = props;
|
|
28467
28460
|
const [fullscreen, setFullscreen] = React$1.useState(false);
|
|
@@ -28941,4 +28934,63 @@ function getDefaultIndexStyle() {
|
|
|
28941
28934
|
// }
|
|
28942
28935
|
`;
|
|
28943
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
|
+
);
|
|
28944
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 };
|