szld-libs 0.3.61 → 0.3.62

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.
@@ -51,7 +51,8 @@ function useUniversalTable() {
51
51
  searchItems.map(async (item) => {
52
52
  var _a;
53
53
  const renderdata = item.renderdata || {};
54
- const { input, width, labelCol } = renderdata || {};
54
+ const { input, width } = renderdata || {};
55
+ const labelCol = (renderdata == null ? void 0 : renderdata["label-col"]) || 6;
55
56
  const renderPlaceholder = () => {
56
57
  const value = renderdata["default-prompt"];
57
58
  if (getTitle) {
@@ -106,8 +107,8 @@ function useUniversalTable() {
106
107
  },
107
108
  colProps: {},
108
109
  formItemProps: {
109
- style: { marginBottom: 10, width: width || 240 },
110
- labelCol: { span: labelCol || 6 }
110
+ style: { marginBottom: 10, width: typeof width === "string" ? `${width}px` : width || 240 },
111
+ labelCol: { span: labelCol }
111
112
  }
112
113
  };
113
114
  if (["select", "checkbox", "radio", "mult-select", "cascader"].includes(input)) {
@@ -210,7 +211,8 @@ function useUniversalTable() {
210
211
  title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"])) || "" : (item == null ? void 0 : item["header-name"]) || "",
211
212
  dataIndex: (item == null ? void 0 : item["header-attribute-id"]) || "",
212
213
  width: isDefaultWidth ? (item == null ? void 0 : item["header-width"]) || 180 : void 0,
213
- render: (text) => {
214
+ render: (text, record) => {
215
+ var _a, _b;
214
216
  if (text && text && typeof text === "string" && (text == null ? void 0 : text.includes("FileName")) && (text == null ? void 0 : text.includes("FilePath"))) {
215
217
  try {
216
218
  const items = JSON.parse(text);
@@ -229,22 +231,22 @@ function useUniversalTable() {
229
231
  return /* @__PURE__ */ jsx(Space, {});
230
232
  }
231
233
  if ((item == null ? void 0 : item["show-lang-data-id"]) && otherLangPageId) {
232
- if (text && text && typeof text === "string" && (text == null ? void 0 : text.includes("delimiter"))) {
233
- const isObj = isArrayString(text);
234
- if (isObj) {
235
- const { list: list2, delimiter = "," } = JSON.parse(text) || {};
236
- const newList = list2 == null ? void 0 : list2.map((item2) => {
237
- if (!item2)
238
- return "-";
239
- const arr = (item2 == null ? void 0 : item2.split("|")) || [];
240
- const pageId = (arr == null ? void 0 : arr.length) > 1 ? arr[0] : objDefaultLangPageId;
241
- const str = (arr == null ? void 0 : arr.length) > 1 ? arr[1] : arr[0];
242
- return (getTitle == null ? void 0 : getTitle(pageId, str)) || "-";
243
- });
244
- return (newList == null ? void 0 : newList.join(delimiter)) || "-";
245
- } else {
246
- return text || "-";
247
- }
234
+ if (text && text && typeof text === "object" && ((_a = Object.keys(text)) == null ? void 0 : _a.includes("delimiter"))) {
235
+ const { list: list2, delimiter = "," } = text || {};
236
+ const newList = list2 == null ? void 0 : list2.map((item2) => {
237
+ if (!item2)
238
+ return "-";
239
+ const arr = (item2 == null ? void 0 : item2.split("|")) || [];
240
+ const pageId = (arr == null ? void 0 : arr.length) > 1 ? arr[0] : objDefaultLangPageId;
241
+ const str = (arr == null ? void 0 : arr.length) > 1 ? arr[1] : arr[0];
242
+ return (getTitle == null ? void 0 : getTitle(pageId, str)) || "-";
243
+ });
244
+ return /* @__PURE__ */ jsx(
245
+ "span",
246
+ {
247
+ dangerouslySetInnerHTML: { __html: ((_b = newList == null ? void 0 : newList.join(delimiter)) == null ? void 0 : _b.replace(/\n/g, "<br>")) || "-" }
248
+ }
249
+ );
248
250
  }
249
251
  return /* @__PURE__ */ jsx(Tooltip, { title: text, children: /* @__PURE__ */ jsx("span", { style: { cursor: "pointer" }, children: (getTitle == null ? void 0 : getTitle(otherLangPageId, text)) || "-" }) });
250
252
  }
@@ -52,7 +52,8 @@ function useUniversalTable() {
52
52
  searchItems.map(async (item) => {
53
53
  var _a;
54
54
  const renderdata = item.renderdata || {};
55
- const { input, width, labelCol } = renderdata || {};
55
+ const { input, width } = renderdata || {};
56
+ const labelCol = (renderdata == null ? void 0 : renderdata["label-col"]) || 6;
56
57
  const renderPlaceholder = () => {
57
58
  const value = renderdata["default-prompt"];
58
59
  if (getTitle) {
@@ -107,8 +108,8 @@ function useUniversalTable() {
107
108
  },
108
109
  colProps: {},
109
110
  formItemProps: {
110
- style: { marginBottom: 10, width: width || 240 },
111
- labelCol: { span: labelCol || 6 }
111
+ style: { marginBottom: 10, width: typeof width === "string" ? `${width}px` : width || 240 },
112
+ labelCol: { span: labelCol }
112
113
  }
113
114
  };
114
115
  if (["select", "checkbox", "radio", "mult-select", "cascader"].includes(input)) {
@@ -211,7 +212,8 @@ function useUniversalTable() {
211
212
  title: attributeSetId ? (getTitle == null ? void 0 : getTitle(attributeSetId, item == null ? void 0 : item["header-attribute-id"])) || "" : (item == null ? void 0 : item["header-name"]) || "",
212
213
  dataIndex: (item == null ? void 0 : item["header-attribute-id"]) || "",
213
214
  width: isDefaultWidth ? (item == null ? void 0 : item["header-width"]) || 180 : void 0,
214
- render: (text) => {
215
+ render: (text, record) => {
216
+ var _a, _b;
215
217
  if (text && text && typeof text === "string" && (text == null ? void 0 : text.includes("FileName")) && (text == null ? void 0 : text.includes("FilePath"))) {
216
218
  try {
217
219
  const items = JSON.parse(text);
@@ -230,22 +232,22 @@ function useUniversalTable() {
230
232
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Space, {});
231
233
  }
232
234
  if ((item == null ? void 0 : item["show-lang-data-id"]) && otherLangPageId) {
233
- if (text && text && typeof text === "string" && (text == null ? void 0 : text.includes("delimiter"))) {
234
- const isObj = isArrayString(text);
235
- if (isObj) {
236
- const { list: list2, delimiter = "," } = JSON.parse(text) || {};
237
- const newList = list2 == null ? void 0 : list2.map((item2) => {
238
- if (!item2)
239
- return "-";
240
- const arr = (item2 == null ? void 0 : item2.split("|")) || [];
241
- const pageId = (arr == null ? void 0 : arr.length) > 1 ? arr[0] : objDefaultLangPageId;
242
- const str = (arr == null ? void 0 : arr.length) > 1 ? arr[1] : arr[0];
243
- return (getTitle == null ? void 0 : getTitle(pageId, str)) || "-";
244
- });
245
- return (newList == null ? void 0 : newList.join(delimiter)) || "-";
246
- } else {
247
- return text || "-";
248
- }
235
+ if (text && text && typeof text === "object" && ((_a = Object.keys(text)) == null ? void 0 : _a.includes("delimiter"))) {
236
+ const { list: list2, delimiter = "," } = text || {};
237
+ const newList = list2 == null ? void 0 : list2.map((item2) => {
238
+ if (!item2)
239
+ return "-";
240
+ const arr = (item2 == null ? void 0 : item2.split("|")) || [];
241
+ const pageId = (arr == null ? void 0 : arr.length) > 1 ? arr[0] : objDefaultLangPageId;
242
+ const str = (arr == null ? void 0 : arr.length) > 1 ? arr[1] : arr[0];
243
+ return (getTitle == null ? void 0 : getTitle(pageId, str)) || "-";
244
+ });
245
+ return /* @__PURE__ */ jsxRuntime.jsx(
246
+ "span",
247
+ {
248
+ dangerouslySetInnerHTML: { __html: ((_b = newList == null ? void 0 : newList.join(delimiter)) == null ? void 0 : _b.replace(/\n/g, "<br>")) || "-" }
249
+ }
250
+ );
249
251
  }
250
252
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { cursor: "pointer" }, children: (getTitle == null ? void 0 : getTitle(otherLangPageId, text)) || "-" }) });
251
253
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.3.61",
4
+ "version": "0.3.62",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",