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.
@@ -18,6 +18,7 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ extraDescObj?: Record<string, any>;
21
22
  hidden?: boolean; // 是否隐藏属性
22
23
  'auto-generate'?: boolean; // 是否自动生成时间
23
24
  'auto-generate-type'?: string; // 自动生成时间类型
@@ -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
- ...((_f = itemWithJson.json) == null ? void 0 : _f.must) && !hidden ? [
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
- ...((_g = itemWithJson.json) == null ? void 0 : _g.regexp) ? [
417
+ ...((_o = itemWithJson.json) == null ? void 0 : _o.regexp) ? [
410
418
  {
411
419
  pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
412
- message: ((_h = itemWithJson.json) == null ? void 0 : _h["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
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
- uploadAction: uploadFormAction,
50
- commonRequest,
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