@web-utils/component 1.2.5 → 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 +2992 -2075
  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/a125d16c.js +0 -1
  110. package/dist/chunks/addb6ed5.js +0 -1
  111. package/dist/chunks/f15477c7.js +0 -1
@@ -1 +1,145 @@
1
- import{p as o}from"../../chunks/8bbde9bf.js";import{n}from"../../chunks/6499de3a.js";var s=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"vux-tab-wrap",class:t.barPosition==="top"?"vux-tab-bar-top":""},[e("div",{staticClass:"vux-tab-container"},[e("div",{ref:"nav",staticClass:"vux-tab",class:[{"vux-tab-no-animate":!t.animate,scrollable:t.scrollable}]},[t._t("default"),t.animate?e("div",{staticClass:"vux-tab-ink-bar",class:t.barClass,style:t.barStyle},[t.customBarWidth?e("span",{staticClass:"vux-tab-bar-inner",style:t.innerBarStyle}):t._e()]):t._e()],2)])])},l=[];const b={name:"Tab",mixins:[o],props:{lineWidth:{type:Number,default:3},activeColor:String,barActiveColor:String,animate:{type:Boolean,default:!0},customBarWidth:[Function,String],scrollThreshold:{type:Number,default:4},barPosition:{type:String,default:"bottom",validator(t){return["bottom","top"].indexOf(t)!==-1}}},data(){return{direction:"forward",hasReady:!1}},computed:{barLeft(){if(this.hasReady){const t=this.scrollable?window.innerWidth/this.$children[this.currentIndex||0].$el.getBoundingClientRect().width:this.number;return`${this.currentIndex*(100/t)}%`}return null},barRight(){if(this.hasReady){const t=this.scrollable?window.innerWidth/this.$children[this.currentIndex||0].$el.getBoundingClientRect().width:this.number;return`${(t-this.currentIndex-1)*(100/t)}%`}return null},innerBarStyle(){return{width:typeof this.customBarWidth=="function"?this.customBarWidth(this.currentIndex):this.customBarWidth,backgroundColor:this.barActiveColor||this.activeColor}},barStyle(){const t={left:this.barLeft,right:this.barRight,display:"block",height:`${this.lineWidth}px`,transition:this.hasReady?null:"none"};return this.customBarWidth?t.backgroundColor="transparent":t.backgroundColor=this.barActiveColor||this.activeColor,t},barClass(){return{"vux-tab-ink-bar-transition-forward":this.direction==="forward","vux-tab-ink-bar-transition-backward":this.direction==="backward"}},scrollable(){return this.number>this.scrollThreshold}},watch:{currentIndex(t,i){this.direction=t>i?"forward":"backward",this.$emit("on-index-change",t,i),this.hasReady&&this.scrollToActiveTab()}},mounted(){this.$nextTick(()=>{setTimeout(()=>{this.hasReady=!0},0)})},methods:{scrollToActiveTab(){if(!this.scrollable||!this.$children||!this.$children.length)return;const t=this.$children[this.currentIndex].$el;let i=0;const e=()=>{const r=this.$refs.nav;r.scrollLeft+=(t.offsetLeft-(r.offsetWidth-t.offsetWidth)/2-r.scrollLeft)/15,++i<15&&window.requestAnimationFrame(e)};window.requestAnimationFrame(e)}}},a={};var c=n(b,s,l,!1,u,null,null,null);function u(t){for(let i in a)this[i]=a[i]}var d=function(){return c.exports}();export{d as default};
1
+ import { p as a } from "../../chunks/8bbde9bf.js";
2
+ import { n as s } from "../../chunks/6499de3a.js";
3
+ var o = function() {
4
+ var t = this, r = t.$createElement, e = t._self._c || r;
5
+ return e("div", {
6
+ staticClass: "vux-tab-wrap",
7
+ class: t.barPosition === "top" ? "vux-tab-bar-top" : ""
8
+ }, [e("div", {
9
+ staticClass: "vux-tab-container"
10
+ }, [e("div", {
11
+ ref: "nav",
12
+ staticClass: "vux-tab",
13
+ class: [{
14
+ "vux-tab-no-animate": !t.animate,
15
+ scrollable: t.scrollable
16
+ }]
17
+ }, [t._t("default"), t.animate ? e("div", {
18
+ staticClass: "vux-tab-ink-bar",
19
+ class: t.barClass,
20
+ style: t.barStyle
21
+ }, [t.customBarWidth ? e("span", {
22
+ staticClass: "vux-tab-bar-inner",
23
+ style: t.innerBarStyle
24
+ }) : t._e()]) : t._e()], 2)])]);
25
+ }, l = [];
26
+ const c = {
27
+ name: "Tab",
28
+ mixins: [a],
29
+ props: {
30
+ lineWidth: {
31
+ type: Number,
32
+ default: 3
33
+ },
34
+ activeColor: String,
35
+ barActiveColor: String,
36
+ animate: {
37
+ type: Boolean,
38
+ default: !0
39
+ },
40
+ customBarWidth: [Function, String],
41
+ scrollThreshold: {
42
+ type: Number,
43
+ default: 4
44
+ },
45
+ barPosition: {
46
+ type: String,
47
+ default: "bottom",
48
+ validator(t) {
49
+ return ["bottom", "top"].indexOf(t) !== -1;
50
+ }
51
+ }
52
+ },
53
+ data() {
54
+ return {
55
+ direction: "forward",
56
+ hasReady: !1
57
+ };
58
+ },
59
+ computed: {
60
+ barLeft() {
61
+ if (this.hasReady) {
62
+ const t = this.scrollable ? window.innerWidth / this.$children[this.currentIndex || 0].$el.getBoundingClientRect().width : this.number;
63
+ return `${this.currentIndex * (100 / t)}%`;
64
+ }
65
+ return null;
66
+ },
67
+ barRight() {
68
+ if (this.hasReady) {
69
+ const t = this.scrollable ? window.innerWidth / this.$children[this.currentIndex || 0].$el.getBoundingClientRect().width : this.number;
70
+ return `${(t - this.currentIndex - 1) * (100 / t)}%`;
71
+ }
72
+ return null;
73
+ },
74
+ innerBarStyle() {
75
+ return {
76
+ width: typeof this.customBarWidth == "function" ? this.customBarWidth(this.currentIndex) : this.customBarWidth,
77
+ backgroundColor: this.barActiveColor || this.activeColor
78
+ };
79
+ },
80
+ barStyle() {
81
+ const t = {
82
+ left: this.barLeft,
83
+ right: this.barRight,
84
+ display: "block",
85
+ height: `${this.lineWidth}px`,
86
+ transition: this.hasReady ? null : "none"
87
+ };
88
+ return this.customBarWidth ? t.backgroundColor = "transparent" : t.backgroundColor = this.barActiveColor || this.activeColor, t;
89
+ },
90
+ barClass() {
91
+ return {
92
+ "vux-tab-ink-bar-transition-forward": this.direction === "forward",
93
+ "vux-tab-ink-bar-transition-backward": this.direction === "backward"
94
+ };
95
+ },
96
+ scrollable() {
97
+ return this.number > this.scrollThreshold;
98
+ }
99
+ },
100
+ watch: {
101
+ currentIndex(t, r) {
102
+ this.direction = t > r ? "forward" : "backward", this.$emit("on-index-change", t, r), this.hasReady && this.scrollToActiveTab();
103
+ }
104
+ },
105
+ mounted() {
106
+ this.$nextTick(() => {
107
+ setTimeout(() => {
108
+ this.hasReady = !0;
109
+ }, 0);
110
+ });
111
+ },
112
+ methods: {
113
+ scrollToActiveTab() {
114
+ if (!this.scrollable || !this.$children || !this.$children.length)
115
+ return;
116
+ const t = this.$children[this.currentIndex].$el;
117
+ let r = 0;
118
+ const e = () => {
119
+ const i = this.$refs.nav;
120
+ i.scrollLeft += (t.offsetLeft - (i.offsetWidth - t.offsetWidth) / 2 - i.scrollLeft) / 15, ++r < 15 && window.requestAnimationFrame(e);
121
+ };
122
+ window.requestAnimationFrame(e);
123
+ }
124
+ }
125
+ }, n = {};
126
+ var h = /* @__PURE__ */ s(
127
+ c,
128
+ o,
129
+ l,
130
+ !1,
131
+ u,
132
+ null,
133
+ null,
134
+ null
135
+ );
136
+ function u(t) {
137
+ for (let r in n)
138
+ this[r] = n[r];
139
+ }
140
+ const m = /* @__PURE__ */ function() {
141
+ return h.exports;
142
+ }();
143
+ export {
144
+ m as default
145
+ };
@@ -1 +1,73 @@
1
- import{c as n}from"../../chunks/8bbde9bf.js";import{n as l}from"../../chunks/6499de3a.js";var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"vux-tab-item",class:[e.currentSelected?e.activeClass:"",{"vux-tab-selected":e.currentSelected,"vux-tab-disabled":e.disabled}],style:e.style,on:{click:e.onItemClick}},[e._t("default"),typeof e.badgeLabel!="undefined"&&e.badgeLabel!==""?a("span",{staticClass:"vux-tab-item-badge",style:{background:e.badgeBackground,color:e.badgeColor}},[e._v(" "+e._s(e.badgeLabel)+" ")]):e._e()],2)},s=[];const i={name:"TabItem",mixins:[n],props:{activeClass:{type:String},disabled:Boolean,badgeBackground:{type:String,default:"#f74c31"},badgeColor:{type:String,default:"#fff"},badgeLabel:{type:String}},computed:{style(){return{borderWidth:`${this.$parent.lineWidth}px`,borderColor:this.$parent.activeColor,color:this.currentSelected?this.$parent.activeColor:this.disabled?this.$parent.disabledColor:this.$parent.defaultColor,border:this.$parent.animate?"none":"auto"}}}},r={};var d=l(i,o,s,!1,c,null,null,null);function c(e){for(let t in r)this[t]=r[t]}var u=function(){return d.exports}();export{u as default};
1
+ import { c as n } from "../../chunks/8bbde9bf.js";
2
+ import { n as l } from "../../chunks/6499de3a.js";
3
+ var o = function() {
4
+ var e = this, t = e.$createElement, a = e._self._c || t;
5
+ return a("div", {
6
+ staticClass: "vux-tab-item",
7
+ class: [e.currentSelected ? e.activeClass : "", {
8
+ "vux-tab-selected": e.currentSelected,
9
+ "vux-tab-disabled": e.disabled
10
+ }],
11
+ style: e.style,
12
+ on: {
13
+ click: e.onItemClick
14
+ }
15
+ }, [e._t("default"), typeof e.badgeLabel < "u" && e.badgeLabel !== "" ? a("span", {
16
+ staticClass: "vux-tab-item-badge",
17
+ style: {
18
+ background: e.badgeBackground,
19
+ color: e.badgeColor
20
+ }
21
+ }, [e._v(" " + e._s(e.badgeLabel) + " ")]) : e._e()], 2);
22
+ }, s = [];
23
+ const i = {
24
+ name: "TabItem",
25
+ mixins: [n],
26
+ props: {
27
+ activeClass: {
28
+ type: String
29
+ },
30
+ disabled: Boolean,
31
+ badgeBackground: {
32
+ type: String,
33
+ default: "#f74c31"
34
+ },
35
+ badgeColor: {
36
+ type: String,
37
+ default: "#fff"
38
+ },
39
+ badgeLabel: {
40
+ type: String
41
+ }
42
+ },
43
+ computed: {
44
+ style() {
45
+ return {
46
+ borderWidth: `${this.$parent.lineWidth}px`,
47
+ borderColor: this.$parent.activeColor,
48
+ color: this.currentSelected ? this.$parent.activeColor : this.disabled ? this.$parent.disabledColor : this.$parent.defaultColor,
49
+ border: this.$parent.animate ? "none" : "auto"
50
+ };
51
+ }
52
+ }
53
+ }, r = {};
54
+ var d = /* @__PURE__ */ l(
55
+ i,
56
+ o,
57
+ s,
58
+ !1,
59
+ c,
60
+ null,
61
+ null,
62
+ null
63
+ );
64
+ function c(e) {
65
+ for (let t in r)
66
+ this[t] = r[t];
67
+ }
68
+ const p = /* @__PURE__ */ function() {
69
+ return d.exports;
70
+ }();
71
+ export {
72
+ p as default
73
+ };
@@ -1 +1,89 @@
1
- var s=Object.defineProperty,d=Object.defineProperties;var c=Object.getOwnPropertyDescriptors;var o=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var i=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,l=(n,e)=>{for(var t in e||(e={}))f.call(e,t)&&i(n,t,e[t]);if(o)for(var t of o(e))p.call(e,t)&&i(n,t,e[t]);return n},r=(n,e)=>d(n,c(e));import{n as g}from"../../chunks/6499de3a.js";const m={props:{type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{},minWidth:{},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showTooltipWhenOverflow:Boolean,showOverflowTooltip:{type:Boolean,default:!0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default(){return["ascending","descending",null]},validator(n){return n.every(e=>["ascending","descending",null].indexOf(e)>-1)}}}},_={name:"TableColumn",functional:!0,mixins:[m],render(n,{data:e,props:t,children:u}){return n("ElTableColumn",r(l({},e),{props:r(l({},t),{showOverflowTooltip:["selection","single-selection","index","expand"].includes(t.type)?!1:t.showOverflowTooltip})}),u)}};let y,S;const a={};var v=g(_,y,S,!1,h,null,null,null);function h(n){for(let e in a)this[e]=a[e]}var b=function(){return v.exports}();export{b as default};
1
+ import { n as o } from "../../chunks/6499de3a.js";
2
+ const i = {
3
+ props: {
4
+ type: {
5
+ type: String,
6
+ default: "default"
7
+ },
8
+ label: String,
9
+ className: String,
10
+ labelClassName: String,
11
+ property: String,
12
+ prop: String,
13
+ width: {},
14
+ minWidth: {},
15
+ renderHeader: Function,
16
+ sortable: {
17
+ type: [Boolean, String],
18
+ default: !1
19
+ },
20
+ sortMethod: Function,
21
+ sortBy: [String, Function, Array],
22
+ resizable: {
23
+ type: Boolean,
24
+ default: !0
25
+ },
26
+ columnKey: String,
27
+ align: String,
28
+ headerAlign: String,
29
+ showTooltipWhenOverflow: Boolean,
30
+ showOverflowTooltip: {
31
+ type: Boolean,
32
+ default: !0
33
+ },
34
+ fixed: [Boolean, String],
35
+ formatter: Function,
36
+ selectable: Function,
37
+ reserveSelection: Boolean,
38
+ filterMethod: Function,
39
+ filteredValue: Array,
40
+ filters: Array,
41
+ filterPlacement: String,
42
+ filterMultiple: {
43
+ type: Boolean,
44
+ default: !0
45
+ },
46
+ index: [Number, Function],
47
+ sortOrders: {
48
+ type: Array,
49
+ default() {
50
+ return ["ascending", "descending", null];
51
+ },
52
+ validator(n) {
53
+ return n.every((e) => ["ascending", "descending", null].indexOf(e) > -1);
54
+ }
55
+ }
56
+ }
57
+ }, a = {
58
+ name: "TableColumn",
59
+ functional: !0,
60
+ mixins: [i],
61
+ render(n, { data: e, props: t, children: r }) {
62
+ return n("ElTableColumn", {
63
+ ...e,
64
+ props: { ...t, showOverflowTooltip: ["selection", "single-selection", "index", "expand"].includes(t.type) ? !1 : t.showOverflowTooltip }
65
+ }, r);
66
+ }
67
+ };
68
+ let s, u;
69
+ const l = {};
70
+ var d = /* @__PURE__ */ o(
71
+ a,
72
+ s,
73
+ u,
74
+ !1,
75
+ c,
76
+ null,
77
+ null,
78
+ null
79
+ );
80
+ function c(n) {
81
+ for (let e in l)
82
+ this[e] = l[e];
83
+ }
84
+ const p = /* @__PURE__ */ function() {
85
+ return d.exports;
86
+ }();
87
+ export {
88
+ p as default
89
+ };
@@ -1 +1,363 @@
1
- import{isString as o,isArray as h,trace as n,warning as b,merge as a,toStringArray as p,isFunction as f,hasOwn as d}from"@web-utils/core";import{k as u}from"../../chunks/8473fc69.js";import{n as w}from"../../chunks/6499de3a.js";var v=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"table-view"},[t("Toolbar",e._g(e._b({on:{search:e.toggleSearch,del:e.del,create:e.create,reload:e.reloadTable,imp:function(l){e.importDialogVisible=!0}},scopedSlots:e._u([{key:"default",fn:function(){return[e._t("toolbar-button")]},proxy:!0},e._l(e.buttonSlots,function(l){return{key:l,fn:function(){return[e._t(l)]},proxy:!0}})],null,!0)},"Toolbar",e.toolbarProps,!1),e.toolbarListeners)),t("div",{staticClass:"table-view-content-wrapper"},[t("div",{staticClass:"table-view-content"},[e.treeProps.show?t("div",{ref:"treeScroller",staticClass:"table-view-sidebar",on:{scroll:e.onTreeScroll}},[t("div",{staticStyle:{"font-size":"16px"}},[e._v(" \u89C6\u56FE\u5BFC\u822A ")]),t("EditableTree",e._g(e._b({ref:"tree",attrs:{readonly:""},scopedSlots:e._u([{key:"default",fn:function(l){var s=l.node,i=l.data;return[e._t("tree-node",function(){return[t("span",[t("i",{staticClass:"node-icon",class:s.childNodes.length>0?s.expanded?"el-icon-folder-opened":"el-icon-folder":"el-icon-tickets"}),e._t("tree-label",function(){return[e._v(e._s(s.label))]},{node:s,data:i})],2)]},{node:s,data:i})]}}],null,!0)},"EditableTree",e.treeProps,!1),e.treeListeners))],1):e._e(),t("div",{staticClass:"table-view-table"},[t("PageableTable",e._g(e._b({ref:"table",class:[{"border-top":e.borderTop,"border-bottom":e.borderBottom,"border-left":e.borderLeft||e.treeAttrs&&e.treeAttrs.show,"border-right":e.borderRight}],attrs:{border:e.border},on:{"row-dblclick":e.rowDbClick,"selection-change":e.onSelectionChange}},"PageableTable",e.tableProps,!1),e.tableListeners),[e._t("columns")],2)],1)]),e.toolbarProps.searchable?t("div",{staticClass:"slide-panel",style:{right:`${e.right}px`,width:`${e.searchPanelProps.width}px`}},[e._m(0),t("div",{staticClass:"slide-panel-content"},[t("ElForm",{ref:"form",attrs:{"label-position":"right",model:e.searchModel||e.searchPanelProps.model,size:"mini","label-width":e.labelWidth},nativeOn:{"!submit":function(l){return l.preventDefault(),e.onSearchClick.apply(null,arguments)}}},[t("FormItemConfigProvider",{attrs:{block:"","wrap-col":!1}},[t("ElRow",{attrs:{gutter:0}},[e._t("search-form",function(){return[t("p",[e._v("\u8BF7\u6DFB\u52A0\u641C\u7D22\u6761\u4EF6\uFF01")])]})],2)],1),t("ElFormItem",{attrs:{"label-width":"0"}},[t("div",{staticClass:"slide-panel-actions"},[t("ElButton",{attrs:{type:"primary","native-type":"submit",size:"mini"}},[e._v(" \u5F00\u59CB\u641C\u7D22 ")]),t("ElButton",{attrs:{size:"mini"},on:{click:e.onClearClick}},[e._v(" \u6E05\u9664\u6761\u4EF6 ")])],1)])],1)],1)]):e._e()]),e._t("default")],2)},m=[function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"slide-panel-line"},[t("div",{staticClass:"slide-panel-line-indicator"})])}];const g=["back","create","save","withdraw","edit","submit","publish","agree","disagree","reject","finish","cancel","enable","exp","imp","del","disabled","reload","slot"],_={name:"TableView",bus:{reloadTableView(e,r){if(!!this._viewIds)if(o(e)||h(e)){let t=e;o(t)&&(t=t.split(",")),this._viewIds.some(l=>t.includes(l))&&(r?this.$refs.tree&&(n.call(this.$parent||{},"reloadTree"),this.refreshTree()):(n.call(this.$parent||{},"reloadTable"),this.reloadTable()))}else b.call(this.$parent||{},"`viewId`\u7684\u7C7B\u578B\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6216\u6570\u7EC4")}},props:{viewId:{type:String},searchPanelAttrs:{type:Object,default:()=>{}},toolbarAttrs:{type:Object,default:()=>{}},toolbarListeners:{type:Object},treeAttrs:{type:Object,default:()=>{}},treeListeners:{type:Object},tableAttrs:{type:Object},searchModel:{type:Object},tableListeners:{type:Object,default:()=>{}},deleteApi:{type:Function},borderTop:Boolean,borderBottom:Boolean,borderLeft:Boolean,borderRight:Boolean,border:{type:Boolean,default:!0},labelWidth:{type:String,default:"80px"},formPath:{type:[String,Function]}},data(){var e;return{importDialogVisible:!1,right:-(((e=this.searchPanelAttrs)==null?void 0:e.width)||350),selectedRows:[]}},computed:{buttonSlots(){return g.filter(e=>this.$scopedSlots[e])},toolbarProps(){var l,s;const e={},r=a(this.toolbarAttrs,e);let t=(r==null?void 0:r.buttons)||this.$parent.buttons;return t=t||[],t.includes("reload")||(t=[...t,"reload"]),r.buttons=t,r.buttons=p(r.buttons),r.searchable=!!((s=(l=this.$scopedSlots)["search-form"])!=null&&s.call(l)),r},treeProps(){const e={treeProps:{children:"children",label:"label",isLeaf:r=>d(r,"hasChildren")?!r.hasChildren:d(r,"hasChild")?!r.hasChild:!0},show:!1,lazy:!0,readonly:!0,data:[],"expand-first-node":!1,"default-expand-all":!1};return a(this.treeAttrs,e)},tableProps(){const e=this.tableAttrs.api||this.$parent.getPage,r={model:this.searchModel||{},height:"auto","highlight-current-row":!0,api:e};return a(this.tableAttrs,r)},searchPanelProps(){const e={width:350,model:this.searchModel||{}};return a(this.searchPanelAttrs,e)}},created(){this._viewIds=[],this.viewId&&this._viewIds.push(this.viewId),this._viewIds.includes(this.$parent.$options.name)||this._viewIds.push(this.$parent.$options.name)},async activated(){this.$refs.treeScroller&&(this.treeScrollTop&&(this.$refs.treeScroller.scrollTop=this.treeScrollTop),this.treeScrollLeft&&(this.$refs.treeScroller.scrollLeft=this.treeScrollLeft))},methods:{onTreeScroll(){this.treeScrollTop=this.$refs.treeScroller.scrollTop,this.treeScrollLeft=this.$refs.treeScroller.scrollLeft},toggleSearch(){this.right=this.right===0?-this.searchPanelProps.width:0},async onSearchClick(){this.$refs.table.setModel(this.searchModel||this.searchPanelProps.model),await this.refreshTable()},async onClearClick(){this.$emit("reset"),this.$refs.form.resetFields(),this.$refs.table.setModel(this.searchModel||this.searchPanelProps.model),await this.refreshTable()},openFrom(e){this.$router.push(u(this.formPath,e))},rowDbClick(e){var r;!((r=this.tableListeners)!=null&&r["row-dblclick"])&&this.formPath&&this.openFrom(e)},onSelectionChange(e){this.selectedRows=e},create(){var e;!((e=this.toolbarListeners)!=null&&e.create)&&this.formPath&&this.openFrom()},async del(){var r;const e=this.deleteApi||this.$parent.del;if(!((r=this.toolbarListeners)!=null&&r.del)&&f(e)){if(!this.selectedRows.length){this.$message.warning("\u8BF7\u9009\u62E9\u8981\u5220\u9664\u7684\u8BB0\u5F55\uFF01");return}await this.$confirm(`\u60A8\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684[<span class="break-word" style="color: orange">${this.selectedRows.length}</span>]\u884C\u8BB0\u5F55\u5417\uFF1F`,"\u7CFB\u7EDF\u63D0\u793A",{type:"warning",modal:!0,dangerouslyUseHTMLString:!0,closeOnClickModal:!1,beforeClose:async(t,l,s)=>{if(t==="confirm")try{l.confirmButtonLoading=!0,l.confirmButtonText="\u5220\u9664...",await e.call(this,this.selectedRows.map(i=>i.id).join(",")),this.$message.success("\u5220\u9664\u6210\u529F"),await this.reloadTable(),await this.refreshTree()}catch{}s()}}).catch(t=>t)}},reloadTable(){var e;(e=this.$refs.table)==null||e.reload()},async refreshTable(){var e;await((e=this.$refs.table)==null?void 0:e.getPage())},refreshTree(){this.$refs.tree.reloadTree()},getSearchModel(){return this.searchPanelProps.model}}},c={};var y=w(_,v,m,!1,P,null,null,null);function P(e){for(let r in c)this[r]=c[r]}var x=function(){return y.exports}();export{x as default};
1
+ import { isString as o, isArray as d, trace as n, warning as f, merge as i, toStringArray as p, isFunction as u, hasOwn as c } from "@web-utils/core";
2
+ import { k as b } from "../../chunks/2bd4e340.js";
3
+ import { n as m } from "../../chunks/6499de3a.js";
4
+ var _ = function() {
5
+ var e = this, r = e.$createElement, t = e._self._c || r;
6
+ return t("div", {
7
+ staticClass: "table-view"
8
+ }, [t("Toolbar", e._g(e._b({
9
+ on: {
10
+ search: e.toggleSearch,
11
+ del: e.del,
12
+ create: e.create,
13
+ reload: e.reloadTable,
14
+ imp: function(s) {
15
+ e.importDialogVisible = !0;
16
+ }
17
+ },
18
+ scopedSlots: e._u([{
19
+ key: "default",
20
+ fn: function() {
21
+ return [e._t("toolbar-button")];
22
+ },
23
+ proxy: !0
24
+ }, e._l(e.buttonSlots, function(s) {
25
+ return {
26
+ key: s,
27
+ fn: function() {
28
+ return [e._t(s)];
29
+ },
30
+ proxy: !0
31
+ };
32
+ })], null, !0)
33
+ }, "Toolbar", e.toolbarProps, !1), e.toolbarListeners)), t("div", {
34
+ staticClass: "table-view-content-wrapper"
35
+ }, [t("div", {
36
+ staticClass: "table-view-content"
37
+ }, [e.treeProps.show ? t("div", {
38
+ ref: "treeScroller",
39
+ staticClass: "table-view-sidebar",
40
+ on: {
41
+ scroll: e.onTreeScroll
42
+ }
43
+ }, [t("div", {
44
+ staticStyle: {
45
+ "font-size": "16px"
46
+ }
47
+ }, [e._v(" \u89C6\u56FE\u5BFC\u822A ")]), t("EditableTree", e._g(e._b({
48
+ ref: "tree",
49
+ attrs: {
50
+ readonly: ""
51
+ },
52
+ scopedSlots: e._u([{
53
+ key: "default",
54
+ fn: function(s) {
55
+ var l = s.node, a = s.data;
56
+ return [e._t("tree-node", function() {
57
+ return [t("span", [t("i", {
58
+ staticClass: "node-icon",
59
+ class: l.childNodes.length > 0 ? l.expanded ? "el-icon-folder-opened" : "el-icon-folder" : "el-icon-tickets"
60
+ }), e._t("tree-label", function() {
61
+ return [e._v(e._s(l.label))];
62
+ }, {
63
+ node: l,
64
+ data: a
65
+ })], 2)];
66
+ }, {
67
+ node: l,
68
+ data: a
69
+ })];
70
+ }
71
+ }], null, !0)
72
+ }, "EditableTree", e.treeProps, !1), e.treeListeners))], 1) : e._e(), t("div", {
73
+ staticClass: "table-view-table"
74
+ }, [t("PageableTable", e._g(e._b({
75
+ ref: "table",
76
+ class: [{
77
+ "border-top": e.borderTop,
78
+ "border-bottom": e.borderBottom,
79
+ "border-left": e.borderLeft || e.treeAttrs && e.treeAttrs.show,
80
+ "border-right": e.borderRight
81
+ }],
82
+ attrs: {
83
+ border: e.border
84
+ },
85
+ on: {
86
+ "row-dblclick": e.rowDbClick,
87
+ "selection-change": e.onSelectionChange
88
+ }
89
+ }, "PageableTable", e.tableProps, !1), e.tableListeners), [e._t("columns")], 2)], 1)]), e.toolbarProps.searchable ? t("div", {
90
+ staticClass: "slide-panel",
91
+ style: {
92
+ right: `${e.right}px`,
93
+ width: `${e.searchPanelProps.width}px`
94
+ }
95
+ }, [e._m(0), t("div", {
96
+ staticClass: "slide-panel-content"
97
+ }, [t("ElForm", {
98
+ ref: "form",
99
+ attrs: {
100
+ "label-position": "right",
101
+ model: e.searchModel || e.searchPanelProps.model,
102
+ size: "mini",
103
+ "label-width": e.labelWidth
104
+ },
105
+ nativeOn: {
106
+ "!submit": function(s) {
107
+ return s.preventDefault(), e.onSearchClick.apply(null, arguments);
108
+ }
109
+ }
110
+ }, [t("FormItemConfigProvider", {
111
+ attrs: {
112
+ block: "",
113
+ "wrap-col": !1
114
+ }
115
+ }, [t("ElRow", {
116
+ attrs: {
117
+ gutter: 0
118
+ }
119
+ }, [e._t("search-form", function() {
120
+ return [t("p", [e._v("\u8BF7\u6DFB\u52A0\u641C\u7D22\u6761\u4EF6\uFF01")])];
121
+ })], 2)], 1), t("ElFormItem", {
122
+ attrs: {
123
+ "label-width": "0"
124
+ }
125
+ }, [t("div", {
126
+ staticClass: "slide-panel-actions"
127
+ }, [t("ElButton", {
128
+ attrs: {
129
+ type: "primary",
130
+ "native-type": "submit",
131
+ size: "mini"
132
+ }
133
+ }, [e._v(" \u5F00\u59CB\u641C\u7D22 ")]), t("ElButton", {
134
+ attrs: {
135
+ size: "mini"
136
+ },
137
+ on: {
138
+ click: e.onClearClick
139
+ }
140
+ }, [e._v(" \u6E05\u9664\u6761\u4EF6 ")])], 1)])], 1)], 1)]) : e._e()]), e._t("default")], 2);
141
+ }, g = [function() {
142
+ var e = this, r = e.$createElement, t = e._self._c || r;
143
+ return t("div", {
144
+ staticClass: "slide-panel-line"
145
+ }, [t("div", {
146
+ staticClass: "slide-panel-line-indicator"
147
+ })]);
148
+ }];
149
+ const w = ["back", "create", "save", "withdraw", "edit", "submit", "publish", "agree", "disagree", "reject", "finish", "cancel", "enable", "exp", "imp", "del", "disabled", "reload", "slot"], v = {
150
+ name: "TableView",
151
+ bus: {
152
+ reloadTableView(e, r) {
153
+ if (!!this._viewIds)
154
+ if (o(e) || d(e)) {
155
+ let t = e;
156
+ o(t) && (t = t.split(",")), this._viewIds.some((s) => t.includes(s)) && (r ? this.$refs.tree && (n.call(this.$parent || {}, "reloadTree"), this.refreshTree()) : (n.call(this.$parent || {}, "reloadTable"), this.reloadTable()));
157
+ } else
158
+ f.call(this.$parent || {}, "`viewId`\u7684\u7C7B\u578B\u5FC5\u987B\u662F\u5B57\u7B26\u4E32\u6216\u6570\u7EC4");
159
+ }
160
+ },
161
+ props: {
162
+ viewId: {
163
+ type: String
164
+ },
165
+ searchPanelAttrs: {
166
+ type: Object,
167
+ default: () => {
168
+ }
169
+ },
170
+ toolbarAttrs: {
171
+ type: Object,
172
+ default: () => {
173
+ }
174
+ },
175
+ toolbarListeners: {
176
+ type: Object
177
+ },
178
+ treeAttrs: {
179
+ type: Object,
180
+ default: () => {
181
+ }
182
+ },
183
+ treeListeners: {
184
+ type: Object
185
+ },
186
+ tableAttrs: {
187
+ type: Object
188
+ },
189
+ searchModel: {
190
+ type: Object
191
+ },
192
+ tableListeners: {
193
+ type: Object,
194
+ default: () => {
195
+ }
196
+ },
197
+ deleteApi: {
198
+ type: Function
199
+ },
200
+ borderTop: Boolean,
201
+ borderBottom: Boolean,
202
+ borderLeft: Boolean,
203
+ borderRight: Boolean,
204
+ border: {
205
+ type: Boolean,
206
+ default: !0
207
+ },
208
+ labelWidth: {
209
+ type: String,
210
+ default: "80px"
211
+ },
212
+ formPath: {
213
+ type: [String, Function]
214
+ }
215
+ },
216
+ data() {
217
+ var e;
218
+ return {
219
+ importDialogVisible: !1,
220
+ right: -(((e = this.searchPanelAttrs) == null ? void 0 : e.width) || 350),
221
+ selectedRows: []
222
+ };
223
+ },
224
+ computed: {
225
+ buttonSlots() {
226
+ return w.filter((e) => this.$scopedSlots[e]);
227
+ },
228
+ toolbarProps() {
229
+ var s, l;
230
+ const e = {}, r = i(this.toolbarAttrs, e);
231
+ let t = (r == null ? void 0 : r.buttons) || this.$parent.buttons;
232
+ return t = t || [], t.includes("reload") || (t = [...t, "reload"]), r.buttons = t, r.buttons = p(r.buttons), r.searchable = !!((l = (s = this.$scopedSlots)["search-form"]) != null && l.call(s)), r;
233
+ },
234
+ treeProps() {
235
+ const e = {
236
+ treeProps: {
237
+ children: "children",
238
+ label: "label",
239
+ isLeaf: (r) => c(r, "hasChildren") ? !r.hasChildren : c(r, "hasChild") ? !r.hasChild : !0
240
+ },
241
+ show: !1,
242
+ lazy: !0,
243
+ readonly: !0,
244
+ data: [],
245
+ "expand-first-node": !1,
246
+ "default-expand-all": !1
247
+ };
248
+ return i(this.treeAttrs, e);
249
+ },
250
+ tableProps() {
251
+ const e = this.tableAttrs.api || this.$parent.getPage, r = {
252
+ model: this.searchModel || {},
253
+ height: "auto",
254
+ "highlight-current-row": !0,
255
+ api: e
256
+ };
257
+ return i(this.tableAttrs, r);
258
+ },
259
+ searchPanelProps() {
260
+ const e = {
261
+ width: 350,
262
+ model: this.searchModel || {}
263
+ };
264
+ return i(this.searchPanelAttrs, e);
265
+ }
266
+ },
267
+ created() {
268
+ this._viewIds = [], this.viewId && this._viewIds.push(this.viewId), this._viewIds.includes(this.$parent.$options.name) || this._viewIds.push(this.$parent.$options.name);
269
+ },
270
+ async activated() {
271
+ this.$refs.treeScroller && (this.treeScrollTop && (this.$refs.treeScroller.scrollTop = this.treeScrollTop), this.treeScrollLeft && (this.$refs.treeScroller.scrollLeft = this.treeScrollLeft));
272
+ },
273
+ methods: {
274
+ onTreeScroll() {
275
+ this.treeScrollTop = this.$refs.treeScroller.scrollTop, this.treeScrollLeft = this.$refs.treeScroller.scrollLeft;
276
+ },
277
+ toggleSearch() {
278
+ this.right = this.right === 0 ? -this.searchPanelProps.width : 0;
279
+ },
280
+ async onSearchClick() {
281
+ this.$refs.table.setModel(this.searchModel || this.searchPanelProps.model), await this.refreshTable();
282
+ },
283
+ async onClearClick() {
284
+ this.$emit("reset"), this.$refs.form.resetFields(), this.$refs.table.setModel(this.searchModel || this.searchPanelProps.model), await this.refreshTable();
285
+ },
286
+ openFrom(e) {
287
+ this.$router.push(b(this.formPath, e));
288
+ },
289
+ rowDbClick(e) {
290
+ var r;
291
+ !((r = this.tableListeners) != null && r["row-dblclick"]) && this.formPath && this.openFrom(e);
292
+ },
293
+ onSelectionChange(e) {
294
+ this.selectedRows = e;
295
+ },
296
+ create() {
297
+ var e;
298
+ !((e = this.toolbarListeners) != null && e.create) && this.formPath && this.openFrom();
299
+ },
300
+ async del() {
301
+ var r;
302
+ const e = this.deleteApi || this.$parent.del;
303
+ if (!((r = this.toolbarListeners) != null && r.del) && u(e)) {
304
+ if (!this.selectedRows.length) {
305
+ this.$message.warning("\u8BF7\u9009\u62E9\u8981\u5220\u9664\u7684\u8BB0\u5F55\uFF01");
306
+ return;
307
+ }
308
+ await this.$confirm(
309
+ `\u60A8\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684[<span class="break-word" style="color: orange">${this.selectedRows.length}</span>]\u884C\u8BB0\u5F55\u5417\uFF1F`,
310
+ "\u7CFB\u7EDF\u63D0\u793A",
311
+ {
312
+ type: "warning",
313
+ modal: !0,
314
+ dangerouslyUseHTMLString: !0,
315
+ closeOnClickModal: !1,
316
+ beforeClose: async (t, s, l) => {
317
+ if (t === "confirm")
318
+ try {
319
+ s.confirmButtonLoading = !0, s.confirmButtonText = "\u5220\u9664...", await e.call(this, this.selectedRows.map((a) => a.id).join(",")), this.$message.success("\u5220\u9664\u6210\u529F"), await this.reloadTable(), await this.refreshTree();
320
+ } catch {
321
+ }
322
+ l();
323
+ }
324
+ }
325
+ ).catch((t) => t);
326
+ }
327
+ },
328
+ reloadTable() {
329
+ var e;
330
+ (e = this.$refs.table) == null || e.reload();
331
+ },
332
+ async refreshTable() {
333
+ var e;
334
+ await ((e = this.$refs.table) == null ? void 0 : e.getPage());
335
+ },
336
+ refreshTree() {
337
+ this.$refs.tree.reloadTree();
338
+ },
339
+ getSearchModel() {
340
+ return this.searchPanelProps.model;
341
+ }
342
+ }
343
+ }, h = {};
344
+ var y = /* @__PURE__ */ m(
345
+ v,
346
+ _,
347
+ g,
348
+ !1,
349
+ P,
350
+ null,
351
+ null,
352
+ null
353
+ );
354
+ function P(e) {
355
+ for (let r in h)
356
+ this[r] = h[r];
357
+ }
358
+ const C = /* @__PURE__ */ function() {
359
+ return y.exports;
360
+ }();
361
+ export {
362
+ C as default
363
+ };