hy-dispatch-ui-v3 0.2.19 → 0.2.20

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.
@@ -1,7 +1,6 @@
1
- import { defineComponent, useModel, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, unref, createBlock, withCtx, withModifiers, createVNode, toDisplayString, createCommentVNode, normalizeStyle, mergeModels } from 'vue';
1
+ import { defineComponent, useModel, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createBlock, unref, withCtx, withModifiers, createVNode, toDisplayString, normalizeStyle, createCommentVNode, mergeModels } from 'vue';
2
2
  import { ElIcon } from 'element-plus';
3
3
  import { Download } from '@element-plus/icons-vue';
4
- import { usePermissionMap } from '../../hooks/usePermissionMap.mjs';
5
4
  import { AppTooltip } from '../appTooltip/index.mjs';
6
5
  import { AppIcon } from '../appIcon/index.mjs';
7
6
 
@@ -16,24 +15,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
16
15
  type: Array,
17
16
  default: () => []
18
17
  },
18
+ modelValue: {
19
+ type: String,
20
+ default: () => ""
21
+ },
19
22
  showShrink: {
20
23
  type: Boolean,
21
24
  default: false
22
25
  }
23
26
  }, {
24
- "modelValue": { type: String, default: "" },
25
- "modelModifiers": {},
26
27
  "expand": { type: Boolean, default: true },
27
28
  "expandModifiers": {}
28
29
  }),
29
- emits: /* @__PURE__ */ mergeModels(["select", "open", "close"], ["update:modelValue", "update:expand"]),
30
+ emits: /* @__PURE__ */ mergeModels(["select", "open", "close"], ["update:expand"]),
30
31
  setup(__props, { expose: __expose, emit: __emit }) {
31
32
  const emits = __emit;
32
- const { permissionMap } = usePermissionMap();
33
- const modelValue = useModel(__props, "modelValue");
34
33
  const expand = useModel(__props, "expand");
35
34
  function onClickHandler(item) {
36
- modelValue.value = item.path;
37
35
  emits("select", item);
38
36
  }
39
37
  function onExpandHandler() {
@@ -53,47 +51,39 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
53
51
  Fragment,
54
52
  null,
55
53
  renderList(__props.menu, (item, index) => {
56
- return openBlock(), createElementBlock(
57
- Fragment,
58
- { key: index },
59
- [
60
- unref(permissionMap).has(item.permission) ? (openBlock(), createBlock(unref(AppTooltip), {
61
- key: 0,
62
- "is-always": "",
63
- overLine: 1,
64
- disabled: expand.value,
65
- content: item.label,
66
- placement: "right"
67
- }, {
68
- default: withCtx(() => [
69
- createElementVNode("div", {
70
- class: normalizeClass(["operator-menu-item", { "operator-menu-item-active": modelValue.value === item.path }]),
71
- onClick: withModifiers(($event) => onClickHandler(item), ["stop"])
72
- }, [
73
- createElementVNode("div", { class: "operator-label clickBox over_one_line" }, [
74
- createVNode(unref(AppIcon), {
75
- "svg-name": `${item.iconName}`,
76
- "class-name": "!w-5 !h-5 flex-shrink-0"
77
- }, null, 8, ["svg-name"]),
78
- createElementVNode(
79
- "span",
80
- {
81
- class: normalizeClass({ "ml-3": expand.value })
82
- },
83
- toDisplayString(expand.value ? item.label : item.tip || item.label),
84
- 3
85
- /* TEXT, CLASS */
86
- )
87
- ])
88
- ], 10, ["onClick"])
89
- ]),
90
- _: 2
91
- /* DYNAMIC */
92
- }, 1032, ["disabled", "content"])) : createCommentVNode("v-if", true)
93
- ],
94
- 64
95
- /* STABLE_FRAGMENT */
96
- );
54
+ return openBlock(), createBlock(unref(AppTooltip), {
55
+ key: index,
56
+ "is-always": "",
57
+ overLine: 1,
58
+ disabled: expand.value,
59
+ content: item.label,
60
+ placement: "right"
61
+ }, {
62
+ default: withCtx(() => [
63
+ createElementVNode("div", {
64
+ class: normalizeClass(["operator-menu-item", { "operator-menu-item-active": __props.modelValue === item.path }]),
65
+ onClick: withModifiers(($event) => onClickHandler(item), ["stop"])
66
+ }, [
67
+ createElementVNode("div", { class: "operator-label clickBox" }, [
68
+ createVNode(unref(AppIcon), {
69
+ "svg-name": `${item.iconName}`,
70
+ "class-name": "!w-5 !h-5 flex-shrink-0"
71
+ }, null, 8, ["svg-name"]),
72
+ createElementVNode(
73
+ "div",
74
+ {
75
+ class: normalizeClass([{ "ml-3": expand.value }, "over_one_line w-full px-2"])
76
+ },
77
+ toDisplayString(expand.value ? item.label : item.tip || item.label),
78
+ 3
79
+ /* TEXT, CLASS */
80
+ )
81
+ ])
82
+ ], 10, ["onClick"])
83
+ ]),
84
+ _: 2
85
+ /* DYNAMIC */
86
+ }, 1032, ["disabled", "content"]);
97
87
  }),
98
88
  128
99
89
  /* KEYED_FRAGMENT */
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.18";
1
+ const version = "0.2.19";
2
2
 
3
3
  export { version };
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var iconsVue = require('@element-plus/icons-vue');
8
- var usePermissionMap = require('../../hooks/usePermissionMap.js');
9
8
  var index = require('../appTooltip/index.js');
10
9
  var index$1 = require('../appIcon/index.js');
11
10
 
@@ -20,24 +19,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
20
19
  type: Array,
21
20
  default: () => []
22
21
  },
22
+ modelValue: {
23
+ type: String,
24
+ default: () => ""
25
+ },
23
26
  showShrink: {
24
27
  type: Boolean,
25
28
  default: false
26
29
  }
27
30
  }, {
28
- "modelValue": { type: String, default: "" },
29
- "modelModifiers": {},
30
31
  "expand": { type: Boolean, default: true },
31
32
  "expandModifiers": {}
32
33
  }),
33
- emits: /* @__PURE__ */ vue.mergeModels(["select", "open", "close"], ["update:modelValue", "update:expand"]),
34
+ emits: /* @__PURE__ */ vue.mergeModels(["select", "open", "close"], ["update:expand"]),
34
35
  setup(__props, { expose: __expose, emit: __emit }) {
35
36
  const emits = __emit;
36
- const { permissionMap } = usePermissionMap.usePermissionMap();
37
- const modelValue = vue.useModel(__props, "modelValue");
38
37
  const expand = vue.useModel(__props, "expand");
39
38
  function onClickHandler(item) {
40
- modelValue.value = item.path;
41
39
  emits("select", item);
42
40
  }
43
41
  function onExpandHandler() {
@@ -57,47 +55,39 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
57
55
  vue.Fragment,
58
56
  null,
59
57
  vue.renderList(__props.menu, (item, index$2) => {
60
- return vue.openBlock(), vue.createElementBlock(
61
- vue.Fragment,
62
- { key: index$2 },
63
- [
64
- vue.unref(permissionMap).has(item.permission) ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppTooltip), {
65
- key: 0,
66
- "is-always": "",
67
- overLine: 1,
68
- disabled: expand.value,
69
- content: item.label,
70
- placement: "right"
71
- }, {
72
- default: vue.withCtx(() => [
73
- vue.createElementVNode("div", {
74
- class: vue.normalizeClass(["operator-menu-item", { "operator-menu-item-active": modelValue.value === item.path }]),
75
- onClick: vue.withModifiers(($event) => onClickHandler(item), ["stop"])
76
- }, [
77
- vue.createElementVNode("div", { class: "operator-label clickBox over_one_line" }, [
78
- vue.createVNode(vue.unref(index$1.AppIcon), {
79
- "svg-name": `${item.iconName}`,
80
- "class-name": "!w-5 !h-5 flex-shrink-0"
81
- }, null, 8, ["svg-name"]),
82
- vue.createElementVNode(
83
- "span",
84
- {
85
- class: vue.normalizeClass({ "ml-3": expand.value })
86
- },
87
- vue.toDisplayString(expand.value ? item.label : item.tip || item.label),
88
- 3
89
- /* TEXT, CLASS */
90
- )
91
- ])
92
- ], 10, ["onClick"])
93
- ]),
94
- _: 2
95
- /* DYNAMIC */
96
- }, 1032, ["disabled", "content"])) : vue.createCommentVNode("v-if", true)
97
- ],
98
- 64
99
- /* STABLE_FRAGMENT */
100
- );
58
+ return vue.openBlock(), vue.createBlock(vue.unref(index.AppTooltip), {
59
+ key: index$2,
60
+ "is-always": "",
61
+ overLine: 1,
62
+ disabled: expand.value,
63
+ content: item.label,
64
+ placement: "right"
65
+ }, {
66
+ default: vue.withCtx(() => [
67
+ vue.createElementVNode("div", {
68
+ class: vue.normalizeClass(["operator-menu-item", { "operator-menu-item-active": __props.modelValue === item.path }]),
69
+ onClick: vue.withModifiers(($event) => onClickHandler(item), ["stop"])
70
+ }, [
71
+ vue.createElementVNode("div", { class: "operator-label clickBox" }, [
72
+ vue.createVNode(vue.unref(index$1.AppIcon), {
73
+ "svg-name": `${item.iconName}`,
74
+ "class-name": "!w-5 !h-5 flex-shrink-0"
75
+ }, null, 8, ["svg-name"]),
76
+ vue.createElementVNode(
77
+ "div",
78
+ {
79
+ class: vue.normalizeClass([{ "ml-3": expand.value }, "over_one_line w-full px-2"])
80
+ },
81
+ vue.toDisplayString(expand.value ? item.label : item.tip || item.label),
82
+ 3
83
+ /* TEXT, CLASS */
84
+ )
85
+ ])
86
+ ], 10, ["onClick"])
87
+ ]),
88
+ _: 2
89
+ /* DYNAMIC */
90
+ }, 1032, ["disabled", "content"]);
101
91
  }),
102
92
  128
103
93
  /* KEYED_FRAGMENT */
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.18";
3
+ const version = "0.2.19";
4
4
 
5
5
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-dispatch-ui-v3",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {