@web-utils/component 1.2.5 → 1.2.7

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/element-dialog/index.js +242 -1
  37. package/dist/components/empty-view/index.js +69 -1
  38. package/dist/components/error-view/index.js +61 -1
  39. package/dist/components/flex-column/index.js +50 -1
  40. package/dist/components/flex-item/index.js +66 -1
  41. package/dist/components/flex-row/index.js +50 -1
  42. package/dist/components/flex-scroller/index.js +47 -1
  43. package/dist/components/form-button/index.js +80 -1
  44. package/dist/components/form-cascader/index.js +151 -1
  45. package/dist/components/form-checkbox-group/index.js +192 -1
  46. package/dist/components/form-date-picker/index.js +182 -1
  47. package/dist/components/form-holder/index.js +90 -1
  48. package/dist/components/form-input/index.js +106 -1
  49. package/dist/components/form-input-email/index.js +97 -1
  50. package/dist/components/form-input-id-card/index.js +104 -1
  51. package/dist/components/form-input-number/index.js +123 -1
  52. package/dist/components/form-input-phone-number/index.js +98 -1
  53. package/dist/components/form-input-time/index.js +124 -1
  54. package/dist/components/form-item/index.js +120 -1
  55. package/dist/components/form-item-config-provider/index.js +63 -1
  56. package/dist/components/form-item-group/index.js +169 -1
  57. package/dist/components/form-radio-group/index.js +170 -1
  58. package/dist/components/form-select/index.js +154 -1
  59. package/dist/components/form-switch/index.js +97 -1
  60. package/dist/components/form-textarea/index.js +102 -1
  61. package/dist/components/form-view/index.js +343 -1
  62. package/dist/components/guide-steps/index.js +94 -1
  63. package/dist/components/icon-card/index.js +62 -1
  64. package/dist/components/iframe-window/index.js +99 -1
  65. package/dist/components/input-number/index.js +274 -1
  66. package/dist/components/input-number-range/index.js +110 -1
  67. package/dist/components/j-s-x-component/index.js +16 -1
  68. package/dist/components/keep-view-alive/index.js +119 -1
  69. package/dist/components/loading-view/index.js +61 -1
  70. package/dist/components/nav-bar/index.js +52 -1
  71. package/dist/components/not-implement/index.js +35 -1
  72. package/dist/components/page/index.js +40 -1
  73. package/dist/components/page-header/index.js +56 -1
  74. package/dist/components/page-index/index.js +151 -1
  75. package/dist/components/page-index-top/index.js +119 -1
  76. package/dist/components/page-skeleton/index.js +56 -1
  77. package/dist/components/page-skeleton-new/index.js +98 -1
  78. package/dist/components/pageable-table/index.js +429 -1
  79. package/dist/components/pageable-view/index.js +328 -2
  80. package/dist/components/photo-swipe/index.js +187 -1
  81. package/dist/components/resize-observer/index.js +62 -1
  82. package/dist/components/search-popover/index.js +391 -2
  83. package/dist/components/sign-panel/index.js +242 -1
  84. package/dist/components/split-pane/index.js +209 -1
  85. package/dist/components/stateful/index.js +84 -1
  86. package/dist/components/static-pageable-table/index.js +92 -1
  87. package/dist/components/swiper/index.js +158 -1
  88. package/dist/components/tab/index.js +145 -1
  89. package/dist/components/tab-item/index.js +73 -1
  90. package/dist/components/table-column/index.js +89 -1
  91. package/dist/components/table-view/index.js +363 -1
  92. package/dist/components/tag-render/index.js +97 -1
  93. package/dist/components/tinymce-editor/index.js +173 -1
  94. package/dist/components/tinymce-wrapper/index.js +618 -1
  95. package/dist/components/toolbar/index.js +217 -1
  96. package/dist/components/toolbar-button/index.js +90 -1
  97. package/dist/components/trigger/index.js +71 -1
  98. package/dist/components/vue-tags-input/index.js +439 -1
  99. package/dist/components/watermark/index.js +63 -1
  100. package/dist/components/x-dialog/index.js +173 -1
  101. package/dist/index.css +2102 -1
  102. package/dist/index.es.js +3097 -2347
  103. package/package.json +29 -29
  104. package/web-types.json +22 -55
  105. package/dist/chunks/23bd3525.js +0 -1
  106. package/dist/chunks/65f4f4f2.js +0 -1
  107. package/dist/chunks/8473fc69.js +0 -1
  108. package/dist/chunks/a125d16c.js +0 -1
  109. package/dist/chunks/addb6ed5.js +0 -1
  110. package/dist/chunks/f15477c7.js +0 -1
  111. package/dist/components/el-color-picker-dropdown/index.js +0 -1
@@ -1 +1,209 @@
1
- import{n as l}from"../../chunks/6499de3a.js";function f(t,e){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}const n=function(){return document.addEventListener?function(t,e,i){t&&e&&i&&t.addEventListener(e,i,!1)}:function(t,e,i){t&&e&&i&&t.attachEvent(`on${e}`,i)}}(),a=function(){return document.removeEventListener?function(t,e,i){t&&e&&t.removeEventListener(e,i,!1)}:function(t,e,i){t&&e&&t.detachEvent(`on${e}`,i)}}();var h=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{ref:"outerWrapper",class:t.wrapperClasses},[t.isHorizontal?i("div",{class:`${t.prefix}-horizontal`},[t.hideLeft?i("div",{class:[`${t.prefix}-pane`,"right-pane"],staticStyle:{left:"0"}},[t._t("right")],2):[i("div",{class:[`${t.prefix}-pane`,"left-pane"],style:{right:`${t.anotherOffset}%`}},[t._t("left")],2),i("div",{class:`${t.prefix}-trigger-con`,style:{left:`calc(${t.offset}% + ${t.triggerSize/2}px)`,width:`${t.triggerSize}px`},on:{mousedown:t.handleMousedown}},[t._t("trigger",function(){return[i("Trigger",{attrs:{mode:"vertical"}})]})],2),i("div",{class:[`${t.prefix}-pane`,"right-pane"],style:{left:`calc(${t.offset}% + ${t.triggerSize}px)`}},[t._t("right")],2)]],2):i("div",{class:`${t.prefix}-vertical`},[i("div",{class:[`${t.prefix}-pane`,"top-pane"],style:{bottom:`${t.anotherOffset}%`}},[t._t("top")],2),i("div",{class:`${t.prefix}-trigger-con`,style:{top:`calc(${t.offset}% + ${t.triggerSize/2}px)`,height:`${t.triggerSize}px`},on:{mousedown:t.handleMousedown}},[t._t("trigger",function(){return[i("Trigger",{attrs:{mode:"horizontal"}})]})],2),i("div",{class:[`${t.prefix}-pane`,"bottom-pane"],style:{top:`calc(${t.offset}% + ${t.triggerSize}px)`}},[t._t("bottom")],2)]),i("ResizeObserver",{on:{notify:t.resetOffset}})],1)},g=[];const d={name:"SplitPane",props:{value:{type:[Number,String],default:.5},mode:{validator(t){return f(t,["horizontal","vertical"])},default:"horizontal"},hideLeft:Boolean,triggerSize:{type:Number,default:6},min:{type:[Number,String],default:"40px"},max:{type:[Number,String],default:"40px"}},data(){return{prefix:"egd-split",offset:0,oldOffset:0,isMoving:!1}},computed:{wrapperClasses(){return[`${this.prefix}-wrapper`,this.isMoving?"no-select":""]},isHorizontal(){return this.mode==="horizontal"},anotherOffset(){return 100-this.offset},valueIsPx(){return typeof this.value=="string"},offsetSize(){return this.isHorizontal?"offsetWidth":"offsetHeight"},computedMin(){return this.getComputedThresholdValue("min")},computedMax(){return this.getComputedThresholdValue("max")}},watch:{value:"resetOffset"},async mounted(){await this.$nextTick(),this.resetOffset()},methods:{resetOffset(){this.offset=(this.valueIsPx?this.px2percent(this.value,this.$refs.outerWrapper[this.offsetSize]):this.value)*1e4/100},px2percent(t,e){return parseFloat(t)/parseFloat(e)},getComputedThresholdValue(t){const e=this.$refs.outerWrapper[this.offsetSize];return this.valueIsPx?typeof this[t]=="string"?this[t]:e*this[t]:typeof this[t]=="string"?this.px2percent(this[t],e):this[t]},getMin(t,e){return this.valueIsPx?`${Math.min(parseFloat(t),parseFloat(e))}px`:Math.min(t,e)},getMax(t,e){return this.valueIsPx?`${Math.max(parseFloat(t),parseFloat(e))}px`:Math.max(t,e)},getAnotherOffset(t){let e=0;return this.valueIsPx?e=`${this.$refs.outerWrapper[this.offsetSize]-parseFloat(t)}px`:e=1-t,e},handleMove(t){const i=(this.isHorizontal?t.pageX:t.pageY)-this.initOffset,s=this.$refs.outerWrapper[this.offsetSize];let r=this.valueIsPx?`${parseFloat(this.oldOffset)+i}px`:this.px2percent(s*this.oldOffset+i,s);const o=this.getAnotherOffset(r);parseFloat(r)<=parseFloat(this.computedMin)&&(r=this.getMax(r,this.computedMin)),parseFloat(o)<=parseFloat(this.computedMax)&&(r=this.getAnotherOffset(this.getMax(o,this.computedMax))),t.atMin=this.value===this.computedMin,t.atMax=this.valueIsPx?this.getAnotherOffset(this.value)===this.computedMax:this.getAnotherOffset(this.value).toFixed(5)===this.computedMax.toFixed(5),this.$emit("input",r),this.$emit("on-moving",t)},handleUp(){this.isMoving=!1,a(window,"mousemove",this.handleMove),a(window,"mouseup",this.handleUp),this.$emit("on-move-end")},handleMousedown(t){this.initOffset=this.isHorizontal?t.pageX:t.pageY,this.oldOffset=this.value,this.isMoving=!0,n(window,"mousemove",this.handleMove),n(window,"mouseup",this.handleUp),this.$emit("on-move-start")}}},p={};var u=l(d,h,g,!1,c,null,null,null);function c(t){for(let e in p)this[e]=p[e]}var x=function(){return u.exports}();export{x as default};
1
+ import { n as h } from "../../chunks/6499de3a.js";
2
+ function l(t, e) {
3
+ for (let s = 0; s < e.length; s++)
4
+ if (t === e[s])
5
+ return !0;
6
+ return !1;
7
+ }
8
+ const n = function() {
9
+ return document.addEventListener ? function(t, e, s) {
10
+ t && e && s && t.addEventListener(e, s, !1);
11
+ } : function(t, e, s) {
12
+ t && e && s && t.attachEvent(`on${e}`, s);
13
+ };
14
+ }(), a = function() {
15
+ return document.removeEventListener ? function(t, e, s) {
16
+ t && e && t.removeEventListener(e, s, !1);
17
+ } : function(t, e, s) {
18
+ t && e && t.detachEvent(`on${e}`, s);
19
+ };
20
+ }();
21
+ var p = function() {
22
+ var t = this, e = t.$createElement, s = t._self._c || e;
23
+ return s("div", {
24
+ ref: "outerWrapper",
25
+ class: t.wrapperClasses
26
+ }, [t.isHorizontal ? s("div", {
27
+ class: `${t.prefix}-horizontal`
28
+ }, [t.hideLeft ? s("div", {
29
+ class: [`${t.prefix}-pane`, "right-pane"],
30
+ staticStyle: {
31
+ left: "0"
32
+ }
33
+ }, [t._t("right")], 2) : [s("div", {
34
+ class: [`${t.prefix}-pane`, "left-pane"],
35
+ style: {
36
+ right: `${t.anotherOffset}%`
37
+ }
38
+ }, [t._t("left")], 2), s("div", {
39
+ class: `${t.prefix}-trigger-con`,
40
+ style: {
41
+ left: `calc(${t.offset}% + ${t.triggerSize / 2}px)`,
42
+ width: `${t.triggerSize}px`
43
+ },
44
+ on: {
45
+ mousedown: t.handleMousedown
46
+ }
47
+ }, [t._t("trigger", function() {
48
+ return [s("Trigger", {
49
+ attrs: {
50
+ mode: "vertical"
51
+ }
52
+ })];
53
+ })], 2), s("div", {
54
+ class: [`${t.prefix}-pane`, "right-pane"],
55
+ style: {
56
+ left: `calc(${t.offset}% + ${t.triggerSize}px)`
57
+ }
58
+ }, [t._t("right")], 2)]], 2) : s("div", {
59
+ class: `${t.prefix}-vertical`
60
+ }, [s("div", {
61
+ class: [`${t.prefix}-pane`, "top-pane"],
62
+ style: {
63
+ bottom: `${t.anotherOffset}%`
64
+ }
65
+ }, [t._t("top")], 2), s("div", {
66
+ class: `${t.prefix}-trigger-con`,
67
+ style: {
68
+ top: `calc(${t.offset}% + ${t.triggerSize / 2}px)`,
69
+ height: `${t.triggerSize}px`
70
+ },
71
+ on: {
72
+ mousedown: t.handleMousedown
73
+ }
74
+ }, [t._t("trigger", function() {
75
+ return [s("Trigger", {
76
+ attrs: {
77
+ mode: "horizontal"
78
+ }
79
+ })];
80
+ })], 2), s("div", {
81
+ class: [`${t.prefix}-pane`, "bottom-pane"],
82
+ style: {
83
+ top: `calc(${t.offset}% + ${t.triggerSize}px)`
84
+ }
85
+ }, [t._t("bottom")], 2)]), s("ResizeObserver", {
86
+ on: {
87
+ notify: t.resetOffset
88
+ }
89
+ })], 1);
90
+ }, u = [];
91
+ const d = {
92
+ name: "SplitPane",
93
+ props: {
94
+ value: {
95
+ type: [Number, String],
96
+ default: 0.5
97
+ },
98
+ mode: {
99
+ validator(t) {
100
+ return l(t, ["horizontal", "vertical"]);
101
+ },
102
+ default: "horizontal"
103
+ },
104
+ hideLeft: Boolean,
105
+ triggerSize: {
106
+ type: Number,
107
+ default: 6
108
+ },
109
+ min: {
110
+ type: [Number, String],
111
+ default: "40px"
112
+ },
113
+ max: {
114
+ type: [Number, String],
115
+ default: "40px"
116
+ }
117
+ },
118
+ data() {
119
+ return {
120
+ prefix: "egd-split",
121
+ offset: 0,
122
+ oldOffset: 0,
123
+ isMoving: !1
124
+ };
125
+ },
126
+ computed: {
127
+ wrapperClasses() {
128
+ return [`${this.prefix}-wrapper`, this.isMoving ? "no-select" : ""];
129
+ },
130
+ isHorizontal() {
131
+ return this.mode === "horizontal";
132
+ },
133
+ anotherOffset() {
134
+ return 100 - this.offset;
135
+ },
136
+ valueIsPx() {
137
+ return typeof this.value == "string";
138
+ },
139
+ offsetSize() {
140
+ return this.isHorizontal ? "offsetWidth" : "offsetHeight";
141
+ },
142
+ computedMin() {
143
+ return this.getComputedThresholdValue("min");
144
+ },
145
+ computedMax() {
146
+ return this.getComputedThresholdValue("max");
147
+ }
148
+ },
149
+ watch: {
150
+ value: "resetOffset"
151
+ },
152
+ async mounted() {
153
+ await this.$nextTick(), this.resetOffset();
154
+ },
155
+ methods: {
156
+ resetOffset() {
157
+ this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 1e4 / 100;
158
+ },
159
+ px2percent(t, e) {
160
+ return parseFloat(t) / parseFloat(e);
161
+ },
162
+ getComputedThresholdValue(t) {
163
+ const e = this.$refs.outerWrapper[this.offsetSize];
164
+ return this.valueIsPx ? typeof this[t] == "string" ? this[t] : e * this[t] : typeof this[t] == "string" ? this.px2percent(this[t], e) : this[t];
165
+ },
166
+ getMin(t, e) {
167
+ return this.valueIsPx ? `${Math.min(parseFloat(t), parseFloat(e))}px` : Math.min(t, e);
168
+ },
169
+ getMax(t, e) {
170
+ return this.valueIsPx ? `${Math.max(parseFloat(t), parseFloat(e))}px` : Math.max(t, e);
171
+ },
172
+ getAnotherOffset(t) {
173
+ let e = 0;
174
+ return this.valueIsPx ? e = `${this.$refs.outerWrapper[this.offsetSize] - parseFloat(t)}px` : e = 1 - t, e;
175
+ },
176
+ handleMove(t) {
177
+ const s = (this.isHorizontal ? t.pageX : t.pageY) - this.initOffset, r = this.$refs.outerWrapper[this.offsetSize];
178
+ let i = this.valueIsPx ? `${parseFloat(this.oldOffset) + s}px` : this.px2percent(r * this.oldOffset + s, r);
179
+ const o = this.getAnotherOffset(i);
180
+ parseFloat(i) <= parseFloat(this.computedMin) && (i = this.getMax(i, this.computedMin)), parseFloat(o) <= parseFloat(this.computedMax) && (i = this.getAnotherOffset(this.getMax(o, this.computedMax))), t.atMin = this.value === this.computedMin, t.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5), this.$emit("input", i), this.$emit("on-moving", t);
181
+ },
182
+ handleUp() {
183
+ this.isMoving = !1, a(window, "mousemove", this.handleMove), a(window, "mouseup", this.handleUp), this.$emit("on-move-end");
184
+ },
185
+ handleMousedown(t) {
186
+ this.initOffset = this.isHorizontal ? t.pageX : t.pageY, this.oldOffset = this.value, this.isMoving = !0, n(window, "mousemove", this.handleMove), n(window, "mouseup", this.handleUp), this.$emit("on-move-start");
187
+ }
188
+ }
189
+ }, f = {};
190
+ var c = /* @__PURE__ */ h(
191
+ d,
192
+ p,
193
+ u,
194
+ !1,
195
+ g,
196
+ null,
197
+ null,
198
+ null
199
+ );
200
+ function g(t) {
201
+ for (let e in f)
202
+ this[e] = f[e];
203
+ }
204
+ const x = /* @__PURE__ */ function() {
205
+ return c.exports;
206
+ }();
207
+ export {
208
+ x as default
209
+ };
@@ -1 +1,84 @@
1
- import{n as g}from"../../chunks/6499de3a.js";const A={name:"Stateful",functional:!0,props:{tag:{type:String,default:"div"},draft:{type:[Array,Boolean],default:()=>[]},doing:{type:[Array,Boolean],default:()=>[]},overdue:{type:[Array,Boolean],default:()=>[]},error:{type:[Array,Boolean],default:()=>[]},done:{type:[Array,Boolean],default:()=>[]},closed:{type:[Array,Boolean],default:()=>[]},type:{type:String,validator:r=>["doing","overdue","error","done","closed"].indexOf(r)>-1},status:{type:[String,Number]},size:{type:String}},render(r,{props:t,data:c,children:y}){const{draft:a,doing:o,overdue:n,error:d,done:l,closed:s,status:e,tag:f,size:u,type:p}=t,_={draft:Array.isArray(a)?a.includes(e):a,doing:Array.isArray(o)?o.includes(e):o,overdue:Array.isArray(n)?n.includes(e):n,error:Array.isArray(d)?d.includes(e):d,done:Array.isArray(l)?l.includes(e):l,closed:Array.isArray(s)?s.includes(e):s};return r(f,c,[r("span",{style:{width:u,height:u},class:["stateful",p,_]}),y])}};let v,b;const i={};var x=g(A,v,b,!1,h,null,null,null);function h(r){for(let t in i)this[t]=i[t]}var m=function(){return x.exports}();export{m as default};
1
+ import { n as A } from "../../chunks/6499de3a.js";
2
+ const v = {
3
+ name: "Stateful",
4
+ functional: !0,
5
+ props: {
6
+ tag: {
7
+ type: String,
8
+ default: "div"
9
+ },
10
+ draft: {
11
+ type: [Array, Boolean],
12
+ default: () => []
13
+ },
14
+ doing: {
15
+ type: [Array, Boolean],
16
+ default: () => []
17
+ },
18
+ overdue: {
19
+ type: [Array, Boolean],
20
+ default: () => []
21
+ },
22
+ error: {
23
+ type: [Array, Boolean],
24
+ default: () => []
25
+ },
26
+ done: {
27
+ type: [Array, Boolean],
28
+ default: () => []
29
+ },
30
+ closed: {
31
+ type: [Array, Boolean],
32
+ default: () => []
33
+ },
34
+ type: {
35
+ type: String,
36
+ validator: (r) => ["doing", "overdue", "error", "done", "closed"].indexOf(r) > -1
37
+ },
38
+ status: {
39
+ type: [String, Number]
40
+ },
41
+ size: {
42
+ type: String
43
+ }
44
+ },
45
+ render(r, { props: t, data: y, children: c }) {
46
+ const { draft: n, doing: a, overdue: o, error: s, done: l, closed: d, status: e, tag: _, size: u, type: f } = t, p = {
47
+ draft: Array.isArray(n) ? n.includes(e) : n,
48
+ doing: Array.isArray(a) ? a.includes(e) : a,
49
+ overdue: Array.isArray(o) ? o.includes(e) : o,
50
+ error: Array.isArray(s) ? s.includes(e) : s,
51
+ done: Array.isArray(l) ? l.includes(e) : l,
52
+ closed: Array.isArray(d) ? d.includes(e) : d
53
+ };
54
+ return r(_, y, [
55
+ r("span", {
56
+ style: { width: u, height: u },
57
+ class: ["stateful", f, p]
58
+ }),
59
+ c
60
+ ]);
61
+ }
62
+ };
63
+ let g, S;
64
+ const i = {};
65
+ var m = /* @__PURE__ */ A(
66
+ v,
67
+ g,
68
+ S,
69
+ !1,
70
+ B,
71
+ null,
72
+ null,
73
+ null
74
+ );
75
+ function B(r) {
76
+ for (let t in i)
77
+ this[t] = i[t];
78
+ }
79
+ const h = /* @__PURE__ */ function() {
80
+ return m.exports;
81
+ }();
82
+ export {
83
+ h as default
84
+ };
@@ -1 +1,92 @@
1
- import{chunk as n}from"lodash";import{n as i}from"../../chunks/6499de3a.js";var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"static-pageable-table"},[a("ElTable",e._g(e._b({attrs:{size:"mini",data:e.records}},"ElTable",e.$attrs,!1),e.$listeners),[e._t("default",function(){return[e._v("\u8BF7\u6DFB\u52A0\u8868\u683C\u5217")]})],2),a("ElPagination",{attrs:{"current-page":e.page.page,"hide-on-single-page":!0,"page-size":e.page.limit,total:e.page.total,background:"",layout:"total, prev, pager, next"},on:{"current-change":function(s){e.page.page=s}}})],1)},o=[];const p={name:"StaticPageableTable",props:{rows:{type:Array,default:()=>[]}},data(){return{page:{total:0,page:1,limit:25},records:[]}},computed:{observer(){return{page:this.page.page,rows:this.rows}}},watch:{rows(){this.page.page=1},observer:{immediate:!0,handler(){this.page.total=this.rows.length,this.fetchData()}}},methods:{fetchData(){this.records=n(this.rows,this.page.limit)[this.page.page-1]}}},r={};var c=i(p,l,o,!1,g,null,null,null);function g(e){for(let t in r)this[t]=r[t]}var u=function(){return c.exports}();export{u as default};
1
+ import { chunk as n } from "lodash";
2
+ import { n as i } 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: "static-pageable-table"
7
+ }, [a("ElTable", e._g(e._b({
8
+ attrs: {
9
+ size: "mini",
10
+ data: e.records
11
+ }
12
+ }, "ElTable", e.$attrs, !1), e.$listeners), [e._t("default", function() {
13
+ return [e._v("\u8BF7\u6DFB\u52A0\u8868\u683C\u5217")];
14
+ })], 2), a("ElPagination", {
15
+ attrs: {
16
+ "current-page": e.page.page,
17
+ "hide-on-single-page": !0,
18
+ "page-size": e.page.limit,
19
+ total: e.page.total,
20
+ background: "",
21
+ layout: "total, prev, pager, next"
22
+ },
23
+ on: {
24
+ "current-change": function(s) {
25
+ e.page.page = s;
26
+ }
27
+ }
28
+ })], 1);
29
+ }, l = [];
30
+ const c = {
31
+ name: "StaticPageableTable",
32
+ props: {
33
+ rows: {
34
+ type: Array,
35
+ default: () => []
36
+ }
37
+ },
38
+ data() {
39
+ return {
40
+ page: {
41
+ total: 0,
42
+ page: 1,
43
+ limit: 25
44
+ },
45
+ records: []
46
+ };
47
+ },
48
+ computed: {
49
+ observer() {
50
+ return {
51
+ page: this.page.page,
52
+ rows: this.rows
53
+ };
54
+ }
55
+ },
56
+ watch: {
57
+ rows() {
58
+ this.page.page = 1;
59
+ },
60
+ observer: {
61
+ immediate: !0,
62
+ handler() {
63
+ this.page.total = this.rows.length, this.fetchData();
64
+ }
65
+ }
66
+ },
67
+ methods: {
68
+ fetchData() {
69
+ this.records = n(this.rows, this.page.limit)[this.page.page - 1];
70
+ }
71
+ }
72
+ }, r = {};
73
+ var p = /* @__PURE__ */ i(
74
+ c,
75
+ o,
76
+ l,
77
+ !1,
78
+ g,
79
+ null,
80
+ null,
81
+ null
82
+ );
83
+ function g(e) {
84
+ for (let t in r)
85
+ this[t] = r[t];
86
+ }
87
+ const h = /* @__PURE__ */ function() {
88
+ return p.exports;
89
+ }();
90
+ export {
91
+ h as default
92
+ };
@@ -1 +1,158 @@
1
- import{getEleWidth as o}from"@web-utils/core";import{n as a}from"../../chunks/6499de3a.js";var l=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"egd-swiper"},[s("ElButton",{staticClass:"el-carousel__arrow el-carousel__arrow--left",attrs:{disabled:t.reachedLeft,icon:"el-icon-arrow-left"},on:{click:t.clickLeft}}),s("div",{ref:"swiperBox",staticClass:"egd-swiper-box",on:{wheel:function(i){return i.stopPropagation(),i.preventDefault(),t.onMouseWheel.apply(null,arguments)}}},[s("div",{ref:"swiperContent",staticClass:"egd-swiper-content",style:t.swiperContentStyle},[t._t("default")],2)]),s("ElButton",{staticClass:"el-carousel__arrow el-carousel__arrow--right",attrs:{disabled:t.reachedRight,icon:"el-icon-arrow-right"},on:{click:t.clickRight}}),s("ResizeObserver",{on:{notify:t.resize}})],1)},h=[];const d={name:"Swiper",data(){return{mouseDown:!1,swiperBoxWith:0,swiperContentWidth:0,translateX:0,reachedLeft:!0,reachedRight:!1,childrenWidth:[],swiperContentStyle:{transitionDuration:"0ms",transform:"translate3d(0px, 0px, 0px)"}}},async mounted(){await this.layout()},updated(){this.computeContentWidth()},methods:{async layout(){await this.$nextTick(),this.computeContentWidth(),this.resize()},resize(){console.log(1),this.swiperBoxWith=this.$refs.swiperBox.offsetWidth},computeContentWidth(){let t=0;const e=[],{children:s}=this.$refs.swiperContent;Array.prototype.forEach.call(s,i=>{const r=o(i);t+=r,e.push(r)}),this.childrenWidth=e,this.swiperContentWidth=t},updateDuration(t){this.swiperContentStyle.transitionDuration=t?"300ms":"0ms"},setTranslateX(t){this.swiperContentWidth<=this.swiperBoxWith||(t>0?(this.translateX=0,this.reachedLeft=!0,this.reachedRight=!1):t-this.swiperBoxWith<-this.swiperContentWidth?(this.translateX=-this.swiperContentWidth+this.swiperBoxWith,this.reachedLeft=!1,this.reachedRight=!0):(this.translateX=t,this.reachedLeft=!1,this.reachedRight=!1),this.swiperContentStyle.transform=`translate3d(${this.translateX}px, 0px, 0px)`)},clickLeft(){this.updateDuration(!0);let t=this.translateX+this.swiperBoxWith,e=t;if(t<0){e=0,t=-t;for(let s=0,i=this.childrenWidth.length;s<i&&(e+=this.childrenWidth[s],!(e>=t));s++);e=-e}this.setTranslateX(e)},clickRight(){this.updateDuration(!0);const t=Math.abs(this.translateX-this.swiperBoxWith);let e=0;for(let s=0,i=this.childrenWidth.length;s<i;s++)if(e+=this.childrenWidth[s],e>=t){e>t&&(e-=this.childrenWidth[s]);break}this.setTranslateX(-e)},onMouseWheel(t){this.updateDuration(!0),t.deltaMode===WheelEvent.DOM_DELTA_LINE?this.setTranslateX(this.translateX-t.deltaY*30):t.deltaMode===WheelEvent.DOM_DELTA_PAGE?t.deltaY>0?this.clickRight():this.clickLeft():this.setTranslateX(this.translateX-t.deltaY)},onMouseDown(t){this.mouseDown=!0,this.startX=t.clientX,this.translateXRaw=this.translateX,window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("mouseup",this.onMouseUp,{passive:!1})},onMouseUp(t){this.mouseDown=!1,this.updateDuration(!0),this.$refs.swiperContent.addEventListener("transitionend",this.transitionend),this.$refs.swiperContent.addEventListener("webkitTransitionEnd",this.transitionend);const e=t.clientX-this.startX;if(e<0){const s=this.translateX+e;this.setTranslateX(s)}if(e>0){const s=this.translateX+e;this.setTranslateX(s)}window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp)},onMouseMove(t){this.mouseDown&&requestAnimationFrame(()=>{const e=t.clientX-this.startX,s=this.translateXRaw+e;this.setTranslateX(s)})},transitionend(){this.updateDuration(!1),this.$refs.swiperContent.removeEventListener("transitionend",this.transitionend),this.$refs.swiperContent.removeEventListener("webkitTransitionEnd",this.transitionend)}}},n={};var c=a(d,l,h,!1,p,null,null,null);function p(t){for(let e in n)this[e]=n[e]}var u=function(){return c.exports}();export{u as default};
1
+ import { getEleWidth as a } from "@web-utils/core";
2
+ import { n as o } from "../../chunks/6499de3a.js";
3
+ var h = function() {
4
+ var t = this, e = t.$createElement, s = t._self._c || e;
5
+ return s("div", {
6
+ staticClass: "egd-swiper"
7
+ }, [s("ElButton", {
8
+ staticClass: "el-carousel__arrow el-carousel__arrow--left",
9
+ attrs: {
10
+ disabled: t.reachedLeft,
11
+ icon: "el-icon-arrow-left"
12
+ },
13
+ on: {
14
+ click: t.clickLeft
15
+ }
16
+ }), s("div", {
17
+ ref: "swiperBox",
18
+ staticClass: "egd-swiper-box",
19
+ on: {
20
+ wheel: function(i) {
21
+ return i.stopPropagation(), i.preventDefault(), t.onMouseWheel.apply(null, arguments);
22
+ }
23
+ }
24
+ }, [s("div", {
25
+ ref: "swiperContent",
26
+ staticClass: "egd-swiper-content",
27
+ style: t.swiperContentStyle
28
+ }, [t._t("default")], 2)]), s("ElButton", {
29
+ staticClass: "el-carousel__arrow el-carousel__arrow--right",
30
+ attrs: {
31
+ disabled: t.reachedRight,
32
+ icon: "el-icon-arrow-right"
33
+ },
34
+ on: {
35
+ click: t.clickRight
36
+ }
37
+ }), s("ResizeObserver", {
38
+ on: {
39
+ notify: t.resize
40
+ }
41
+ })], 1);
42
+ }, l = [];
43
+ const d = {
44
+ name: "Swiper",
45
+ data() {
46
+ return {
47
+ mouseDown: !1,
48
+ swiperBoxWith: 0,
49
+ swiperContentWidth: 0,
50
+ translateX: 0,
51
+ reachedLeft: !0,
52
+ reachedRight: !1,
53
+ childrenWidth: [],
54
+ swiperContentStyle: {
55
+ transitionDuration: "0ms",
56
+ transform: "translate3d(0px, 0px, 0px)"
57
+ }
58
+ };
59
+ },
60
+ async mounted() {
61
+ await this.layout();
62
+ },
63
+ updated() {
64
+ this.computeContentWidth();
65
+ },
66
+ methods: {
67
+ async layout() {
68
+ await this.$nextTick(), this.computeContentWidth(), this.resize();
69
+ },
70
+ resize() {
71
+ console.log(1), this.swiperBoxWith = this.$refs.swiperBox.offsetWidth;
72
+ },
73
+ computeContentWidth() {
74
+ let t = 0;
75
+ const e = [], { children: s } = this.$refs.swiperContent;
76
+ Array.prototype.forEach.call(s, (i) => {
77
+ const n = a(i);
78
+ t += n, e.push(n);
79
+ }), this.childrenWidth = e, this.swiperContentWidth = t;
80
+ },
81
+ updateDuration(t) {
82
+ this.swiperContentStyle.transitionDuration = t ? "300ms" : "0ms";
83
+ },
84
+ setTranslateX(t) {
85
+ this.swiperContentWidth <= this.swiperBoxWith || (t > 0 ? (this.translateX = 0, this.reachedLeft = !0, this.reachedRight = !1) : t - this.swiperBoxWith < -this.swiperContentWidth ? (this.translateX = -this.swiperContentWidth + this.swiperBoxWith, this.reachedLeft = !1, this.reachedRight = !0) : (this.translateX = t, this.reachedLeft = !1, this.reachedRight = !1), this.swiperContentStyle.transform = `translate3d(${this.translateX}px, 0px, 0px)`);
86
+ },
87
+ clickLeft() {
88
+ this.updateDuration(!0);
89
+ let t = this.translateX + this.swiperBoxWith, e = t;
90
+ if (t < 0) {
91
+ e = 0, t = -t;
92
+ for (let s = 0, i = this.childrenWidth.length; s < i && (e += this.childrenWidth[s], !(e >= t)); s++)
93
+ ;
94
+ e = -e;
95
+ }
96
+ this.setTranslateX(e);
97
+ },
98
+ clickRight() {
99
+ this.updateDuration(!0);
100
+ const t = Math.abs(this.translateX - this.swiperBoxWith);
101
+ let e = 0;
102
+ for (let s = 0, i = this.childrenWidth.length; s < i; s++)
103
+ if (e += this.childrenWidth[s], e >= t) {
104
+ e > t && (e -= this.childrenWidth[s]);
105
+ break;
106
+ }
107
+ this.setTranslateX(-e);
108
+ },
109
+ onMouseWheel(t) {
110
+ this.updateDuration(!0), t.deltaMode === WheelEvent.DOM_DELTA_LINE ? this.setTranslateX(this.translateX - t.deltaY * 30) : t.deltaMode === WheelEvent.DOM_DELTA_PAGE ? t.deltaY > 0 ? this.clickRight() : this.clickLeft() : this.setTranslateX(this.translateX - t.deltaY);
111
+ },
112
+ onMouseDown(t) {
113
+ this.mouseDown = !0, this.startX = t.clientX, this.translateXRaw = this.translateX, window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("mouseup", this.onMouseUp, { passive: !1 });
114
+ },
115
+ onMouseUp(t) {
116
+ this.mouseDown = !1, this.updateDuration(!0), this.$refs.swiperContent.addEventListener("transitionend", this.transitionend), this.$refs.swiperContent.addEventListener("webkitTransitionEnd", this.transitionend);
117
+ const e = t.clientX - this.startX;
118
+ if (e < 0) {
119
+ const s = this.translateX + e;
120
+ this.setTranslateX(s);
121
+ }
122
+ if (e > 0) {
123
+ const s = this.translateX + e;
124
+ this.setTranslateX(s);
125
+ }
126
+ window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp);
127
+ },
128
+ onMouseMove(t) {
129
+ this.mouseDown && requestAnimationFrame(() => {
130
+ const e = t.clientX - this.startX, s = this.translateXRaw + e;
131
+ this.setTranslateX(s);
132
+ });
133
+ },
134
+ transitionend() {
135
+ this.updateDuration(!1), this.$refs.swiperContent.removeEventListener("transitionend", this.transitionend), this.$refs.swiperContent.removeEventListener("webkitTransitionEnd", this.transitionend);
136
+ }
137
+ }
138
+ }, r = {};
139
+ var c = /* @__PURE__ */ o(
140
+ d,
141
+ h,
142
+ l,
143
+ !1,
144
+ u,
145
+ null,
146
+ null,
147
+ null
148
+ );
149
+ function u(t) {
150
+ for (let e in r)
151
+ this[e] = r[e];
152
+ }
153
+ const w = /* @__PURE__ */ function() {
154
+ return c.exports;
155
+ }();
156
+ export {
157
+ w as default
158
+ };