szld-libs 0.4.40 → 0.4.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/szld-components.es.js +5164 -5144
- package/dist/szld-components.umd.js +41 -41
- package/es/components/DynamicForm/index.d.ts +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +12 -4
- package/es/components/DynamicFormMobile/useDynamicForm.js +14 -2
- package/es/index.js +9 -4
- package/es/mock/index.js +323 -408
- package/lib/components/DynamicForm/index.d.ts +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +12 -4
- package/lib/components/DynamicFormMobile/useDynamicForm.js +14 -2
- package/lib/index.js +9 -4
- package/lib/mock/index.js +323 -408
- package/package.json +1 -1
- package/es/services/index.d.ts +0 -6
- package/es/services/index.js +0 -83
- package/es/services/request.d.ts +0 -6
- package/es/services/request.js +0 -140
- package/es/services/status.d.ts +0 -1
- package/es/services/status.js +0 -44
- package/es/services/vite.svg +0 -1
- package/lib/services/index.d.ts +0 -6
- package/lib/services/index.js +0 -83
- package/lib/services/request.d.ts +0 -6
- package/lib/services/request.js +0 -140
- package/lib/services/status.d.ts +0 -1
- package/lib/services/status.js +0 -44
- package/lib/services/vite.svg +0 -1
|
@@ -300,7 +300,7 @@ function useDynamicForm(props) {
|
|
|
300
300
|
formListField,
|
|
301
301
|
isShowLabel = true
|
|
302
302
|
}) => {
|
|
303
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
304
304
|
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
305
305
|
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true) {
|
|
306
306
|
return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
@@ -334,6 +334,13 @@ function useDynamicForm(props) {
|
|
|
334
334
|
{
|
|
335
335
|
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
336
336
|
required: ((_e = itemWithJson.json) == null ? void 0 : _e.must) && !hidden,
|
|
337
|
+
extra: /* @__PURE__ */ jsx(
|
|
338
|
+
"span",
|
|
339
|
+
{
|
|
340
|
+
style: { marginTop: 10, display: "inline-block", color: (_g = (_f = itemWithJson.json) == null ? void 0 : _f.extraDescObj) == null ? void 0 : _g.color },
|
|
341
|
+
children: (_i = (_h = itemWithJson.json) == null ? void 0 : _h.extraDescObj) == null ? void 0 : _i.info
|
|
342
|
+
}
|
|
343
|
+
),
|
|
337
344
|
children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
|
|
338
345
|
var _a2, _b2, _c2, _d2, _e2;
|
|
339
346
|
let initValue = handleSetFormItemInitialValue(item);
|
|
@@ -399,17 +406,18 @@ function useDynamicForm(props) {
|
|
|
399
406
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
400
407
|
initialValue,
|
|
401
408
|
hidden,
|
|
409
|
+
extra: /* @__PURE__ */ jsx("span", { style: { marginTop: 10, display: "inline-block", color: (_k = (_j = itemWithJson.json) == null ? void 0 : _j.extraDescObj) == null ? void 0 : _k.color }, children: (_m = (_l = itemWithJson.json) == null ? void 0 : _l.extraDescObj) == null ? void 0 : _m.info }),
|
|
402
410
|
rules: [
|
|
403
|
-
...((
|
|
411
|
+
...((_n = itemWithJson.json) == null ? void 0 : _n.must) && !hidden ? [
|
|
404
412
|
{
|
|
405
413
|
required: true,
|
|
406
414
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
407
415
|
}
|
|
408
416
|
] : [],
|
|
409
|
-
...((
|
|
417
|
+
...((_o = itemWithJson.json) == null ? void 0 : _o.regexp) ? [
|
|
410
418
|
{
|
|
411
419
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
412
|
-
message: ((
|
|
420
|
+
message: ((_p = itemWithJson.json) == null ? void 0 : _p["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
413
421
|
}
|
|
414
422
|
] : []
|
|
415
423
|
],
|
|
@@ -253,7 +253,7 @@ function useDynamicForm(props) {
|
|
|
253
253
|
formListField,
|
|
254
254
|
isShowLabel = true
|
|
255
255
|
}) => {
|
|
256
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
256
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
257
257
|
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
258
258
|
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true || (hideAttrList == null ? void 0 : hideAttrList.includes(itemWithJson.attrid))) {
|
|
259
259
|
return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
@@ -284,7 +284,7 @@ function useDynamicForm(props) {
|
|
|
284
284
|
const { combinations = [] } = itemWithJson.json || {};
|
|
285
285
|
if (combinations == null ? void 0 : combinations.length) {
|
|
286
286
|
return /* @__PURE__ */ jsx(Flex, { children: combinations.map((item, index) => {
|
|
287
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
287
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
|
|
288
288
|
let initValue = handleSetFormItemInitialValue(item);
|
|
289
289
|
let width = defaultWidth;
|
|
290
290
|
const mode = item.json.input || "text";
|
|
@@ -323,6 +323,17 @@ function useDynamicForm(props) {
|
|
|
323
323
|
}
|
|
324
324
|
] : []
|
|
325
325
|
],
|
|
326
|
+
intro: /* @__PURE__ */ jsx(
|
|
327
|
+
"span",
|
|
328
|
+
{
|
|
329
|
+
style: {
|
|
330
|
+
marginTop: 10,
|
|
331
|
+
display: "inline-block",
|
|
332
|
+
color: (_i2 = (_h2 = itemWithJson.json) == null ? void 0 : _h2.extraDescObj) == null ? void 0 : _i2.color
|
|
333
|
+
},
|
|
334
|
+
children: (_k2 = (_j2 = itemWithJson.json) == null ? void 0 : _j2.extraDescObj) == null ? void 0 : _k2.info
|
|
335
|
+
}
|
|
336
|
+
),
|
|
326
337
|
...handleSetFormItemProps(item),
|
|
327
338
|
children: handleRenderItemInputMode({
|
|
328
339
|
item,
|
|
@@ -368,6 +379,7 @@ function useDynamicForm(props) {
|
|
|
368
379
|
] : []
|
|
369
380
|
],
|
|
370
381
|
...handleSetFormItemProps(itemWithJson),
|
|
382
|
+
intro: /* @__PURE__ */ jsx("span", { style: { marginTop: 10, display: "inline-block", color: (_i = (_h = itemWithJson.json) == null ? void 0 : _h.extraDescObj) == null ? void 0 : _i.color }, children: (_k = (_j = itemWithJson.json) == null ? void 0 : _j.extraDescObj) == null ? void 0 : _k.info }),
|
|
371
383
|
children: handleRenderItemInputMode({
|
|
372
384
|
item: itemWithJson,
|
|
373
385
|
readonly,
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { commonRequestWidthParams, uploadFormAction, commonRequest } from "./services";
|
|
3
2
|
import { handleAttrList, handleSubmitForm } from "./utils/method";
|
|
4
3
|
import { BackHeader, DynamicFormMobile } from "./main";
|
|
5
4
|
import { BrowserRouter } from "react-router-dom";
|
|
@@ -45,9 +44,15 @@ const Demo = () => {
|
|
|
45
44
|
relatedid: "guid",
|
|
46
45
|
colNum: 1,
|
|
47
46
|
defaultWidth: 358,
|
|
48
|
-
commonRequestWidthParams
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
commonRequestWidthParams: () => {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
uploadAction: () => "",
|
|
52
|
+
commonRequest: () => {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
});
|
|
55
|
+
},
|
|
51
56
|
instructionShowMode: "icon",
|
|
52
57
|
ref: formRef,
|
|
53
58
|
langId
|