element-less 0.0.68 → 0.0.70

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.
@@ -31816,6 +31816,11 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
31816
31816
  const selectValue = ref([]);
31817
31817
  const prevCascaderValue = ref([]);
31818
31818
  let cascadeNormalizing = false;
31819
+ const lastReturnedModel = ref(void 0);
31820
+ function returnCascaderModel(v) {
31821
+ lastReturnedModel.value = v;
31822
+ returnModelValue(v);
31823
+ }
31819
31824
  const selectOptionData = ref([]);
31820
31825
  const remoteLoading = ref(false);
31821
31826
  const defaultExpandedKeys = ref([]);
@@ -31854,6 +31859,9 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
31854
31859
  }
31855
31860
  }, { immediate: true });
31856
31861
  watch(currModelValue, () => {
31862
+ if (componentName === "cascader" && props2.multiple && props2.checkStrictly && (props2.checkWithParent || props2.unCheckWithchild) && currModelValue.value === lastReturnedModel.value) {
31863
+ return;
31864
+ }
31857
31865
  initSelectValue();
31858
31866
  }, { immediate: true });
31859
31867
  function handleHasLazyChild(item, data = null) {
@@ -32221,20 +32229,29 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32221
32229
  if (value === void 0) {
32222
32230
  value = "";
32223
32231
  }
32224
- if (props2.multiple && !props2.emitPath && props2.checkStrictly && (props2.checkWithParent || props2.unCheckWithchild) && !cascadeNormalizing) {
32225
- const normalized = normalizeCascaderCascade(Array.isArray(value) ? value : []);
32226
- prevCascaderValue.value = normalized;
32227
- if (normalized.length !== (Array.isArray(value) ? value.length : 0)) {
32232
+ if (props2.multiple && props2.checkStrictly && (props2.checkWithParent || props2.unCheckWithchild) && !cascadeNormalizing) {
32233
+ const arr = Array.isArray(value) ? value : [];
32234
+ const prev = prevCascaderValue.value;
32235
+ const normalized = normalizeCascaderCascade(arr);
32236
+ if (!sameCascaderValueSet(normalized, arr)) {
32237
+ const { added, removed } = diffCascaderEntries(arr, prev);
32238
+ prevCascaderValue.value = normalized;
32239
+ const panel = getCascaderPanel();
32240
+ if (panel == null ? void 0 : panel.handleCheckChange) {
32241
+ nextTick(() => applyCascadeViaPanel(added, removed));
32242
+ return;
32243
+ }
32228
32244
  cascadeNormalizing = true;
32229
32245
  selectValue.value = normalized;
32230
32246
  cascadeNormalizing = false;
32231
32247
  return;
32232
32248
  }
32233
- } else if (props2.multiple && !props2.emitPath && props2.checkStrictly) {
32249
+ prevCascaderValue.value = normalized;
32250
+ } else if (props2.multiple && props2.checkStrictly) {
32234
32251
  prevCascaderValue.value = Array.isArray(value) ? [...value] : [];
32235
32252
  }
32236
32253
  if (!value || value.length == 0) {
32237
- returnModelValue("");
32254
+ returnCascaderModel("");
32238
32255
  if (initSelect.value) {
32239
32256
  defaultEmits("update:select", {});
32240
32257
  defaultEmits("update:select-label", "");
@@ -32247,7 +32264,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32247
32264
  }
32248
32265
  if (props2.multiple && props2.emitPath) {
32249
32266
  const currValue = value.map((ele) => ele.join(props2.valueSeparator)).join(props2.pathSeparator);
32250
- returnModelValue(currValue);
32267
+ returnCascaderModel(currValue);
32251
32268
  if (initSelect && optionData.value.length) {
32252
32269
  let selectData = value.map((ele) => optionData.value.filter((cele) => ele.includes(cele[props2.valueField])));
32253
32270
  defaultEmits("update:select", selectData);
@@ -32261,7 +32278,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32261
32278
  return;
32262
32279
  }
32263
32280
  if (props2.emitPath || props2.multiple) {
32264
- returnModelValue(value.join(props2.valueSeparator));
32281
+ returnCascaderModel(value.join(props2.valueSeparator));
32265
32282
  if (initSelect.value && optionData.value.length) {
32266
32283
  let selectData = optionData.value.filter((cele) => value.indexOf(cele[props2.valueField]) > -1);
32267
32284
  defaultEmits("update:select", selectData);
@@ -32274,7 +32291,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32274
32291
  }
32275
32292
  return;
32276
32293
  }
32277
- returnModelValue(value);
32294
+ returnCascaderModel(value);
32278
32295
  if (initSelect.value && optionData.value.length) {
32279
32296
  let selectData = optionData.value.find((cele) => value == cele[props2.valueField]);
32280
32297
  if (selectData) {
@@ -32361,9 +32378,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32361
32378
  });
32362
32379
  return acc;
32363
32380
  }
32364
- function normalizeCascaderCascade(value) {
32365
- if (!props2.multiple || props2.emitPath || !props2.checkStrictly) return value;
32366
- if (!props2.checkWithParent && !props2.unCheckWithchild) return value;
32381
+ function normalizeCascaderFlat(value) {
32367
32382
  const set = new Set(value);
32368
32383
  const prev = prevCascaderValue.value;
32369
32384
  if (props2.checkWithParent) {
@@ -32374,6 +32389,105 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32374
32389
  }
32375
32390
  return Array.from(set);
32376
32391
  }
32392
+ function pathKey(p) {
32393
+ return Array.isArray(p) ? p.join(props2.valueSeparator) : String(p);
32394
+ }
32395
+ function normalizeCascaderPath(value) {
32396
+ const prev = prevCascaderValue.value;
32397
+ const prevKeys = prev.map(pathKey);
32398
+ const map2 = /* @__PURE__ */ new Map();
32399
+ value.forEach((p) => map2.set(pathKey(p), p));
32400
+ if (props2.checkWithParent) {
32401
+ value.filter((p) => prevKeys.indexOf(pathKey(p)) === -1).forEach((p) => {
32402
+ for (let i = 1; i < p.length; i++) {
32403
+ const prefix = p.slice(0, i);
32404
+ map2.set(pathKey(prefix), prefix);
32405
+ }
32406
+ });
32407
+ }
32408
+ if (props2.unCheckWithchild) {
32409
+ const valueKeys = value.map(pathKey);
32410
+ prev.filter((p) => valueKeys.indexOf(pathKey(p)) === -1).forEach((removed) => {
32411
+ const rk = pathKey(removed);
32412
+ Array.from(map2.keys()).forEach((k) => {
32413
+ const p = map2.get(k);
32414
+ if (Array.isArray(p) && p.length > removed.length && pathKey(p.slice(0, removed.length)) === rk) {
32415
+ map2.delete(k);
32416
+ }
32417
+ });
32418
+ });
32419
+ }
32420
+ return Array.from(map2.values());
32421
+ }
32422
+ function normalizeCascaderCascade(value) {
32423
+ if (!props2.multiple || !props2.checkStrictly) return value;
32424
+ if (!props2.checkWithParent && !props2.unCheckWithchild) return value;
32425
+ return props2.emitPath ? normalizeCascaderPath(value) : normalizeCascaderFlat(value);
32426
+ }
32427
+ function sameCascaderValueSet(a, b) {
32428
+ if (a.length !== b.length) return false;
32429
+ const kb = b.map(pathKey);
32430
+ return a.every((p) => kb.indexOf(pathKey(p)) > -1);
32431
+ }
32432
+ function diffCascaderEntries(curr, prev) {
32433
+ const ck = curr.map(pathKey);
32434
+ const pk = prev.map(pathKey);
32435
+ return {
32436
+ added: curr.filter((e) => pk.indexOf(pathKey(e)) === -1),
32437
+ removed: prev.filter((e) => ck.indexOf(pathKey(e)) === -1)
32438
+ };
32439
+ }
32440
+ function getCascaderPanel() {
32441
+ const inst = dataTree.value;
32442
+ if (!inst) return null;
32443
+ return inst.cascaderPanelRef || inst;
32444
+ }
32445
+ function findCascaderNode(entry) {
32446
+ var _a, _b;
32447
+ const nodes = ((_b = (_a = getCascaderPanel()) == null ? void 0 : _a.getFlattedNodes) == null ? void 0 : _b.call(_a, false)) || [];
32448
+ if (Array.isArray(entry)) {
32449
+ const key = entry.map(String).join("\0");
32450
+ return nodes.find((n) => (n.pathValues || []).map(String).join("\0") === key);
32451
+ }
32452
+ return nodes.find((n) => String(n.value) === String(entry));
32453
+ }
32454
+ function collectDescendantNodes(node, acc = []) {
32455
+ (node.children || []).forEach((child) => {
32456
+ acc.push(child);
32457
+ collectDescendantNodes(child, acc);
32458
+ });
32459
+ return acc;
32460
+ }
32461
+ function applyCascadeViaPanel(added, removed) {
32462
+ const panel = getCascaderPanel();
32463
+ if (!(panel == null ? void 0 : panel.handleCheckChange)) return false;
32464
+ let changed = false;
32465
+ if (props2.checkWithParent) {
32466
+ added.forEach((e) => {
32467
+ const node = findCascaderNode(e);
32468
+ if (!node) return;
32469
+ (node.pathNodes || []).slice(0, -1).forEach((anc) => {
32470
+ if (anc && anc.checked !== true) {
32471
+ panel.handleCheckChange(reactive(anc), true, false);
32472
+ changed = true;
32473
+ }
32474
+ });
32475
+ });
32476
+ }
32477
+ if (props2.unCheckWithchild) {
32478
+ removed.forEach((e) => {
32479
+ const node = findCascaderNode(e);
32480
+ if (!node) return;
32481
+ collectDescendantNodes(node).forEach((d) => {
32482
+ if (d && d.checked !== false) {
32483
+ panel.handleCheckChange(reactive(d), false, false);
32484
+ changed = true;
32485
+ }
32486
+ });
32487
+ });
32488
+ }
32489
+ return changed;
32490
+ }
32377
32491
  function unCheckChild(parentID) {
32378
32492
  optionData.value.filter((ele) => ele[props2.parentIdField] == parentID).forEach((ele) => {
32379
32493
  if (dataTree.value.getCheckedKeys().indexOf(ele[currIdField.value]) > -1) {
@@ -70896,7 +71010,7 @@ const property_cascader = [
70896
71010
  "suffixContent": "",
70897
71011
  "requiredMessage": "",
70898
71012
  "re_required": "",
70899
- "tip": "仅多选 + 选择任意一级 + 非返回节点路径时生效",
71013
+ "tip": "仅多选 + 选择任意一级时生效",
70900
71014
  "tipPosition": "left",
70901
71015
  "validType": "",
70902
71016
  "validMessage": "",
@@ -70929,7 +71043,7 @@ const property_cascader = [
70929
71043
  "suffixContent": "",
70930
71044
  "requiredMessage": "",
70931
71045
  "re_required": "",
70932
- "tip": "仅多选 + 选择任意一级 + 非返回节点路径时生效",
71046
+ "tip": "仅多选 + 选择任意一级时生效",
70933
71047
  "tipPosition": "left",
70934
71048
  "validType": "",
70935
71049
  "validMessage": "",
@@ -73553,7 +73667,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
73553
73667
  emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
73554
73668
  setup(__props, { emit: __emit }) {
73555
73669
  const DynamicDesignerInnerItem = defineAsyncComponent(() => {
73556
- return import("./innerItem-CqXGUjai.js");
73670
+ return import("./innerItem-hCYuS1Ma.js");
73557
73671
  });
73558
73672
  const { getValue: getValue2 } = useProps();
73559
73673
  const tagID = getValue2("tagID");
@@ -74533,10 +74647,10 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
74533
74647
  emits: ["update:modelValue"],
74534
74648
  setup(__props, { expose: __expose, emit: __emit }) {
74535
74649
  const DynamicRenderInner = defineAsyncComponent(() => {
74536
- return import("./inner-Cf5U_aKM.js").then((n) => n.i);
74650
+ return import("./inner-D0l83fj6.js").then((n) => n.i);
74537
74651
  });
74538
74652
  const DynamicRenderForm = defineAsyncComponent(() => {
74539
- return import("./inner-Cf5U_aKM.js").then((n) => n.f);
74653
+ return import("./inner-D0l83fj6.js").then((n) => n.f);
74540
74654
  });
74541
74655
  const props2 = __props;
74542
74656
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -74766,10 +74880,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
74766
74880
  emits: ["update:modelValue"],
74767
74881
  setup(__props, { expose: __expose, emit: __emit }) {
74768
74882
  const DynamicRenderInnerAsync = defineAsyncComponent(() => {
74769
- return import("./inner-Cf5U_aKM.js").then((n) => n.i);
74883
+ return import("./inner-D0l83fj6.js").then((n) => n.i);
74770
74884
  });
74771
74885
  const DynamicRenderFormAsync = defineAsyncComponent(() => {
74772
- return import("./inner-Cf5U_aKM.js").then((n) => n.f);
74886
+ return import("./inner-D0l83fj6.js").then((n) => n.f);
74773
74887
  });
74774
74888
  const props2 = __props;
74775
74889
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -80414,31 +80528,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
80414
80528
  __publicField(this, "editor", ref());
80415
80529
  onMounted(() => {
80416
80530
  if (props2.language === "json") {
80417
- const currModule = import("./mode-json-Br_Lu-Mh.js").then((n) => n.m);
80531
+ const currModule = import("./mode-json-BQVTlnPx.js").then((n) => n.m);
80418
80532
  currModule.then((res) => {
80419
80533
  ace.config.setModuleUrl("ace/mode/json", res);
80420
80534
  this.init();
80421
80535
  });
80422
80536
  } else if (props2.language === "javascript") {
80423
- const currModule = import("./mode-javascript-B8epNaGN.js").then((n) => n.m);
80537
+ const currModule = import("./mode-javascript-lomz8qCz.js").then((n) => n.m);
80424
80538
  currModule.then((res) => {
80425
80539
  ace.config.setModuleUrl("ace/mode/javascript", res);
80426
80540
  this.init();
80427
80541
  });
80428
80542
  } else if (props2.language === "csharp") {
80429
- const currModule = import("./mode-csharp-DnzxQJcZ.js").then((n) => n.m);
80543
+ const currModule = import("./mode-csharp-BlAPRtxP.js").then((n) => n.m);
80430
80544
  currModule.then((res) => {
80431
80545
  ace.config.setModuleUrl("ace/mode/csharp", res);
80432
80546
  this.init();
80433
80547
  });
80434
80548
  } else if (props2.language === "mysql") {
80435
- const currModule = import("./mode-mysql-BDVOBDPt.js").then((n) => n.m);
80549
+ const currModule = import("./mode-mysql-Cou6xANN.js").then((n) => n.m);
80436
80550
  currModule.then((res) => {
80437
80551
  ace.config.setModuleUrl("ace/mode/mysql", res);
80438
80552
  this.init();
80439
80553
  });
80440
80554
  } else if (props2.language === "css") {
80441
- const currModule = import("./mode-css-BKArO9O3.js").then((n) => n.m);
80555
+ const currModule = import("./mode-css-C3ZC-V7X.js").then((n) => n.m);
80442
80556
  currModule.then((res) => {
80443
80557
  ace.config.setModuleUrl("ace/mode/css", res);
80444
80558
  this.init();