@web-utils/component 2.0.9 → 2.0.11

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.
Files changed (172) hide show
  1. package/dist/chunks/3d28cc08.js +57 -0
  2. package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
  3. package/dist/chunks/5d33812d.js +147 -0
  4. package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
  5. package/dist/chunks/9d848bf6.js +99 -0
  6. package/dist/chunks/a0bb327b.js +96 -0
  7. package/dist/chunks/a8891d2c.js +30 -0
  8. package/dist/chunks/c69d5628.js +248 -0
  9. package/dist/chunks/de9fe802.js +24 -0
  10. package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
  11. package/dist/components/address-input/index.js +56 -43
  12. package/dist/components/address-input/style.css +15 -1
  13. package/dist/components/aside-menu/index.js +36 -30
  14. package/dist/components/aside-menu/style.css +9 -1
  15. package/dist/components/awesome-button/index.js +35 -32
  16. package/dist/components/base.css +66 -1
  17. package/dist/components/capsule-tab/index.js +33 -27
  18. package/dist/components/capsule-tab/style.css +32 -1
  19. package/dist/components/chunk-file-uploader/index.js +88 -54
  20. package/dist/components/chunk-file-uploader/style.css +4 -1
  21. package/dist/components/chunk-file-uploader-button/index.js +31 -25
  22. package/dist/components/chunk-file-uploader-button/style.css +17 -1
  23. package/dist/components/chunk-file-uploader-drop/index.js +42 -28
  24. package/dist/components/chunk-file-uploader-drop/style.css +12 -1
  25. package/dist/components/chunk-file-uploader-file/index.js +212 -134
  26. package/dist/components/chunk-file-uploader-file/style.css +125 -1
  27. package/dist/components/chunk-file-uploader-files/index.js +34 -28
  28. package/dist/components/chunk-file-uploader-files/style.css +9 -1
  29. package/dist/components/chunk-file-uploader-list/index.js +35 -29
  30. package/dist/components/chunk-file-uploader-list/style.css +9 -1
  31. package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
  32. package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
  33. package/dist/components/code-mirror-editor/index.js +181 -153
  34. package/dist/components/code-mirror-editor/style.css +17 -1
  35. package/dist/components/color-picker/index.js +68 -49
  36. package/dist/components/confirm-button/index.js +21 -19
  37. package/dist/components/confirmable/index.js +19 -18
  38. package/dist/components/context-menu/index.js +130 -108
  39. package/dist/components/context-menu/style.css +88 -1
  40. package/dist/components/custom-scrollbar/index.js +67 -49
  41. package/dist/components/data-table-picker/index.js +81 -62
  42. package/dist/components/dynamic-table/index.js +113 -89
  43. package/dist/components/dynamic-table/style.css +30 -1
  44. package/dist/components/e-charts/index.js +201 -120
  45. package/dist/components/e-charts/style.css +10 -1
  46. package/dist/components/editable-progress/index.js +93 -60
  47. package/dist/components/editable-progress/style.css +37 -1
  48. package/dist/components/editable-tree/index.js +638 -423
  49. package/dist/components/editable-tree/style.css +82 -1
  50. package/dist/components/egd-collapse/index.js +46 -33
  51. package/dist/components/egd-collapse-item/index.js +76 -60
  52. package/dist/components/element-dialog/index.js +147 -95
  53. package/dist/components/element-dialog/style.css +102 -1
  54. package/dist/components/empty-view/index.js +34 -28
  55. package/dist/components/empty-view/style.css +17 -1
  56. package/dist/components/error-view/index.js +32 -26
  57. package/dist/components/error-view/style.css +17 -1
  58. package/dist/components/flex-column/index.js +40 -25
  59. package/dist/components/flex-item/index.js +57 -29
  60. package/dist/components/flex-row/index.js +40 -25
  61. package/dist/components/flex-scroller/index.js +32 -26
  62. package/dist/components/flex-scroller/style.css +20 -1
  63. package/dist/components/form-button/index.js +38 -34
  64. package/dist/components/form-cascader/index.js +81 -71
  65. package/dist/components/form-checkbox-group/index.js +113 -88
  66. package/dist/components/form-checkbox-group/style.css +51 -1
  67. package/dist/components/form-date-picker/index.js +132 -70
  68. package/dist/components/form-holder/index.js +39 -32
  69. package/dist/components/form-input/index.js +62 -56
  70. package/dist/components/form-input-email/index.js +60 -48
  71. package/dist/components/form-input-id-card/index.js +59 -53
  72. package/dist/components/form-input-number/index.js +68 -61
  73. package/dist/components/form-input-number/style.css +12 -1
  74. package/dist/components/form-input-phone-number/index.js +55 -49
  75. package/dist/components/form-input-time/index.js +59 -53
  76. package/dist/components/form-item/index.js +123 -80
  77. package/dist/components/form-item/style.css +11 -1
  78. package/dist/components/form-item-config-provider/index.js +26 -25
  79. package/dist/components/form-item-group/index.js +111 -85
  80. package/dist/components/form-item-group/style.css +30 -1
  81. package/dist/components/form-radio-group/index.js +104 -85
  82. package/dist/components/form-radio-group/style.css +53 -1
  83. package/dist/components/form-select/index.js +91 -76
  84. package/dist/components/form-switch/index.js +57 -51
  85. package/dist/components/form-textarea/index.js +57 -51
  86. package/dist/components/form-view/index.js +232 -165
  87. package/dist/components/form-view/style.css +158 -1
  88. package/dist/components/guide-steps/index.js +58 -44
  89. package/dist/components/guide-steps/style.css +34 -1
  90. package/dist/components/icon-card/index.js +35 -29
  91. package/dist/components/icon-card/style.css +56 -1
  92. package/dist/components/iframe-window/index.js +35 -29
  93. package/dist/components/iframe-window/style.css +20 -1
  94. package/dist/components/image-viewer/index.js +66 -48
  95. package/dist/components/image-viewer/style.css +21 -1
  96. package/dist/components/input-number/index.js +193 -127
  97. package/dist/components/input-number/style.css +15 -1
  98. package/dist/components/input-number-range/index.js +57 -45
  99. package/dist/components/input-number-range/style.css +12 -1
  100. package/dist/components/j-s-x-component/index.js +4 -4
  101. package/dist/components/keep-view-alive/index.js +120 -73
  102. package/dist/components/loading-view/index.js +32 -26
  103. package/dist/components/loading-view/style.css +17 -1
  104. package/dist/components/nav-bar/index.js +37 -27
  105. package/dist/components/nav-bar/style.css +17 -1
  106. package/dist/components/not-implement/index.js +31 -23
  107. package/dist/components/not-implement/style.css +15 -1
  108. package/dist/components/page/index.js +28 -22
  109. package/dist/components/page/style.css +12 -1
  110. package/dist/components/page-header/index.js +36 -30
  111. package/dist/components/page-header/style.css +14 -1
  112. package/dist/components/page-index/index.js +83 -62
  113. package/dist/components/page-index/style.css +23 -1
  114. package/dist/components/page-index-top/index.js +68 -53
  115. package/dist/components/page-skeleton/index.js +37 -31
  116. package/dist/components/page-skeleton/style.css +23 -1
  117. package/dist/components/page-skeleton-new/index.js +48 -42
  118. package/dist/components/page-skeleton-new/style.css +42 -1
  119. package/dist/components/pageable-table/index.js +253 -186
  120. package/dist/components/pageable-table/style.css +72 -1
  121. package/dist/components/pageable-view/index.js +199 -129
  122. package/dist/components/pageable-view/style.css +69 -1
  123. package/dist/components/photo-swipe/index.js +151 -110
  124. package/dist/components/photo-swipe/style.css +20 -1
  125. package/dist/components/resize-observer/index.js +68 -34
  126. package/dist/components/resize-observer/style.css +31 -1
  127. package/dist/components/search-popover/index.js +211 -153
  128. package/dist/components/search-popover/style.css +93 -1
  129. package/dist/components/sign-panel/index.js +142 -92
  130. package/dist/components/sign-panel/style.css +97 -1
  131. package/dist/components/split-pane/index.js +162 -101
  132. package/dist/components/split-pane/style.css +100 -1
  133. package/dist/components/stateful/index.js +34 -31
  134. package/dist/components/stateful/style.css +33 -1
  135. package/dist/components/static-pageable-table/index.js +44 -37
  136. package/dist/components/static-pageable-table/style.css +9 -1
  137. package/dist/components/swiper/index.js +150 -85
  138. package/dist/components/swiper/style.css +43 -1
  139. package/dist/components/tab/index.js +72 -54
  140. package/dist/components/tab/style.css +122 -1
  141. package/dist/components/tab-item/index.js +35 -30
  142. package/dist/components/table-column/index.js +32 -30
  143. package/dist/components/table-view/index.js +227 -156
  144. package/dist/components/table-view/style.css +95 -1
  145. package/dist/components/tag-render/index.js +58 -44
  146. package/dist/components/tag-render/style.css +33 -1
  147. package/dist/components/tinymce-editor/index.js +95 -79
  148. package/dist/components/tinymce-editor/style.css +43 -1
  149. package/dist/components/tinymce-wrapper/index.js +121 -92
  150. package/dist/components/tinymce-wrapper/style.css +36 -1
  151. package/dist/components/toolbar/index.js +84 -63
  152. package/dist/components/toolbar/style.css +39 -1
  153. package/dist/components/toolbar-button/index.js +48 -41
  154. package/dist/components/toolbar-button/style.css +21 -1
  155. package/dist/components/trigger/index.js +36 -29
  156. package/dist/components/vue-tags-input/index.js +308 -188
  157. package/dist/components/vue-tags-input/style.css +682 -1
  158. package/dist/components/watermark/index.js +37 -25
  159. package/dist/components/watermark/style.css +11 -1
  160. package/dist/components/x-dialog/index.js +93 -67
  161. package/dist/components/x-dialog/style.css +15 -1
  162. package/dist/index.css +1105 -193
  163. package/dist/index.es.js +7242 -4789
  164. package/package.json +2 -1
  165. package/web-types.json +1 -1
  166. package/dist/chunks/3a79781b.js +0 -75
  167. package/dist/chunks/5d4282fb.js +0 -30
  168. package/dist/chunks/76680a03.js +0 -24
  169. package/dist/chunks/8c0142e0.js +0 -81
  170. package/dist/chunks/97652d86.js +0 -26
  171. package/dist/chunks/b4acd3a6.js +0 -126
  172. package/dist/chunks/f71045fc.js +0 -184
@@ -1,110 +1,129 @@
1
- import s from "element-ui/packages/color-picker/src/color";
2
- import l from "element-ui/src/utils/clickoutside";
3
- import { n } from "../../chunks/5d4282fb.js";
4
- var c = function() {
5
- var e = this, i = e.$createElement, t = e._self._c || i;
6
- return t("ElColorPickerDropdown", {
1
+ import Color from "element-ui/packages/color-picker/src/color";
2
+ import Clickoutside from "element-ui/src/utils/clickoutside";
3
+ import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
4
+ var render = function() {
5
+ var _vm = this;
6
+ var _h = _vm.$createElement;
7
+ var _c = _vm._self._c || _h;
8
+ return _c("ElColorPickerDropdown", {
7
9
  directives: [{
8
10
  name: "clickoutside",
9
11
  rawName: "v-clickoutside",
10
- value: e.onClickOutside,
12
+ value: _vm.onClickOutside,
11
13
  expression: "onClickOutside"
12
14
  }],
13
15
  ref: "dropdown",
14
- class: ["el-color-picker__panel", e.popperClass || ""],
16
+ class: ["el-color-picker__panel", _vm.popperClass || ""],
15
17
  attrs: {
16
- offset: e.offset,
17
- "append-to-body": e.appendToBody,
18
- color: e.color,
19
- predefine: e.predefine
18
+ "offset": _vm.offset,
19
+ "append-to-body": _vm.appendToBody,
20
+ "color": _vm.color,
21
+ "predefine": _vm.predefine
20
22
  },
21
23
  on: {
22
- pick: e.confirmValue,
23
- clear: e.clearValue
24
+ "pick": _vm.confirmValue,
25
+ "clear": _vm.clearValue
24
26
  },
25
27
  model: {
26
- value: e.showPicker,
27
- callback: function(r) {
28
- e.showPicker = r;
28
+ value: _vm.showPicker,
29
+ callback: function($$v) {
30
+ _vm.showPicker = $$v;
29
31
  },
30
32
  expression: "showPicker"
31
33
  }
32
34
  });
33
- }, a = [];
34
- const d = {
35
+ };
36
+ var staticRenderFns = [];
37
+ const __vue2_script = {
35
38
  name: "ColorPicker",
36
- directives: { Clickoutside: l },
39
+ directives: { Clickoutside },
37
40
  props: {
38
41
  popperClass: String,
39
42
  predefine: Array,
40
43
  visible: Boolean,
41
44
  hideOnClickOutside: {
42
45
  type: Boolean,
43
- default: !0
46
+ default: true
44
47
  },
45
48
  value: String,
46
49
  offset: Number,
47
50
  anchor: HTMLElement,
48
51
  appendToBody: {
49
52
  type: Boolean,
50
- default: !0
53
+ default: true
51
54
  }
52
55
  },
53
56
  data() {
57
+ const color = new Color({ enableAlpha: false });
54
58
  return {
55
- color: new s({ enableAlpha: !1 }),
56
- showPicker: !1
59
+ color,
60
+ showPicker: false
57
61
  };
58
62
  },
59
63
  watch: {
60
64
  value: {
61
- immediate: !0,
62
- handler(e) {
63
- e && e !== this.color.value && this.color.fromString(e);
65
+ immediate: true,
66
+ handler(val) {
67
+ if (val && val !== this.color.value) {
68
+ this.color.fromString(val);
69
+ }
64
70
  }
65
71
  },
66
72
  visible: {
67
- immediate: !0,
68
- async handler(e) {
69
- e ? (await this.$nextTick(), this.$refs.dropdown.referenceElm = this.anchor) : this.$refs.dropdown && this.$refs.dropdown.doDestroy(!0), this.showPicker = e;
73
+ immediate: true,
74
+ async handler(newVal) {
75
+ if (newVal) {
76
+ await this.$nextTick();
77
+ this.$refs.dropdown.referenceElm = this.anchor;
78
+ } else {
79
+ this.$refs.dropdown && this.$refs.dropdown.doDestroy(true);
80
+ }
81
+ this.showPicker = newVal;
70
82
  }
71
83
  }
72
84
  },
73
85
  methods: {
74
86
  confirmValue() {
75
- this.emitInput(this.color), this.$emit("pick", this.color.value), this.hide();
87
+ this.emitInput(this.color);
88
+ this.$emit("pick", this.color.value);
89
+ this.hide();
76
90
  },
77
91
  clearValue() {
78
- this.$emit("clear"), this.hide();
92
+ this.$emit("clear");
93
+ this.hide();
79
94
  },
80
- emitInput(e) {
81
- this.$emit("input", e.value);
95
+ emitInput(color) {
96
+ this.$emit("input", color.value);
82
97
  },
83
98
  onClickOutside() {
84
- this.hideOnClickOutside && this.hide();
99
+ if (this.hideOnClickOutside) {
100
+ this.hide();
101
+ }
85
102
  },
86
103
  hide() {
87
- this.$emit("update:visible", !1);
104
+ this.$emit("update:visible", false);
88
105
  }
89
106
  }
90
- }, o = {};
91
- var u = /* @__PURE__ */ n(
92
- d,
93
- c,
94
- a,
95
- !1,
96
- p,
107
+ };
108
+ const __cssModules = {};
109
+ var __component__ = /* @__PURE__ */ normalizeComponent(
110
+ __vue2_script,
111
+ render,
112
+ staticRenderFns,
113
+ false,
114
+ __vue2_injectStyles,
97
115
  null,
98
116
  null,
99
117
  null
100
118
  );
101
- function p(e) {
102
- for (let i in o)
103
- this[i] = o[i];
119
+ function __vue2_injectStyles(context) {
120
+ for (let o in __cssModules) {
121
+ this[o] = __cssModules[o];
122
+ }
104
123
  }
105
- const k = /* @__PURE__ */ function() {
106
- return u.exports;
124
+ const ColorPicker = /* @__PURE__ */ function() {
125
+ return __component__.exports;
107
126
  }();
108
127
  export {
109
- k as default
128
+ ColorPicker as default
110
129
  };
@@ -1,6 +1,6 @@
1
- import { c as e } from "../../chunks/3a79781b.js";
2
- import { n as o } from "../../chunks/5d4282fb.js";
3
- const i = {
1
+ import { c as confirmableMixin } from "../../chunks/a0bb327b.js";
2
+ import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
3
+ const props = {
4
4
  props: {
5
5
  type: {
6
6
  type: String,
@@ -29,29 +29,31 @@ const i = {
29
29
  default: "ElButton"
30
30
  }
31
31
  }
32
- }, l = {
32
+ };
33
+ const __vue2_script = {
33
34
  name: "ConfirmButton",
34
- mixins: [e, i]
35
+ mixins: [confirmableMixin, props]
35
36
  };
36
- let r, a;
37
- const n = {};
38
- var u = /* @__PURE__ */ o(
39
- l,
40
- r,
41
- a,
42
- !1,
43
- s,
37
+ let __vue2_render, __vue2_staticRenderFns;
38
+ const __cssModules = {};
39
+ var __component__ = /* @__PURE__ */ normalizeComponent(
40
+ __vue2_script,
41
+ __vue2_render,
42
+ __vue2_staticRenderFns,
43
+ false,
44
+ __vue2_injectStyles,
44
45
  null,
45
46
  null,
46
47
  null
47
48
  );
48
- function s(p) {
49
- for (let t in n)
50
- this[t] = n[t];
49
+ function __vue2_injectStyles(context) {
50
+ for (let o in __cssModules) {
51
+ this[o] = __cssModules[o];
52
+ }
51
53
  }
52
- const f = /* @__PURE__ */ function() {
53
- return u.exports;
54
+ const ConfirmButton = /* @__PURE__ */ function() {
55
+ return __component__.exports;
54
56
  }();
55
57
  export {
56
- f as default
58
+ ConfirmButton as default
57
59
  };
@@ -1,28 +1,29 @@
1
- import { c as o } from "../../chunks/3a79781b.js";
2
- import { n as t } from "../../chunks/5d4282fb.js";
3
- const r = {
1
+ import { c as confirmableMixin } from "../../chunks/a0bb327b.js";
2
+ import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
3
+ const __vue2_script = {
4
4
  name: "Confirmable",
5
- mixins: [o]
5
+ mixins: [confirmableMixin]
6
6
  };
7
- let _, i;
8
- const e = {};
9
- var s = /* @__PURE__ */ t(
10
- r,
11
- _,
12
- i,
13
- !1,
14
- l,
7
+ let __vue2_render, __vue2_staticRenderFns;
8
+ const __cssModules = {};
9
+ var __component__ = /* @__PURE__ */ normalizeComponent(
10
+ __vue2_script,
11
+ __vue2_render,
12
+ __vue2_staticRenderFns,
13
+ false,
14
+ __vue2_injectStyles,
15
15
  null,
16
16
  null,
17
17
  null
18
18
  );
19
- function l(c) {
20
- for (let n in e)
21
- this[n] = e[n];
19
+ function __vue2_injectStyles(context) {
20
+ for (let o in __cssModules) {
21
+ this[o] = __cssModules[o];
22
+ }
22
23
  }
23
- const u = /* @__PURE__ */ function() {
24
- return s.exports;
24
+ const Confirmable = /* @__PURE__ */ function() {
25
+ return __component__.exports;
25
26
  }();
26
27
  export {
27
- u as default
28
+ Confirmable as default
28
29
  };
@@ -1,133 +1,137 @@
1
- import { n as a } from "../../chunks/5d4282fb.js";
2
- var d = function() {
3
- var t = this, i = t.$createElement, e = t._self._c || i;
4
- return t.rendered ? e("div", {
1
+ import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
2
+ var render = function() {
3
+ var _vm = this;
4
+ var _h = _vm.$createElement;
5
+ var _c = _vm._self._c || _h;
6
+ return _vm.rendered ? _c("div", {
5
7
  directives: [{
6
8
  name: "show",
7
9
  rawName: "v-show",
8
- value: t.visible,
10
+ value: _vm.visible,
9
11
  expression: "visible"
10
12
  }],
11
13
  staticClass: "cm-container",
12
- style: t.axisComputed
13
- }, [e("svg", {
14
+ style: _vm.axisComputed
15
+ }, [_c("svg", {
14
16
  staticStyle: {
15
- position: "absolute",
16
- width: "0",
17
- height: "0",
18
- overflow: "hidden"
17
+ "position": "absolute",
18
+ "width": "0",
19
+ "height": "0",
20
+ "overflow": "hidden"
19
21
  },
20
22
  attrs: {
21
23
  "aria-hidden": "true"
22
24
  }
23
- }, [e("symbol", {
25
+ }, [_c("symbol", {
24
26
  attrs: {
25
- id: "icon-arrow",
26
- viewBox: "0 0 1024 1024"
27
+ "id": "icon-arrow",
28
+ "viewBox": "0 0 1024 1024"
27
29
  }
28
- }, [e("path", {
30
+ }, [_c("path", {
29
31
  attrs: {
30
- d: "M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"
32
+ "d": "M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"
31
33
  }
32
- })])]), e("ul", {
34
+ })])]), _c("ul", {
33
35
  staticClass: "cm-ul cm-ul-1 easy-cm-ul",
34
- class: t.underline ? "cm-underline" : ""
35
- }, t._l(t.list, function(s, l) {
36
- return e("li", {
37
- key: l,
38
- style: t.liStyle
39
- }, [e("div", {
40
- class: t.firstLeft ? "cm-left" : "",
36
+ class: _vm.underline ? "cm-underline" : ""
37
+ }, _vm._l(_vm.list, function(item, index) {
38
+ return _c("li", {
39
+ key: index,
40
+ style: _vm.liStyle
41
+ }, [_c("div", {
42
+ class: _vm.firstLeft ? "cm-left" : "",
41
43
  on: {
42
- click: function(n) {
43
- return t.onItemClick(s, [l]);
44
+ "click": function($event) {
45
+ return _vm.onItemClick(item, [index]);
44
46
  }
45
47
  }
46
- }, [e("i", {
48
+ }, [_c("i", {
47
49
  staticClass: "cm-item-icon",
48
- class: s.icon
49
- }), e("span", {
50
+ class: item.icon
51
+ }), _c("span", {
50
52
  staticClass: "cm-item-label"
51
- }, [t._v(t._s(s.text))]), t.arrow && s.children && s.children.length > 0 ? e("svg", {
53
+ }, [_vm._v(_vm._s(item.text))]), _vm.arrow && item.children && item.children.length > 0 ? _c("svg", {
52
54
  staticClass: "icon",
53
55
  attrs: {
54
56
  "aria-hidden": "true"
55
57
  }
56
- }, [e("use", {
58
+ }, [_c("use", {
57
59
  attrs: {
58
60
  "xlink:href": "#icon-arrow"
59
61
  }
60
- })]) : t._e()]), s.children && s.children.length > 0 ? e("ul", {
62
+ })]) : _vm._e()]), item.children && item.children.length > 0 ? _c("ul", {
61
63
  staticClass: "cm-ul cm-ul-2 easy-cm-ul",
62
- class: t.underline ? "cm-underline" : "",
63
- style: t.secondBorderCheck(l)
64
- }, t._l(s.children, function(n, r) {
65
- return e("li", {
66
- key: r,
67
- style: t.liStyle
68
- }, [e("div", {
69
- class: t.secondLeft ? "cm-left" : "",
64
+ class: _vm.underline ? "cm-underline" : "",
65
+ style: _vm.secondBorderCheck(index)
66
+ }, _vm._l(item.children, function(second, si) {
67
+ return _c("li", {
68
+ key: si,
69
+ style: _vm.liStyle
70
+ }, [_c("div", {
71
+ class: _vm.secondLeft ? "cm-left" : "",
70
72
  on: {
71
- click: function(h) {
72
- return t.onItemClick(n, [l, r]);
73
+ "click": function($event) {
74
+ return _vm.onItemClick(second, [index, si]);
73
75
  }
74
76
  }
75
- }, [e("i", {
77
+ }, [_c("i", {
76
78
  staticClass: "cm-item-icon",
77
- class: n.icon
78
- }), e("span", {
79
+ class: second.icon
80
+ }), _c("span", {
79
81
  staticClass: "cm-item-label"
80
- }, [t._v(t._s(n.text))]), t.arrow && n.children && n.children.length > 0 ? e("svg", {
82
+ }, [_vm._v(_vm._s(second.text))]), _vm.arrow && second.children && second.children.length > 0 ? _c("svg", {
81
83
  staticClass: "icon",
82
84
  attrs: {
83
85
  "aria-hidden": "true"
84
86
  }
85
- }, [e("use", {
87
+ }, [_c("use", {
86
88
  attrs: {
87
89
  "xlink:href": "#icon-arrow"
88
90
  }
89
- })]) : t._e()]), n.children && n.children.length > 0 ? e("ul", {
91
+ })]) : _vm._e()]), second.children && second.children.length > 0 ? _c("ul", {
90
92
  staticClass: "cm-ul cm-ul-3 easy-cm-ul",
91
- class: t.underline ? "cm-underline" : "",
92
- style: t.thirdBorderCheck(l, r)
93
- }, t._l(n.children, function(h, c) {
94
- return e("li", {
95
- key: c,
96
- style: t.liStyle
97
- }, [e("div", {
93
+ class: _vm.underline ? "cm-underline" : "",
94
+ style: _vm.thirdBorderCheck(index, si)
95
+ }, _vm._l(second.children, function(third, ti) {
96
+ return _c("li", {
97
+ key: ti,
98
+ style: _vm.liStyle
99
+ }, [_c("div", {
98
100
  on: {
99
- click: function(x) {
100
- return t.onItemClick(h, [l, r, c]);
101
+ "click": function($event) {
102
+ return _vm.onItemClick(third, [index, si, ti]);
101
103
  }
102
104
  }
103
- }, [e("i", {
105
+ }, [_c("i", {
104
106
  staticClass: "cm-item-icon",
105
- class: h.icon
106
- }), e("span", {
107
+ class: third.icon
108
+ }), _c("span", {
107
109
  staticClass: "cm-item-label"
108
- }, [t._v(t._s(h.text))])])]);
109
- }), 0) : t._e()]);
110
- }), 0) : t._e()]);
111
- }), 0)]) : t._e();
112
- }, u = [];
113
- const m = {
110
+ }, [_vm._v(_vm._s(third.text))])])]);
111
+ }), 0) : _vm._e()]);
112
+ }), 0) : _vm._e()]);
113
+ }), 0)]) : _vm._e();
114
+ };
115
+ var staticRenderFns = [];
116
+ const ContextMenu_vue_vue_type_style_index_0_lang = "";
117
+ const __vue2_script = {
114
118
  name: "ContextMenu",
115
119
  props: {
116
120
  list: {
117
121
  type: Array,
118
- required: !0
122
+ required: true
119
123
  },
120
124
  underline: {
121
125
  type: Boolean,
122
- default: !1
126
+ default: false
123
127
  },
124
128
  arrow: {
125
129
  type: Boolean,
126
- default: !0
130
+ default: true
127
131
  },
128
132
  border: {
129
133
  type: Boolean,
130
- default: !0
134
+ default: true
131
135
  },
132
136
  itemWidth: {
133
137
  type: Number,
@@ -143,10 +147,12 @@ const m = {
143
147
  },
144
148
  offset: {
145
149
  type: Object,
146
- default: () => ({
147
- x: 6,
148
- y: 2
149
- })
150
+ default: () => {
151
+ return {
152
+ x: 6,
153
+ y: 2
154
+ };
155
+ }
150
156
  },
151
157
  borderWidth: {
152
158
  type: Number,
@@ -155,8 +161,8 @@ const m = {
155
161
  },
156
162
  data() {
157
163
  return {
158
- visible: !1,
159
- rendered: !1,
164
+ visible: false,
165
+ rendered: false,
160
166
  axis: {
161
167
  x: 0,
162
168
  y: 0
@@ -179,65 +185,81 @@ const m = {
179
185
  };
180
186
  },
181
187
  firstLeft() {
182
- const t = document.body.offsetWidth;
183
- return this.axis.x + this.itemWidth * 2 >= t;
188
+ const bw = document.body.offsetWidth;
189
+ return this.axis.x + this.itemWidth * 2 >= bw;
184
190
  },
185
191
  secondLeft() {
186
- const t = document.body.offsetWidth;
187
- return this.axis.x + this.itemWidth * 3 >= t;
192
+ const bw = document.body.offsetWidth;
193
+ return this.axis.x + this.itemWidth * 3 >= bw;
188
194
  }
189
195
  },
190
196
  watch: {
191
197
  axis() {
192
198
  if (this.border) {
193
- const t = document.body.offsetWidth, i = document.body.offsetHeight;
194
- this.axis.x + this.offset.x + this.itemWidth >= t && (this.axis.x = t - this.itemWidth - this.borderWidth - this.offset.x), this.axis.y + this.offset.y + this.itemHeight * this.list.length >= i && (this.axis.y = i - this.itemHeight * this.list.length - this.borderWidth - this.offset.y);
199
+ const bw = document.body.offsetWidth;
200
+ const bh = document.body.offsetHeight;
201
+ if (this.axis.x + this.offset.x + this.itemWidth >= bw) {
202
+ this.axis.x = bw - this.itemWidth - this.borderWidth - this.offset.x;
203
+ }
204
+ if (this.axis.y + this.offset.y + this.itemHeight * this.list.length >= bh) {
205
+ this.axis.y = bh - this.itemHeight * this.list.length - this.borderWidth - this.offset.y;
206
+ }
195
207
  }
196
208
  }
197
209
  },
198
210
  methods: {
199
- secondBorderCheck(t) {
200
- const i = document.body.offsetWidth, e = document.body.offsetHeight, s = this.axis.y + (t + this.list[t].children.length) * this.itemHeight;
211
+ secondBorderCheck(i) {
212
+ const bw = document.body.offsetWidth;
213
+ const bh = document.body.offsetHeight;
214
+ const cy = this.axis.y + (i + this.list[i].children.length) * this.itemHeight;
201
215
  return {
202
- left: this.axis.x + this.itemWidth * 2 >= i ? "-100%" : "100%",
203
- top: e >= s ? 0 : `${-(this.list[t].children.length - 1) * this.itemHeight}px`
216
+ left: this.axis.x + this.itemWidth * 2 >= bw ? "-100%" : "100%",
217
+ top: bh >= cy ? 0 : `${-(this.list[i].children.length - 1) * this.itemHeight}px`
204
218
  };
205
219
  },
206
- thirdBorderCheck(t, i) {
207
- const e = document.body.offsetWidth, s = document.body.offsetHeight, l = this.axis.y + this.list[t].children[i].children.length * this.itemHeight + (t + i) * this.itemHeight + parseInt(this.secondBorderCheck(t).top);
220
+ thirdBorderCheck(i, si) {
221
+ const bw = document.body.offsetWidth;
222
+ const bh = document.body.offsetHeight;
223
+ const cy = this.axis.y + this.list[i].children[si].children.length * this.itemHeight + (i + si) * this.itemHeight + parseInt(this.secondBorderCheck(i).top);
208
224
  return {
209
- left: this.axis.x + this.itemWidth * 3 >= e ? "-100%" : "100%",
210
- top: l > s ? `${-(this.list[t].children[i].children.length - 1) * this.itemHeight}px` : 0
225
+ left: this.axis.x + this.itemWidth * 3 >= bw ? "-100%" : "100%",
226
+ top: cy > bh ? `${-(this.list[i].children[si].children.length - 1) * this.itemHeight}px` : 0
211
227
  };
212
228
  },
213
- show(t) {
214
- document.addEventListener("click", this.hide, !0), this.axis = { x: t.clientX, y: t.clientY }, this.rendered = !0, this.visible = !0;
229
+ show(event) {
230
+ document.addEventListener("click", this.hide, true);
231
+ this.axis = { x: event.clientX, y: event.clientY };
232
+ this.rendered = true;
233
+ this.visible = true;
215
234
  },
216
235
  hide() {
217
- this.visible = !1, document.removeEventListener("click", this.hide);
236
+ this.visible = false;
237
+ document.removeEventListener("click", this.hide);
218
238
  },
219
- onItemClick(t, i) {
220
- this.$emit("on-item-click", t, i);
239
+ onItemClick(item, indexList) {
240
+ this.$emit("on-item-click", item, indexList);
221
241
  }
222
242
  }
223
- }, o = {};
224
- var f = /* @__PURE__ */ a(
225
- m,
226
- d,
227
- u,
228
- !1,
229
- y,
243
+ };
244
+ const __cssModules = {};
245
+ var __component__ = /* @__PURE__ */ normalizeComponent(
246
+ __vue2_script,
247
+ render,
248
+ staticRenderFns,
249
+ false,
250
+ __vue2_injectStyles,
230
251
  null,
231
252
  null,
232
253
  null
233
254
  );
234
- function y(t) {
235
- for (let i in o)
236
- this[i] = o[i];
255
+ function __vue2_injectStyles(context) {
256
+ for (let o in __cssModules) {
257
+ this[o] = __cssModules[o];
258
+ }
237
259
  }
238
- const _ = /* @__PURE__ */ function() {
239
- return f.exports;
260
+ const ContextMenu = /* @__PURE__ */ function() {
261
+ return __component__.exports;
240
262
  }();
241
263
  export {
242
- _ as default
264
+ ContextMenu as default
243
265
  };