@web-utils/component 1.2.4 → 1.2.6

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 (111) hide show
  1. package/README.md +27 -27
  2. package/dist/chunks/163eed3b.js +16 -1
  3. package/dist/chunks/2bd4e340.js +184 -0
  4. package/dist/chunks/6499de3a.js +30 -1
  5. package/dist/chunks/7af3ceb1.js +75 -0
  6. package/dist/chunks/86bcadec.js +24 -0
  7. package/dist/chunks/8bbde9bf.js +81 -1
  8. package/dist/chunks/90bd3d52.js +26 -1
  9. package/dist/chunks/92404ceb.js +126 -0
  10. package/dist/chunks/a73fe8ee.js +11 -0
  11. package/dist/chunks/df803484.js +60 -0
  12. package/dist/components/address-input/index.js +113 -1
  13. package/dist/components/aside-menu/index.js +58 -1
  14. package/dist/components/awesome-button/index.js +82 -1
  15. package/dist/components/capsule-tab/index.js +52 -1
  16. package/dist/components/chunk-file-uploader/index.js +119 -1
  17. package/dist/components/chunk-file-uploader-button/index.js +60 -1
  18. package/dist/components/chunk-file-uploader-drop/index.js +65 -1
  19. package/dist/components/chunk-file-uploader-file/index.js +311 -1
  20. package/dist/components/chunk-file-uploader-files/index.js +49 -1
  21. package/dist/components/chunk-file-uploader-list/index.js +50 -1
  22. package/dist/components/chunk-file-uploader-un-support/index.js +51 -1
  23. package/dist/components/code-mirror-editor/index.js +310 -6
  24. package/dist/components/color-picker/index.js +110 -1
  25. package/dist/components/confirm-button/index.js +57 -1
  26. package/dist/components/confirmable/index.js +28 -1
  27. package/dist/components/context-menu/index.js +236 -1
  28. package/dist/components/custom-scrollbar/index.js +150 -1
  29. package/dist/components/data-table-picker/index.js +137 -1
  30. package/dist/components/dynamic-table/index.js +195 -1
  31. package/dist/components/e-charts/index.js +229 -1
  32. package/dist/components/editable-progress/index.js +141 -1
  33. package/dist/components/editable-tree/index.js +789 -1
  34. package/dist/components/egd-collapse/index.js +79 -1
  35. package/dist/components/egd-collapse-item/index.js +132 -1
  36. package/dist/components/el-color-picker-dropdown/index.js +170 -1
  37. package/dist/components/element-dialog/index.js +242 -1
  38. package/dist/components/empty-view/index.js +69 -1
  39. package/dist/components/error-view/index.js +61 -1
  40. package/dist/components/flex-column/index.js +50 -1
  41. package/dist/components/flex-item/index.js +66 -1
  42. package/dist/components/flex-row/index.js +50 -1
  43. package/dist/components/flex-scroller/index.js +47 -1
  44. package/dist/components/form-button/index.js +80 -1
  45. package/dist/components/form-cascader/index.js +151 -1
  46. package/dist/components/form-checkbox-group/index.js +192 -1
  47. package/dist/components/form-date-picker/index.js +182 -1
  48. package/dist/components/form-holder/index.js +90 -1
  49. package/dist/components/form-input/index.js +106 -1
  50. package/dist/components/form-input-email/index.js +97 -1
  51. package/dist/components/form-input-id-card/index.js +104 -1
  52. package/dist/components/form-input-number/index.js +123 -1
  53. package/dist/components/form-input-phone-number/index.js +98 -1
  54. package/dist/components/form-input-time/index.js +124 -1
  55. package/dist/components/form-item/index.js +120 -1
  56. package/dist/components/form-item-config-provider/index.js +63 -1
  57. package/dist/components/form-item-group/index.js +169 -1
  58. package/dist/components/form-radio-group/index.js +170 -1
  59. package/dist/components/form-select/index.js +154 -1
  60. package/dist/components/form-switch/index.js +97 -1
  61. package/dist/components/form-textarea/index.js +102 -1
  62. package/dist/components/form-view/index.js +343 -1
  63. package/dist/components/guide-steps/index.js +94 -1
  64. package/dist/components/icon-card/index.js +62 -1
  65. package/dist/components/iframe-window/index.js +99 -1
  66. package/dist/components/input-number/index.js +274 -1
  67. package/dist/components/input-number-range/index.js +110 -1
  68. package/dist/components/j-s-x-component/index.js +16 -1
  69. package/dist/components/keep-view-alive/index.js +119 -1
  70. package/dist/components/loading-view/index.js +61 -1
  71. package/dist/components/nav-bar/index.js +52 -1
  72. package/dist/components/not-implement/index.js +35 -1
  73. package/dist/components/page/index.js +40 -1
  74. package/dist/components/page-header/index.js +56 -1
  75. package/dist/components/page-index/index.js +151 -1
  76. package/dist/components/page-index-top/index.js +119 -1
  77. package/dist/components/page-skeleton/index.js +56 -1
  78. package/dist/components/page-skeleton-new/index.js +98 -1
  79. package/dist/components/pageable-table/index.js +429 -1
  80. package/dist/components/pageable-view/index.js +328 -2
  81. package/dist/components/photo-swipe/index.js +187 -1
  82. package/dist/components/resize-observer/index.js +62 -1
  83. package/dist/components/search-popover/index.js +391 -2
  84. package/dist/components/sign-panel/index.js +242 -1
  85. package/dist/components/split-pane/index.js +209 -1
  86. package/dist/components/stateful/index.js +84 -1
  87. package/dist/components/static-pageable-table/index.js +92 -1
  88. package/dist/components/swiper/index.js +158 -1
  89. package/dist/components/tab/index.js +145 -1
  90. package/dist/components/tab-item/index.js +73 -1
  91. package/dist/components/table-column/index.js +89 -1
  92. package/dist/components/table-view/index.js +363 -1
  93. package/dist/components/tag-render/index.js +97 -1
  94. package/dist/components/tinymce-editor/index.js +173 -1
  95. package/dist/components/tinymce-wrapper/index.js +618 -1
  96. package/dist/components/toolbar/index.js +217 -1
  97. package/dist/components/toolbar-button/index.js +90 -1
  98. package/dist/components/trigger/index.js +71 -1
  99. package/dist/components/vue-tags-input/index.js +439 -1
  100. package/dist/components/watermark/index.js +63 -1
  101. package/dist/components/x-dialog/index.js +173 -1
  102. package/dist/index.css +2102 -1
  103. package/dist/index.es.js +2995 -2078
  104. package/package.json +29 -29
  105. package/web-types.json +22 -16
  106. package/dist/chunks/23bd3525.js +0 -1
  107. package/dist/chunks/65f4f4f2.js +0 -1
  108. package/dist/chunks/8473fc69.js +0 -1
  109. package/dist/chunks/addb6ed5.js +0 -1
  110. package/dist/chunks/b8305633.js +0 -1
  111. package/dist/chunks/e8547f66.js +0 -1
@@ -1 +1,195 @@
1
- import{fastClone as d,validateNumber as u,validateIdCard as c,validatePhoneNum as m}from"@web-utils/core";import{n as f}from"../../chunks/6499de3a.js";var y=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("div",{staticClass:"dynamic-table"},[t("ElTable",{key:e.key,staticStyle:{width:"100%"},attrs:{data:e.value}},[e._l(e.columns,function(a){return t("ElTableColumn",{key:a.prop,attrs:{prop:a.prop,label:a.label,"min-width":"150"},scopedSlots:e._u([{key:"default",fn:function(n){var l=n.row,r=n.$index;return[t("ElFormItem",{style:{marginBottom:e.inputDisabled?"0px":"16px"},attrs:{prop:`${e.prop}.${r}.${a.prop}`,size:"mini",rules:e.getRules(a)}},[t("ElInput",{attrs:{"prefix-icon":e.getIcon(a),disabled:e.inputDisabled,placeholder:e.inputDisabled?"":`\u8BF7\u8F93\u5165${a.label}\uFF01`},model:{value:l[a.prop],callback:function(o){e.$set(l,a.prop,o)},expression:"row[column.prop]"}})],1)]}}],null,!0)})}),e.inputDisabled?e._e():t("ElTableColumn",{attrs:{label:"\u64CD\u4F5C",width:"60",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(a){var n=a.row,l=a.column,r=a.$index;return[t("i",{staticClass:"el-icon-minus dynamic-table-action-icon",staticStyle:{position:"relative",top:"-8px",color:"#f00"},attrs:{title:"\u5220\u9664"},on:{click:function(o){return o.stopPropagation(),e.removeRow(n,r,l)}}})]}}],null,!1,410881950)})],2),e.inputDisabled?e._e():t("ElButton",{staticStyle:{color:"#08c108"},attrs:{type:"text",icon:"el-icon-plus"},on:{click:e.addRow}},[e._v(" \u6DFB\u52A0 ")])],1)},b=[];const s={number:"fa fa-superscript",email:"el-icon-lx-mail",phone:"fa fa-phone",idCard:"el-icon-lx-news"},h={name:"DynamicTable",inject:{elForm:{default:""},elFormItem:{default:""}},props:{prop:{type:String,default:"rows"},value:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},disabled:Boolean},data(){return{key:1}},computed:{inputDisabled(){return this.disabled||(this.elForm||{}).disabled}},watch:{value:{deep:!0,handler(e){this.$emit("input",e)}},columns:{deep:!0,handler(){this.key++}}},methods:{getIcon(e){return s[e.type]?s[e.type]:""},addRow(){const e=this.value;e.push(this.newRow()),this.$emit("input",e)},removeRow(e,i){const t=this.value;t.splice(i,1),this.$emit("input",t)},newRow(){const e={};return this.columns.forEach(i=>{e[i.prop]=void 0}),e},getRules(e){const i=e.rules;if(["email","idCard","phone","number"].includes(e.type)){const t=d(i||[]);return e.type==="number"&&t.push({validator:u,message:"\u8BF7\u8F93\u5165\u6570\u5B57\uFF01"}),e.type==="email"&&t.push({type:"email",message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1\u5730\u5740\uFF01"}),e.type==="idCard"&&t.push({validator:c,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7\u7801\uFF01"}),e.type==="phone"&&t.push({validator:m,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801\uFF01"}),t}else return i}}},p={};var v=f(h,y,b,!1,_,null,null,null);function _(e){for(let i in p)this[i]=p[i]}var w=function(){return v.exports}();export{w as default};
1
+ import { fastClone as u, validateNumber as d, validateIdCard as c, validatePhoneNum as m } from "@web-utils/core";
2
+ import { n as f } from "../../chunks/6499de3a.js";
3
+ var h = function() {
4
+ var e = this, i = e.$createElement, t = e._self._c || i;
5
+ return t("div", {
6
+ staticClass: "dynamic-table"
7
+ }, [t("ElTable", {
8
+ key: e.key,
9
+ staticStyle: {
10
+ width: "100%"
11
+ },
12
+ attrs: {
13
+ data: e.value
14
+ }
15
+ }, [e._l(e.columns, function(a) {
16
+ return t("ElTableColumn", {
17
+ key: a.prop,
18
+ attrs: {
19
+ prop: a.prop,
20
+ label: a.label,
21
+ "min-width": "150"
22
+ },
23
+ scopedSlots: e._u([{
24
+ key: "default",
25
+ fn: function(l) {
26
+ var n = l.row, r = l.$index;
27
+ return [t("ElFormItem", {
28
+ style: {
29
+ marginBottom: e.inputDisabled ? "0px" : "16px"
30
+ },
31
+ attrs: {
32
+ prop: `${e.prop}.${r}.${a.prop}`,
33
+ size: "mini",
34
+ rules: e.getRules(a)
35
+ }
36
+ }, [t("ElInput", {
37
+ attrs: {
38
+ "prefix-icon": e.getIcon(a),
39
+ disabled: e.inputDisabled,
40
+ placeholder: e.inputDisabled ? "" : `\u8BF7\u8F93\u5165${a.label}\uFF01`
41
+ },
42
+ model: {
43
+ value: n[a.prop],
44
+ callback: function(s) {
45
+ e.$set(n, a.prop, s);
46
+ },
47
+ expression: "row[column.prop]"
48
+ }
49
+ })], 1)];
50
+ }
51
+ }], null, !0)
52
+ });
53
+ }), e.inputDisabled ? e._e() : t("ElTableColumn", {
54
+ attrs: {
55
+ label: "\u64CD\u4F5C",
56
+ width: "60",
57
+ fixed: "right"
58
+ },
59
+ scopedSlots: e._u([{
60
+ key: "default",
61
+ fn: function(a) {
62
+ var l = a.row, n = a.column, r = a.$index;
63
+ return [t("i", {
64
+ staticClass: "el-icon-minus dynamic-table-action-icon",
65
+ staticStyle: {
66
+ position: "relative",
67
+ top: "-8px",
68
+ color: "#f00"
69
+ },
70
+ attrs: {
71
+ title: "\u5220\u9664"
72
+ },
73
+ on: {
74
+ click: function(s) {
75
+ return s.stopPropagation(), e.removeRow(l, r, n);
76
+ }
77
+ }
78
+ })];
79
+ }
80
+ }], null, !1, 410881950)
81
+ })], 2), e.inputDisabled ? e._e() : t("ElButton", {
82
+ staticStyle: {
83
+ color: "#08c108"
84
+ },
85
+ attrs: {
86
+ type: "text",
87
+ icon: "el-icon-plus"
88
+ },
89
+ on: {
90
+ click: e.addRow
91
+ }
92
+ }, [e._v(" \u6DFB\u52A0 ")])], 1);
93
+ }, y = [];
94
+ const o = {
95
+ number: "fa fa-superscript",
96
+ email: "el-icon-lx-mail",
97
+ phone: "fa fa-phone",
98
+ idCard: "el-icon-lx-news"
99
+ }, v = {
100
+ name: "DynamicTable",
101
+ inject: {
102
+ elForm: {
103
+ default: ""
104
+ },
105
+ elFormItem: {
106
+ default: ""
107
+ }
108
+ },
109
+ props: {
110
+ prop: {
111
+ type: String,
112
+ default: "rows"
113
+ },
114
+ value: {
115
+ type: Array,
116
+ default: () => []
117
+ },
118
+ columns: {
119
+ type: Array,
120
+ default: () => []
121
+ },
122
+ disabled: Boolean
123
+ },
124
+ data() {
125
+ return {
126
+ key: 1
127
+ };
128
+ },
129
+ computed: {
130
+ inputDisabled() {
131
+ return this.disabled || (this.elForm || {}).disabled;
132
+ }
133
+ },
134
+ watch: {
135
+ value: {
136
+ deep: !0,
137
+ handler(e) {
138
+ this.$emit("input", e);
139
+ }
140
+ },
141
+ columns: {
142
+ deep: !0,
143
+ handler() {
144
+ this.key++;
145
+ }
146
+ }
147
+ },
148
+ methods: {
149
+ getIcon(e) {
150
+ return o[e.type] ? o[e.type] : "";
151
+ },
152
+ addRow() {
153
+ const e = this.value;
154
+ e.push(this.newRow()), this.$emit("input", e);
155
+ },
156
+ removeRow(e, i) {
157
+ const t = this.value;
158
+ t.splice(i, 1), this.$emit("input", t);
159
+ },
160
+ newRow() {
161
+ const e = {};
162
+ return this.columns.forEach((i) => {
163
+ e[i.prop] = void 0;
164
+ }), e;
165
+ },
166
+ getRules(e) {
167
+ const i = e.rules;
168
+ if (["email", "idCard", "phone", "number"].includes(e.type)) {
169
+ const t = u(i || []);
170
+ return e.type === "number" && t.push({ validator: d, message: "\u8BF7\u8F93\u5165\u6570\u5B57\uFF01" }), e.type === "email" && t.push({ type: "email", message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1\u5730\u5740\uFF01" }), e.type === "idCard" && t.push({ validator: c, message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7\u7801\uFF01" }), e.type === "phone" && t.push({ validator: m, message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801\uFF01" }), t;
171
+ } else
172
+ return i;
173
+ }
174
+ }
175
+ }, p = {};
176
+ var b = /* @__PURE__ */ f(
177
+ v,
178
+ h,
179
+ y,
180
+ !1,
181
+ _,
182
+ null,
183
+ null,
184
+ null
185
+ );
186
+ function _(e) {
187
+ for (let i in p)
188
+ this[i] = p[i];
189
+ }
190
+ const g = /* @__PURE__ */ function() {
191
+ return b.exports;
192
+ }();
193
+ export {
194
+ g as default
195
+ };
@@ -1 +1,229 @@
1
- import*as s from"echarts/core";import{BarChart as a,LineChart as n,PieChart as o,RadarChart as d,MapChart as c,ScatterChart as l,EffectScatterChart as p,PictorialBarChart as g}from"echarts/charts";import{TitleComponent as u,TooltipComponent as f,GridComponent as m,LegendComponent as _,DatasetComponent as O,PolarComponent as C}from"echarts/components";import{CanvasRenderer as w}from"echarts/renderers";import{debounce as M,isString as R}from"@web-utils/core";import{addListener as v,removeListener as y}from"resize-detector";import{n as z}from"../../chunks/6499de3a.js";var S=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"echarts",style:{width:t.width,height:t.height}})},L=[];s.use([u,f,m,_,O,C,w,a,n,o,d,c,l,p,g]);const x=["theme","initOptions","autoResize"],E=["manualUpdate","watchShallow"],$={name:"ECharts",props:{options:{type:Object},theme:{type:[String,Object]},initOptions:{type:Object},group:{type:String},width:{type:String,default:"100%"},height:{type:String,default:"100%"},autoResize:Boolean,watchShallow:Boolean,manualUpdate:Boolean},data(){return{lastArea:0}},watch:{group(t){this.chart.group=t}},created(){this.initOptionsWatcher(),x.forEach(t=>{this.$watch(t,()=>{this.refresh()},{deep:!0})}),E.forEach(t=>{this.$watch(t,()=>{this.initOptionsWatcher(),this.refresh()})})},mounted(){this.options&&this.init()},activated(){this.autoResize&&this.chart&&this.chart.resize()},destroyed(){this.chart&&this.destroy()},methods:{mergeOptions(t,e,i){this.manualUpdate&&(this.manualOptions=t),this.chart?this.delegateMethod("setOption",t,e,i):this.init(t)},appendData(t){this.delegateMethod("appendData",t)},resize(t){this.delegateMethod("resize",t)},dispatchAction(t){this.delegateMethod("dispatchAction",t)},convertToPixel(t,e){return this.delegateMethod("convertToPixel",t,e)},convertFromPixel(t,e){return this.delegateMethod("convertFromPixel",t,e)},containPixel(t,e){return this.delegateMethod("containPixel",t,e)},showLoading(t,e){this.delegateMethod("showLoading",t,e)},hideLoading(){this.delegateMethod("hideLoading")},getDataURL(t){return this.delegateMethod("getDataURL",t)},getConnectedDataURL(t){return this.delegateMethod("getConnectedDataURL",t)},clear(){this.delegateMethod("clear")},dispose(){this.delegateMethod("dispose")},delegateMethod(t,...e){return this.chart||this.init(),this.chart[t](...e)},delegateGet(t){return this.chart||this.init(),this.chart[t]()},getArea(){return this.$el.offsetWidth*this.$el.offsetHeight},init(t){if(this.chart)return;const e=s.init(this.$el,this.theme,this.initOptions);this.group&&(e.group=this.group),e.setOption(t||this.manualOptions||this.options||{},!0),Object.keys(this.$listeners).forEach(i=>{const r=this.$listeners[i];i.indexOf("zr:")===0?e.getZr().on(i.slice(3),r):e.on(i,r)}),this.autoResize&&(this.lastArea=this.getArea(),this.__resizeHandler=M(()=>{this.lastArea===0?(this.mergeOptions({},!0),this.resize(),this.mergeOptions(this.options||this.manualOptions||{},!0)):this.resize(),this.lastArea=this.getArea()},100,{leading:!0}),v(this.$el,this.__resizeHandler)),Object.defineProperties(this,{width:{configurable:!0,get:()=>this.delegateGet("getWidth")},height:{configurable:!0,get:()=>this.delegateGet("getHeight")},isDisposed:{configurable:!0,get:()=>!!this.delegateGet("isDisposed")},computedOptions:{configurable:!0,get:()=>this.delegateGet("getOption")}}),this.chart=e},initOptionsWatcher(){this.__unwatchOptions&&(this.__unwatchOptions(),this.__unwatchOptions=null),this.manualUpdate||(this.__unwatchOptions=this.$watch("options",(t,e)=>{!this.chart&&t?this.init():this.chart.setOption(t,t!==e)},{deep:!this.watchShallow}))},destroy(){this.autoResize&&y(this.$el,this.__resizeHandler),this.dispose(),this.chart=null},refresh(){this.chart&&(this.destroy(),this.init())}},connect(t){R(t)||(t=t.map(e=>e.chart)),s.connect(t)},disconnect(t){s.disConnect(t)},getMap(t){return s.getMap(t)},registerMap(t,e,i){s.registerMap(t,e,i)},registerTheme(t,e){s.registerTheme(t,e)},graphic:s.graphic},h={};var b=z($,S,L,!1,A,null,null,null);function A(t){for(let e in h)this[e]=h[e]}var G=function(){return b.exports}();export{G as default};
1
+ import * as s from "echarts/core";
2
+ import { BarChart as a, LineChart as n, PieChart as o, RadarChart as c, MapChart as d, ScatterChart as l, EffectScatterChart as p, PictorialBarChart as g } from "echarts/charts";
3
+ import { TitleComponent as u, TooltipComponent as f, GridComponent as m, LegendComponent as _, DatasetComponent as O, PolarComponent as C } from "echarts/components";
4
+ import { CanvasRenderer as w } from "echarts/renderers";
5
+ import { debounce as M, isString as R } from "@web-utils/core";
6
+ import { addListener as y, removeListener as z } from "resize-detector";
7
+ import { n as v } from "../../chunks/6499de3a.js";
8
+ var S = function() {
9
+ var t = this, e = t.$createElement, i = t._self._c || e;
10
+ return i("div", {
11
+ staticClass: "echarts",
12
+ style: {
13
+ width: t.width,
14
+ height: t.height
15
+ }
16
+ });
17
+ }, L = [];
18
+ s.use([
19
+ u,
20
+ f,
21
+ m,
22
+ _,
23
+ O,
24
+ C,
25
+ w,
26
+ a,
27
+ n,
28
+ o,
29
+ c,
30
+ d,
31
+ l,
32
+ p,
33
+ g
34
+ ]);
35
+ const x = ["theme", "initOptions", "autoResize"], E = ["manualUpdate", "watchShallow"], $ = {
36
+ name: "ECharts",
37
+ props: {
38
+ options: {
39
+ type: Object
40
+ },
41
+ theme: {
42
+ type: [String, Object]
43
+ },
44
+ initOptions: {
45
+ type: Object
46
+ },
47
+ group: {
48
+ type: String
49
+ },
50
+ width: {
51
+ type: String,
52
+ default: "100%"
53
+ },
54
+ height: {
55
+ type: String,
56
+ default: "100%"
57
+ },
58
+ autoResize: Boolean,
59
+ watchShallow: Boolean,
60
+ manualUpdate: Boolean
61
+ },
62
+ data() {
63
+ return {
64
+ lastArea: 0
65
+ };
66
+ },
67
+ watch: {
68
+ group(t) {
69
+ this.chart.group = t;
70
+ }
71
+ },
72
+ created() {
73
+ this.initOptionsWatcher(), x.forEach((t) => {
74
+ this.$watch(
75
+ t,
76
+ () => {
77
+ this.refresh();
78
+ },
79
+ { deep: !0 }
80
+ );
81
+ }), E.forEach((t) => {
82
+ this.$watch(t, () => {
83
+ this.initOptionsWatcher(), this.refresh();
84
+ });
85
+ });
86
+ },
87
+ mounted() {
88
+ this.options && this.init();
89
+ },
90
+ activated() {
91
+ this.autoResize && this.chart && this.chart.resize();
92
+ },
93
+ destroyed() {
94
+ this.chart && this.destroy();
95
+ },
96
+ methods: {
97
+ mergeOptions(t, e, i) {
98
+ this.manualUpdate && (this.manualOptions = t), this.chart ? this.delegateMethod("setOption", t, e, i) : this.init(t);
99
+ },
100
+ appendData(t) {
101
+ this.delegateMethod("appendData", t);
102
+ },
103
+ resize(t) {
104
+ this.delegateMethod("resize", t);
105
+ },
106
+ dispatchAction(t) {
107
+ this.delegateMethod("dispatchAction", t);
108
+ },
109
+ convertToPixel(t, e) {
110
+ return this.delegateMethod("convertToPixel", t, e);
111
+ },
112
+ convertFromPixel(t, e) {
113
+ return this.delegateMethod("convertFromPixel", t, e);
114
+ },
115
+ containPixel(t, e) {
116
+ return this.delegateMethod("containPixel", t, e);
117
+ },
118
+ showLoading(t, e) {
119
+ this.delegateMethod("showLoading", t, e);
120
+ },
121
+ hideLoading() {
122
+ this.delegateMethod("hideLoading");
123
+ },
124
+ getDataURL(t) {
125
+ return this.delegateMethod("getDataURL", t);
126
+ },
127
+ getConnectedDataURL(t) {
128
+ return this.delegateMethod("getConnectedDataURL", t);
129
+ },
130
+ clear() {
131
+ this.delegateMethod("clear");
132
+ },
133
+ dispose() {
134
+ this.delegateMethod("dispose");
135
+ },
136
+ delegateMethod(t, ...e) {
137
+ return this.chart || this.init(), this.chart[t](...e);
138
+ },
139
+ delegateGet(t) {
140
+ return this.chart || this.init(), this.chart[t]();
141
+ },
142
+ getArea() {
143
+ return this.$el.offsetWidth * this.$el.offsetHeight;
144
+ },
145
+ init(t) {
146
+ if (this.chart)
147
+ return;
148
+ const e = s.init(this.$el, this.theme, this.initOptions);
149
+ this.group && (e.group = this.group), e.setOption(t || this.manualOptions || this.options || {}, !0), Object.keys(this.$listeners).forEach((i) => {
150
+ const r = this.$listeners[i];
151
+ i.indexOf("zr:") === 0 ? e.getZr().on(i.slice(3), r) : e.on(i, r);
152
+ }), this.autoResize && (this.lastArea = this.getArea(), this.__resizeHandler = M(
153
+ () => {
154
+ this.lastArea === 0 ? (this.mergeOptions({}, !0), this.resize(), this.mergeOptions(this.options || this.manualOptions || {}, !0)) : this.resize(), this.lastArea = this.getArea();
155
+ },
156
+ 100,
157
+ { leading: !0 }
158
+ ), y(this.$el, this.__resizeHandler)), Object.defineProperties(this, {
159
+ width: {
160
+ configurable: !0,
161
+ get: () => this.delegateGet("getWidth")
162
+ },
163
+ height: {
164
+ configurable: !0,
165
+ get: () => this.delegateGet("getHeight")
166
+ },
167
+ isDisposed: {
168
+ configurable: !0,
169
+ get: () => !!this.delegateGet("isDisposed")
170
+ },
171
+ computedOptions: {
172
+ configurable: !0,
173
+ get: () => this.delegateGet("getOption")
174
+ }
175
+ }), this.chart = e;
176
+ },
177
+ initOptionsWatcher() {
178
+ this.__unwatchOptions && (this.__unwatchOptions(), this.__unwatchOptions = null), this.manualUpdate || (this.__unwatchOptions = this.$watch(
179
+ "options",
180
+ (t, e) => {
181
+ !this.chart && t ? this.init() : this.chart.setOption(t, t !== e);
182
+ },
183
+ { deep: !this.watchShallow }
184
+ ));
185
+ },
186
+ destroy() {
187
+ this.autoResize && z(this.$el, this.__resizeHandler), this.dispose(), this.chart = null;
188
+ },
189
+ refresh() {
190
+ this.chart && (this.destroy(), this.init());
191
+ }
192
+ },
193
+ connect(t) {
194
+ R(t) || (t = t.map((e) => e.chart)), s.connect(t);
195
+ },
196
+ disconnect(t) {
197
+ s.disConnect(t);
198
+ },
199
+ getMap(t) {
200
+ return s.getMap(t);
201
+ },
202
+ registerMap(t, e, i) {
203
+ s.registerMap(t, e, i);
204
+ },
205
+ registerTheme(t, e) {
206
+ s.registerTheme(t, e);
207
+ },
208
+ graphic: s.graphic
209
+ }, h = {};
210
+ var b = /* @__PURE__ */ v(
211
+ $,
212
+ S,
213
+ L,
214
+ !1,
215
+ A,
216
+ null,
217
+ null,
218
+ null
219
+ );
220
+ function A(t) {
221
+ for (let e in h)
222
+ this[e] = h[e];
223
+ }
224
+ const H = /* @__PURE__ */ function() {
225
+ return b.exports;
226
+ }();
227
+ export {
228
+ H as default
229
+ };
@@ -1 +1,141 @@
1
- import{n as o}from"../../chunks/6499de3a.js";var l=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"editable-progress",on:{mouseover:e.onMouseOver,mousedown:e.onMouseDown,mouseleave:e.onMouseLeave,click:e.wrapperClick}},[s("ElProgress",{directives:[{name:"show",rawName:"v-show",value:!e.slider,expression:"!slider"}],class:e.percent===100?"progress__success":"",attrs:{"stroke-width":e.strokeWidth,"text-inside":"",percentage:e.percent}}),e.disabled?e._e():s("ElSlider",{directives:[{name:"show",rawName:"v-show",value:e.slider,expression:"slider"}],ref:"slider",style:{width:`${e.max===100?100:e.max-1}%`},attrs:{"tooltip-class":e.tooltipClass,max:e.max,"format-tooltip":e.formatTooltip,disabled:e.disabled,step:e.step},on:{input:e.onInput,change:e.onChange},model:{value:e.percent,callback:function(i){e.percent=i},expression:"percent"}})],1)},a=[];const n={name:"EditableProgress",props:{disabled:{type:Boolean,default:!1},strokeWidth:{type:Number,default:22},step:{type:Number,default:10},max:{type:Number,default:100},value:{type:Number,default:0}},data(){return{slider:!1,mouseDown:!1,tooltipClass:"hide-tooltip",percent:this.value}},watch:{value(e){this.percent!==e&&(this.percent=e)}},methods:{formatTooltip(e){return`${e}%`},onInput(e){this.value!==e&&this.$emit("input",e)},onChange(e){this.slider=!1,this.tooltipClass="hide-tooltip",this.$emit("change",e)},onMouseOver(){this.disabled||this.slider||(this.slider=!0,this.$nextTick(()=>{this.$refs.slider.$refs.button1.$refs.tooltip.updatePopper(),this.tooltipClass=""}))},onMouseDown(){this.disabled||(this.mouseDown=!0,window.addEventListener("mouseup",this.onMouseUp))},onMouseUp(){this.disabled||(this.mouseDown=!1,this.tooltipClass="hide-tooltip",window.removeEventListener("mouseup",this.onMouseUp))},onMouseLeave(){this.disabled||this.mouseDown||(this.tooltipClass="hide-tooltip",this.slider=!1)},wrapperClick(){this.disabled||(this.slider=!0)}}},r={};var d=o(n,l,a,!1,p,null,null,null);function p(e){for(let t in r)this[t]=r[t]}var u=function(){return d.exports}();export{u as default};
1
+ import { n as r } from "../../chunks/6499de3a.js";
2
+ var l = function() {
3
+ var e = this, t = e.$createElement, s = e._self._c || t;
4
+ return s("div", {
5
+ staticClass: "editable-progress",
6
+ on: {
7
+ mouseover: e.onMouseOver,
8
+ mousedown: e.onMouseDown,
9
+ mouseleave: e.onMouseLeave,
10
+ click: e.wrapperClick
11
+ }
12
+ }, [s("ElProgress", {
13
+ directives: [{
14
+ name: "show",
15
+ rawName: "v-show",
16
+ value: !e.slider,
17
+ expression: "!slider"
18
+ }],
19
+ class: e.percent === 100 ? "progress__success" : "",
20
+ attrs: {
21
+ "stroke-width": e.strokeWidth,
22
+ "text-inside": "",
23
+ percentage: e.percent
24
+ }
25
+ }), e.disabled ? e._e() : s("ElSlider", {
26
+ directives: [{
27
+ name: "show",
28
+ rawName: "v-show",
29
+ value: e.slider,
30
+ expression: "slider"
31
+ }],
32
+ ref: "slider",
33
+ style: {
34
+ width: `${e.max === 100 ? 100 : e.max - 1}%`
35
+ },
36
+ attrs: {
37
+ "tooltip-class": e.tooltipClass,
38
+ max: e.max,
39
+ "format-tooltip": e.formatTooltip,
40
+ disabled: e.disabled,
41
+ step: e.step
42
+ },
43
+ on: {
44
+ input: e.onInput,
45
+ change: e.onChange
46
+ },
47
+ model: {
48
+ value: e.percent,
49
+ callback: function(i) {
50
+ e.percent = i;
51
+ },
52
+ expression: "percent"
53
+ }
54
+ })], 1);
55
+ }, n = [];
56
+ const a = {
57
+ name: "EditableProgress",
58
+ props: {
59
+ disabled: {
60
+ type: Boolean,
61
+ default: !1
62
+ },
63
+ strokeWidth: {
64
+ type: Number,
65
+ default: 22
66
+ },
67
+ step: {
68
+ type: Number,
69
+ default: 10
70
+ },
71
+ max: {
72
+ type: Number,
73
+ default: 100
74
+ },
75
+ value: {
76
+ type: Number,
77
+ default: 0
78
+ }
79
+ },
80
+ data() {
81
+ return {
82
+ slider: !1,
83
+ mouseDown: !1,
84
+ tooltipClass: "hide-tooltip",
85
+ percent: this.value
86
+ };
87
+ },
88
+ watch: {
89
+ value(e) {
90
+ this.percent !== e && (this.percent = e);
91
+ }
92
+ },
93
+ methods: {
94
+ formatTooltip(e) {
95
+ return `${e}%`;
96
+ },
97
+ onInput(e) {
98
+ this.value !== e && this.$emit("input", e);
99
+ },
100
+ onChange(e) {
101
+ this.slider = !1, this.tooltipClass = "hide-tooltip", this.$emit("change", e);
102
+ },
103
+ onMouseOver() {
104
+ this.disabled || this.slider || (this.slider = !0, this.$nextTick(() => {
105
+ this.$refs.slider.$refs.button1.$refs.tooltip.updatePopper(), this.tooltipClass = "";
106
+ }));
107
+ },
108
+ onMouseDown() {
109
+ this.disabled || (this.mouseDown = !0, window.addEventListener("mouseup", this.onMouseUp));
110
+ },
111
+ onMouseUp() {
112
+ this.disabled || (this.mouseDown = !1, this.tooltipClass = "hide-tooltip", window.removeEventListener("mouseup", this.onMouseUp));
113
+ },
114
+ onMouseLeave() {
115
+ this.disabled || this.mouseDown || (this.tooltipClass = "hide-tooltip", this.slider = !1);
116
+ },
117
+ wrapperClick() {
118
+ this.disabled || (this.slider = !0);
119
+ }
120
+ }
121
+ }, o = {};
122
+ var u = /* @__PURE__ */ r(
123
+ a,
124
+ l,
125
+ n,
126
+ !1,
127
+ d,
128
+ null,
129
+ null,
130
+ null
131
+ );
132
+ function d(e) {
133
+ for (let t in o)
134
+ this[t] = o[t];
135
+ }
136
+ const h = /* @__PURE__ */ function() {
137
+ return u.exports;
138
+ }();
139
+ export {
140
+ h as default
141
+ };