@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.cjs.js CHANGED
@@ -22516,15 +22516,14 @@ var script$h = {
22516
22516
  default: () => ({})
22517
22517
  }
22518
22518
  },
22519
- emits: ['update:modelValue', 'change'],
22520
- setup(__props, { emit: __emit }) {
22519
+ setup(__props) {
22521
22520
 
22522
22521
  const props = __props;
22523
- // 遵循 Vue 3 v-model 规范,使用 update:modelValue 事件
22524
- const emit = __emit;
22525
22522
 
22526
- const scopeThis_box = vue.reactive(Object.assign({}, props.scopeThis));
22527
- const propsItem_box = vue.reactive(Object.assign({}, props.item));
22523
+ // props属性包装,使得页面和js使用相同的命名
22524
+ const formData_box = props.modelValue;
22525
+ const scopeThis_box = props.scopeThis;
22526
+ const propsItem_box = props.item;
22528
22527
 
22529
22528
  const style = vue.ref({
22530
22529
  box: styleModule.label.box(propsItem_box),
@@ -22533,18 +22532,9 @@ const style = vue.ref({
22533
22532
 
22534
22533
  const hdlClick = () => {
22535
22534
  if(propsItem_box.hdlLabelClick){
22536
- propsItem_box.hdlLabelClick({formData: props.modelValue, scopeThis: scopeThis_box});
22535
+ propsItem_box.hdlLabelClick({formData: formData_box, scopeThis: scopeThis_box});
22537
22536
  }
22538
22537
  };
22539
-
22540
- // 表单数据监听
22541
- vue.watch(
22542
- props.modelValue, // 监听 reactive 对象时,默认是深层监听
22543
- (newVal, oldVal) => {
22544
- // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
22545
- emit("update:modelValue", newVal);
22546
- }
22547
- );
22548
22538
 
22549
22539
  return (_ctx, _cache) => {
22550
22540
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
@@ -22555,7 +22545,7 @@ return (_ctx, _cache) => {
22555
22545
  }, [
22556
22546
  vue.createElementVNode("span", {
22557
22547
  style: vue.normalizeStyle(style.value.label)
22558
- }, vue.toDisplayString(propsItem_box.label), 5 /* TEXT, STYLE */)
22548
+ }, vue.toDisplayString(vue.unref(propsItem_box).label), 5 /* TEXT, STYLE */)
22559
22549
  ], 4 /* STYLE */)
22560
22550
  ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
22561
22551
  }
@@ -22619,8 +22609,8 @@ var script$g = {
22619
22609
 
22620
22610
  const props = __props;
22621
22611
 
22622
- // props属性包装,使得页面和js使用相同的命名
22623
- let formData_box = props.modelValue;
22612
+ // props属性包装,继承了顶层组件的响应性,页面和js可以使用相同的命名
22613
+ const formData_box = props.modelValue;
22624
22614
  const formProps_box = props.myProps;
22625
22615
  const scopeThis_box = props.scopeThis;
22626
22616
  const propsItem_box = props.item;
@@ -23310,7 +23300,7 @@ return (_ctx, _cache) => {
23310
23300
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
23311
23301
  vue.createVNode(_component_ly0d7thumb, {
23312
23302
  modelValue: vue.unref(formData_box),
23313
- "onUpdate:modelValue": _cache[18] || (_cache[18] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23303
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : null)),
23314
23304
  myProps: {
23315
23305
  thumb: {
23316
23306
  fieldName: vue.unref(propsItem_box).thumb.fieldName || vue.unref(formProps_box).para.ly0d7thumb.thumb.fieldName,
@@ -23364,8 +23354,8 @@ var script$f = {
23364
23354
 
23365
23355
  const props = __props;
23366
23356
 
23367
- // props属性包装,使得页面和js使用相同的命名
23368
- let formData_box = props.modelValue;
23357
+ // props属性包装,继承了顶层组件的响应性,页面和js可以使用相同的命名
23358
+ const formData_box = props.modelValue;
23369
23359
  const formProps_box = props.myProps;
23370
23360
  const scopeThis_box = props.scopeThis;
23371
23361
 
@@ -23454,7 +23444,7 @@ return (_ctx, _cache) => {
23454
23444
  }, [
23455
23445
  vue.createVNode(script$h, {
23456
23446
  modelValue: vue.unref(formData_box),
23457
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23447
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : null)),
23458
23448
  myProps: vue.unref(formProps_box),
23459
23449
  scopeThis: vue.unref(scopeThis_box),
23460
23450
  item: item0
@@ -23504,7 +23494,7 @@ return (_ctx, _cache) => {
23504
23494
  }, [
23505
23495
  vue.createVNode(script$h, {
23506
23496
  modelValue: vue.unref(formData_box),
23507
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23497
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : null)),
23508
23498
  myProps: vue.unref(formProps_box),
23509
23499
  scopeThis: vue.unref(scopeThis_box),
23510
23500
  item: item2
@@ -23517,7 +23507,7 @@ return (_ctx, _cache) => {
23517
23507
  }, [
23518
23508
  vue.createVNode(script$g, {
23519
23509
  modelValue: vue.unref(formData_box),
23520
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23510
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : null)),
23521
23511
  myProps: vue.unref(formProps_box),
23522
23512
  scopeThis: vue.unref(scopeThis_box),
23523
23513
  item: item2
@@ -23540,7 +23530,7 @@ return (_ctx, _cache) => {
23540
23530
  : vue.createCommentVNode("v-if", true),
23541
23531
  vue.createVNode(script$g, {
23542
23532
  modelValue: vue.unref(formData_box),
23543
- "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23533
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : null)),
23544
23534
  myProps: vue.unref(formProps_box),
23545
23535
  scopeThis: vue.unref(scopeThis_box),
23546
23536
  item: item0
@@ -23606,9 +23596,10 @@ var script$e = {
23606
23596
 
23607
23597
  const props = __props;
23608
23598
 
23609
- let formData_box = props.modelValue;
23599
+ // 顶层组件的props属性需做响应性包装,页面和js可以使用相同的命名
23600
+ const formData_box = vue.reactive(props.modelValue);
23610
23601
  const formProps_box = vue.reactive(Object.assign({}, ly0default$2.myProps, props.myProps));
23611
- const scopeThis_box = props.scopeThis;
23602
+ const scopeThis_box = vue.reactive(props.scopeThis);
23612
23603
 
23613
23604
  return (_ctx, _cache) => {
23614
23605
  const _component_el_dialog = vue.resolveComponent("el-dialog");
@@ -23628,20 +23619,20 @@ return (_ctx, _cache) => {
23628
23619
  }, {
23629
23620
  default: vue.withCtx(() => [
23630
23621
  vue.createVNode(script$f, {
23631
- modelValue: vue.unref(formData_box),
23632
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23622
+ modelValue: formData_box,
23623
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((formData_box) = $event)),
23633
23624
  myProps: formProps_box,
23634
- scopeThis: vue.unref(scopeThis_box)
23625
+ scopeThis: scopeThis_box
23635
23626
  }, null, 8 /* PROPS */, ["modelValue", "myProps", "scopeThis"])
23636
23627
  ]),
23637
23628
  _: 1 /* STABLE */
23638
23629
  }, 8 /* PROPS */, ["modelValue", "title", "width", "top"]))
23639
23630
  : (vue.openBlock(), vue.createBlock(script$f, {
23640
23631
  key: 1,
23641
- modelValue: vue.unref(formData_box),
23642
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (vue.isRef(formData_box) ? (formData_box).value = $event : formData_box = $event)),
23632
+ modelValue: formData_box,
23633
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ((formData_box) = $event)),
23643
23634
  myProps: formProps_box,
23644
- scopeThis: vue.unref(scopeThis_box)
23635
+ scopeThis: scopeThis_box
23645
23636
  }, null, 8 /* PROPS */, ["modelValue", "myProps", "scopeThis"]))
23646
23637
  }
23647
23638
  }
@@ -23670,7 +23661,8 @@ var script$d = {
23670
23661
  setup(__props) {
23671
23662
 
23672
23663
  const props = __props;
23673
- const myProps_box = vue.ref(Object.assign({}, ly0default$1.myProps, props.myProps));
23664
+ const myProps_box = vue.reactive(Object.assign({}, ly0default$1.myProps, props.myProps));
23665
+ const scopeThis_box = vue.reactive(props.scopeThis);
23674
23666
 
23675
23667
  const handleRun = (
23676
23668
  index, // 目标索引
@@ -23685,7 +23677,7 @@ const handleRun = (
23685
23677
  // 节点存在自定义索引
23686
23678
  if (!!menu[i].index && index === menu[i].index) {
23687
23679
  if (menu[i].handle) {
23688
- menu[i].handle(props.scopeThis, index);
23680
+ menu[i].handle(scopeThis_box, index);
23689
23681
  }
23690
23682
  result = true;
23691
23683
  break
@@ -23693,7 +23685,7 @@ const handleRun = (
23693
23685
  // 节点不存在自定义索引
23694
23686
  if (index === index0) {
23695
23687
  if (menu[i].handle) {
23696
- menu[i].handle(props.scopeThis, index);
23688
+ menu[i].handle(scopeThis_box, index);
23697
23689
  }
23698
23690
  result = true;
23699
23691
  break
@@ -23710,7 +23702,7 @@ const handleRun = (
23710
23702
  };
23711
23703
 
23712
23704
  const handleSelect = key=>{
23713
- handleRun(key, props.myProps.menu, '');
23705
+ handleRun(key, myProps_box.menu, '');
23714
23706
  };
23715
23707
 
23716
23708
  const handleOpen = key=>{};
@@ -23722,22 +23714,22 @@ return (_ctx, _cache) => {
23722
23714
  const _component_el_menu = vue.resolveComponent("el-menu");
23723
23715
 
23724
23716
  return (vue.openBlock(), vue.createBlock(_component_el_menu, {
23725
- mode: myProps_box.value.mode,
23726
- "default-active": myProps_box.value.defaultActive,
23717
+ mode: myProps_box.mode,
23718
+ "default-active": myProps_box.defaultActive,
23727
23719
  onOpen: handleOpen,
23728
23720
  onClose: handleClose,
23729
23721
  onSelect: handleSelect,
23730
- "background-color": myProps_box.value.backgroundColor,
23731
- "text-color": myProps_box.value.textColor,
23732
- "active-text-color": myProps_box.value.activeTextColor,
23722
+ "background-color": myProps_box.backgroundColor,
23723
+ "text-color": myProps_box.textColor,
23724
+ "active-text-color": myProps_box.activeTextColor,
23733
23725
  "menu-trigger": "hover",
23734
- style: vue.normalizeStyle('--el-menu-horizontal-height: ' + myProps_box.value.horizontalHeight + '; ' +
23735
- myProps_box.value.styleBase + ' ' +
23736
- myProps_box.value.style)
23726
+ style: vue.normalizeStyle('--el-menu-horizontal-height: ' + myProps_box.horizontalHeight + '; ' +
23727
+ myProps_box.styleBase + ' ' +
23728
+ myProps_box.style)
23737
23729
  }, {
23738
23730
  default: vue.withCtx(() => [
23739
23731
  vue.createCommentVNode(" 第1层 "),
23740
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.myProps.menu, (item, index) => {
23732
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(myProps_box.menu, (item, index) => {
23741
23733
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
23742
23734
  key: item.index ? item.index : String(index)
23743
23735
  }, [
@@ -23749,7 +23741,7 @@ return (_ctx, _cache) => {
23749
23741
  'disabled' in item
23750
23742
  ? item.disabled
23751
23743
  : 'hdlDisabled' in item
23752
- ? item.hdlDisabled(__props.scopeThis, item, index)
23744
+ ? item.hdlDisabled(scopeThis_box, item, index)
23753
23745
  : false
23754
23746
 
23755
23747
  }, {
@@ -23778,7 +23770,7 @@ return (_ctx, _cache) => {
23778
23770
  'disabled' in item0
23779
23771
  ? item0.disabled
23780
23772
  : 'hdlDisabled' in item0
23781
- ? item0.hdlDisabled(__props.scopeThis, item0, index0)
23773
+ ? item0.hdlDisabled(scopeThis_box, item0, index0)
23782
23774
  : false
23783
23775
 
23784
23776
  }, {
@@ -23815,7 +23807,7 @@ return (_ctx, _cache) => {
23815
23807
  'disabled' in item1
23816
23808
  ? item1.disabled
23817
23809
  : 'hdlDisabled' in item1
23818
- ? item1.hdlDisabled(__props.scopeThis, item1, index1)
23810
+ ? item1.hdlDisabled(scopeThis_box, item1, index1)
23819
23811
  : false
23820
23812
 
23821
23813
  }, {
@@ -23856,7 +23848,7 @@ return (_ctx, _cache) => {
23856
23848
  'disabled' in item2
23857
23849
  ? item2.disabled
23858
23850
  : 'hdlDisabled' in item2
23859
- ? item2.hdlDisabled(__props.scopeThis, item2, index2)
23851
+ ? item2.hdlDisabled(scopeThis_box, item2, index2)
23860
23852
  : false
23861
23853
 
23862
23854
  }, {
@@ -23894,7 +23886,7 @@ return (_ctx, _cache) => {
23894
23886
  'disabled' in item3
23895
23887
  ? item3.disabled
23896
23888
  : 'hdlDisabled' in item3
23897
- ? item3.hdlDisabled(__props.scopeThis, item3, index3)
23889
+ ? item3.hdlDisabled(scopeThis_box, item3, index3)
23898
23890
  : false
23899
23891
 
23900
23892
  }, {