szld-libs 0.3.53 → 0.3.55

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.
@@ -203,7 +203,7 @@ const processItem = (item, extraAttrs) => {
203
203
  const infoStr = item.info_base64 === 1 ? base64ToString(item.info) : item.info;
204
204
  const json = getJson(infoStr);
205
205
  const _extraAttrs = _.cloneDeep(extraAttrs) || {};
206
- const { langConfig } = _extraAttrs || {};
206
+ const { langConfig = [], attrLangConfig = [] } = _extraAttrs || {};
207
207
  _extraAttrs == null ? true : delete _extraAttrs.langConfig;
208
208
  if ((langConfig == null ? void 0 : langConfig.length) && ((_a = json == null ? void 0 : json.data) == null ? void 0 : _a.length) && (json == null ? void 0 : json.inputType) === "local") {
209
209
  json.options = (_b = json.data) == null ? void 0 : _b.map((v) => {
@@ -215,16 +215,16 @@ const processItem = (item, extraAttrs) => {
215
215
  json == null ? true : delete json.data;
216
216
  }
217
217
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["combination-name"])) {
218
- json["combination-name"] = getTitle(langConfig, json["combination-name"]);
218
+ json["combination-name"] = getTitle(attrLangConfig, json["combination-name"]) || getTitle(langConfig, json["combination-name"]);
219
219
  }
220
220
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["default-prompt"])) {
221
- json["default-prompt"] = getTitle(langConfig, json["default-prompt"]);
221
+ json["default-prompt"] = getTitle(attrLangConfig, json["default-prompt"]);
222
222
  }
223
223
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json.instruction)) {
224
- json.instruction = getTitle(langConfig, json.instruction);
224
+ json.instruction = getTitle(attrLangConfig, json.instruction);
225
225
  }
226
226
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["regexp-message"])) {
227
- json["regexp-message"] = getTitle(langConfig, json["regexp-message"]);
227
+ json["regexp-message"] = getTitle(attrLangConfig, json["regexp-message"]);
228
228
  }
229
229
  return { ...item, json, ..._extraAttrs, info: JSON.stringify(json) };
230
230
  } catch (error) {
@@ -480,7 +480,7 @@ const handleSelectOptions = async ({
480
480
  actionUrlKey = "action-url",
481
481
  actionUrlExtraParams = {},
482
482
  item,
483
- langConfig
483
+ langConfig = []
484
484
  }) => {
485
485
  var _a;
486
486
  let options = [];
@@ -550,7 +550,7 @@ const handleSelectOptions = async ({
550
550
  };
551
551
  if (item.inputType === "local") {
552
552
  options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
553
- label: val,
553
+ label: getTitle(langConfig, val),
554
554
  value: val
555
555
  }))) || [];
556
556
  if (item.options && Array.isArray(item.options)) {
@@ -205,7 +205,7 @@ const processItem = (item, extraAttrs) => {
205
205
  const infoStr = item.info_base64 === 1 ? base64ToString(item.info) : item.info;
206
206
  const json = getJson(infoStr);
207
207
  const _extraAttrs = _.cloneDeep(extraAttrs) || {};
208
- const { langConfig } = _extraAttrs || {};
208
+ const { langConfig = [], attrLangConfig = [] } = _extraAttrs || {};
209
209
  _extraAttrs == null ? true : delete _extraAttrs.langConfig;
210
210
  if ((langConfig == null ? void 0 : langConfig.length) && ((_a = json == null ? void 0 : json.data) == null ? void 0 : _a.length) && (json == null ? void 0 : json.inputType) === "local") {
211
211
  json.options = (_b = json.data) == null ? void 0 : _b.map((v) => {
@@ -217,16 +217,16 @@ const processItem = (item, extraAttrs) => {
217
217
  json == null ? true : delete json.data;
218
218
  }
219
219
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["combination-name"])) {
220
- json["combination-name"] = getTitle(langConfig, json["combination-name"]);
220
+ json["combination-name"] = getTitle(attrLangConfig, json["combination-name"]) || getTitle(langConfig, json["combination-name"]);
221
221
  }
222
222
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["default-prompt"])) {
223
- json["default-prompt"] = getTitle(langConfig, json["default-prompt"]);
223
+ json["default-prompt"] = getTitle(attrLangConfig, json["default-prompt"]);
224
224
  }
225
225
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json.instruction)) {
226
- json.instruction = getTitle(langConfig, json.instruction);
226
+ json.instruction = getTitle(attrLangConfig, json.instruction);
227
227
  }
228
228
  if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["regexp-message"])) {
229
- json["regexp-message"] = getTitle(langConfig, json["regexp-message"]);
229
+ json["regexp-message"] = getTitle(attrLangConfig, json["regexp-message"]);
230
230
  }
231
231
  return { ...item, json, ..._extraAttrs, info: JSON.stringify(json) };
232
232
  } catch (error) {
@@ -482,7 +482,7 @@ const handleSelectOptions = async ({
482
482
  actionUrlKey = "action-url",
483
483
  actionUrlExtraParams = {},
484
484
  item,
485
- langConfig
485
+ langConfig = []
486
486
  }) => {
487
487
  var _a;
488
488
  let options = [];
@@ -552,7 +552,7 @@ const handleSelectOptions = async ({
552
552
  };
553
553
  if (item.inputType === "local") {
554
554
  options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
555
- label: val,
555
+ label: getTitle(langConfig, val),
556
556
  value: val
557
557
  }))) || [];
558
558
  if (item.options && Array.isArray(item.options)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.3.53",
4
+ "version": "0.3.55",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -23,7 +23,7 @@
23
23
  "react-router-dom": "^6.6.1",
24
24
  "react-vant": "^3.3.5",
25
25
  "react-window": "^1.8.9",
26
- "szld-libs": "^0.3.50"
26
+ "szld-libs": "^0.3.54"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/crypto-js": "^4.2.1",