@yoooloo42/joker 1.0.106 → 1.0.109

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.
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useRouter } from 'vue-router';
2
- import { reactive, ref, watch, createElementBlock, openBlock, Fragment, createCommentVNode, createElementVNode, normalizeStyle, toDisplayString, computed, resolveComponent, unref, createBlock, withCtx, renderList, createTextVNode, createVNode, isRef, defineComponent, h, onMounted, onBeforeUnmount, nextTick as nextTick$1 } from 'vue';
2
+ import { ref, createElementBlock, openBlock, Fragment, createCommentVNode, createElementVNode, normalizeStyle, toDisplayString, unref, reactive, computed, resolveComponent, createBlock, withCtx, renderList, createTextVNode, createVNode, isRef, defineComponent, h, onMounted, onBeforeUnmount, watch, nextTick as nextTick$1 } from 'vue';
3
3
  import { ElMessage } from 'element-plus';
4
4
 
5
5
  function _mergeNamespaces(n, m) {
@@ -22512,15 +22512,14 @@ var script$h = {
22512
22512
  default: () => ({})
22513
22513
  }
22514
22514
  },
22515
- emits: ['update:modelValue', 'change'],
22516
- setup(__props, { emit: __emit }) {
22515
+ setup(__props) {
22517
22516
 
22518
22517
  const props = __props;
22519
- // 遵循 Vue 3 v-model 规范,使用 update:modelValue 事件
22520
- const emit = __emit;
22521
22518
 
22522
- const scopeThis_box = reactive(Object.assign({}, props.scopeThis));
22523
- const propsItem_box = reactive(Object.assign({}, props.item));
22519
+ // props属性包装,使得页面和js使用相同的命名
22520
+ const formData_box = props.modelValue;
22521
+ const scopeThis_box = props.scopeThis;
22522
+ const propsItem_box = props.item;
22524
22523
 
22525
22524
  const style = ref({
22526
22525
  box: styleModule.label.box(propsItem_box),
@@ -22529,18 +22528,9 @@ const style = ref({
22529
22528
 
22530
22529
  const hdlClick = () => {
22531
22530
  if(propsItem_box.hdlLabelClick){
22532
- propsItem_box.hdlLabelClick({formData: props.modelValue, scopeThis: scopeThis_box});
22531
+ propsItem_box.hdlLabelClick({formData: formData_box, scopeThis: scopeThis_box});
22533
22532
  }
22534
22533
  };
22535
-
22536
- // 表单数据监听
22537
- watch(
22538
- props.modelValue, // 监听 reactive 对象时,默认是深层监听
22539
- (newVal, oldVal) => {
22540
- // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
22541
- emit("update:modelValue", newVal);
22542
- }
22543
- );
22544
22534
 
22545
22535
  return (_ctx, _cache) => {
22546
22536
  return (openBlock(), createElementBlock(Fragment, null, [
@@ -22551,7 +22541,7 @@ return (_ctx, _cache) => {
22551
22541
  }, [
22552
22542
  createElementVNode("span", {
22553
22543
  style: normalizeStyle(style.value.label)
22554
- }, toDisplayString(propsItem_box.label), 5 /* TEXT, STYLE */)
22544
+ }, toDisplayString(unref(propsItem_box).label), 5 /* TEXT, STYLE */)
22555
22545
  ], 4 /* STYLE */)
22556
22546
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
22557
22547
  }
@@ -22615,8 +22605,8 @@ var script$g = {
22615
22605
 
22616
22606
  const props = __props;
22617
22607
 
22618
- // props属性包装,使得页面和js使用相同的命名
22619
- let formData_box = props.modelValue;
22608
+ // props属性包装,继承了顶层组件的响应性,页面和js可以使用相同的命名
22609
+ const formData_box = props.modelValue;
22620
22610
  const formProps_box = props.myProps;
22621
22611
  const scopeThis_box = props.scopeThis;
22622
22612
  const propsItem_box = props.item;
@@ -23306,7 +23296,7 @@ return (_ctx, _cache) => {
23306
23296
  ? (openBlock(), createElementBlock("div", _hoisted_28, [
23307
23297
  createVNode(_component_ly0d7thumb, {
23308
23298
  modelValue: unref(formData_box),
23309
- "onUpdate:modelValue": _cache[18] || (_cache[18] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23299
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = $event => (isRef(formData_box) ? (formData_box).value = $event : null)),
23310
23300
  myProps: {
23311
23301
  thumb: {
23312
23302
  fieldName: unref(propsItem_box).thumb.fieldName || unref(formProps_box).para.ly0d7thumb.thumb.fieldName,
@@ -23360,8 +23350,8 @@ var script$f = {
23360
23350
 
23361
23351
  const props = __props;
23362
23352
 
23363
- // props属性包装,使得页面和js使用相同的命名
23364
- let formData_box = props.modelValue;
23353
+ // props属性包装,继承了顶层组件的响应性,页面和js可以使用相同的命名
23354
+ const formData_box = props.modelValue;
23365
23355
  const formProps_box = props.myProps;
23366
23356
  const scopeThis_box = props.scopeThis;
23367
23357
 
@@ -23450,7 +23440,7 @@ return (_ctx, _cache) => {
23450
23440
  }, [
23451
23441
  createVNode(script$h, {
23452
23442
  modelValue: unref(formData_box),
23453
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23443
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(formData_box) ? (formData_box).value = $event : null)),
23454
23444
  myProps: unref(formProps_box),
23455
23445
  scopeThis: unref(scopeThis_box),
23456
23446
  item: item0
@@ -23500,7 +23490,7 @@ return (_ctx, _cache) => {
23500
23490
  }, [
23501
23491
  createVNode(script$h, {
23502
23492
  modelValue: unref(formData_box),
23503
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23493
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (isRef(formData_box) ? (formData_box).value = $event : null)),
23504
23494
  myProps: unref(formProps_box),
23505
23495
  scopeThis: unref(scopeThis_box),
23506
23496
  item: item2
@@ -23513,7 +23503,7 @@ return (_ctx, _cache) => {
23513
23503
  }, [
23514
23504
  createVNode(script$g, {
23515
23505
  modelValue: unref(formData_box),
23516
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23506
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (isRef(formData_box) ? (formData_box).value = $event : null)),
23517
23507
  myProps: unref(formProps_box),
23518
23508
  scopeThis: unref(scopeThis_box),
23519
23509
  item: item2
@@ -23536,7 +23526,7 @@ return (_ctx, _cache) => {
23536
23526
  : createCommentVNode("v-if", true),
23537
23527
  createVNode(script$g, {
23538
23528
  modelValue: unref(formData_box),
23539
- "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23529
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (isRef(formData_box) ? (formData_box).value = $event : null)),
23540
23530
  myProps: unref(formProps_box),
23541
23531
  scopeThis: unref(scopeThis_box),
23542
23532
  item: item0
@@ -23602,9 +23592,10 @@ var script$e = {
23602
23592
 
23603
23593
  const props = __props;
23604
23594
 
23605
- let formData_box = props.modelValue;
23595
+ // 顶层组件的props属性需做响应性包装,页面和js可以使用相同的命名
23596
+ const formData_box = reactive(props.modelValue);
23606
23597
  const formProps_box = reactive(Object.assign({}, ly0default$2.myProps, props.myProps));
23607
- const scopeThis_box = props.scopeThis;
23598
+ const scopeThis_box = reactive(props.scopeThis);
23608
23599
 
23609
23600
  return (_ctx, _cache) => {
23610
23601
  const _component_el_dialog = resolveComponent("el-dialog");
@@ -23624,20 +23615,20 @@ return (_ctx, _cache) => {
23624
23615
  }, {
23625
23616
  default: withCtx(() => [
23626
23617
  createVNode(script$f, {
23627
- modelValue: unref(formData_box),
23628
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23618
+ modelValue: formData_box,
23619
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((formData_box) = $event)),
23629
23620
  myProps: formProps_box,
23630
- scopeThis: unref(scopeThis_box)
23621
+ scopeThis: scopeThis_box
23631
23622
  }, null, 8 /* PROPS */, ["modelValue", "myProps", "scopeThis"])
23632
23623
  ]),
23633
23624
  _: 1 /* STABLE */
23634
23625
  }, 8 /* PROPS */, ["modelValue", "title", "width", "top"]))
23635
23626
  : (openBlock(), createBlock(script$f, {
23636
23627
  key: 1,
23637
- modelValue: unref(formData_box),
23638
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23628
+ modelValue: formData_box,
23629
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ((formData_box) = $event)),
23639
23630
  myProps: formProps_box,
23640
- scopeThis: unref(scopeThis_box)
23631
+ scopeThis: scopeThis_box
23641
23632
  }, null, 8 /* PROPS */, ["modelValue", "myProps", "scopeThis"]))
23642
23633
  }
23643
23634
  }
@@ -23666,7 +23657,8 @@ var script$d = {
23666
23657
  setup(__props) {
23667
23658
 
23668
23659
  const props = __props;
23669
- const myProps_box = ref(Object.assign({}, ly0default$1.myProps, props.myProps));
23660
+ const myProps_box = reactive(Object.assign({}, ly0default$1.myProps, props.myProps));
23661
+ const scopeThis_box = reactive(props.scopeThis);
23670
23662
 
23671
23663
  const handleRun = (
23672
23664
  index, // 目标索引
@@ -23681,7 +23673,7 @@ const handleRun = (
23681
23673
  // 节点存在自定义索引
23682
23674
  if (!!menu[i].index && index === menu[i].index) {
23683
23675
  if (menu[i].handle) {
23684
- menu[i].handle(props.scopeThis, index);
23676
+ menu[i].handle(scopeThis_box, index);
23685
23677
  }
23686
23678
  result = true;
23687
23679
  break
@@ -23689,7 +23681,7 @@ const handleRun = (
23689
23681
  // 节点不存在自定义索引
23690
23682
  if (index === index0) {
23691
23683
  if (menu[i].handle) {
23692
- menu[i].handle(props.scopeThis, index);
23684
+ menu[i].handle(scopeThis_box, index);
23693
23685
  }
23694
23686
  result = true;
23695
23687
  break
@@ -23706,7 +23698,7 @@ const handleRun = (
23706
23698
  };
23707
23699
 
23708
23700
  const handleSelect = key=>{
23709
- handleRun(key, props.myProps.menu, '');
23701
+ handleRun(key, myProps_box.menu, '');
23710
23702
  };
23711
23703
 
23712
23704
  const handleOpen = key=>{};
@@ -23718,22 +23710,22 @@ return (_ctx, _cache) => {
23718
23710
  const _component_el_menu = resolveComponent("el-menu");
23719
23711
 
23720
23712
  return (openBlock(), createBlock(_component_el_menu, {
23721
- mode: myProps_box.value.mode,
23722
- "default-active": myProps_box.value.defaultActive,
23713
+ mode: myProps_box.mode,
23714
+ "default-active": myProps_box.defaultActive,
23723
23715
  onOpen: handleOpen,
23724
23716
  onClose: handleClose,
23725
23717
  onSelect: handleSelect,
23726
- "background-color": myProps_box.value.backgroundColor,
23727
- "text-color": myProps_box.value.textColor,
23728
- "active-text-color": myProps_box.value.activeTextColor,
23718
+ "background-color": myProps_box.backgroundColor,
23719
+ "text-color": myProps_box.textColor,
23720
+ "active-text-color": myProps_box.activeTextColor,
23729
23721
  "menu-trigger": "hover",
23730
- style: normalizeStyle('--el-menu-horizontal-height: ' + myProps_box.value.horizontalHeight + '; ' +
23731
- myProps_box.value.styleBase + ' ' +
23732
- myProps_box.value.style)
23722
+ style: normalizeStyle('--el-menu-horizontal-height: ' + myProps_box.horizontalHeight + '; ' +
23723
+ myProps_box.styleBase + ' ' +
23724
+ myProps_box.style)
23733
23725
  }, {
23734
23726
  default: withCtx(() => [
23735
23727
  createCommentVNode(" 第1层 "),
23736
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.myProps.menu, (item, index) => {
23728
+ (openBlock(true), createElementBlock(Fragment, null, renderList(myProps_box.menu, (item, index) => {
23737
23729
  return (openBlock(), createElementBlock(Fragment, {
23738
23730
  key: item.index ? item.index : String(index)
23739
23731
  }, [
@@ -23745,7 +23737,7 @@ return (_ctx, _cache) => {
23745
23737
  'disabled' in item
23746
23738
  ? item.disabled
23747
23739
  : 'hdlDisabled' in item
23748
- ? item.hdlDisabled(__props.scopeThis, item, index)
23740
+ ? item.hdlDisabled(scopeThis_box, item, index)
23749
23741
  : false
23750
23742
 
23751
23743
  }, {
@@ -23774,7 +23766,7 @@ return (_ctx, _cache) => {
23774
23766
  'disabled' in item0
23775
23767
  ? item0.disabled
23776
23768
  : 'hdlDisabled' in item0
23777
- ? item0.hdlDisabled(__props.scopeThis, item0, index0)
23769
+ ? item0.hdlDisabled(scopeThis_box, item0, index0)
23778
23770
  : false
23779
23771
 
23780
23772
  }, {
@@ -23811,7 +23803,7 @@ return (_ctx, _cache) => {
23811
23803
  'disabled' in item1
23812
23804
  ? item1.disabled
23813
23805
  : 'hdlDisabled' in item1
23814
- ? item1.hdlDisabled(__props.scopeThis, item1, index1)
23806
+ ? item1.hdlDisabled(scopeThis_box, item1, index1)
23815
23807
  : false
23816
23808
 
23817
23809
  }, {
@@ -23852,7 +23844,7 @@ return (_ctx, _cache) => {
23852
23844
  'disabled' in item2
23853
23845
  ? item2.disabled
23854
23846
  : 'hdlDisabled' in item2
23855
- ? item2.hdlDisabled(__props.scopeThis, item2, index2)
23847
+ ? item2.hdlDisabled(scopeThis_box, item2, index2)
23856
23848
  : false
23857
23849
 
23858
23850
  }, {
@@ -23890,7 +23882,7 @@ return (_ctx, _cache) => {
23890
23882
  'disabled' in item3
23891
23883
  ? item3.disabled
23892
23884
  : 'hdlDisabled' in item3
23893
- ? item3.hdlDisabled(__props.scopeThis, item3, index3)
23885
+ ? item3.hdlDisabled(scopeThis_box, item3, index3)
23894
23886
  : false
23895
23887
 
23896
23888
  }, {