next-element-vue 0.3.8 → 0.4.0

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.umd.js CHANGED
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * 作  者:huangteng
4
4
  * 邮  箱:htengweb@163.com
5
- * 当前版本:0.3.8 v
6
- * 发布日期:2024-09-26
5
+ * 当前版本:0.4.0 v
6
+ * 发布日期:2024-11-13
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
@@ -1813,15 +1813,18 @@
1813
1813
  return isHeaderBarColorGradual ? {
1814
1814
  background: `linear-gradient(to bottom , ${color}, ${getLightColor$3(color, .5)})`
1815
1815
  } : "";
1816
- }));
1817
- return vue.createVNode("header", {
1816
+ })), __slots_header_tools = {};
1817
+ return slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
1818
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]()),
1819
+ vue.createVNode("header", {
1818
1820
  class: _ns.b("header"),
1819
1821
  style: headerStyle.value
1820
1822
  }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
1821
1823
  class: _ns.bf("header", "right")
1822
- }, [ vue.createVNode(HeaderTools, null, {
1823
- default: () => [ slots[slots_config_headerToolsPrefix]?.(), slots[slots_config_headerToolsSuffix]?.() ]
1824
- }) ]) ]);
1824
+ }, [ vue.createVNode(HeaderTools, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header_tools : {
1825
+ default: () => [ __slots_header_tools ]
1826
+ })) ]) ]);
1827
+ var s;
1825
1828
  }
1826
1829
  });
1827
1830
  function getDefaultExportFromCjs(x) {
@@ -2635,21 +2638,29 @@
2635
2638
  render() {
2636
2639
  const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
2637
2640
  slots.menu;
2641
+ const __slots_header_tools = {};
2642
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
2643
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2638
2644
  const isTabs = vue.ref(!!slots.tabs);
2639
2645
  return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
2640
2646
  class: ns$j.b()
2641
2647
  }, {
2642
- default: () => [ vue.createVNode(Sidebar$2, null, null), vue.createVNode("div", {
2643
- class: [ ns$j.b("content") ]
2644
- }, [ vue.createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
2645
- tabs: _config.tabs,
2646
- activeTab: _config.activeTab,
2647
- onChange: (...arg) => _emit("tabsChange", ...arg),
2648
- onSelect: (...arg) => _emit("tabsSelect", ...arg),
2649
- onClose: (...arg) => _emit("tabsClose", ...arg)
2650
- }, null) : null, vue.createVNode("main", {
2651
- class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
2652
- }, [ slots.default?.() ]) ]) ]
2648
+ default: () => {
2649
+ return [ vue.createVNode(Sidebar$2, null, null), vue.createVNode("div", {
2650
+ class: [ ns$j.b("content") ]
2651
+ }, [ vue.createVNode(Header$3, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header_tools : {
2652
+ default: () => [ __slots_header_tools ]
2653
+ })), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
2654
+ tabs: _config.tabs,
2655
+ activeTab: _config.activeTab,
2656
+ onChange: (...arg) => _emit("tabsChange", ...arg),
2657
+ onSelect: (...arg) => _emit("tabsSelect", ...arg),
2658
+ onClose: (...arg) => _emit("tabsClose", ...arg)
2659
+ }, null) : null, vue.createVNode("main", {
2660
+ class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
2661
+ }, [ slots.default?.() ]) ]) ];
2662
+ var s;
2663
+ }
2653
2664
  });
2654
2665
  }
2655
2666
  });
@@ -2661,21 +2672,26 @@
2661
2672
  return isHeaderBarColorGradual ? {
2662
2673
  background: `linear-gradient(to bottom , ${color}, ${getLightColor$2(color, .5)})`
2663
2674
  } : "";
2664
- }));
2665
- return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("header", {
2666
- class: _ns.b("header"),
2667
- style: headerStyle.value
2668
- }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
2669
- class: _ns.bf("header", "menu")
2670
- }, [ slots[slots_config_headerMenu] ? slots[slots_config_headerMenu]() : vue.createVNode(NextMenu, {
2671
- menuTree: _config.menuTree,
2672
- router: _config.menuRouter,
2673
- mode: _config.menuMode
2674
- }, null) ]), vue.createVNode("div", {
2675
- class: _ns.bf("header", "right")
2676
- }, [ vue.createVNode(HeaderTools, null, {
2677
- default: () => [ slots[slots_config_headerToolsPrefix]?.(), slots[slots_config_headerToolsSuffix]?.() ]
2678
- }) ]) ]) ]);
2675
+ })), __slots_header_tools = {};
2676
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
2677
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2678
+ return () => {
2679
+ return vue.createVNode(vue.Fragment, null, [ vue.createVNode("header", {
2680
+ class: _ns.b("header"),
2681
+ style: headerStyle.value
2682
+ }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
2683
+ class: _ns.bf("header", "menu")
2684
+ }, [ slots[slots_config_headerMenu] ? slots[slots_config_headerMenu]() : vue.createVNode(NextMenu, {
2685
+ menuTree: _config.menuTree,
2686
+ router: _config.menuRouter,
2687
+ mode: _config.menuMode
2688
+ }, null) ]), vue.createVNode("div", {
2689
+ class: _ns.bf("header", "right")
2690
+ }, [ vue.createVNode(HeaderTools, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header_tools : {
2691
+ default: () => [ __slots_header_tools ]
2692
+ })) ]) ]) ]);
2693
+ var s;
2694
+ };
2679
2695
  }
2680
2696
  });
2681
2697
  const ns$i = useNamespace("layout-transverse");
@@ -2711,17 +2727,22 @@
2711
2727
  return isHeaderBarColorGradual ? {
2712
2728
  background: `linear-gradient(to bottom , ${color}, ${getLightColor$1(color, .5)})`
2713
2729
  } : "";
2714
- }));
2715
- return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("header", {
2716
- class: _ns.b("header"),
2717
- style: headerStyle.value
2718
- }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
2719
- class: _ns.bf("header", "menu")
2720
- }, null), vue.createVNode("div", {
2721
- class: _ns.bf("header", "right")
2722
- }, [ vue.createVNode(HeaderTools, null, {
2723
- default: () => [ slots[slots_config_headerToolsPrefix]?.(), slots[slots_config_headerToolsSuffix]?.() ]
2724
- }) ]) ]) ]);
2730
+ })), __slots_header_tools = {};
2731
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
2732
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2733
+ return () => {
2734
+ return vue.createVNode(vue.Fragment, null, [ vue.createVNode("header", {
2735
+ class: _ns.b("header"),
2736
+ style: headerStyle.value
2737
+ }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
2738
+ class: _ns.bf("header", "menu")
2739
+ }, null), vue.createVNode("div", {
2740
+ class: _ns.bf("header", "right")
2741
+ }, [ vue.createVNode(HeaderTools, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header_tools : {
2742
+ default: () => [ __slots_header_tools ]
2743
+ })) ]) ]) ]);
2744
+ var s;
2745
+ };
2725
2746
  }
2726
2747
  }), Sidebar$1 = vue.defineComponent({
2727
2748
  setup: () => ({
@@ -2777,17 +2798,22 @@
2777
2798
  return isHeaderBarColorGradual ? {
2778
2799
  background: `linear-gradient(to bottom , ${color}, ${getLightColor(color, .5)})`
2779
2800
  } : "";
2780
- }));
2781
- return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("header", {
2782
- class: _ns.b("header"),
2783
- style: headerStyle.value
2784
- }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
2785
- class: _ns.bf("header", "menu")
2786
- }, [ slots[slots_config_headerMenu]?.() ]), vue.createVNode("div", {
2787
- class: _ns.bf("header", "right")
2788
- }, [ vue.createVNode(HeaderTools, null, {
2789
- default: () => [ slots[slots_config_headerToolsPrefix]?.(), slots[slots_config_headerToolsSuffix]?.() ]
2790
- }) ]) ]) ]);
2801
+ })), __slots_header_tools = {};
2802
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
2803
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2804
+ return () => {
2805
+ return vue.createVNode(vue.Fragment, null, [ vue.createVNode("header", {
2806
+ class: _ns.b("header"),
2807
+ style: headerStyle.value
2808
+ }, [ vue.createVNode(LogoView, null, null), vue.createVNode("div", {
2809
+ class: _ns.bf("header", "menu")
2810
+ }, [ slots[slots_config_headerMenu]?.() ]), vue.createVNode("div", {
2811
+ class: _ns.bf("header", "right")
2812
+ }, [ vue.createVNode(HeaderTools, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header_tools : {
2813
+ default: () => [ __slots_header_tools ]
2814
+ })) ]) ]) ]);
2815
+ var s;
2816
+ };
2791
2817
  }
2792
2818
  }), Sidebar = vue.defineComponent({
2793
2819
  setup: () => ({
@@ -2814,8 +2840,14 @@
2814
2840
  render() {
2815
2841
  const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
2816
2842
  slots.menu;
2843
+ const __slots_header_tools = {};
2844
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
2845
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2817
2846
  const isTabs = vue.ref(!!slots.tabs);
2818
- return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(vue.Fragment, null, [ vue.createVNode(Header, null, null), vue.createVNode("div", {
2847
+ return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(vue.Fragment, null, [ vue.createVNode(Header, null, (s = __slots_header_tools,
2848
+ "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header_tools : {
2849
+ default: () => [ __slots_header_tools ]
2850
+ })), vue.createVNode("div", {
2819
2851
  class: [ ns$g.b("content"), ns$g.is("layout-tabs", isTabs.value) ]
2820
2852
  }, [ vue.createVNode(Sidebar, null, null), vue.createVNode("div", {
2821
2853
  class: ns$g.b("container")
@@ -2828,6 +2860,7 @@
2828
2860
  }, null) : null, vue.createVNode("main", {
2829
2861
  class: [ ns$g.b("main") ]
2830
2862
  }, [ slots.default?.() ]) ]) ]) ]);
2863
+ var s;
2831
2864
  }
2832
2865
  });
2833
2866
  const ns$f = useNamespace("layout"), layouts = {
@@ -3748,9 +3781,15 @@
3748
3781
  columnSlots.value.forEach((slotName => {
3749
3782
  column_slots[slotName] = (...arg) => slots[slotName] && slots[slotName](...arg);
3750
3783
  }));
3751
- const _options = vue.inject("options", {}), options = vue.isRef(_options) ? vue.unref(_options) : _options, columnOption = props.columnOption, _dicKey = valueExist(columnOption.dicKey, "value"), _formatterColumnValue = (value, dicData) => {
3784
+ const _options = vue.inject("options", {}), options = vue.isRef(_options) ? vue.unref(_options) : _options, columnOption = props.columnOption, _dicKey = valueExist(columnOption.dicKey, "value"), _dicLabel = valueExist(columnOption.dicLabel, columnOption.treeSelectProps?.label, "label"), _separator = valueExist(columnOption.treeSelectProps?.separator, ","), _formatterColumnValue = (value, dicData) => {
3785
+ if (Array.isArray(value)) {
3786
+ const temp = [];
3787
+ return value.forEach((val => {
3788
+ temp.push(_formatterColumnValue(val, dicData));
3789
+ })), temp.join(_separator);
3790
+ }
3752
3791
  const item = dicData.find((o => o[_dicKey] == value));
3753
- return item ? item.label : value;
3792
+ return item ? item[_dicLabel] : value;
3754
3793
  }, renderCustomItem = (row, $index) => {
3755
3794
  if (columnOption.children?.length > 0) return vue.createVNode(vue.Fragment, null, [ columnOption.children.map((column => {
3756
3795
  return vue.createVNode(TableColumnDynamic, {
@@ -3943,6 +3982,14 @@
3943
3982
  var NextDialog$1 = vue.defineComponent({
3944
3983
  name: "NextDialog",
3945
3984
  props: {
3985
+ className: {
3986
+ type: String,
3987
+ default: ""
3988
+ },
3989
+ style: {
3990
+ type: Object,
3991
+ default: () => ({})
3992
+ },
3946
3993
  modelValue: {
3947
3994
  type: Boolean,
3948
3995
  default: !1
@@ -4008,7 +4055,8 @@
4008
4055
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElDialog, {
4009
4056
  modelValue: visible.value,
4010
4057
  "onUpdate:modelValue": $event => visible.value = $event,
4011
- class: ns$b.b(),
4058
+ class: [ ns$b.b(), props.className ],
4059
+ style: props.style,
4012
4060
  title: props.title,
4013
4061
  appendToBody: props.appendToBody,
4014
4062
  "destroy-on-close": !0,
@@ -4524,6 +4572,60 @@
4524
4572
  onClear: onClearValue
4525
4573
  }, null) ]);
4526
4574
  }
4575
+ }), NestTreeCascader = vue.defineComponent({
4576
+ name: "NextTreeCascader",
4577
+ props: {
4578
+ modelValue: {
4579
+ type: [ Number, String, Boolean, Object, Array ],
4580
+ default: ""
4581
+ },
4582
+ column: {
4583
+ type: Object,
4584
+ default: () => ({})
4585
+ },
4586
+ disabled: {
4587
+ type: Boolean,
4588
+ default: !1
4589
+ },
4590
+ formParams: {
4591
+ type: Object,
4592
+ default: () => ({})
4593
+ }
4594
+ },
4595
+ emits: [ "change", "clear", "expand-change", "visible-change", "remove-tag", "blur", "focus" ],
4596
+ setup(props, {emit: emit, expose: expose}) {
4597
+ const {t: t} = useLocale(), _modelValue = vue.ref(props.modelValue);
4598
+ vue.watch((() => props.modelValue), (val => {
4599
+ _modelValue.value = val;
4600
+ }));
4601
+ const _column = props.column, placeholder = _column.placeholder || t("next.form.select") + _column.label, _defaultProps = {
4602
+ label: "label",
4603
+ children: "children"
4604
+ }, onChange = val => {
4605
+ const nodes = treeSelectRef.value.getCheckedNodes().map((item => item.data));
4606
+ props.formParams[_column.prop] = val, _modelValue.value = val, emit("change", val, nodes);
4607
+ }, treeSelectRef = vue.ref(), getInstance = () => treeSelectRef.value;
4608
+ _column.loadInstance && _column.loadInstance(getInstance()), expose({
4609
+ getInstance: getInstance,
4610
+ onClearValue: () => {
4611
+ props.formParams[_column.prop] = "", _modelValue.value = "";
4612
+ }
4613
+ });
4614
+ return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElCascader, {
4615
+ ref: treeSelectRef,
4616
+ modelValue: _modelValue.value,
4617
+ "onUpdate:modelValue": $event => _modelValue.value = $event,
4618
+ placeholder: placeholder,
4619
+ options: valueExist(_column.dicData, []),
4620
+ props: valueExist(_column.treeSelectProps, _defaultProps),
4621
+ disabled: valueExist(props.disabled, !1),
4622
+ clearable: valueExist(_column.clearable, !0),
4623
+ filterable: valueExist(_column.filterable, !1),
4624
+ "collapse-tags": !0,
4625
+ "collapse-tags-tooltip": !0,
4626
+ onChange: onChange
4627
+ }, null) ]);
4628
+ }
4527
4629
  });
4528
4630
  function _isSlot$2(s) {
4529
4631
  return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
@@ -4639,9 +4741,9 @@
4639
4741
  return vue.createVNode(elementPlus.ElInput, {
4640
4742
  modelValue: formParams[col.prop],
4641
4743
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4642
- clearable: !0,
4744
+ clearable: valueExist(col.clearable, !0),
4643
4745
  readonly: valueExist(col.readonly, !1),
4644
- disabled: col.disabled,
4746
+ disabled: valueExist(col.disabled, !1),
4645
4747
  placeholder: placeholder,
4646
4748
  onChange: event => col.onChange?.(event, col, formParams, formColumns)
4647
4749
  }, {
@@ -4657,7 +4759,7 @@
4657
4759
  modelValue: formParams[col.prop],
4658
4760
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4659
4761
  type: "password",
4660
- clearable: !0,
4762
+ clearable: valueExist(col.clearable, !0),
4661
4763
  "show-password": !0,
4662
4764
  readonly: valueExist(col.readonly, !1),
4663
4765
  disabled: col.disabled,
@@ -4675,7 +4777,7 @@
4675
4777
  return vue.createVNode(elementPlus.ElInput, {
4676
4778
  modelValue: formParams[col.prop],
4677
4779
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4678
- clearable: !0,
4780
+ clearable: valueExist(col.clearable, !0),
4679
4781
  readonly: valueExist(col.readonly, !1),
4680
4782
  disabled: col.disabled,
4681
4783
  placeholder: placeholder,
@@ -4696,7 +4798,7 @@
4696
4798
  return vue.createVNode(elementPlus.ElInput, {
4697
4799
  modelValue: formParams[col.prop],
4698
4800
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4699
- clearable: !0,
4801
+ clearable: valueExist(col.clearable, !0),
4700
4802
  readonly: valueExist(col.readonly, !1),
4701
4803
  disabled: col.disabled,
4702
4804
  placeholder: placeholder,
@@ -4720,7 +4822,7 @@
4720
4822
  modelValue: formParams[col.prop],
4721
4823
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4722
4824
  type: "textarea",
4723
- clearable: !0,
4825
+ clearable: valueExist(col.clearable, !0),
4724
4826
  readonly: valueExist(col.readonly, !1),
4725
4827
  disabled: col.disabled,
4726
4828
  placeholder: placeholder,
@@ -4738,8 +4840,9 @@
4738
4840
  modelValue: formParams[col.prop],
4739
4841
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4740
4842
  placeholder: placeholder,
4741
- clearable: !0,
4742
- disabled: col.disabled,
4843
+ clearable: valueExist(col.clearable, !0),
4844
+ disabled: valueExist(col.disabled, !1),
4845
+ readonly: valueExist(col.readonly, !1),
4743
4846
  multiple: valueExist(col.multiple, !1),
4744
4847
  "collapse-tags-tooltip": !0,
4745
4848
  onChange: event => col.onChange?.(event, col, formParams, formColumns)
@@ -4760,8 +4863,10 @@
4760
4863
  start: "00:00",
4761
4864
  step: "00:30",
4762
4865
  end: "23:59",
4763
- editable: !1,
4764
- disabled: col.disabled,
4866
+ clearable: valueExist(col.clearable, !0),
4867
+ editable: valueExist(col.editable, !1),
4868
+ disabled: valueExist(col.disabled, !1),
4869
+ readonly: valueExist(col.readonly, !1),
4765
4870
  placeholder: placeholder,
4766
4871
  onChange: event => col.onChange?.(event, col, formParams, formColumns)
4767
4872
  }, {
@@ -4772,7 +4877,8 @@
4772
4877
  if ("radio" === col.type) return vue.createVNode(elementPlus.ElRadioGroup, {
4773
4878
  modelValue: formParams[col.prop],
4774
4879
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4775
- disabled: col.disabled,
4880
+ disabled: valueExist(col.disabled, !1),
4881
+ readonly: valueExist(col.readonly, !1),
4776
4882
  onChange: event => col.onChange?.(event, col, formParams, formColumns)
4777
4883
  }, {
4778
4884
  default: () => [ col.dicData && col.dicData.map((item => vue.createVNode(elementPlus.ElRadio, {
@@ -4787,7 +4893,8 @@
4787
4893
  vue.createVNode(elementPlus.ElCheckboxGroup, {
4788
4894
  modelValue: formParams[col.prop],
4789
4895
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4790
- disabled: col.disabled,
4896
+ disabled: valueExist(col.disabled, !1),
4897
+ readonly: valueExist(col.readonly, !1),
4791
4898
  onChange: event => col.onChange?.(event, col, formParams, formColumns)
4792
4899
  }, {
4793
4900
  default: () => [ col.dicData && col.dicData.map((item => vue.createVNode(elementPlus.ElCheckbox, {
@@ -4807,10 +4914,11 @@
4807
4914
  type: "date",
4808
4915
  valueFormat: col.format || "YYYY-MM-DD",
4809
4916
  format: col.format || "YYYY-MM-DD",
4810
- clearable: !0,
4917
+ clearable: valueExist(col.clearable, !0),
4811
4918
  disabledDate: col.disabledDate || _defaultDisabledDate,
4812
- disabled: col.disabled,
4813
- editable: col.editable
4919
+ editable: valueExist(col.editable, !1),
4920
+ disabled: valueExist(col.disabled, !1),
4921
+ readonly: valueExist(col.readonly, !1)
4814
4922
  }, null);
4815
4923
  }
4816
4924
  if ("datetime" === col.type) {
@@ -4822,10 +4930,11 @@
4822
4930
  type: "datetime",
4823
4931
  valueFormat: col.format || "YYYY-MM-DD HH:mm:ss",
4824
4932
  format: col.format || "YYYY-MM-DD HH:mm:ss",
4825
- clearable: !0,
4933
+ clearable: valueExist(col.clearable, !0),
4826
4934
  disabledDate: col.disabledDate || _defaultDisabledDate,
4827
- disabled: col.disabled,
4828
- editable: col.editable
4935
+ editable: valueExist(col.editable, !1),
4936
+ disabled: valueExist(col.disabled, !1),
4937
+ readonly: valueExist(col.readonly, !1)
4829
4938
  }, null);
4830
4939
  }
4831
4940
  if ("datetimerange" === col.type) {
@@ -4837,13 +4946,14 @@
4837
4946
  type: "datetimerange",
4838
4947
  valueFormat: col.format || "YYYY-MM-DD HH:mm:ss",
4839
4948
  format: col.format || "YYYY-MM-DD HH:mm:ss",
4840
- clearable: !0,
4841
4949
  "range-separator": t("next.date.rangeSeparator"),
4842
4950
  "start-placeholder": t("next.date.startPlaceholder"),
4843
4951
  "end-placeholder": t("next.date.endPlaceholder"),
4844
4952
  disabledDate: col.disabledDate || _defaultDisabledDate,
4845
- disabled: col.disabled,
4846
- editable: col.editable,
4953
+ clearable: valueExist(col.clearable, !0),
4954
+ editable: valueExist(col.editable, !1),
4955
+ disabled: valueExist(col.disabled, !1),
4956
+ readonly: valueExist(col.readonly, !1),
4847
4957
  shortcuts: col.shortcuts || _defaultShortcuts
4848
4958
  }, null);
4849
4959
  }
@@ -4861,7 +4971,7 @@
4861
4971
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4862
4972
  formParams: formParams,
4863
4973
  column: col,
4864
- disabled: col.disabled,
4974
+ disabled: valueExist(col.disabled, !1),
4865
4975
  onSelect: rows => ((rows, col) => {
4866
4976
  rows && (col.tableSelectRows = rows);
4867
4977
  const {value: value} = col.tableSelectProps || {};
@@ -4870,17 +4980,25 @@
4870
4980
  }, null) : "uploadImage" === col.type ? vue.createVNode(UploadImage, {
4871
4981
  modelValue: formParams[col.prop],
4872
4982
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4873
- disabled: col.disabled,
4874
- multiple: col.multiple,
4983
+ disabled: valueExist(col.disabled, !1),
4984
+ multiple: valueExist(col.multiple, !1),
4875
4985
  limit: col.limit,
4876
4986
  onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns),
4877
4987
  onExceed: (...arg) => col.onExceed?.(...arg, col, formParams, formColumns)
4878
4988
  }, null) : "treeSelect" === col.type ? vue.createVNode(treeSelect, {
4879
4989
  modelValue: formParams[col.prop],
4880
4990
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4881
- disabled: col.disabled,
4991
+ disabled: valueExist(col.disabled, !1),
4882
4992
  column: col,
4883
- formParams: formParams
4993
+ formParams: formParams,
4994
+ onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns)
4995
+ }, null) : "cascader" === col.type ? vue.createVNode(NestTreeCascader, {
4996
+ modelValue: formParams[col.prop],
4997
+ "onUpdate:modelValue": $event => formParams[col.prop] = $event,
4998
+ disabled: valueExist(col.disabled, !1),
4999
+ column: col,
5000
+ formParams: formParams,
5001
+ onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns)
4884
5002
  }, null) : void 0;
4885
5003
  };
4886
5004
  expose({
@@ -5050,7 +5168,7 @@
5050
5168
  append: valueExist(col.formAppend, col.append, null),
5051
5169
  hide: valueExist(col.formHide, col.hide, !1),
5052
5170
  disabled: valueExist(col.formDisabled, col.disabled, !1),
5053
- clearable: valueExist(col.formClearable, col.clearable, !1),
5171
+ clearable: valueExist(col.formClearable, col.clearable, !0),
5054
5172
  readonly: valueExist(col.formReadonly, col.readonly, !1),
5055
5173
  tip: valueExist(col.formTip, col.tip, null),
5056
5174
  rules: valueExist(col.formRules, col.rules, null),
@@ -7123,6 +7241,10 @@
7123
7241
  onEditPolygon(callback) {
7124
7242
  this.editPolygonObserver = callback;
7125
7243
  }
7244
+ getTransformPoint(x, y) {
7245
+ const transformMatrix = this.ctx.getTransform(), scaleX = parseFloat(transformMatrix.a.toFixed(1)), scaleY = parseFloat(transformMatrix.d.toFixed(1)), translateX = Math.ceil(transformMatrix.e), translateY = Math.ceil(transformMatrix.f);
7246
+ return [ Math.floor((x - translateX) / scaleX), Math.floor((y - translateY) / scaleY) ];
7247
+ }
7126
7248
  drawPolygonPath(vertexes, mouseX, mouseY) {
7127
7249
  const ctx = this.ctx;
7128
7250
  if (!vertexes.length) return;
@@ -7154,11 +7276,11 @@
7154
7276
  this.drawPolygonEdgeCentre(vertexes));
7155
7277
  }
7156
7278
  pointInVertexes(x, y) {
7157
- const vertexes = this.vertexes;
7279
+ const [_x, _y] = this.getTransformPoint(x, y), vertexes = this.vertexes;
7158
7280
  let aimIndex = null;
7159
7281
  for (let i = 0; i < vertexes.length; i++) {
7160
7282
  const [vertex_x, vertex_y] = vertexes[i];
7161
- if (isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius)) {
7283
+ if (isPointInCircle(_x, _y, vertex_x, vertex_y, this.vertexRadius)) {
7162
7284
  this.canvas.style.cursor = "pointer", aimIndex = i;
7163
7285
  break;
7164
7286
  }
@@ -7167,11 +7289,11 @@
7167
7289
  return aimIndex;
7168
7290
  }
7169
7291
  pointInEdgeCentre(x, y) {
7170
- const vertexes = this.vertexes;
7292
+ const [_x, _y] = this.getTransformPoint(x, y), vertexes = this.vertexes;
7171
7293
  let aimIndex = null;
7172
7294
  for (let i = 0; i < vertexes.length; i++) {
7173
7295
  const start = vertexes[i % vertexes.length], end = vertexes[(i + 1) % vertexes.length], vertex_x = start[0] + (end[0] - start[0]) / 2, vertex_y = start[1] + (end[1] - start[1]) / 2;
7174
- if (isPointInCircle(x, y, vertex_x, vertex_y, this.edgeCentreRadius)) {
7296
+ if (isPointInCircle(_x, _y, vertex_x, vertex_y, this.edgeCentreRadius)) {
7175
7297
  this.canvas.style.cursor = "pointer", aimIndex = i;
7176
7298
  break;
7177
7299
  }
@@ -7180,9 +7302,9 @@
7180
7302
  return aimIndex;
7181
7303
  }
7182
7304
  pointInVertexesOrEdgeCentre(x, y) {
7183
- const vertexes = this.vertexes;
7305
+ const [_x, _y] = this.getTransformPoint(x, y), vertexes = this.vertexes;
7184
7306
  for (let i = 0; i < vertexes.length; i++) {
7185
- const [vertex_x, vertex_y] = vertexes[i], isInVertex = isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius), start = vertexes[i % vertexes.length], end = vertexes[(i + 1) % vertexes.length], edge_center_x = start[0] + (end[0] - start[0]) / 2, edge_center_y = start[1] + (end[1] - start[1]) / 2, isInEdgeCenter = isPointInCircle(x, y, edge_center_x, edge_center_y, this.edgeCentreRadius);
7307
+ const [vertex_x, vertex_y] = vertexes[i], isInVertex = isPointInCircle(_x, _y, vertex_x, vertex_y, this.vertexRadius), start = vertexes[i % vertexes.length], end = vertexes[(i + 1) % vertexes.length], edge_center_x = start[0] + (end[0] - start[0]) / 2, edge_center_y = start[1] + (end[1] - start[1]) / 2, isInEdgeCenter = isPointInCircle(_x, _y, edge_center_x, edge_center_y, this.edgeCentreRadius);
7186
7308
  if (isInVertex || isInEdgeCenter) {
7187
7309
  this.canvas.style.cursor = "pointer";
7188
7310
  break;
@@ -7322,7 +7444,7 @@
7322
7444
  this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight), this.ctx.drawImage(this.image, 0, 0, this.canvasWidth, this.canvasHeight),
7323
7445
  this.ctx.save();
7324
7446
  const shapes = this.labels.shapes;
7325
- this.drawPolygons(shapes), this.ctx.restore();
7447
+ shapes?.length && this.drawPolygons(shapes), this.ctx.restore();
7326
7448
  };
7327
7449
  render=() => {
7328
7450
  this.canvas.width = this.canvasWidth, this.scaleOffset.value && (this.ctx.translate(this.scaleOffset.value.x, this.scaleOffset.value.y),
@@ -7894,7 +8016,7 @@
7894
8016
  })(app);
7895
8017
  };
7896
8018
  var index = {
7897
- version: "0.3.8",
8019
+ version: "0.4.0",
7898
8020
  install: install
7899
8021
  };
7900
8022
  exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
@@ -7941,7 +8063,7 @@
7941
8063
  }), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
7942
8064
  const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
7943
8065
  localeRef.value.name = lang, localeRef.value.next = nextLang.next;
7944
- }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.8",
8066
+ }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.4.0",
7945
8067
  Object.defineProperty(exports, "__esModule", {
7946
8068
  value: !0
7947
8069
  });