szld-libs 0.4.7 → 0.4.9

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.
@@ -86,7 +86,7 @@ const DynamicForm = forwardRef((props, ref) => {
86
86
  align: "center",
87
87
  children: [
88
88
  /* @__PURE__ */ jsx("span", { style: { color: "#555555" }, children: langId === "10001" ? `第${idx + 1}条` : `Record ${idx + 1}` }),
89
- /* @__PURE__ */ jsx("a", { style: { color: "#ff4d4f" }, onClick: () => remove(idx), children: langId === "10001" ? "删除" : "Delete" })
89
+ fields.length > 1 && /* @__PURE__ */ jsx("a", { style: { color: "#ff4d4f" }, onClick: () => remove(idx), children: langId === "10001" ? "删除" : "Delete" })
90
90
  ]
91
91
  }
92
92
  ),
@@ -117,6 +117,7 @@ const MySelect = ({
117
117
  {
118
118
  popup: true,
119
119
  columns: options,
120
+ placeholder: "",
120
121
  columnsFieldNames: {
121
122
  text: "label"
122
123
  },
@@ -391,6 +391,10 @@ function useUniversalTable() {
391
391
  const updatedSelList = currentSelList.map((item) => {
392
392
  var _a, _b;
393
393
  const { input, inputType } = (item == null ? void 0 : item.renderdata) || {};
394
+ const defaultRenderData = item == null ? void 0 : item["default-render-data"];
395
+ if (defaultRenderData) {
396
+ return item;
397
+ }
394
398
  if (input === "tab" && (inputType == null ? void 0 : inputType.startsWith("local-")) && (tabItems == null ? void 0 : tabItems.length) && (currentActive || currentActive === 0)) {
395
399
  const tabConfig = currentSelList.find((item2) => input === "tab" && (inputType == null ? void 0 : inputType.startsWith("local-")));
396
400
  const selectedPackage = tabItems[currentActive];
package/es/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { commonRequestWidthParams, uploadFormAction, commonRequest } from "./services";
3
3
  import { handleAttrList } from "./utils/method";
4
- import { BackHeader, DynamicForm } from "./main";
4
+ import { BackHeader, DynamicFormMobile } from "./main";
5
5
  import { BrowserRouter } from "react-router-dom";
6
- import { ConfigProvider, App, Form } from "antd";
6
+ import { ConfigProvider, App } from "antd";
7
+ import { Form } from "react-vant";
7
8
  import { useRef, useState, useEffect } from "react";
8
9
  import ReactDOM from "react-dom/client";
9
10
  import zhCN from "antd/es/locale/zh_CN";
@@ -22,26 +23,13 @@ const Demo = () => {
22
23
  };
23
24
  useEffect(() => {
24
25
  setList(handleAttrList(attrList));
25
- setTimeout(() => {
26
- form.setFieldsValue({
27
- customFormList: [
28
- {
29
- "30BDE6E7977E40069B55DDE61C8795AE": "2026-05-29",
30
- "38A7DADC6D64492D83DA607EC121A02D": "12",
31
- "7BB9BE8A96824CCF89B721C8F1AF9F38": "7:00am – 7:30am",
32
- "665F59E637664037939512C9877EAD75": "2222",
33
- "290CF33D2AAD45399987987FAB80900B": "4"
34
- }
35
- ]
36
- });
37
- }, 2e3);
38
26
  }, []);
39
27
  const onFinish = async (values) => {
40
28
  };
41
29
  return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
42
30
  /* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
43
31
  /* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsx(Form, { form, onValuesChange, onFinish, children: /* @__PURE__ */ jsx(
44
- DynamicForm,
32
+ DynamicFormMobile,
45
33
  {
46
34
  formConfig: list,
47
35
  readonly: false,
package/es/mock/index.js CHANGED
@@ -38,7 +38,7 @@ const attrList = [
38
38
  attrid: "7BB9BE8A96824CCF89B721C8F1AF9F38",
39
39
  attrname: "Feeding Time",
40
40
  attrtype: 0,
41
- info: '{"input":"mult-select","dataType":"string","length":100,"inputType":"local","data":["7:00am – 7:30am", "7:30am – 8:00am", "8:00am – 8:30am", "8:30am – 9:00am", "9:00am – 9:30am", "9:30am – 10:00am", "10:00am – 10:30am", "10:30am – 11:00am", "11:00am – 11:30am", "11:30am – 12:00pm", "12:00pm – 12:30pm", "12:30pm – 1:00pm", "1:00pm – 1:30pm", "1:30pm – 2:00pm", "2:00pm – 2:30pm", "2:30pm – 3:00pm", "3:00pm – 3:30pm", "3:30pm – 4:00pm", "4:00pm – 4:30pm", "4:30pm – 5:00pm", "5:00pm – 5:30pm", "5:30pm – 6:00pm", "6:00pm – 6:30pm", "6:30pm – 7:00pm", "7:00pm – 7:30pm", "7:30pm – 8:00pm"],"must":true}',
41
+ info: '{"input":"select","dataType":"string","length":100,"inputType":"local","data":["7:00am – 7:30am", "7:30am – 8:00am", "8:00am – 8:30am", "8:30am – 9:00am", "9:00am – 9:30am", "9:30am – 10:00am", "10:00am – 10:30am", "10:30am – 11:00am", "11:00am – 11:30am", "11:30am – 12:00pm", "12:00pm – 12:30pm", "12:30pm – 1:00pm", "1:00pm – 1:30pm", "1:30pm – 2:00pm", "2:00pm – 2:30pm", "2:30pm – 3:00pm", "3:00pm – 3:30pm", "3:30pm – 4:00pm", "4:00pm – 4:30pm", "4:30pm – 5:00pm", "5:00pm – 5:30pm", "5:30pm – 6:00pm", "6:00pm – 6:30pm", "6:30pm – 7:00pm", "7:00pm – 7:30pm", "7:30pm – 8:00pm"],"must":true}',
42
42
  info_base64: 0,
43
43
  createtime: "2026-02-11 15:12:26",
44
44
  attrvalue: "",
@@ -87,7 +87,7 @@ const DynamicForm = react.forwardRef((props, ref) => {
87
87
  align: "center",
88
88
  children: [
89
89
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#555555" }, children: langId === "10001" ? `第${idx + 1}条` : `Record ${idx + 1}` }),
90
- /* @__PURE__ */ jsxRuntime.jsx("a", { style: { color: "#ff4d4f" }, onClick: () => remove(idx), children: langId === "10001" ? "删除" : "Delete" })
90
+ fields.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("a", { style: { color: "#ff4d4f" }, onClick: () => remove(idx), children: langId === "10001" ? "删除" : "Delete" })
91
91
  ]
92
92
  }
93
93
  ),
@@ -118,6 +118,7 @@ const MySelect = ({
118
118
  {
119
119
  popup: true,
120
120
  columns: options,
121
+ placeholder: "",
121
122
  columnsFieldNames: {
122
123
  text: "label"
123
124
  },
@@ -392,6 +392,10 @@ function useUniversalTable() {
392
392
  const updatedSelList = currentSelList.map((item) => {
393
393
  var _a, _b;
394
394
  const { input, inputType } = (item == null ? void 0 : item.renderdata) || {};
395
+ const defaultRenderData = item == null ? void 0 : item["default-render-data"];
396
+ if (defaultRenderData) {
397
+ return item;
398
+ }
395
399
  if (input === "tab" && (inputType == null ? void 0 : inputType.startsWith("local-")) && (tabItems == null ? void 0 : tabItems.length) && (currentActive || currentActive === 0)) {
396
400
  const tabConfig = currentSelList.find((item2) => input === "tab" && (inputType == null ? void 0 : inputType.startsWith("local-")));
397
401
  const selectedPackage = tabItems[currentActive];
package/lib/index.js CHANGED
@@ -5,6 +5,7 @@ const method = require("./utils/method");
5
5
  const main = require("./main");
6
6
  const reactRouterDom = require("react-router-dom");
7
7
  const antd = require("antd");
8
+ const reactVant = require("react-vant");
8
9
  const react = require("react");
9
10
  const ReactDOM = require("react-dom/client");
10
11
  const zhCN = require("antd/es/locale/zh_CN");
@@ -16,33 +17,20 @@ const tableDetail = "";
16
17
  dayjs.locale("zh-cn");
17
18
  const Demo = () => {
18
19
  const formRef = react.useRef(null);
19
- const [form] = antd.Form.useForm();
20
+ const [form] = reactVant.Form.useForm();
20
21
  const [list, setList] = react.useState([]);
21
22
  const [langId, setLangId] = react.useState("");
22
23
  const onValuesChange = async (values, allValues) => {
23
24
  };
24
25
  react.useEffect(() => {
25
26
  setList(method.handleAttrList(mock.attrList));
26
- setTimeout(() => {
27
- form.setFieldsValue({
28
- customFormList: [
29
- {
30
- "30BDE6E7977E40069B55DDE61C8795AE": "2026-05-29",
31
- "38A7DADC6D64492D83DA607EC121A02D": "12",
32
- "7BB9BE8A96824CCF89B721C8F1AF9F38": "7:00am – 7:30am",
33
- "665F59E637664037939512C9877EAD75": "2222",
34
- "290CF33D2AAD45399987987FAB80900B": "4"
35
- }
36
- ]
37
- });
38
- }, 2e3);
39
27
  }, []);
40
28
  const onFinish = async (values) => {
41
29
  };
42
30
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
43
31
  /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
44
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { form, onValuesChange, onFinish, children: /* @__PURE__ */ jsxRuntime.jsx(
45
- main.DynamicForm,
32
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx(reactVant.Form, { form, onValuesChange, onFinish, children: /* @__PURE__ */ jsxRuntime.jsx(
33
+ main.DynamicFormMobile,
46
34
  {
47
35
  formConfig: list,
48
36
  readonly: false,
package/lib/mock/index.js CHANGED
@@ -40,7 +40,7 @@ const attrList = [
40
40
  attrid: "7BB9BE8A96824CCF89B721C8F1AF9F38",
41
41
  attrname: "Feeding Time",
42
42
  attrtype: 0,
43
- info: '{"input":"mult-select","dataType":"string","length":100,"inputType":"local","data":["7:00am – 7:30am", "7:30am – 8:00am", "8:00am – 8:30am", "8:30am – 9:00am", "9:00am – 9:30am", "9:30am – 10:00am", "10:00am – 10:30am", "10:30am – 11:00am", "11:00am – 11:30am", "11:30am – 12:00pm", "12:00pm – 12:30pm", "12:30pm – 1:00pm", "1:00pm – 1:30pm", "1:30pm – 2:00pm", "2:00pm – 2:30pm", "2:30pm – 3:00pm", "3:00pm – 3:30pm", "3:30pm – 4:00pm", "4:00pm – 4:30pm", "4:30pm – 5:00pm", "5:00pm – 5:30pm", "5:30pm – 6:00pm", "6:00pm – 6:30pm", "6:30pm – 7:00pm", "7:00pm – 7:30pm", "7:30pm – 8:00pm"],"must":true}',
43
+ info: '{"input":"select","dataType":"string","length":100,"inputType":"local","data":["7:00am – 7:30am", "7:30am – 8:00am", "8:00am – 8:30am", "8:30am – 9:00am", "9:00am – 9:30am", "9:30am – 10:00am", "10:00am – 10:30am", "10:30am – 11:00am", "11:00am – 11:30am", "11:30am – 12:00pm", "12:00pm – 12:30pm", "12:30pm – 1:00pm", "1:00pm – 1:30pm", "1:30pm – 2:00pm", "2:00pm – 2:30pm", "2:30pm – 3:00pm", "3:00pm – 3:30pm", "3:30pm – 4:00pm", "4:00pm – 4:30pm", "4:30pm – 5:00pm", "5:00pm – 5:30pm", "5:30pm – 6:00pm", "6:00pm – 6:30pm", "6:30pm – 7:00pm", "7:00pm – 7:30pm", "7:30pm – 8:00pm"],"must":true}',
44
44
  info_base64: 0,
45
45
  createtime: "2026-02-11 15:12:26",
46
46
  attrvalue: "",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.4.7",
4
+ "version": "0.4.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",