matrix_components 2.0.412 → 2.0.414

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.
@@ -54779,13 +54779,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
54779
54779
  },
54780
54780
  setup(__props, { expose: __expose }) {
54781
54781
  useCssVars((_ctx) => ({
54782
- "v0f8c7d00": customBackgroundColor.value,
54783
- "a7946b38": gapV.value,
54784
- "v21172f2e": superLabelWidth.value,
54785
- "v463febee": subLabelWidth.value,
54786
- "v77d7164b": height.value,
54787
- "v33084a56": labelWidth.value,
54788
- "v531446e6": _ctx.$props.labelColor
54782
+ "v41461ce4": customBackgroundColor.value,
54783
+ "v4d8c0496": gapV.value,
54784
+ "v06ef8a12": superLabelWidth.value,
54785
+ "v1fa309fc": subLabelWidth.value,
54786
+ "v1c878bfd": height.value,
54787
+ "v7a429708": labelWidth.value,
54788
+ "v244178ca": _ctx.$props.labelColor
54789
54789
  }));
54790
54790
  const props = __props;
54791
54791
  const initialValues = ref$1(/* @__PURE__ */ new Map());
@@ -55297,7 +55297,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
55297
55297
  };
55298
55298
  });
55299
55299
  function getCascaderDisplayValue(rowInfo) {
55300
- var _a3, _b, _c2, _d;
55300
+ var _a3, _b, _c2, _d, _e;
55301
55301
  if (!rowInfo.value || !((_a3 = rowInfo.params) == null ? void 0 : _a3.options)) {
55302
55302
  return rowInfo.value;
55303
55303
  }
@@ -55306,6 +55306,85 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
55306
55306
  const labelKey = ((_c2 = rowInfo.params.props) == null ? void 0 : _c2.label) || "label";
55307
55307
  const childrenKey = ((_d = rowInfo.params.props) == null ? void 0 : _d.children) || "children";
55308
55308
  const separator = rowInfo.params.separator || " / ";
55309
+ const showAllLevels = rowInfo.params.showAllLevels !== false && rowInfo.params["show-all-levels"] !== false;
55310
+ const isMultiple = ((_e = rowInfo.params.props) == null ? void 0 : _e.multiple) === true;
55311
+ if (isMultiple) {
55312
+ let values2 = [];
55313
+ if (Array.isArray(rowInfo.value)) {
55314
+ values2 = rowInfo.value;
55315
+ } else if (typeof rowInfo.value === "string") {
55316
+ values2 = rowInfo.value.split(",").map((v) => v.trim()).filter((v) => v);
55317
+ } else {
55318
+ values2 = [rowInfo.value];
55319
+ }
55320
+ const displayPaths = [];
55321
+ for (const value of values2) {
55322
+ if (Array.isArray(value)) {
55323
+ const labels = [];
55324
+ let currentOptions = options;
55325
+ for (const val of value) {
55326
+ const currentOption = currentOptions.find((opt) => opt[valueKey] === val);
55327
+ if (!currentOption) {
55328
+ labels.push(val);
55329
+ break;
55330
+ }
55331
+ labels.push(currentOption[labelKey]);
55332
+ if (currentOption[childrenKey] && Array.isArray(currentOption[childrenKey])) {
55333
+ currentOptions = currentOption[childrenKey];
55334
+ } else {
55335
+ break;
55336
+ }
55337
+ }
55338
+ if (!showAllLevels && labels.length > 0) {
55339
+ displayPaths.push(labels[labels.length - 1]);
55340
+ } else {
55341
+ displayPaths.push(labels.join(separator));
55342
+ }
55343
+ } else {
55344
+ const findFullPath2 = (opts, targetValue, currentPath = []) => {
55345
+ for (const option of opts) {
55346
+ if (option[valueKey] === targetValue) {
55347
+ return [...currentPath, option[labelKey]];
55348
+ }
55349
+ if (option[childrenKey] && Array.isArray(option[childrenKey])) {
55350
+ const newPath = [...currentPath, option[labelKey]];
55351
+ const result = findFullPath2(option[childrenKey], targetValue, newPath);
55352
+ if (result) {
55353
+ return result;
55354
+ }
55355
+ }
55356
+ }
55357
+ return null;
55358
+ };
55359
+ const fullPath2 = findFullPath2(options, value);
55360
+ if (fullPath2 && fullPath2.length > 0) {
55361
+ if (!showAllLevels) {
55362
+ displayPaths.push(fullPath2[fullPath2.length - 1]);
55363
+ } else {
55364
+ displayPaths.push(fullPath2.join(separator));
55365
+ }
55366
+ } else {
55367
+ const findOptionInTree2 = (opts, targetValue) => {
55368
+ for (const option of opts) {
55369
+ if (option[valueKey] === targetValue) {
55370
+ return option[labelKey];
55371
+ }
55372
+ if (option[childrenKey] && Array.isArray(option[childrenKey])) {
55373
+ const result = findOptionInTree2(option[childrenKey], targetValue);
55374
+ if (result) {
55375
+ return option[labelKey] + separator + result;
55376
+ }
55377
+ }
55378
+ }
55379
+ return null;
55380
+ };
55381
+ const label2 = findOptionInTree2(options, value);
55382
+ displayPaths.push(label2 || value);
55383
+ }
55384
+ }
55385
+ }
55386
+ return displayPaths.join(",");
55387
+ }
55309
55388
  if (Array.isArray(rowInfo.value)) {
55310
55389
  const labels = [];
55311
55390
  let currentOptions = options;
@@ -55321,8 +55400,33 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
55321
55400
  break;
55322
55401
  }
55323
55402
  }
55403
+ if (!showAllLevels && labels.length > 0) {
55404
+ return labels[labels.length - 1];
55405
+ }
55324
55406
  return labels.join(separator);
55325
55407
  }
55408
+ const findFullPath = (opts, targetValue, currentPath = []) => {
55409
+ for (const option of opts) {
55410
+ if (option[valueKey] === targetValue) {
55411
+ return [...currentPath, option[labelKey]];
55412
+ }
55413
+ if (option[childrenKey] && Array.isArray(option[childrenKey])) {
55414
+ const newPath = [...currentPath, option[labelKey]];
55415
+ const result = findFullPath(option[childrenKey], targetValue, newPath);
55416
+ if (result) {
55417
+ return result;
55418
+ }
55419
+ }
55420
+ }
55421
+ return null;
55422
+ };
55423
+ const fullPath = findFullPath(options, rowInfo.value);
55424
+ if (fullPath && fullPath.length > 0) {
55425
+ if (!showAllLevels) {
55426
+ return fullPath[fullPath.length - 1];
55427
+ }
55428
+ return fullPath.join(separator);
55429
+ }
55326
55430
  const findOptionInTree = (opts, targetValue) => {
55327
55431
  for (const option of opts) {
55328
55432
  if (option[valueKey] === targetValue) {
@@ -55670,7 +55774,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
55670
55774
  };
55671
55775
  }
55672
55776
  });
55673
- const NsForm = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-71562b25"]]);
55777
+ const NsForm = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f5dfded2"]]);
55674
55778
  const _hoisted_1$1 = { class: "title-image-view" };
55675
55779
  const _hoisted_2 = { class: "content-model-title" };
55676
55780
  const _hoisted_3 = { class: "title-text" };
@@ -58437,6 +58541,10 @@ function getBaseUrl() {
58437
58541
  var _a3, _b;
58438
58542
  return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$BaseUrl) || localStorage.getItem("BaseUrl") || localStorage.getItem("bseUrl") || sessionStorage.getItem("BaseUrl") || sessionStorage.getItem("bseUrl") || globalThis.BaseUrl || globalThis.bseUrl || "";
58439
58543
  }
58544
+ function ImageBaseUrl() {
58545
+ var _a3, _b;
58546
+ return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$ImageBaseUrl) || localStorage.getItem("ImageBaseUrl") || localStorage.getItem("imageBaseUrl") || sessionStorage.getItem("ImageBaseUrl") || sessionStorage.getItem("imageBaseUrl") || globalThis.ImageBaseUrl || globalThis.imageBaseUrl || "";
58547
+ }
58440
58548
  const get = async (url, params, base = "", customConfig = {}, errorCallback = null) => {
58441
58549
  const baseUrl = base || getBaseUrl();
58442
58550
  if (baseUrl.endsWith("/") || url.startsWith("/")) {
@@ -58595,7 +58703,7 @@ function getTokenInfo() {
58595
58703
  const instance = getCurrentInstance();
58596
58704
  function getImageBaseUrl() {
58597
58705
  var _a3, _b, _c2, _d;
58598
- return ((_d = (_c2 = (_b = (_a3 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a3.app) == null ? void 0 : _b.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$ImageBaseUrl) || getBaseUrl();
58706
+ return ((_d = (_c2 = (_b = (_a3 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a3.app) == null ? void 0 : _b.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$ImageBaseUrl) || ImageBaseUrl();
58599
58707
  }
58600
58708
  const getFieldPathByKey = (rows, key, formPropKey = "rows") => {
58601
58709
  for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
@@ -77858,7 +77966,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77858
77966
  ref$1(false);
77859
77967
  function getImageBaseUrl2() {
77860
77968
  var _a3, _b, _c2, _d;
77861
- return ((_d = (_c2 = (_b = (_a3 = instance2 == null ? void 0 : instance2.appContext) == null ? void 0 : _a3.app) == null ? void 0 : _b.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$ImageBaseUrl) || getBaseUrl();
77969
+ return ((_d = (_c2 = (_b = (_a3 = instance2 == null ? void 0 : instance2.appContext) == null ? void 0 : _a3.app) == null ? void 0 : _b.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$ImageBaseUrl) || ImageBaseUrl();
77862
77970
  }
77863
77971
  const _url = ref$1("");
77864
77972
  watch(
@@ -77946,7 +78054,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77946
78054
  };
77947
78055
  }
77948
78056
  });
77949
- const NsImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-85338e5b"]]);
78057
+ const NsImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-af5258bc"]]);
77950
78058
  NsImage.install = (app2) => {
77951
78059
  app2.component(NsImage.name, NsImage);
77952
78060
  };