next-element-vue 0.4.0 → 0.4.3

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.js CHANGED
@@ -2,12 +2,12 @@
2
2
  /**
3
3
  * 作  者:huangteng
4
4
  * 邮  箱:htengweb@163.com
5
- * 当前版本:0.4.0 v
6
- * 发布日期:2024-11-13
5
+ * 当前版本:0.4.3 v
6
+ * 发布日期:2024-11-20
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
10
- import { getCurrentInstance, inject, ref, computed, unref, isRef, defineComponent, createVNode, Fragment, openBlock, createElementBlock, createElementVNode, reactive, createTextVNode, resolveComponent, Teleport, isVNode, onUnmounted, provide, watch, markRaw, watchEffect, h, onMounted, toRaw, render, nextTick, toRef } from "vue";
10
+ import { getCurrentInstance, inject, ref, computed, unref, isRef, defineComponent, createVNode, Fragment, openBlock, createElementBlock, createElementVNode, reactive, createTextVNode, resolveComponent, Teleport, isVNode, onUnmounted, provide, watch, nextTick, markRaw, watchEffect, h, onMounted, toRaw, render, toRef } from "vue";
11
11
 
12
12
  import { localeContextKey as localeContextKey$1, ElMessage, ElTooltip, ElScrollbar, ElDivider, ElColorPicker, ElSwitch, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem, ElDrawer, ElMenuItem, ElSubMenu, ElMenu, ElContainer, ElCol, ElFormItem, ElInput, ElSelect, ElOption, ElDatePicker, ElInputNumber, ElForm, ElRow, ElButton, ElTable, ElTableColumn, ElCheckbox, ElMessageBox, ElPagination, ElDialog, ElTag, ElRadioGroup, ElRadio, ElUpload, ElImageViewer, ElImage, ElTreeSelect, ElCascader, ElTimeSelect, ElCheckboxGroup, ElEmpty, ElPopover, ElPopconfirm } from "element-plus";
13
13
 
@@ -1140,11 +1140,11 @@ function useChangeColor() {
1140
1140
  };
1141
1141
  }
1142
1142
 
1143
- const {getLightColor: getLightColor$4} = useChangeColor(), nextUseCssVar = (cssvar, value) => {
1143
+ const {getLightColor: getLightColor$5} = useChangeColor(), nextUseCssVar = (cssvar, value) => {
1144
1144
  document.documentElement.style.setProperty(cssvar, value);
1145
1145
  }, nextUseCssTheme = (cssvar, value) => {
1146
1146
  nextUseCssVar(cssvar, value);
1147
- for (let i = 1; i < 10; i++) nextUseCssVar(cssvar + "-light-" + i, getLightColor$4(value, i / 10));
1147
+ for (let i = 1; i < 10; i++) nextUseCssVar(cssvar + "-light-" + i, getLightColor$5(value, i / 10));
1148
1148
  nextUseCssVar(`${cssvar}-dark-2`, value);
1149
1149
  }, updateThemeColor = color => {
1150
1150
  color && nextUseCssTheme("--el-color-primary", color);
@@ -1290,7 +1290,7 @@ var defaultConfig$5 = {
1290
1290
  }
1291
1291
  };
1292
1292
 
1293
- const ns$l = useNamespace("text-ellipsis");
1293
+ const ns$n = useNamespace("text-ellipsis");
1294
1294
 
1295
1295
  const NextTextEllipsis = withInstall(defineComponent({
1296
1296
  name: "NextTextEllipsis",
@@ -1337,7 +1337,7 @@ const NextTextEllipsis = withInstall(defineComponent({
1337
1337
  }
1338
1338
  };
1339
1339
  return () => createVNode(Fragment, null, [ createVNode("div", {
1340
- class: [ ns$l.b(), props.class ],
1340
+ class: [ ns$n.b(), props.class ],
1341
1341
  style: setWidth.value,
1342
1342
  onMouseenter: onMouseenter
1343
1343
  }, [ isTip.value ? createVNode(ElTooltip, {
@@ -1347,11 +1347,11 @@ const NextTextEllipsis = withInstall(defineComponent({
1347
1347
  disabled: props.disabled
1348
1348
  }, {
1349
1349
  default: () => [ createVNode("span", {
1350
- class: ns$l.e("text"),
1350
+ class: ns$n.e("text"),
1351
1351
  ref: ellipsisRef
1352
1352
  }, [ slots.default ? slots.default() : props.content ]) ]
1353
1353
  }) : createVNode("span", {
1354
- class: ns$l.e("text"),
1354
+ class: ns$n.e("text"),
1355
1355
  ref: ellipsisRef
1356
1356
  }, [ slots.default ? slots.default() : props.content ]) ]) ]);
1357
1357
  }
@@ -1711,6 +1711,9 @@ var warning_default = export_helper_default(warning_vue_vue_type_script_lang_def
1711
1711
  }, {
1712
1712
  type: "columns",
1713
1713
  text: "分栏"
1714
+ }, {
1715
+ type: "composite",
1716
+ text: "综合"
1714
1717
  } ];
1715
1718
  return createVNode(ElScrollbar, null, {
1716
1719
  default: () => [ createVNode(ElDivider, {
@@ -1965,9 +1968,9 @@ var HeaderTools = defineComponent({
1965
1968
  }
1966
1969
  });
1967
1970
 
1968
- const {getLightColor: getLightColor$3} = useChangeColor();
1971
+ const {getLightColor: getLightColor$4} = useChangeColor();
1969
1972
 
1970
- var Header$3 = defineComponent({
1973
+ var Header$4 = defineComponent({
1971
1974
  setup: () => ({
1972
1975
  ns: inject("ns", {})
1973
1976
  }),
@@ -1975,7 +1978,7 @@ var Header$3 = defineComponent({
1975
1978
  const slots = this.$slots, _ns = this.ns, _config = inject("options", {}), headerStyle = computed((() => {
1976
1979
  const {isHeaderBarColorGradual: isHeaderBarColorGradual, headerBarColor: color} = _config.setting;
1977
1980
  return isHeaderBarColorGradual ? {
1978
- background: `linear-gradient(to bottom , ${color}, ${getLightColor$3(color, .5)})`
1981
+ background: `linear-gradient(to bottom , ${color}, ${getLightColor$4(color, .5)})`
1979
1982
  } : "";
1980
1983
  })), __slots_header_tools = {};
1981
1984
  return slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
@@ -2738,7 +2741,7 @@ const NextMenuItem = defineComponent({
2738
2741
  }, null) ]
2739
2742
  }))) ]) ]);
2740
2743
  }
2741
- }), ns$k = useNamespace("menu");
2744
+ }), ns$m = useNamespace("menu");
2742
2745
 
2743
2746
  const NextMenu = withInstall(defineComponent({
2744
2747
  name: "NextMenu",
@@ -2766,21 +2769,22 @@ const NextMenu = withInstall(defineComponent({
2766
2769
  }
2767
2770
  },
2768
2771
  setup(props) {
2769
- provide("ns", ns$k);
2772
+ provide("ns", ns$m);
2770
2773
  const router = getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = ref(currentPath);
2771
2774
  watch((() => router.currentRoute?.value), (to => {
2772
2775
  activePath.value = to.fullPath;
2773
2776
  }));
2774
2777
  return () => createVNode(Fragment, null, [ createVNode(ElMenu, {
2775
- class: [ ns$k.b(), props.className ],
2778
+ class: [ ns$m.b(), props.className ],
2776
2779
  style: props.style,
2780
+ "popper-class": ns$m.b("popper"),
2777
2781
  defaultActive: activePath.value,
2778
2782
  router: props.router,
2779
2783
  mode: props.mode,
2780
2784
  ellipsis: !0
2781
2785
  }, {
2782
2786
  default: () => [ createVNode(Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : createVNode(ElSubMenu, {
2783
- "popper-class": ns$k.b("popper"),
2787
+ "popper-class": ns$m.b("popper"),
2784
2788
  index: item.path || item.id,
2785
2789
  teleported: !0
2786
2790
  }, {
@@ -2791,7 +2795,7 @@ const NextMenu = withInstall(defineComponent({
2791
2795
  menuData: item.children
2792
2796
  }, null)
2793
2797
  }) : valueExist(item.meta?.isHide, !1) ? null : createVNode(ElMenuItem, {
2794
- "popper-class": ns$k.b("popper"),
2798
+ "popper-class": ns$m.b("popper"),
2795
2799
  index: item.path
2796
2800
  }, {
2797
2801
  default: () => [ createVNode(MenuItemTitle, {
@@ -2802,7 +2806,7 @@ const NextMenu = withInstall(defineComponent({
2802
2806
  }
2803
2807
  }));
2804
2808
 
2805
- var Sidebar$2 = defineComponent({
2809
+ var Sidebar$3 = defineComponent({
2806
2810
  setup: () => ({
2807
2811
  ns: inject("ns", {})
2808
2812
  }),
@@ -2819,11 +2823,11 @@ var Sidebar$2 = defineComponent({
2819
2823
  }
2820
2824
  });
2821
2825
 
2822
- const ns$j = useNamespace("layout-defaults");
2826
+ const ns$l = useNamespace("layout-defaults");
2823
2827
 
2824
2828
  var defaults = defineComponent({
2825
2829
  props: {},
2826
- setup: () => (provide("ns", ns$j), {}),
2830
+ setup: () => (provide("ns", ns$l), {}),
2827
2831
  render() {
2828
2832
  const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
2829
2833
  slots.menu;
@@ -2832,12 +2836,12 @@ var defaults = defineComponent({
2832
2836
  slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2833
2837
  const isTabs = ref(!!slots.tabs);
2834
2838
  return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
2835
- class: ns$j.b()
2839
+ class: ns$l.b()
2836
2840
  }, {
2837
2841
  default: () => {
2838
- return [ createVNode(Sidebar$2, null, null), createVNode("div", {
2839
- class: [ ns$j.b("content") ]
2840
- }, [ createVNode(Header$3, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header_tools : {
2842
+ return [ createVNode(Sidebar$3, null, null), createVNode("div", {
2843
+ class: [ ns$l.b("content") ]
2844
+ }, [ createVNode(Header$4, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header_tools : {
2841
2845
  default: () => [ __slots_header_tools ]
2842
2846
  })), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
2843
2847
  tabs: _config.tabs,
@@ -2846,7 +2850,7 @@ var defaults = defineComponent({
2846
2850
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2847
2851
  onClose: (...arg) => _emit("tabsClose", ...arg)
2848
2852
  }, null) : null, createVNode("main", {
2849
- class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
2853
+ class: [ ns$l.bf("main"), ns$l.is("layout-tabs", isTabs.value) ]
2850
2854
  }, [ slots.default?.() ]) ]) ];
2851
2855
  var s;
2852
2856
  }
@@ -2854,14 +2858,14 @@ var defaults = defineComponent({
2854
2858
  }
2855
2859
  });
2856
2860
 
2857
- const {getLightColor: getLightColor$2} = useChangeColor();
2861
+ const {getLightColor: getLightColor$3} = useChangeColor();
2858
2862
 
2859
- var Header$2 = defineComponent({
2863
+ var Header$3 = defineComponent({
2860
2864
  setup(props, {slots: slots}) {
2861
2865
  const _ns = inject("ns", {}), _config = inject("options", {}), headerStyle = computed((() => {
2862
2866
  const {isHeaderBarColorGradual: isHeaderBarColorGradual, headerBarColor: color} = _config.setting;
2863
2867
  return isHeaderBarColorGradual ? {
2864
- background: `linear-gradient(to bottom , ${color}, ${getLightColor$2(color, .5)})`
2868
+ background: `linear-gradient(to bottom , ${color}, ${getLightColor$3(color, .5)})`
2865
2869
  } : "";
2866
2870
  })), __slots_header_tools = {};
2867
2871
  slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
@@ -2886,18 +2890,18 @@ var Header$2 = defineComponent({
2886
2890
  }
2887
2891
  });
2888
2892
 
2889
- const ns$i = useNamespace("layout-transverse");
2893
+ const ns$k = useNamespace("layout-transverse");
2890
2894
 
2891
2895
  var transverse = defineComponent({
2892
2896
  props: {},
2893
- setup: () => (provide("ns", ns$i), {}),
2897
+ setup: () => (provide("ns", ns$k), {}),
2894
2898
  render() {
2895
2899
  const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
2896
2900
  slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
2897
2901
  slots[slots_config_headerToolsPrefix] && (__slots_header[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
2898
2902
  slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2899
2903
  const isTabs = ref(!!slots.tabs);
2900
- return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header$2, null, (s = __slots_header,
2904
+ return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header$3, null, (s = __slots_header,
2901
2905
  "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
2902
2906
  default: () => [ __slots_header ]
2903
2907
  })), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
@@ -2907,20 +2911,20 @@ var transverse = defineComponent({
2907
2911
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2908
2912
  onClose: (...arg) => _emit("tabsClose", ...arg)
2909
2913
  }, null) : null, createVNode("main", {
2910
- class: [ ns$i.b("main"), ns$i.is("layout-tabs", isTabs.value) ]
2914
+ class: [ ns$k.b("main"), ns$k.is("layout-tabs", isTabs.value) ]
2911
2915
  }, [ slots.default?.() ]) ]);
2912
2916
  var s;
2913
2917
  }
2914
2918
  });
2915
2919
 
2916
- const {getLightColor: getLightColor$1} = useChangeColor();
2920
+ const {getLightColor: getLightColor$2} = useChangeColor();
2917
2921
 
2918
- var Header$1 = defineComponent({
2922
+ var Header$2 = defineComponent({
2919
2923
  setup(props, {slots: slots}) {
2920
2924
  const _ns = inject("ns", {}), _config = inject("options", {}), headerStyle = computed((() => {
2921
2925
  const {isHeaderBarColorGradual: isHeaderBarColorGradual, headerBarColor: color} = _config.setting;
2922
2926
  return isHeaderBarColorGradual ? {
2923
- background: `linear-gradient(to bottom , ${color}, ${getLightColor$1(color, .5)})`
2927
+ background: `linear-gradient(to bottom , ${color}, ${getLightColor$2(color, .5)})`
2924
2928
  } : "";
2925
2929
  })), __slots_header_tools = {};
2926
2930
  slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
@@ -2939,7 +2943,7 @@ var Header$1 = defineComponent({
2939
2943
  var s;
2940
2944
  };
2941
2945
  }
2942
- }), Sidebar$1 = defineComponent({
2946
+ }), Sidebar$2 = defineComponent({
2943
2947
  setup: () => ({
2944
2948
  ns: inject("ns", {})
2945
2949
  }),
@@ -2954,11 +2958,11 @@ var Header$1 = defineComponent({
2954
2958
  }
2955
2959
  });
2956
2960
 
2957
- const ns$h = useNamespace("layout-columns");
2961
+ const ns$j = useNamespace("layout-columns");
2958
2962
 
2959
2963
  var columns = defineComponent({
2960
2964
  props: {},
2961
- setup: () => (provide("ns", ns$h), {}),
2965
+ setup: () => (provide("ns", ns$j), {}),
2962
2966
  render() {
2963
2967
  const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
2964
2968
  slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
@@ -2966,12 +2970,12 @@ var columns = defineComponent({
2966
2970
  slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2967
2971
  const isTabs = ref(!!slots.tabs);
2968
2972
  return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
2969
- class: ns$h.b()
2973
+ class: ns$j.b()
2970
2974
  }, {
2971
2975
  default: () => {
2972
- return [ createVNode(Sidebar$1, null, null), createVNode("div", {
2973
- class: [ ns$h.b("content") ]
2974
- }, [ createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
2976
+ return [ createVNode(Sidebar$2, null, null), createVNode("div", {
2977
+ class: [ ns$j.b("content") ]
2978
+ }, [ createVNode(Header$2, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
2975
2979
  default: () => [ __slots_header ]
2976
2980
  })), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
2977
2981
  tabs: _config.tabs,
@@ -2980,7 +2984,7 @@ var columns = defineComponent({
2980
2984
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2981
2985
  onClose: (...arg) => _emit("tabsClose", ...arg)
2982
2986
  }, null) : null, createVNode("main", {
2983
- class: [ ns$h.bf("main"), ns$h.is("layout-tabs", isTabs.value) ]
2987
+ class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
2984
2988
  }, [ slots.default?.() ]) ]) ];
2985
2989
  var s;
2986
2990
  }
@@ -2988,14 +2992,14 @@ var columns = defineComponent({
2988
2992
  }
2989
2993
  });
2990
2994
 
2991
- const {getLightColor: getLightColor} = useChangeColor();
2995
+ const {getLightColor: getLightColor$1} = useChangeColor();
2992
2996
 
2993
- var Header = defineComponent({
2997
+ var Header$1 = defineComponent({
2994
2998
  setup(props, {slots: slots}) {
2995
2999
  const _ns = inject("ns", {}), _config = inject("options", {}), headerStyle = computed((() => {
2996
3000
  const {isHeaderBarColorGradual: isHeaderBarColorGradual, headerBarColor: color} = _config.setting;
2997
3001
  return isHeaderBarColorGradual ? {
2998
- background: `linear-gradient(to bottom , ${color}, ${getLightColor(color, .5)})`
3002
+ background: `linear-gradient(to bottom , ${color}, ${getLightColor$1(color, .5)})`
2999
3003
  } : "";
3000
3004
  })), __slots_header_tools = {};
3001
3005
  slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
@@ -3014,7 +3018,7 @@ var Header = defineComponent({
3014
3018
  var s;
3015
3019
  };
3016
3020
  }
3017
- }), Sidebar = defineComponent({
3021
+ }), Sidebar$1 = defineComponent({
3018
3022
  setup: () => ({
3019
3023
  ns: inject("ns", {})
3020
3024
  }),
@@ -3031,13 +3035,162 @@ var Header = defineComponent({
3031
3035
  }
3032
3036
  });
3033
3037
 
3034
- const ns$g = useNamespace("layout-classic");
3038
+ const ns$i = useNamespace("layout-classic");
3035
3039
 
3036
3040
  var classic = defineComponent({
3037
3041
  props: {},
3038
- setup: () => (provide("ns", ns$g), {
3039
- ns: ns$g
3042
+ setup: () => (provide("ns", ns$i), {
3043
+ ns: ns$i
3040
3044
  }),
3045
+ render() {
3046
+ const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
3047
+ slots.menu;
3048
+ const __slots_header_tools = {};
3049
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
3050
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
3051
+ const isTabs = ref(!!slots.tabs);
3052
+ return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header$1, null, (s = __slots_header_tools,
3053
+ "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header_tools : {
3054
+ default: () => [ __slots_header_tools ]
3055
+ })), createVNode("div", {
3056
+ class: [ ns$i.b("content"), ns$i.is("layout-tabs", isTabs.value) ]
3057
+ }, [ createVNode(Sidebar$1, null, null), createVNode("div", {
3058
+ class: ns$i.b("container")
3059
+ }, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
3060
+ tabs: _config.tabs,
3061
+ activeTab: _config.activeTab,
3062
+ onChange: (...arg) => _emit("tabsChange", ...arg),
3063
+ onSelect: (...arg) => _emit("tabsSelect", ...arg),
3064
+ onClose: (...arg) => _emit("tabsClose", ...arg)
3065
+ }, null) : null, createVNode("main", {
3066
+ class: [ ns$i.b("main") ]
3067
+ }, [ slots.default?.() ]) ]) ]) ]);
3068
+ var s;
3069
+ }
3070
+ });
3071
+
3072
+ const findParentNode = (path, tree) => {
3073
+ for (const node of tree) {
3074
+ if (node.children?.some((child => child.path === path))) return node;
3075
+ if (node.children) {
3076
+ const parent = findParentNode(path, node.children);
3077
+ if (parent) return parent;
3078
+ }
3079
+ }
3080
+ return null;
3081
+ }, ns$h = useNamespace("menu");
3082
+
3083
+ var MenuTop = defineComponent({
3084
+ props: {
3085
+ className: {
3086
+ type: String,
3087
+ default: ""
3088
+ },
3089
+ style: {
3090
+ type: Object,
3091
+ default: () => ({})
3092
+ },
3093
+ menuTree: {
3094
+ type: Array,
3095
+ default: () => []
3096
+ }
3097
+ },
3098
+ setup(props) {
3099
+ provide("ns", ns$h);
3100
+ const updateSubmentTree = inject("updateSubmentTree"), router = getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, parentNode = findParentNode(currentPath, props.menuTree), activeMenuId = ref(parentNode?.id);
3101
+ parentNode?.id && updateSubmentTree(parentNode.children), watch((() => router.currentRoute?.value), (to => {
3102
+ const parentNode = findParentNode(to.fullPath, props.menuTree);
3103
+ activeMenuId.value = parentNode?.id, parentNode?.id && updateSubmentTree(parentNode.children);
3104
+ }));
3105
+ const findTreeFirst = tree => {
3106
+ let result = tree[0];
3107
+ for (let i = 0; i < tree.length; i++) {
3108
+ const node = tree[i];
3109
+ if (node.children?.length && (result = findTreeFirst(node.children), result)) break;
3110
+ }
3111
+ return result;
3112
+ }, renderContent = () => createVNode(ElMenu, {
3113
+ class: [ ns$h.b(), props.className ],
3114
+ style: props.style,
3115
+ "popper-class": ns$h.b("popper"),
3116
+ defaultActive: activeMenuId.value,
3117
+ mode: "horizontal",
3118
+ ellipsis: !0
3119
+ }, {
3120
+ default: () => [ createVNode(Fragment, null, [ props.menuTree.map((item => valueExist(item.meta?.isHide, !1) ? null : createVNode(ElMenuItem, {
3121
+ index: item.id,
3122
+ onClick: val => ((val, item) => {
3123
+ if (updateSubmentTree(item.children), item.children?.length) {
3124
+ const firstNode = findTreeFirst(item.children);
3125
+ router.push(firstNode.path);
3126
+ } else router.push(item.path);
3127
+ })(0, item)
3128
+ }, {
3129
+ default: () => [ createVNode(MenuItemTitle, {
3130
+ meta: item.meta
3131
+ }, null) ]
3132
+ }))) ]) ]
3133
+ });
3134
+ return () => createVNode(Fragment, null, [ renderContent() ]);
3135
+ }
3136
+ });
3137
+
3138
+ const {getLightColor: getLightColor} = useChangeColor();
3139
+
3140
+ var Header = defineComponent({
3141
+ setup(props, {slots: slots}) {
3142
+ const _ns = inject("ns", {}), _config = inject("options", {}), headerStyle = computed((() => {
3143
+ const {isHeaderBarColorGradual: isHeaderBarColorGradual, headerBarColor: color} = _config.setting;
3144
+ return isHeaderBarColorGradual ? {
3145
+ background: `linear-gradient(to bottom , ${color}, ${getLightColor(color, .5)})`
3146
+ } : "";
3147
+ })), __slots_header_tools = {};
3148
+ slots[slots_config_headerToolsPrefix] && (__slots_header_tools[slots_config_headerToolsPrefix] = () => slots[slots_config_headerToolsPrefix]()),
3149
+ slots[slots_config_headerToolsSuffix] && (__slots_header_tools[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
3150
+ return () => {
3151
+ return createVNode(Fragment, null, [ createVNode("header", {
3152
+ class: _ns.b("header"),
3153
+ style: headerStyle.value
3154
+ }, [ createVNode(LogoView, null, null), createVNode("div", {
3155
+ class: _ns.bf("header", "menu")
3156
+ }, [ slots[slots_config_headerMenu] ? slots[slots_config_headerMenu]() : createVNode(MenuTop, {
3157
+ menuTree: _config.menuTree
3158
+ }, null) ]), createVNode("div", {
3159
+ class: _ns.bf("header", "right")
3160
+ }, [ createVNode(HeaderTools, null, (s = __slots_header_tools, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header_tools : {
3161
+ default: () => [ __slots_header_tools ]
3162
+ })) ]) ]) ]);
3163
+ var s;
3164
+ };
3165
+ }
3166
+ }), Sidebar = defineComponent({
3167
+ setup(props, {slots: slots}) {
3168
+ const ns = inject("ns", {}), submenuTree = inject("submenuTree", []);
3169
+ return () => createVNode(Fragment, null, [ 0 === submenuTree.value.length ? null : createVNode("aside", {
3170
+ class: ns.b("sidebar")
3171
+ }, [ slots[slots_config_headerMenu] ? slots[slots_config_headerMenu]() : createVNode(NextMenu, {
3172
+ mode: "vertical",
3173
+ menuTree: submenuTree.value
3174
+ }, null) ]) ]);
3175
+ }
3176
+ });
3177
+
3178
+ const ns$g = useNamespace("layout-composite");
3179
+
3180
+ var composite = defineComponent({
3181
+ props: {},
3182
+ setup() {
3183
+ provide("ns", ns$g);
3184
+ const submenuTree = ref([]);
3185
+ return provide("submenuTree", submenuTree), provide("updateSubmentTree", (val => {
3186
+ submenuTree.value = [], nextTick((() => {
3187
+ submenuTree.value = val;
3188
+ }));
3189
+ })), {
3190
+ ns: ns$g,
3191
+ submenuTree: submenuTree
3192
+ };
3193
+ },
3041
3194
  render() {
3042
3195
  const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
3043
3196
  slots.menu;
@@ -3069,7 +3222,8 @@ const ns$f = useNamespace("layout"), layouts = {
3069
3222
  defaults: markRaw(defaults),
3070
3223
  transverse: markRaw(transverse),
3071
3224
  columns: markRaw(columns),
3072
- classic: markRaw(classic)
3225
+ classic: markRaw(classic),
3226
+ composite: markRaw(composite)
3073
3227
  }, customizerCoverArray = (objValue, srcValue) => {
3074
3228
  if (Array.isArray(objValue)) return srcValue;
3075
3229
  };
@@ -3693,6 +3847,12 @@ var NextSpinLoading$1 = defineComponent({
3693
3847
  disabled: col.disabled,
3694
3848
  column: col,
3695
3849
  formParams: formParams
3850
+ }, null) : "cascader" === col.type ? createVNode(NextTreeCascader, {
3851
+ modelValue: formParams[col.prop],
3852
+ "onUpdate:modelValue": $event => formParams[col.prop] = $event,
3853
+ disabled: col.disabled,
3854
+ column: col,
3855
+ formParams: formParams
3696
3856
  }, null) : void 0;
3697
3857
  };
3698
3858
  return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ columns.value.map((col => !col.hide && createVNode(ElCol, {
@@ -4798,7 +4958,7 @@ var UploadImage = defineComponent({
4798
4958
  onClear: onClearValue
4799
4959
  }, null) ]);
4800
4960
  }
4801
- }), NestTreeCascader = defineComponent({
4961
+ }), treeCascader = defineComponent({
4802
4962
  name: "NextTreeCascader",
4803
4963
  props: {
4804
4964
  modelValue: {
@@ -5221,7 +5381,7 @@ var Element$7 = defineComponent({
5221
5381
  column: col,
5222
5382
  formParams: formParams,
5223
5383
  onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns)
5224
- }, null) : "cascader" === col.type ? createVNode(NestTreeCascader, {
5384
+ }, null) : "cascader" === col.type ? createVNode(treeCascader, {
5225
5385
  modelValue: formParams[col.prop],
5226
5386
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
5227
5387
  disabled: valueExist(col.disabled, !1),
@@ -5305,7 +5465,7 @@ var Element$7 = defineComponent({
5305
5465
  }
5306
5466
  });
5307
5467
 
5308
- const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$7);
5468
+ const NextTreeSelect = withInstall(treeSelect), NextTreeCascader = withInstall(treeCascader), NextForm = withInstall(Element$7);
5309
5469
 
5310
5470
  var AddEditForm = defineComponent({
5311
5471
  name: "AddEditForm",
@@ -8232,6 +8392,7 @@ var components = Object.freeze({
8232
8392
  NextSpinLoading: NextSpinLoading,
8233
8393
  NextTabs: NextTabs,
8234
8394
  NextTextEllipsis: NextTextEllipsis,
8395
+ NextTreeCascader: NextTreeCascader,
8235
8396
  NextTreeSelect: NextTreeSelect,
8236
8397
  NextUpload: NextUpload,
8237
8398
  NextVideoPlayer: NextVideoPlayer
@@ -8269,7 +8430,7 @@ const zoomDialog = app => {
8269
8430
  }));
8270
8431
  }
8271
8432
  });
8272
- }, version = "0.4.0", install = function(app) {
8433
+ }, version = "0.4.3", install = function(app) {
8273
8434
  Object.keys(components).forEach((key => {
8274
8435
  const component = components[key];
8275
8436
  app.component(component.name, component);
@@ -8279,8 +8440,8 @@ const zoomDialog = app => {
8279
8440
  };
8280
8441
 
8281
8442
  var index = {
8282
- version: "0.4.0",
8443
+ version: "0.4.3",
8283
8444
  install: install
8284
8445
  };
8285
8446
 
8286
- export { NextContainer, NextCrudTable, NextCrudTableVirtualized, NextDialog, NextDragResize, NextForm, NextLabelimg, NextLabelimgPreview, NextLabelme, NextLayout, NextMenu, NextSpinLoading, NextTabs, NextTextEllipsis, NextTreeSelect, NextUpload, NextVideoPlayer, buildLocaleContext, buildTranslator, index as default, defaultNamespace, install, localeContextKey, localeLang, namespaceContextKey, nextUseCssTheme, nextUseCssVar, translate, updateThemeColor, updateThemeColorCssVar, useDetectVideo, useGetDerivedNamespace, useLanguage, useLocale, useNamespace, version };
8447
+ export { NextContainer, NextCrudTable, NextCrudTableVirtualized, NextDialog, NextDragResize, NextForm, NextLabelimg, NextLabelimgPreview, NextLabelme, NextLayout, NextMenu, NextSpinLoading, NextTabs, NextTextEllipsis, NextTreeCascader, NextTreeSelect, NextUpload, NextVideoPlayer, buildLocaleContext, buildTranslator, index as default, defaultNamespace, install, localeContextKey, localeLang, namespaceContextKey, nextUseCssTheme, nextUseCssVar, translate, updateThemeColor, updateThemeColorCssVar, useDetectVideo, useGetDerivedNamespace, useLanguage, useLocale, useNamespace, version };