@web-utils/component 2.70.0 → 3.0.1

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 (189) hide show
  1. package/address-input/index.mjs +16 -14
  2. package/awesome-button/index.mjs +30 -29
  3. package/card/index.mjs +42 -40
  4. package/carousel/index.mjs +27 -25
  5. package/chat/index.mjs +70 -59
  6. package/chunk-file-uploader/index.mjs +594 -35
  7. package/chunk-file-uploader/style.css +1 -1
  8. package/chunks/CountUp.f1a19f35.mjs +124 -0
  9. package/chunks/CountUp.vue_vue_type_template_lang.1f68c96e.mjs +8 -0
  10. package/chunks/EasyPopup.vue_vue_type_style_index_0_lang.89350bda.mjs +32 -0
  11. package/chunks/EditableTree.vue_vue_type_style_index_0_lang.5dba9f89.mjs +356 -0
  12. package/chunks/ElementDialog.d8f3105c.mjs +211 -0
  13. package/chunks/ElementDialog.vue_vue_type_style_index_0_lang.57cb8e07.mjs +95 -0
  14. package/chunks/EmptyView.e2430422.mjs +51 -0
  15. package/chunks/EmptyView.vue_vue_type_style_index_0_lang.ffa84770.mjs +23 -0
  16. package/chunks/FlowNode.vue_vue_type_template_lang.662bdcfa.mjs +37 -0
  17. package/chunks/FormInput.vue_vue_type_template_lang.3cb79386.mjs +65 -0
  18. package/chunks/FormItem.2920ac0c.mjs +45 -0
  19. package/chunks/FormItem.vue_vue_type_style_index_0_lang.970bd712.mjs +258 -0
  20. package/chunks/FormItemGroup.41daddb6.mjs +64 -0
  21. package/chunks/FormItemGroup.vue_vue_type_style_index_0_lang.b588a8ea.mjs +155 -0
  22. package/chunks/FyCurd.8acd2983.mjs +548 -0
  23. package/chunks/FyCurd.vue_vue_type_style_index_0_lang.4fbd4b30.mjs +2945 -0
  24. package/chunks/FyDate.vue_vue_type_style_index_0_lang.429c03e3.mjs +47 -0
  25. package/chunks/FyDynamic.vue_vue_type_style_index_0_lang.304417ce.mjs +151 -0
  26. package/chunks/FyEmpty.vue_vue_type_style_index_0_lang.fc8bd24c.mjs +22 -0
  27. package/chunks/FyForm.0294e494.mjs +439 -0
  28. package/chunks/FyForm.vue_vue_type_style_index_0_lang.6e64daee.mjs +737 -0
  29. package/chunks/FyInput.vue_vue_type_template_lang.d2c56811.mjs +93 -0
  30. package/chunks/FyInputColor.vue_vue_type_template_lang.6eca0ddd.mjs +56 -0
  31. package/chunks/FyInputIcon.vue_vue_type_style_index_0_lang.11a6a221.mjs +158 -0
  32. package/chunks/FyRate.vue_vue_type_style_index_0_lang.82174185.mjs +39 -0
  33. package/chunks/FySelect.vue_vue_type_style_index_0_lang.5f0f3244.mjs +102 -0
  34. package/chunks/FyTabs.vue_vue_type_template_lang.66af5ac9.mjs +41 -0
  35. package/chunks/HighlightJS.vue_vue_type_style_index_0_lang.fefeaa3b.mjs +15 -0
  36. package/chunks/IconTemp.42c48e1f.mjs +32 -0
  37. package/chunks/IconTemp.vue_vue_type_style_index_0_lang.a0777b31.mjs +23 -0
  38. package/chunks/InputNumber.vue_vue_type_style_index_0_lang.18046bd3.mjs +172 -0
  39. package/chunks/LoadingView.vue_vue_type_style_index_0_lang.4c3fff2a.mjs +23 -0
  40. package/chunks/NavBar.vue_vue_type_style_index_0_lang.e21b57f3.mjs +21 -0
  41. package/chunks/Page.81f4b8d9.mjs +32 -0
  42. package/chunks/Page.vue_vue_type_style_index_0_lang.cb4f9bf2.mjs +13 -0
  43. package/chunks/PageHeader.vue_vue_type_style_index_0_lang.3bcca5aa.mjs +26 -0
  44. package/chunks/PageSkeleton.vue_vue_type_style_index_0_lang.8621381f.mjs +88 -0
  45. package/chunks/PageableTable.333cbdc1.mjs +335 -0
  46. package/chunks/PageableTable.vue_vue_type_style_index_0_lang.fd89fb43.mjs +148 -0
  47. package/chunks/ResizeObserver.60f728f0.mjs +54 -0
  48. package/chunks/ResizeObserver.vue_vue_type_style_index_0_lang.7079029c.mjs +13 -0
  49. package/chunks/TableColumn.8503272e.mjs +106 -0
  50. package/chunks/Toolbar.5c539dbb.mjs +24 -0
  51. package/chunks/Toolbar.vue_vue_type_style_index_0_lang.7594243c.mjs +275 -0
  52. package/chunks/ToolbarButton.vue_vue_type_style_index_0_lang.e2cb14ba.mjs +31 -0
  53. package/chunks/XInputTag.vue_vue_type_style_index_0_lang.7ad045b3.mjs +74 -0
  54. package/chunks/confirmable-mixin.26e1d0e0.mjs +197 -0
  55. package/chunks/{dataformat.f995e2f9.mjs → dataformat.816df805.mjs} +5 -5
  56. package/chunks/{dic.eaac0823.mjs → dic.3b4ba802.mjs} +40 -40
  57. package/chunks/{event.b5d855dd.mjs → event.4377230d.mjs} +2 -2
  58. package/chunks/{index.57f871af.mjs → index.d91bd77a.mjs} +7 -7
  59. package/chunks/{init.47f219b4.mjs → init.f0a03127.mjs} +2 -2
  60. package/chunks/{util.ae730cde.mjs → util.7844e2c2.mjs} +21 -21
  61. package/color-picker/index.mjs +200 -32
  62. package/confirm-button/index.mjs +1 -1
  63. package/confirmable/index.mjs +1 -1
  64. package/count-up/index.mjs +14 -17
  65. package/data-box/index.mjs +36 -33
  66. package/data-card/index.mjs +35 -33
  67. package/data-cardtext/index.mjs +29 -27
  68. package/data-display/index.mjs +37 -34
  69. package/data-icons/index.mjs +32 -29
  70. package/data-imgtext/index.mjs +30 -27
  71. package/data-operatext/index.mjs +41 -39
  72. package/data-panel/index.mjs +39 -36
  73. package/data-pay/index.mjs +26 -22
  74. package/data-price/index.mjs +34 -32
  75. package/data-progress/index.mjs +32 -28
  76. package/data-rotate/index.mjs +38 -35
  77. package/data-table-picker/index.mjs +25 -22
  78. package/data-tabs/index.mjs +35 -32
  79. package/dialog-form/index.mjs +41 -32
  80. package/dynamic-table/index.mjs +47 -42
  81. package/easy-popup/index.mjs +29 -56
  82. package/editable-progress/index.mjs +16 -14
  83. package/editable-tree/index.mjs +129 -476
  84. package/egd-collapse-item/index.mjs +1 -2
  85. package/element-dialog/index.mjs +37 -126
  86. package/empty-view/index.mjs +13 -31
  87. package/flex-column/index.mjs +1 -1
  88. package/flex-item/index.mjs +1 -1
  89. package/flex-row/index.mjs +1 -1
  90. package/flow/index.mjs +105 -40
  91. package/flow-designer/index.mjs +1190 -1114
  92. package/flow-node/index.mjs +15 -47
  93. package/flow-viewer/index.mjs +167 -78
  94. package/form-block/index.mjs +24 -22
  95. package/form-cascader/index.mjs +29 -29
  96. package/form-checkbox-group/index.mjs +76 -31
  97. package/form-date-picker/index.mjs +21 -20
  98. package/form-holder/index.mjs +16 -15
  99. package/form-input/index.mjs +30 -88
  100. package/form-input-email/index.mjs +28 -28
  101. package/form-input-id-card/index.mjs +37 -37
  102. package/form-input-number/index.mjs +219 -59
  103. package/form-input-phone-number/index.mjs +25 -25
  104. package/form-input-tag/index.mjs +160 -38
  105. package/form-input-time/index.mjs +23 -23
  106. package/form-item/index.mjs +15 -144
  107. package/form-item-group/index.mjs +15 -163
  108. package/form-radio-group/index.mjs +39 -38
  109. package/form-select/index.mjs +33 -32
  110. package/form-switch/index.mjs +26 -26
  111. package/form-textarea/index.mjs +26 -26
  112. package/form-view/index.mjs +46 -42
  113. package/fy-array/index.mjs +65 -61
  114. package/fy-cascader/index.mjs +14 -13
  115. package/fy-checkbox/index.mjs +37 -32
  116. package/fy-code/index.mjs +11 -14
  117. package/fy-curd/index.mjs +206 -2795
  118. package/fy-date/index.mjs +16 -57
  119. package/fy-draggable/index.mjs +21 -20
  120. package/fy-dynamic/index.mjs +64 -207
  121. package/fy-empty/index.mjs +12 -29
  122. package/fy-form/index.mjs +178 -732
  123. package/fy-form-design/index.mjs +1738 -1179
  124. package/fy-input/index.mjs +15 -101
  125. package/fy-input-color/index.mjs +17 -66
  126. package/fy-input-icon/index.mjs +21 -116
  127. package/fy-input-map/index.mjs +27 -24
  128. package/fy-input-number/index.mjs +23 -22
  129. package/fy-input-table/index.mjs +22 -18
  130. package/fy-input-tree/index.mjs +32 -28
  131. package/fy-progress/index.mjs +24 -23
  132. package/fy-radio/index.mjs +23 -18
  133. package/fy-rate/index.mjs +16 -49
  134. package/fy-select/index.mjs +29 -122
  135. package/fy-slider/index.mjs +18 -17
  136. package/fy-switch/index.mjs +21 -20
  137. package/fy-tabs/index.mjs +14 -48
  138. package/fy-time/index.mjs +20 -14
  139. package/fy-title/index.mjs +1 -1
  140. package/fy-tree/index.mjs +26 -20
  141. package/fy-u-editor/index.mjs +1 -1
  142. package/fy-upload/index.mjs +76 -74
  143. package/guide-steps/index.mjs +24 -22
  144. package/highlight-j-s/index.mjs +19 -29
  145. package/icon-temp/index.mjs +12 -30
  146. package/iframe-window/index.mjs +19 -18
  147. package/image-cropper/index.mjs +53 -51
  148. package/image-preview/index.mjs +27 -25
  149. package/input-number/index.mjs +63 -172
  150. package/input-number-range/index.mjs +24 -23
  151. package/license/index.mjs +1 -1
  152. package/loading-view/index.mjs +15 -33
  153. package/login/index.mjs +40 -35
  154. package/nav-bar/index.mjs +15 -30
  155. package/notice/index.mjs +19 -18
  156. package/package.json +1 -1
  157. package/page/index.mjs +12 -20
  158. package/page-header/index.mjs +13 -34
  159. package/page-index/index.mjs +34 -33
  160. package/page-index-top/index.mjs +100 -51
  161. package/page-skeleton/index.mjs +18 -35
  162. package/page-skeleton-new/index.mjs +16 -15
  163. package/pageable-table/index.mjs +85 -223
  164. package/pageable-view/index.mjs +34 -33
  165. package/present-view/index.mjs +75 -71
  166. package/record-video/index.mjs +1 -1
  167. package/resize-observer/index.mjs +21 -29
  168. package/search/index.mjs +29 -27
  169. package/search-popover/index.mjs +1 -1
  170. package/sign/index.mjs +1 -1
  171. package/split-pane/index.mjs +40 -45
  172. package/static-pageable-table/index.mjs +20 -18
  173. package/swiper/index.mjs +27 -25
  174. package/table-view/index.mjs +627 -89
  175. package/tag-render/index.mjs +21 -19
  176. package/text-ellipsis/index.mjs +13 -12
  177. package/tinymce-editor/index.mjs +73 -72
  178. package/toolbar/index.mjs +15 -208
  179. package/toolbar-button/index.mjs +32 -57
  180. package/verify/index.mjs +1 -1
  181. package/vue-cron/index.mjs +112 -104
  182. package/watermark/index.mjs +1 -1
  183. package/web-types.json +1 -1
  184. package/x-input-tag/index.mjs +51 -117
  185. package/chunks/FormTemp.7f91629d.mjs +0 -165
  186. package/chunks/confirmable-mixin.817b542f.mjs +0 -116
  187. package/chunks/form-input-mixin.4632ad36.mjs +0 -24
  188. package/chunks/form-item-mixin.ad148e7b.mjs +0 -140
  189. package/chunks/input-number-mixin.41a066be.mjs +0 -60
@@ -0,0 +1,172 @@
1
+ import i from "element-ui/lib/input";
2
+ const a = {
3
+ props: {
4
+ suffixIcon: {
5
+ type: String
6
+ },
7
+ prefixIcon: {
8
+ type: String
9
+ },
10
+ step: {
11
+ type: Number,
12
+ default: 1
13
+ },
14
+ stepStrictly: {
15
+ type: Boolean,
16
+ default: !1
17
+ },
18
+ max: {
19
+ type: Number,
20
+ default: 1 / 0
21
+ },
22
+ min: {
23
+ type: Number,
24
+ default: -1 / 0
25
+ },
26
+ value: {
27
+ type: [Number, String]
28
+ },
29
+ disabled: Boolean,
30
+ size: {
31
+ type: String
32
+ },
33
+ controls: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ controlsPosition: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ name: {
42
+ type: String
43
+ },
44
+ label: {
45
+ type: String
46
+ },
47
+ placeholder: {
48
+ type: String
49
+ },
50
+ precision: {
51
+ type: Number,
52
+ default: void 0,
53
+ validator(e) {
54
+ return e >= 0 && e === parseInt(e, 10);
55
+ }
56
+ }
57
+ }
58
+ };
59
+ var l = function() {
60
+ var e = this, t = e.$createElement, r = e._self._c || t;
61
+ return r("div", {
62
+ class: ["input-number", "el-input-number", e.inputNumberSize ? `el-input-number--${e.inputNumberSize}` : "", {
63
+ "is-disabled": e.inputNumberDisabled,
64
+ "is-without-controls": !e.controls,
65
+ "is-controls-right": e.controlsAtRight
66
+ }],
67
+ on: {
68
+ dragstart: function(n) {
69
+ n.preventDefault();
70
+ }
71
+ }
72
+ }, [e.controls ? r("span", {
73
+ directives: [{
74
+ name: "repeat-click",
75
+ rawName: "v-repeat-click",
76
+ value: e.decrease,
77
+ expression: "decrease"
78
+ }],
79
+ staticClass: "el-input-number__decrease",
80
+ class: {
81
+ "is-disabled": e.minDisabled
82
+ },
83
+ attrs: {
84
+ role: "button"
85
+ },
86
+ on: {
87
+ keydown: function(n) {
88
+ return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.decrease.apply(null, arguments);
89
+ }
90
+ }
91
+ }, [r("i", {
92
+ class: `el-icon-${e.controlsAtRight ? "arrow-down" : "minus"}`
93
+ })]) : e._e(), e.controls ? r("span", {
94
+ directives: [{
95
+ name: "repeat-click",
96
+ rawName: "v-repeat-click",
97
+ value: e.increase,
98
+ expression: "increase"
99
+ }],
100
+ staticClass: "el-input-number__increase",
101
+ class: {
102
+ "is-disabled": e.maxDisabled
103
+ },
104
+ attrs: {
105
+ role: "button"
106
+ },
107
+ on: {
108
+ keydown: function(n) {
109
+ return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.increase.apply(null, arguments);
110
+ }
111
+ }
112
+ }, [r("i", {
113
+ class: `el-icon-${e.controlsAtRight ? "arrow-up" : "plus"}`
114
+ })]) : e._e(), r(i, {
115
+ ref: "input",
116
+ attrs: {
117
+ value: e.displayValue,
118
+ placeholder: e.placeholder,
119
+ disabled: e.inputNumberDisabled,
120
+ size: e.inputNumberSize,
121
+ max: e.max,
122
+ "prefix-icon": e.prefixIcon,
123
+ "suffix-icon": e.suffixIcon,
124
+ min: e.min,
125
+ name: e.name,
126
+ label: e.label
127
+ },
128
+ on: {
129
+ blur: e.handleBlur,
130
+ focus: e.handleFocus,
131
+ input: e.handleInput,
132
+ change: e.handleInputChange
133
+ },
134
+ nativeOn: {
135
+ keydown: [function(n) {
136
+ return !n.type.indexOf("key") && e._k(n.keyCode, "up", 38, n.key, ["Up", "ArrowUp"]) ? null : (n.preventDefault(), e.increase.apply(null, arguments));
137
+ }, function(n) {
138
+ return !n.type.indexOf("key") && e._k(n.keyCode, "down", 40, n.key, ["Down", "ArrowDown"]) ? null : (n.preventDefault(), e.decrease.apply(null, arguments));
139
+ }]
140
+ },
141
+ scopedSlots: e._u([{
142
+ key: "append",
143
+ fn: function() {
144
+ return [e._t("append")];
145
+ },
146
+ proxy: !0
147
+ }, {
148
+ key: "prefix",
149
+ fn: function() {
150
+ return [e._t("prefix")];
151
+ },
152
+ proxy: !0
153
+ }, {
154
+ key: "prepend",
155
+ fn: function() {
156
+ return [e._t("prepend")];
157
+ },
158
+ proxy: !0
159
+ }, {
160
+ key: "suffix",
161
+ fn: function() {
162
+ return [e._t("suffix")];
163
+ },
164
+ proxy: !0
165
+ }], null, !0)
166
+ })], 1);
167
+ }, s = [];
168
+ export {
169
+ a as i,
170
+ l as r,
171
+ s
172
+ };
@@ -0,0 +1,23 @@
1
+ var n = function() {
2
+ var e = this, i = e.$createElement, t = e._self._c || i;
3
+ return t("div", {
4
+ staticClass: "loading-view",
5
+ style: {
6
+ fontSize: e.fontSize,
7
+ height: e.height
8
+ }
9
+ }, [e._t("default", function() {
10
+ return [t("div", {
11
+ staticClass: "flex-column horizon-center"
12
+ }, [t("i", {
13
+ staticClass: "el-icon-loading",
14
+ style: {
15
+ fontSize: e.iconSize
16
+ }
17
+ }), t("p", [e._v(e._s(e.loadingTips))])])];
18
+ })], 2);
19
+ }, s = [];
20
+ export {
21
+ n as r,
22
+ s
23
+ };
@@ -0,0 +1,21 @@
1
+ import a from "element-ui/lib/button";
2
+ var s = function() {
3
+ var t = this, r = t.$createElement, e = t._self._c || r;
4
+ return e("div", {
5
+ staticClass: "nav-bar"
6
+ }, [t.showBack ? e(a, {
7
+ attrs: {
8
+ type: "text",
9
+ icon: "el-icon-arrow-left"
10
+ },
11
+ on: {
12
+ click: t.goBack
13
+ }
14
+ }, [t._v(" 返回 ")]) : t._e(), t.$slots.right ? e("div", {
15
+ staticClass: "flex-item flex-row-column vertical-center"
16
+ }, [t._t("right")], 2) : t._e()], 1);
17
+ }, _ = [];
18
+ export {
19
+ s as r,
20
+ _ as s
21
+ };
@@ -0,0 +1,32 @@
1
+ import { s as e, r as t } from "./Page.vue_vue_type_style_index_0_lang.cb4f9bf2.mjs";
2
+ import { n as r } from "./vueComponentNormalizer.446f5dc4.mjs";
3
+ const s = {
4
+ name: "Page",
5
+ props: {
6
+ vertical: {
7
+ type: Boolean,
8
+ default: !0
9
+ },
10
+ horizontal: Boolean
11
+ }
12
+ }, o = {};
13
+ var l = /* @__PURE__ */ r(
14
+ s,
15
+ t,
16
+ e,
17
+ !1,
18
+ _,
19
+ null,
20
+ null,
21
+ null
22
+ );
23
+ function _(a) {
24
+ for (let n in o)
25
+ this[n] = o[n];
26
+ }
27
+ const u = /* @__PURE__ */ function() {
28
+ return l.exports;
29
+ }();
30
+ export {
31
+ u as _
32
+ };
@@ -0,0 +1,13 @@
1
+ var r = function() {
2
+ var e = this, a = e.$createElement, t = e._self._c || a;
3
+ return t("div", {
4
+ staticClass: "page flex-row flex-item",
5
+ class: {
6
+ vertical: e.vertical && !e.horizontal
7
+ }
8
+ }, [e._t("default")], 2);
9
+ }, s = [];
10
+ export {
11
+ r,
12
+ s
13
+ };
@@ -0,0 +1,26 @@
1
+ var i = function() {
2
+ var e = this, a = e.$createElement, t = e._self._c || a;
3
+ return t("div", {
4
+ staticClass: "egd-header flex-row egd-page-header"
5
+ }, [e._t("section-title", function() {
6
+ return [t("span", {
7
+ staticClass: "section-title"
8
+ }, [e._t("title", function() {
9
+ return [e._v(e._s(e.title))];
10
+ }, {
11
+ title: e.title
12
+ })], 2)];
13
+ }, {
14
+ title: e.title
15
+ }), t("div", {
16
+ staticClass: "flex-row flex-item vertical-center"
17
+ }, [t("div", {
18
+ class: ["flex-row", "flex-item", "vertical-center", {
19
+ "align-end": e.alignEnd
20
+ }]
21
+ }, [e._t("default")], 2)])], 2);
22
+ }, r = [];
23
+ export {
24
+ i as r,
25
+ r as s
26
+ };
@@ -0,0 +1,88 @@
1
+ import { s as l, r as a } from "./NavBar.vue_vue_type_style_index_0_lang.e21b57f3.mjs";
2
+ import { n as r } from "./vueComponentNormalizer.446f5dc4.mjs";
3
+ import { s as _, r as c } from "./PageHeader.vue_vue_type_style_index_0_lang.3bcca5aa.mjs";
4
+ import { _ as i } from "./Page.81f4b8d9.mjs";
5
+ const u = {
6
+ name: "PageHeader",
7
+ props: {
8
+ title: {
9
+ type: String,
10
+ default: "标题"
11
+ },
12
+ alignEnd: {
13
+ type: Boolean,
14
+ default: !0
15
+ }
16
+ }
17
+ }, o = {};
18
+ var p = /* @__PURE__ */ r(
19
+ u,
20
+ c,
21
+ _,
22
+ !1,
23
+ f,
24
+ null,
25
+ null,
26
+ null
27
+ );
28
+ function f(e) {
29
+ for (let t in o)
30
+ this[t] = o[t];
31
+ }
32
+ const m = /* @__PURE__ */ function() {
33
+ return p.exports;
34
+ }(), d = {
35
+ name: "NavBar",
36
+ props: {
37
+ onGoBack: Function,
38
+ showBack: {
39
+ type: Boolean,
40
+ default: !0
41
+ }
42
+ },
43
+ methods: {
44
+ goBack() {
45
+ this.onGoBack ? this.onGoBack() : this.$router.back();
46
+ }
47
+ }
48
+ }, s = {};
49
+ var v = /* @__PURE__ */ r(
50
+ d,
51
+ a,
52
+ l,
53
+ !1,
54
+ g,
55
+ null,
56
+ null,
57
+ null
58
+ );
59
+ function g(e) {
60
+ for (let t in s)
61
+ this[t] = s[t];
62
+ }
63
+ const h = /* @__PURE__ */ function() {
64
+ return v.exports;
65
+ }();
66
+ var y = function() {
67
+ var e = this, t = e.$createElement, n = e._self._c || t;
68
+ return n(i, {
69
+ staticClass: "page-skeleton"
70
+ }, [e.header ? e._t("header", function() {
71
+ return [e.title ? n(m, {
72
+ attrs: {
73
+ title: e.title
74
+ }
75
+ }) : n(h)];
76
+ }) : e._e(), n("div", {
77
+ class: ["page-content", {
78
+ "flex-column": e.flexColumn,
79
+ "flex-row": e.flexRow,
80
+ "content-scroll": e.contentScroll
81
+ }, e.contentClass]
82
+ }, [e._t("default")], 2)], 2);
83
+ }, S = [];
84
+ export {
85
+ m as _,
86
+ y as r,
87
+ S as s
88
+ };
@@ -0,0 +1,335 @@
1
+ var _ = Object.defineProperty, w = Object.defineProperties;
2
+ var B = Object.getOwnPropertyDescriptors;
3
+ var p = Object.getOwnPropertySymbols;
4
+ var f = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
5
+ var g = (e, t, s) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, u = (e, t) => {
6
+ for (var s in t || (t = {}))
7
+ f.call(t, s) && g(e, s, t[s]);
8
+ if (p)
9
+ for (var s of p(t))
10
+ m.call(t, s) && g(e, s, t[s]);
11
+ return e;
12
+ }, b = (e, t) => w(e, B(t));
13
+ var y = (e, t) => {
14
+ var s = {};
15
+ for (var i in e)
16
+ f.call(e, i) && t.indexOf(i) < 0 && (s[i] = e[i]);
17
+ if (e != null && p)
18
+ for (var i of p(e))
19
+ t.indexOf(i) < 0 && m.call(e, i) && (s[i] = e[i]);
20
+ return s;
21
+ };
22
+ var d = (e, t, s) => new Promise((i, l) => {
23
+ var c = (a) => {
24
+ try {
25
+ r(s.next(a));
26
+ } catch (n) {
27
+ l(n);
28
+ }
29
+ }, h = (a) => {
30
+ try {
31
+ r(s.throw(a));
32
+ } catch (n) {
33
+ l(n);
34
+ }
35
+ }, r = (a) => a.done ? i(a.value) : Promise.resolve(a.value).then(c, h);
36
+ r((s = s.apply(e, t)).next());
37
+ });
38
+ import { hasOwn as P } from "@web-utils/core";
39
+ import { cloneDeep as S, merge as v } from "@web-utils/integrations/lodash";
40
+ import { f as $, a as O, b as L } from "./index.d91bd77a.mjs";
41
+ import { s as x, r as A } from "./PageableTable.vue_vue_type_style_index_0_lang.fd89fb43.mjs";
42
+ import { n as C } from "./vueComponentNormalizer.446f5dc4.mjs";
43
+ const o = {
44
+ loading: 1,
45
+ error: -1,
46
+ empty: 2,
47
+ success: 0
48
+ }, M = {
49
+ name: "PageableTable",
50
+ bus: {
51
+ reloadTableView(e) {
52
+ e === this.viewId && this.getPage();
53
+ }
54
+ },
55
+ inheritAttrs: !1,
56
+ props: {
57
+ viewId: {
58
+ type: String
59
+ },
60
+ url: {
61
+ type: String
62
+ },
63
+ httpGet: Boolean,
64
+ hideOnSinglePage: Boolean,
65
+ api: {
66
+ type: Function
67
+ },
68
+ filters: {
69
+ type: Object
70
+ },
71
+ filter: {
72
+ type: Object
73
+ },
74
+ rules: {
75
+ type: Array,
76
+ default: () => []
77
+ },
78
+ model: {
79
+ type: Object
80
+ },
81
+ ascs: {
82
+ type: String,
83
+ default: ""
84
+ },
85
+ descs: {
86
+ type: String,
87
+ default: ""
88
+ },
89
+ headerBold: Boolean,
90
+ autoHeight: Boolean,
91
+ immediate: {
92
+ type: Boolean,
93
+ default: !0
94
+ },
95
+ index: {
96
+ type: Boolean,
97
+ default: !0
98
+ },
99
+ multiple: {
100
+ type: Boolean,
101
+ default: !0
102
+ },
103
+ selection: {
104
+ type: Boolean,
105
+ default: !0
106
+ },
107
+ border: {
108
+ type: Boolean,
109
+ default: !0
110
+ },
111
+ reloadOnModelChange: {
112
+ type: Boolean,
113
+ default: !1
114
+ },
115
+ columns: {
116
+ type: Array
117
+ },
118
+ pageSize: {
119
+ type: Number,
120
+ default: 25
121
+ }
122
+ },
123
+ data() {
124
+ let e = { rules: [] };
125
+ this.rules && this.rules.length > 0 && (e.rules = this.rules), this.filters && (e = this.filters), this.filter && (e = Object.assign({}, e, this.filter));
126
+ let t = {};
127
+ this.model && (t = S(this.model));
128
+ const s = this.pageSize;
129
+ return {
130
+ TABLE_STATUS: Object.freeze(o),
131
+ tableStatus: o.empty,
132
+ records: [],
133
+ currentRow: null,
134
+ page: {
135
+ total: 0,
136
+ page: 1,
137
+ limit: s,
138
+ ascs: this.ascs,
139
+ descs: this.descs,
140
+ model: t,
141
+ filters: e
142
+ }
143
+ };
144
+ },
145
+ computed: {
146
+ guard() {
147
+ return this.reloadOnModelChange ? {
148
+ asc: this.page.ascs,
149
+ desc: this.page.descs,
150
+ page: this.page.page,
151
+ model: this.page.model,
152
+ filters: this.page.filters
153
+ } : {
154
+ asc: this.page.ascs,
155
+ desc: this.page.descs,
156
+ page: this.page.page,
157
+ filters: this.page.filters
158
+ };
159
+ },
160
+ method() {
161
+ return this.httpGet ? this.httpGet : this.httpPost;
162
+ },
163
+ indexWidth() {
164
+ const e = `${(this.page.page - 1) * this.page.limit + this.records.length}`;
165
+ return e.length > 3 ? 50 + (e.length - 3) * 10 : 50;
166
+ },
167
+ mergeAttrs() {
168
+ return v({}, this.$attrs, { height: this.autoHeight ? null : "auto" });
169
+ },
170
+ headers() {
171
+ var e;
172
+ return ((e = this.columns) == null ? void 0 : e.map($)) || [];
173
+ }
174
+ },
175
+ watch: {
176
+ url: { handler: "reload" },
177
+ api: { handler: "reload" },
178
+ "$attrs.data"() {
179
+ this.getPage();
180
+ },
181
+ model: {
182
+ deep: !0,
183
+ handler(e) {
184
+ this.setModel(e);
185
+ }
186
+ }
187
+ },
188
+ created() {
189
+ this.$watch(() => this.guard, this.getPage, {
190
+ deep: !0,
191
+ immediate: this.immediate
192
+ });
193
+ },
194
+ mounted() {
195
+ this.$refs.table.bodyWrapper.addEventListener("scroll", this.onTableScroll);
196
+ },
197
+ beforeDestroy() {
198
+ this.$refs.table.bodyWrapper.removeEventListener("scroll", this.onTableScroll);
199
+ },
200
+ methods: {
201
+ rowDbClick(...e) {
202
+ var s;
203
+ const t = this.$refs.table.$children.find((i) => {
204
+ var l;
205
+ return ((l = i.$options) == null ? void 0 : l.name) === "ElTableBody";
206
+ });
207
+ t && ((s = t.$refs.tooltip) == null || s.hide()), this.$emit("row-dblclick", ...e);
208
+ },
209
+ updateTableScrollPosition() {
210
+ return d(this, null, function* () {
211
+ this.$refs.table.bodyWrapper && this.scrollTo(this.tableScrollTop, this.tableScrollLeft);
212
+ });
213
+ },
214
+ filterTableProperties: O,
215
+ filterTableEvents: L,
216
+ filterTableColumnProperties: $,
217
+ onTableScroll() {
218
+ this.tableScrollTop = this.$refs.table.bodyWrapper.scrollTop, this.tableScrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
219
+ },
220
+ onSortChange({ prop: e, order: t }) {
221
+ this.page.ascs = t === "ascending" ? e : "", this.page.descs = t === "descending" ? e : "";
222
+ },
223
+ onCurrentChange(e) {
224
+ this.currentRow = e;
225
+ },
226
+ /**
227
+ *
228
+ * @param {FilterRule} rule
229
+ */
230
+ addRule(e) {
231
+ this.removeRule(e.field), this.page.filters.rules.push(e);
232
+ },
233
+ addRules(e) {
234
+ e.forEach((t) => this.addRule(t));
235
+ },
236
+ setModelField(e, t) {
237
+ this.$set(this.page.model, e, t);
238
+ },
239
+ setModel(e) {
240
+ this.page.page = 1, this.page.model = S(e);
241
+ },
242
+ deleteModelField(e) {
243
+ delete this.page.model[e];
244
+ },
245
+ removeRule(e) {
246
+ const t = this.page.filters.rules, s = t.findIndex((i) => i.field === e);
247
+ s > -1 && t.splice(s, 1);
248
+ },
249
+ addFilter({ field: e, op: t, value: s }) {
250
+ this.page.filters = Object.assign({}, this.page.filters, {
251
+ rules: [
252
+ {
253
+ field: e,
254
+ op: t,
255
+ value: s
256
+ }
257
+ ],
258
+ op: "and"
259
+ });
260
+ },
261
+ clearFilters() {
262
+ this.page.filters = {};
263
+ },
264
+ clearSelection() {
265
+ this.$refs.table.clearSelection();
266
+ },
267
+ search() {
268
+ this.setModel(this.model), this.getPage();
269
+ },
270
+ getPage() {
271
+ return d(this, null, function* () {
272
+ var a;
273
+ if (P(this.$attrs, "data")) {
274
+ this.records = this.$attrs.data, this.page.page = 1, this.page.total = this.records.length, this.page.limit = this.page.total;
275
+ return;
276
+ }
277
+ this.records = [];
278
+ let e;
279
+ const r = this.page, { filters: t } = r, s = y(r, ["filters"]), i = u({}, s);
280
+ if ((a = t == null ? void 0 : t.rules) != null && a.length && (i.filters = { rules: t.rules }), this.api || this.url) {
281
+ this.tableStatus = o.loading;
282
+ try {
283
+ this.api && (e = yield this.api(i)), this.url && (e = yield this.method(this.url, i));
284
+ } catch (n) {
285
+ this.tableStatus = o.error, console.error(n);
286
+ return;
287
+ }
288
+ } else {
289
+ this.$notify.warning({
290
+ title: "开发提示!",
291
+ message: "PageableTable 请提供 url(String) 或 api(Function) 属性"
292
+ });
293
+ return;
294
+ }
295
+ const { data: l } = e || {}, { total: c, records: h } = l || {};
296
+ this.page.total = Number(c), this.records = h, !h || !h.length ? this.tableStatus = o.empty : this.tableStatus = o.success, this.$refs.table.doLayout(), this.$emit("page-loaded", l);
297
+ });
298
+ },
299
+ refresh() {
300
+ return d(this, null, function* () {
301
+ yield this.getPage();
302
+ });
303
+ },
304
+ reload() {
305
+ return d(this, null, function* () {
306
+ this.page = b(u({}, this.$options.data.call(this).page), {
307
+ total: this.page.total
308
+ });
309
+ });
310
+ },
311
+ scrollTo(e, t) {
312
+ e && (this.$refs.table.bodyWrapper.scrollTop = e), t && (this.$refs.table.bodyWrapper.scrollLeft = t);
313
+ }
314
+ }
315
+ }, T = {};
316
+ var R = /* @__PURE__ */ C(
317
+ M,
318
+ A,
319
+ x,
320
+ !1,
321
+ W,
322
+ null,
323
+ null,
324
+ null
325
+ );
326
+ function W(e) {
327
+ for (let t in T)
328
+ this[t] = T[t];
329
+ }
330
+ const I = /* @__PURE__ */ function() {
331
+ return R.exports;
332
+ }();
333
+ export {
334
+ I as _
335
+ };