element-less 0.0.69 → 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) {
@@ -32223,19 +32231,27 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32223
32231
  }
32224
32232
  if (props2.multiple && props2.checkStrictly && (props2.checkWithParent || props2.unCheckWithchild) && !cascadeNormalizing) {
32225
32233
  const arr = Array.isArray(value) ? value : [];
32234
+ const prev = prevCascaderValue.value;
32226
32235
  const normalized = normalizeCascaderCascade(arr);
32227
- prevCascaderValue.value = normalized;
32228
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
+ }
32229
32244
  cascadeNormalizing = true;
32230
32245
  selectValue.value = normalized;
32231
32246
  cascadeNormalizing = false;
32232
32247
  return;
32233
32248
  }
32249
+ prevCascaderValue.value = normalized;
32234
32250
  } else if (props2.multiple && props2.checkStrictly) {
32235
32251
  prevCascaderValue.value = Array.isArray(value) ? [...value] : [];
32236
32252
  }
32237
32253
  if (!value || value.length == 0) {
32238
- returnModelValue("");
32254
+ returnCascaderModel("");
32239
32255
  if (initSelect.value) {
32240
32256
  defaultEmits("update:select", {});
32241
32257
  defaultEmits("update:select-label", "");
@@ -32248,7 +32264,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32248
32264
  }
32249
32265
  if (props2.multiple && props2.emitPath) {
32250
32266
  const currValue = value.map((ele) => ele.join(props2.valueSeparator)).join(props2.pathSeparator);
32251
- returnModelValue(currValue);
32267
+ returnCascaderModel(currValue);
32252
32268
  if (initSelect && optionData.value.length) {
32253
32269
  let selectData = value.map((ele) => optionData.value.filter((cele) => ele.includes(cele[props2.valueField])));
32254
32270
  defaultEmits("update:select", selectData);
@@ -32262,7 +32278,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32262
32278
  return;
32263
32279
  }
32264
32280
  if (props2.emitPath || props2.multiple) {
32265
- returnModelValue(value.join(props2.valueSeparator));
32281
+ returnCascaderModel(value.join(props2.valueSeparator));
32266
32282
  if (initSelect.value && optionData.value.length) {
32267
32283
  let selectData = optionData.value.filter((cele) => value.indexOf(cele[props2.valueField]) > -1);
32268
32284
  defaultEmits("update:select", selectData);
@@ -32275,7 +32291,7 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32275
32291
  }
32276
32292
  return;
32277
32293
  }
32278
- returnModelValue(value);
32294
+ returnCascaderModel(value);
32279
32295
  if (initSelect.value && optionData.value.length) {
32280
32296
  let selectData = optionData.value.find((cele) => value == cele[props2.valueField]);
32281
32297
  if (selectData) {
@@ -32413,6 +32429,65 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
32413
32429
  const kb = b.map(pathKey);
32414
32430
  return a.every((p) => kb.indexOf(pathKey(p)) > -1);
32415
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
+ }
32416
32491
  function unCheckChild(parentID) {
32417
32492
  optionData.value.filter((ele) => ele[props2.parentIdField] == parentID).forEach((ele) => {
32418
32493
  if (dataTree.value.getCheckedKeys().indexOf(ele[currIdField.value]) > -1) {
@@ -73592,7 +73667,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
73592
73667
  emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
73593
73668
  setup(__props, { emit: __emit }) {
73594
73669
  const DynamicDesignerInnerItem = defineAsyncComponent(() => {
73595
- return import("./innerItem-DU40XfAJ.js");
73670
+ return import("./innerItem-hCYuS1Ma.js");
73596
73671
  });
73597
73672
  const { getValue: getValue2 } = useProps();
73598
73673
  const tagID = getValue2("tagID");
@@ -74572,10 +74647,10 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
74572
74647
  emits: ["update:modelValue"],
74573
74648
  setup(__props, { expose: __expose, emit: __emit }) {
74574
74649
  const DynamicRenderInner = defineAsyncComponent(() => {
74575
- return import("./inner-c32GSLul.js").then((n) => n.i);
74650
+ return import("./inner-D0l83fj6.js").then((n) => n.i);
74576
74651
  });
74577
74652
  const DynamicRenderForm = defineAsyncComponent(() => {
74578
- return import("./inner-c32GSLul.js").then((n) => n.f);
74653
+ return import("./inner-D0l83fj6.js").then((n) => n.f);
74579
74654
  });
74580
74655
  const props2 = __props;
74581
74656
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -74805,10 +74880,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
74805
74880
  emits: ["update:modelValue"],
74806
74881
  setup(__props, { expose: __expose, emit: __emit }) {
74807
74882
  const DynamicRenderInnerAsync = defineAsyncComponent(() => {
74808
- return import("./inner-c32GSLul.js").then((n) => n.i);
74883
+ return import("./inner-D0l83fj6.js").then((n) => n.i);
74809
74884
  });
74810
74885
  const DynamicRenderFormAsync = defineAsyncComponent(() => {
74811
- return import("./inner-c32GSLul.js").then((n) => n.f);
74886
+ return import("./inner-D0l83fj6.js").then((n) => n.f);
74812
74887
  });
74813
74888
  const props2 = __props;
74814
74889
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -80453,31 +80528,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
80453
80528
  __publicField(this, "editor", ref());
80454
80529
  onMounted(() => {
80455
80530
  if (props2.language === "json") {
80456
- const currModule = import("./mode-json-B8PST1D1.js").then((n) => n.m);
80531
+ const currModule = import("./mode-json-BQVTlnPx.js").then((n) => n.m);
80457
80532
  currModule.then((res) => {
80458
80533
  ace.config.setModuleUrl("ace/mode/json", res);
80459
80534
  this.init();
80460
80535
  });
80461
80536
  } else if (props2.language === "javascript") {
80462
- const currModule = import("./mode-javascript-cKgW4Fbi.js").then((n) => n.m);
80537
+ const currModule = import("./mode-javascript-lomz8qCz.js").then((n) => n.m);
80463
80538
  currModule.then((res) => {
80464
80539
  ace.config.setModuleUrl("ace/mode/javascript", res);
80465
80540
  this.init();
80466
80541
  });
80467
80542
  } else if (props2.language === "csharp") {
80468
- const currModule = import("./mode-csharp-BOa7PnjW.js").then((n) => n.m);
80543
+ const currModule = import("./mode-csharp-BlAPRtxP.js").then((n) => n.m);
80469
80544
  currModule.then((res) => {
80470
80545
  ace.config.setModuleUrl("ace/mode/csharp", res);
80471
80546
  this.init();
80472
80547
  });
80473
80548
  } else if (props2.language === "mysql") {
80474
- const currModule = import("./mode-mysql-DdaLezhw.js").then((n) => n.m);
80549
+ const currModule = import("./mode-mysql-Cou6xANN.js").then((n) => n.m);
80475
80550
  currModule.then((res) => {
80476
80551
  ace.config.setModuleUrl("ace/mode/mysql", res);
80477
80552
  this.init();
80478
80553
  });
80479
80554
  } else if (props2.language === "css") {
80480
- const currModule = import("./mode-css-CIRwr__W.js").then((n) => n.m);
80555
+ const currModule = import("./mode-css-C3ZC-V7X.js").then((n) => n.m);
80481
80556
  currModule.then((res) => {
80482
80557
  ace.config.setModuleUrl("ace/mode/css", res);
80483
80558
  this.init();