bkui-vue 1.0.3-beta.7 → 1.0.3-beta.70

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 (230) hide show
  1. package/dist/index.cjs.js +148 -150
  2. package/dist/index.esm.js +17965 -16537
  3. package/dist/index.umd.js +148 -150
  4. package/dist/locale/en.esm.js +1 -1
  5. package/dist/locale/en.esm.js.map +1 -1
  6. package/dist/locale/en.umd.js +1 -1
  7. package/dist/locale/en.umd.js.map +1 -1
  8. package/dist/locale/zh-cn.esm.js +1 -1
  9. package/dist/locale/zh-cn.esm.js.map +1 -1
  10. package/dist/locale/zh-cn.umd.js +1 -1
  11. package/dist/locale/zh-cn.umd.js.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/style.variable.css +1 -1
  14. package/lib/affix/affix.variable.css +3 -0
  15. package/lib/alert/alert.variable.css +3 -0
  16. package/lib/backtop/backtop.variable.css +3 -0
  17. package/lib/badge/badge.variable.css +3 -0
  18. package/lib/breadcrumb/breadcrumb.variable.css +3 -0
  19. package/lib/button/button.variable.css +3 -0
  20. package/lib/card/card.variable.css +3 -0
  21. package/lib/cascader/cascader.variable.css +3 -0
  22. package/lib/checkbox/checkbox.variable.css +3 -0
  23. package/lib/checkbox/index.js +4 -4
  24. package/lib/code-diff/code-diff.variable.css +3 -0
  25. package/lib/collapse/collapse.variable.css +3 -0
  26. package/lib/collapse-transition/collapse-transition.variable.css +3 -0
  27. package/lib/color-picker/color-picker.variable.css +3 -0
  28. package/lib/components.d.ts +1 -0
  29. package/lib/components.js +2 -5
  30. package/lib/config-provider/config-provider.d.ts +3 -0
  31. package/lib/config-provider/config-provider.variable.css +3 -0
  32. package/lib/config-provider/index.d.ts +4 -0
  33. package/lib/config-provider/token.d.ts +1 -0
  34. package/lib/container/container.variable.css +3 -0
  35. package/lib/date-picker/base/month-table.d.ts +2 -2
  36. package/lib/date-picker/date-picker.d.ts +1 -0
  37. package/lib/date-picker/date-picker.variable.css +3 -0
  38. package/lib/date-picker/index.d.ts +3 -0
  39. package/lib/date-picker/index.js +70 -32
  40. package/lib/date-picker/interface.d.ts +1 -1
  41. package/lib/date-picker/time-picker.d.ts +1 -0
  42. package/lib/date-picker/utils.d.ts +4 -0
  43. package/lib/dialog/dialog.css +93 -122
  44. package/lib/dialog/dialog.d.ts +39 -14
  45. package/lib/dialog/dialog.less +92 -98
  46. package/lib/dialog/dialog.variable.css +96 -122
  47. package/lib/dialog/index.d.ts +81 -30
  48. package/lib/dialog/index.js +146 -124
  49. package/lib/dialog/props.d.ts +18 -6
  50. package/lib/directives/index.js +0 -1
  51. package/lib/dist.index.js +0 -1
  52. package/lib/divider/divider.variable.css +3 -0
  53. package/lib/dropdown/dropdown.css +3 -1
  54. package/lib/dropdown/dropdown.variable.css +6 -1
  55. package/lib/exception/exception.variable.css +3 -0
  56. package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
  57. package/lib/form/form.variable.css +3 -0
  58. package/lib/form/index.js +3 -1
  59. package/lib/hooks.js +1 -8
  60. package/lib/icon/image-fill.js +82 -167
  61. package/lib/icon/img-error.js +82 -167
  62. package/lib/icon/img-placehoulder.js +82 -167
  63. package/lib/icon/index.d.ts +1 -0
  64. package/lib/icon/index.js +87 -2427
  65. package/lib/icon/info-line.js +82 -167
  66. package/lib/icon/info.js +82 -167
  67. package/lib/icon/left-shape.js +82 -167
  68. package/lib/icon/left-turn-line.js +82 -167
  69. package/lib/icon/loading.js +82 -167
  70. package/lib/icon/narrow-line.js +82 -167
  71. package/lib/icon/original.js +82 -167
  72. package/lib/icon/pdf-fill.js +82 -167
  73. package/lib/icon/play-shape.js +82 -167
  74. package/lib/icon/plus.js +82 -167
  75. package/lib/icon/ppt-fill.js +82 -167
  76. package/lib/icon/qq.js +82 -167
  77. package/lib/icon/right-shape.js +82 -167
  78. package/lib/icon/right-turn-line.js +82 -167
  79. package/lib/icon/search.js +82 -167
  80. package/lib/icon/share.js +82 -167
  81. package/lib/icon/spinner.js +82 -167
  82. package/lib/icon/success.js +82 -167
  83. package/lib/icon/switcher-loading.js +82 -167
  84. package/lib/icon/text-all.d.ts +4 -0
  85. package/lib/icon/text-all.js +191 -0
  86. package/lib/icon/text-file.js +82 -167
  87. package/lib/icon/text-fill.js +82 -167
  88. package/lib/icon/transfer.js +82 -167
  89. package/lib/icon/tree-application-shape.js +82 -167
  90. package/lib/icon/unfull-screen.js +82 -167
  91. package/lib/icon/unvisible.js +82 -167
  92. package/lib/icon/up-shape.js +82 -167
  93. package/lib/icon/upload.js +82 -167
  94. package/lib/icon/video-fill.js +82 -167
  95. package/lib/icon/warn.js +82 -167
  96. package/lib/icon/weixin-pro.js +82 -167
  97. package/lib/icon/weixin.js +82 -167
  98. package/lib/image/image-viewer.variable.css +3 -0
  99. package/lib/image/image.variable.css +3 -0
  100. package/lib/image/index.js +5 -2
  101. package/lib/index.js +0 -1
  102. package/lib/info-box/index.js +41 -455
  103. package/lib/info-box/info-box.css +6 -32
  104. package/lib/info-box/info-box.d.ts +1 -1
  105. package/lib/info-box/info-box.less +16 -47
  106. package/lib/info-box/info-box.variable.css +9 -32
  107. package/lib/input/index.js +5 -0
  108. package/lib/input/input.variable.css +3 -0
  109. package/lib/link/link.variable.css +3 -0
  110. package/lib/loading/loading.variable.css +3 -0
  111. package/lib/locale/index.js +4 -2
  112. package/lib/locale/lang/en.d.ts +1 -0
  113. package/lib/menu/menu.variable.css +3 -0
  114. package/lib/menu/submenu.variable.css +3 -0
  115. package/lib/message/message.variable.css +3 -0
  116. package/lib/modal/hooks.d.ts +6 -0
  117. package/lib/modal/index.d.ts +100 -52
  118. package/lib/modal/index.js +173 -74
  119. package/lib/modal/modal.css +41 -65
  120. package/lib/modal/modal.d.ts +40 -17
  121. package/lib/modal/modal.less +50 -57
  122. package/lib/modal/modal.variable.css +44 -65
  123. package/lib/modal/props.mixin.d.ts +12 -0
  124. package/lib/navigation/navigation.variable.css +3 -0
  125. package/lib/notify/notify.variable.css +3 -0
  126. package/lib/pagination/index.js +2 -1
  127. package/lib/pagination/pagination.variable.css +3 -0
  128. package/lib/plugin-popover/index.d.ts +1 -1
  129. package/lib/plugin-popover/index.js +45 -26
  130. package/lib/pop-confirm/index.js +8 -5
  131. package/lib/pop-confirm/pop-confirm.variable.css +3 -0
  132. package/lib/popover/content.d.ts +1 -1
  133. package/lib/popover/index.js +45 -26
  134. package/lib/popover/plugin-popover.d.ts +4 -1
  135. package/lib/popover/popover.css +3 -1
  136. package/lib/popover/popover.less +4 -1
  137. package/lib/popover/popover.variable.css +6 -1
  138. package/lib/preset.d.ts +2 -0
  139. package/lib/preset.js +14 -20
  140. package/lib/process/process.variable.css +3 -0
  141. package/lib/progress/progress.variable.css +3 -0
  142. package/lib/radio/index.js +5 -5
  143. package/lib/radio/radio.variable.css +3 -0
  144. package/lib/rate/rate.variable.css +3 -0
  145. package/lib/rate/star.variable.css +3 -0
  146. package/lib/resize-layout/index.js +1 -1
  147. package/lib/resize-layout/resize-layout.variable.css +3 -0
  148. package/lib/search-select/index.d.ts +375 -16
  149. package/lib/search-select/index.js +701 -366
  150. package/lib/search-select/input.d.ts +14 -5
  151. package/lib/search-select/search-select.css +20 -6
  152. package/lib/search-select/search-select.d.ts +129 -7
  153. package/lib/search-select/search-select.less +16 -12
  154. package/lib/search-select/search-select.variable.css +23 -6
  155. package/lib/search-select/selected.d.ts +116 -6
  156. package/lib/search-select/utils.d.ts +19 -6
  157. package/lib/select/index.d.ts +143 -6
  158. package/lib/select/index.js +1355 -78
  159. package/lib/select/option.d.ts +3 -1
  160. package/lib/select/pinyin/core.d.ts +14 -0
  161. package/lib/select/pinyin/dict.d.ts +34 -0
  162. package/lib/select/pinyin/index.d.ts +2 -0
  163. package/lib/select/select.css +55 -12
  164. package/lib/select/select.d.ts +59 -2
  165. package/lib/select/select.less +69 -19
  166. package/lib/select/select.variable.css +58 -12
  167. package/lib/select/selectTagInput.d.ts +7 -0
  168. package/lib/select/type.d.ts +2 -3
  169. package/lib/shared/index.js +67 -3
  170. package/lib/shared/utils.d.ts +12 -0
  171. package/lib/shared/vue-types.d.ts +5 -0
  172. package/lib/sideslider/index.d.ts +55 -9
  173. package/lib/sideslider/index.js +26 -25
  174. package/lib/sideslider/sideslider.css +51 -46
  175. package/lib/sideslider/sideslider.d.ts +25 -3
  176. package/lib/sideslider/sideslider.less +108 -104
  177. package/lib/sideslider/sideslider.variable.css +54 -46
  178. package/lib/slider/slider.variable.css +3 -0
  179. package/lib/steps/steps.variable.css +3 -0
  180. package/lib/styles/mixins/animate.variable.css +3 -0
  181. package/lib/styles/mixins/popper.variable.css +3 -0
  182. package/lib/styles/mixins/scroll.variable.css +3 -0
  183. package/lib/styles/reset.css +1 -3
  184. package/lib/styles/reset.less +3 -6
  185. package/lib/styles/reset.variable.css +4 -3
  186. package/lib/styles/themes/themes.less +5 -0
  187. package/lib/swiper/swiper.variable.css +3 -0
  188. package/lib/switcher/switcher.variable.css +3 -0
  189. package/lib/tab/tab.variable.css +3 -0
  190. package/lib/table/cache.d.ts +11 -3
  191. package/lib/table/components/table-column.d.ts +111 -5
  192. package/lib/table/index.d.ts +51 -5
  193. package/lib/table/index.js +504 -261
  194. package/lib/table/plugins/head-filter.variable.css +3 -0
  195. package/lib/table/plugins/head-sort.variable.css +3 -0
  196. package/lib/table/plugins/settings.variable.css +3 -0
  197. package/lib/table/plugins/use-draggable.d.ts +2 -2
  198. package/lib/table/plugins/use-observer-resize.d.ts +5 -0
  199. package/lib/table/props.d.ts +6 -4
  200. package/lib/table/table.css +6 -12
  201. package/lib/table/table.less +12 -9
  202. package/lib/table/table.variable.css +9 -12
  203. package/lib/table/use-attributes.d.ts +4 -42
  204. package/lib/table/utils.d.ts +2 -2
  205. package/lib/table-column/index.d.ts +235 -119
  206. package/lib/table-column/index.js +217 -30
  207. package/lib/tag/tag.variable.css +3 -0
  208. package/lib/tag-input/index.d.ts +4 -4
  209. package/lib/tag-input/tag-input.d.ts +2 -2
  210. package/lib/tag-input/tag-input.variable.css +3 -0
  211. package/lib/tag-input/tag-props.d.ts +1 -1
  212. package/lib/tag-input/tag-render.d.ts +1 -1
  213. package/lib/time-picker/index.d.ts +38 -35
  214. package/lib/time-picker/time-picker.variable.css +3 -0
  215. package/lib/timeline/index.d.ts +80 -44
  216. package/lib/timeline/index.js +54 -65
  217. package/lib/timeline/timeline.d.ts +46 -29
  218. package/lib/timeline/timeline.variable.css +3 -0
  219. package/lib/transfer/transfer.variable.css +3 -0
  220. package/lib/tree/tree.variable.css +3 -0
  221. package/lib/upload/index.d.ts +12 -0
  222. package/lib/upload/index.js +21 -30
  223. package/lib/upload/props.d.ts +3 -0
  224. package/lib/upload/upload-trigger.d.ts +6 -0
  225. package/lib/upload/upload.d.ts +6 -0
  226. package/lib/upload/upload.variable.css +3 -0
  227. package/lib/virtual-render/index.d.ts +9 -9
  228. package/lib/virtual-render/virtual-render.d.ts +3 -3
  229. package/lib/virtual-render/virtual-render.variable.css +3 -0
  230. package/package.json +3 -2
@@ -8,10 +8,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_virtual_render_927587a8__ fro
8
8
  import "../virtual-render/virtual-render.less";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__ from "lodash/isElement";
10
10
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
11
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
12
- import "../loading/loading.less";
13
11
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
14
12
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__ from "lodash/get";
13
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
14
+ import "../loading/loading.less";
15
15
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../checkbox";
16
16
  import "../checkbox/checkbox.less";
17
17
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
@@ -122,7 +122,95 @@ function defineProperty_defineProperty(obj, key, value) {
122
122
  ;// CONCATENATED MODULE: external "vue"
123
123
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
124
124
  var external_vue_y = x => () => x
125
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
125
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
126
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
127
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
128
+ /* harmony default export */ const esm_browser_native = ({
129
+ randomUUID
130
+ });
131
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
132
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
133
+ // require the crypto API and do not support built-in fallback to lower quality random number
134
+ // generators (like Math.random()).
135
+ let getRandomValues;
136
+ const rnds8 = new Uint8Array(16);
137
+ function rng() {
138
+ // lazy load so that environments that need to polyfill have a chance to do so
139
+ if (!getRandomValues) {
140
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
141
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
142
+
143
+ if (!getRandomValues) {
144
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
145
+ }
146
+ }
147
+
148
+ return getRandomValues(rnds8);
149
+ }
150
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
151
+
152
+ /**
153
+ * Convert array of 16 byte values to UUID string format of the form:
154
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
155
+ */
156
+
157
+ const byteToHex = [];
158
+
159
+ for (let i = 0; i < 256; ++i) {
160
+ byteToHex.push((i + 0x100).toString(16).slice(1));
161
+ }
162
+
163
+ function unsafeStringify(arr, offset = 0) {
164
+ // Note: Be careful editing this code! It's been tuned for performance
165
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
166
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
167
+ }
168
+
169
+ function stringify(arr, offset = 0) {
170
+ const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
171
+ // of the following:
172
+ // - One or more input array values don't map to a hex octet (leading to
173
+ // "undefined" in the uuid)
174
+ // - Invalid input values for the RFC `version` or `variant` fields
175
+
176
+ if (!validate(uuid)) {
177
+ throw TypeError('Stringified UUID is invalid');
178
+ }
179
+
180
+ return uuid;
181
+ }
182
+
183
+ /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
184
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
185
+
186
+
187
+
188
+
189
+ function v4(options, buf, offset) {
190
+ if (esm_browser_native.randomUUID && !buf && !options) {
191
+ return esm_browser_native.randomUUID();
192
+ }
193
+
194
+ options = options || {};
195
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
196
+
197
+ rnds[6] = rnds[6] & 0x0f | 0x40;
198
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
199
+
200
+ if (buf) {
201
+ offset = offset || 0;
202
+
203
+ for (let i = 0; i < 16; ++i) {
204
+ buf[offset + i] = rnds[i];
205
+ }
206
+
207
+ return buf;
208
+ }
209
+
210
+ return unsafeStringify(rnds);
211
+ }
212
+
213
+ /* harmony default export */ const esm_browser_v4 = (v4);
126
214
  ;// CONCATENATED MODULE: ../../packages/table/src/const.ts
127
215
 
128
216
  /*
@@ -302,7 +390,7 @@ var ColumnTypeEnum;
302
390
  ColumnTypeEnum["SELECTION"] = "selection";
303
391
  ColumnTypeEnum["INDEX"] = "index";
304
392
  ColumnTypeEnum["EXPAND"] = "expand";
305
- ColumnTypeEnum["NONE"] = "none";
393
+ ColumnTypeEnum["NONE"] = "__COL_TYPE_NONE";
306
394
  })(ColumnTypeEnum || (ColumnTypeEnum = {}));
307
395
  var TableAlignEnum;
308
396
  (function (TableAlignEnum) {
@@ -640,6 +728,7 @@ var tableProps = {
640
728
  ;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
641
729
 
642
730
 
731
+
643
732
  /*
644
733
  * Tencent is pleased to support the open source community by making
645
734
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -669,6 +758,7 @@ var tableProps = {
669
758
 
670
759
 
671
760
 
761
+
672
762
  var TableColumnProp = {
673
763
  label: LabelFunctionStringType,
674
764
  field: LabelFunctionStringType,
@@ -687,7 +777,10 @@ var TableColumnProp = {
687
777
  align: TableAlign,
688
778
  className: RowClassFunctionStringType,
689
779
  prop: LabelFunctionStringType,
690
- index: shared_namespaceObject.PropTypes.number.def(undefined)
780
+ index: shared_namespaceObject.PropTypes.number.def(undefined),
781
+ uniqueId: shared_namespaceObject.PropTypes.object.def({
782
+ val: ''
783
+ })
691
784
  };
692
785
  /* harmony default export */ const table_column = ((0,external_vue_namespaceObject.defineComponent)({
693
786
  name: 'TableColumn',
@@ -704,18 +797,39 @@ var TableColumnProp = {
704
797
  var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
705
798
  field: props.prop || props.field
706
799
  }));
800
+ var isIndexPropChanged = (0,external_vue_namespaceObject.ref)(false);
801
+ var setIsIndexChanged = function setIsIndexChanged(val) {
802
+ isIndexPropChanged.value = val;
803
+ };
707
804
  return {
805
+ isIndexPropChanged: isIndexPropChanged,
806
+ setIsIndexChanged: setIsIndexChanged,
708
807
  initColumns: initColumns,
709
808
  bkTableCache: bkTableCache,
710
809
  column: column
711
810
  };
712
811
  },
812
+ watch: {
813
+ index: {
814
+ handler: function handler() {
815
+ this.setIsIndexChanged(!this.isIndexPropChanged);
816
+ },
817
+ deep: true
818
+ }
819
+ },
713
820
  unmounted: function unmounted() {
714
821
  this.updateColumnDefine(true);
715
822
  },
716
823
  mounted: function mounted() {
824
+ this.setNodeUid();
717
825
  this.updateColumnDefine();
718
826
  },
827
+ updated: function updated() {
828
+ if (this.isIndexPropChanged) {
829
+ this.updateColumnDefineByParent();
830
+ this.setIsIndexChanged(!this.isIndexPropChanged);
831
+ }
832
+ },
719
833
  methods: {
720
834
  updateColumnDefine: function updateColumnDefine() {
721
835
  var unmounted = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
@@ -733,43 +847,113 @@ var TableColumnProp = {
733
847
  return Object.assign(result, defineProperty_defineProperty({}, target, props[key]));
734
848
  }, {});
735
849
  },
850
+ rsolveIndexedColumn: function rsolveIndexedColumn() {
851
+ // 如果是设置了Index,则先添加Index列,不做自动递归读取Column
852
+ if (/\d+\.?\d*/.test("".concat(this.$props.index))) {
853
+ var _props$render;
854
+ var props = this.$.vnode.props;
855
+ var resolveProp = Object.assign({}, this.copyProps(props), {
856
+ field: props.prop || props.field,
857
+ render: (_props$render = props.render) !== null && _props$render !== void 0 ? _props$render : this.$slots["default"],
858
+ uniqueId: this.getNodeCtxUid(this.$.ctx)
859
+ });
860
+ this.initColumns(resolveProp);
861
+ return false;
862
+ }
863
+ return true;
864
+ },
865
+ setNodeUid: function setNodeUid() {
866
+ var ctx = this.$.ctx;
867
+ if (!ctx) {
868
+ return;
869
+ }
870
+ if (ctx.uniqueId && !ctx.uniqueId.val) {
871
+ ctx.uniqueId.val = esm_browser_v4();
872
+ }
873
+ if (!ctx.uniqueId) {
874
+ Object.assign(ctx, {
875
+ uniqueId: {
876
+ val: esm_browser_v4()
877
+ }
878
+ });
879
+ }
880
+ },
881
+ getNodeCtxUid: function getNodeCtxUid(ctx) {
882
+ var _ctx$uniqueId;
883
+ return ctx === null || ctx === void 0 || (_ctx$uniqueId = ctx.uniqueId) === null || _ctx$uniqueId === void 0 ? void 0 : _ctx$uniqueId.val;
884
+ },
736
885
  updateColumnDefineByParent: function updateColumnDefineByParent() {
737
886
  var _this = this;
887
+ if (!this.rsolveIndexedColumn()) {
888
+ return;
889
+ }
738
890
  var fn = function fn() {
739
891
  // @ts-ignore
740
- var selfVnode = _this._;
741
- var colList = selfVnode.parent.vnode.children["default"]() || [];
892
+ var selfVnode = _this.$;
893
+ var getTableNode = function getTableNode(root) {
894
+ var _parentVnode$type;
895
+ if (root === document.body || !root) {
896
+ return null;
897
+ }
898
+ var parentVnode = root.parent;
899
+ if (((_parentVnode$type = parentVnode.type) === null || _parentVnode$type === void 0 ? void 0 : _parentVnode$type.name) === 'Table') {
900
+ return parentVnode.vnode;
901
+ }
902
+ return getTableNode(parentVnode);
903
+ };
904
+ var getNodeUid = function getNodeUid(node) {
905
+ return _this.getNodeCtxUid(node.ctx);
906
+ };
907
+ var tableNode = getTableNode(selfVnode);
908
+ if (!tableNode) {
909
+ return;
910
+ }
742
911
  var sortColumns = [];
743
912
  var index = 0;
913
+ var resolveChildNode = function resolveChildNode(node) {
914
+ var _node$type;
915
+ if (!node) {
916
+ return null;
917
+ }
918
+ if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
919
+ var _node$props$render, _node$children;
920
+ var resolveProp = Object.assign({
921
+ index: index
922
+ }, _this.copyProps(node.props), {
923
+ field: node.props.prop || node.props.field,
924
+ render: (_node$props$render = node.props.render) !== null && _node$props$render !== void 0 ? _node$props$render : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"],
925
+ uniqueId: getNodeUid(node)
926
+ });
927
+ sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
928
+ index = index + 1;
929
+ return null;
930
+ }
931
+ if (Array.isArray(node === null || node === void 0 ? void 0 : node.children)) {
932
+ return node.children;
933
+ }
934
+ if ((0,external_vue_namespaceObject.isVNode)(node) && node !== null && node !== void 0 && node.children && typeof_typeof(node === null || node === void 0 ? void 0 : node.children) === 'object') {
935
+ return Object.keys(node.children).map(function (key) {
936
+ return node.children[key];
937
+ });
938
+ }
939
+ if (typeof node === 'function') {
940
+ return node();
941
+ }
942
+ return null;
943
+ };
744
944
  var reduceColumns = function reduceColumns(nodes) {
745
945
  if (!Array.isArray(nodes)) {
946
+ var children = resolveChildNode(nodes);
947
+ if (children) {
948
+ reduceColumns(children);
949
+ }
746
950
  return;
747
951
  }
748
- nodes.forEach(function (node) {
749
- var _node$type, _node$children2;
750
- if (Array.isArray(node)) {
751
- reduceColumns(node);
752
- return;
753
- }
754
- var skipValidateKey0 = true;
755
- if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
756
- var _node$children;
757
- skipValidateKey0 = Object.hasOwnProperty.call(node.props || {}, 'key');
758
- var resolveProp = Object.assign({
759
- index: index
760
- }, _this.copyProps(node.props), {
761
- field: node.props.prop || node.props.field,
762
- render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
763
- });
764
- sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
765
- index = index + 1;
766
- }
767
- if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0) {
768
- reduceColumns(node.children);
769
- }
952
+ nodes === null || nodes === void 0 || nodes.forEach(function (node) {
953
+ return reduceColumns(node);
770
954
  });
771
955
  };
772
- reduceColumns(colList);
956
+ reduceColumns(tableNode);
773
957
  _this.initColumns(sortColumns);
774
958
  };
775
959
  if (typeof this.bkTableCache.queueStack === 'function') {
@@ -777,9 +961,12 @@ var TableColumnProp = {
777
961
  }
778
962
  },
779
963
  unmountColumn: function unmountColumn() {
964
+ var _props$render2;
965
+ var props = this.$.vnode.props;
780
966
  var resolveProp = Object.assign({}, this.copyProps(this.$props), {
781
- field: this.$props.prop || this.$props.field,
782
- render: this.$slots["default"]
967
+ field: props.prop || props.field,
968
+ render: (_props$render2 = props.render) !== null && _props$render2 !== void 0 ? _props$render2 : this.$slots["default"],
969
+ uniqueId: this.getNodeCtxUid(this.$.ctx)
783
970
  });
784
971
  this.initColumns(resolveProp, true);
785
972
  }
@@ -861,21 +1048,41 @@ var BkTableCache = /*#__PURE__*/function () {
861
1048
  function BkTableCache() {
862
1049
  _classCallCheck(this, BkTableCache);
863
1050
  defineProperty_defineProperty(this, "storage", undefined);
864
- this.storage = {};
1051
+ defineProperty_defineProperty(this, "defKey", Symbol('bk-table-cache-def-key'));
1052
+ this.storage = new WeakMap();
865
1053
  }
866
1054
  _createClass(BkTableCache, [{
867
1055
  key: "queueStack",
868
1056
  value: function queueStack(methodName) {
1057
+ var _target$methodName;
869
1058
  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
870
- this.storage[methodName] && clearTimeout(this.storage[methodName]);
871
- this.storage[methodName] = setTimeout(function () {
872
- return fn();
873
- });
1059
+ var key = arguments.length > 2 ? arguments[2] : undefined;
1060
+ var stackKey = key !== null && key !== void 0 ? key : this.defKey;
1061
+ if (!this.storage.has(stackKey)) {
1062
+ this.storage.set(stackKey, {});
1063
+ }
1064
+ var target = this.storage.get(stackKey);
1065
+ if ((_target$methodName = target[methodName]) !== null && _target$methodName !== void 0 && _target$methodName.timerId) {
1066
+ var _target$methodName2;
1067
+ clearTimeout((_target$methodName2 = target[methodName]) === null || _target$methodName2 === void 0 ? void 0 : _target$methodName2.timerId);
1068
+ }
1069
+ Object.assign(target, defineProperty_defineProperty({}, methodName, {
1070
+ timerId: setTimeout(fn),
1071
+ fn: fn
1072
+ }));
874
1073
  }
875
1074
  }, {
876
1075
  key: "clearQueueStack",
877
- value: function clearQueueStack(methodName) {
878
- this.storage[methodName] && clearTimeout(this.storage[methodName]);
1076
+ value: function clearQueueStack(methodName, key) {
1077
+ var stackKey = key !== null && key !== void 0 ? key : this.defKey;
1078
+ if (this.storage.has(stackKey)) {
1079
+ var _target$methodName3;
1080
+ var target = this.storage.get(stackKey);
1081
+ if ((_target$methodName3 = target[methodName]) !== null && _target$methodName3 !== void 0 && _target$methodName3.timerId) {
1082
+ var _target$methodName4;
1083
+ clearTimeout((_target$methodName4 = target[methodName]) === null || _target$methodName4 === void 0 ? void 0 : _target$methodName4.timerId);
1084
+ }
1085
+ }
879
1086
  }
880
1087
  }]);
881
1088
  return BkTableCache;
@@ -1439,176 +1646,6 @@ function _toConsumableArray(arr) {
1439
1646
  updateFixClass: updateFixClass
1440
1647
  };
1441
1648
  });
1442
- ;// CONCATENATED MODULE: external "../loading"
1443
- var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1444
- var loading_y = x => () => x
1445
- const loading_namespaceObject = loading_x({ ["BkLoadingMode"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingMode, ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"] });
1446
- ;// CONCATENATED MODULE: external "../loading/loading.less"
1447
- var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1448
- var loading_less_y = x => () => x
1449
- const loading_less_namespaceObject = loading_less_x({ });
1450
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
1451
-
1452
-
1453
- /*
1454
- * Tencent is pleased to support the open source community by making
1455
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1456
- *
1457
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1458
- *
1459
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1460
- *
1461
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1462
- *
1463
- * ---------------------------------------------------
1464
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1465
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1466
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1467
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1468
- *
1469
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1470
- * the Software.
1471
- *
1472
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1473
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1474
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1475
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1476
- * IN THE SOFTWARE.
1477
- */
1478
-
1479
-
1480
-
1481
-
1482
- /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
1483
- var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
1484
- var getLoadingOption = function getLoadingOption() {
1485
- if (typeof refScrollLoading.value === 'boolean') {
1486
- return {
1487
- loading: !!refScrollLoading.value,
1488
- inline: true,
1489
- title: '',
1490
- size: loading_namespaceObject.BkLoadingSize.Normal,
1491
- mode: loading_namespaceObject.BkLoadingMode.Default,
1492
- indicator: null
1493
- };
1494
- }
1495
- return refScrollLoading.value;
1496
- };
1497
- var isRender = (0,external_vue_namespaceObject.computed)(function () {
1498
- return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
1499
- });
1500
- var renderScrollLoading = function renderScrollLoading() {
1501
- if (isRender.value) {
1502
- var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
1503
- var _getLoadingOption = getLoadingOption(),
1504
- loading = _getLoadingOption.loading,
1505
- size = _getLoadingOption.size,
1506
- mode = _getLoadingOption.mode,
1507
- title = _getLoadingOption.title,
1508
- inline = _getLoadingOption.inline,
1509
- indicator = _getLoadingOption.indicator;
1510
- return (_ctx$slots$fixedBotto = (_ctx$slots$fixedBotto2 = (_ctx$slots = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto2 === void 0 ? void 0 : _ctx$slots$fixedBotto2.call(_ctx$slots)) !== null && _ctx$slots$fixedBotto !== void 0 ? _ctx$slots$fixedBotto : (0,external_vue_namespaceObject.createVNode)(loading_namespaceObject["default"], {
1511
- loading: loading,
1512
- size: size,
1513
- mode: mode,
1514
- title: title,
1515
- inline: inline,
1516
- indicator: indicator
1517
- }, null);
1518
- }
1519
- };
1520
- return {
1521
- renderScrollLoading: renderScrollLoading
1522
- };
1523
- });
1524
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
1525
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1526
- /* harmony default export */ const esm_browser_native = ({
1527
- randomUUID
1528
- });
1529
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
1530
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1531
- // require the crypto API and do not support built-in fallback to lower quality random number
1532
- // generators (like Math.random()).
1533
- let getRandomValues;
1534
- const rnds8 = new Uint8Array(16);
1535
- function rng() {
1536
- // lazy load so that environments that need to polyfill have a chance to do so
1537
- if (!getRandomValues) {
1538
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1539
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1540
-
1541
- if (!getRandomValues) {
1542
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1543
- }
1544
- }
1545
-
1546
- return getRandomValues(rnds8);
1547
- }
1548
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
1549
-
1550
- /**
1551
- * Convert array of 16 byte values to UUID string format of the form:
1552
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1553
- */
1554
-
1555
- const byteToHex = [];
1556
-
1557
- for (let i = 0; i < 256; ++i) {
1558
- byteToHex.push((i + 0x100).toString(16).slice(1));
1559
- }
1560
-
1561
- function unsafeStringify(arr, offset = 0) {
1562
- // Note: Be careful editing this code! It's been tuned for performance
1563
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1564
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
1565
- }
1566
-
1567
- function stringify(arr, offset = 0) {
1568
- const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
1569
- // of the following:
1570
- // - One or more input array values don't map to a hex octet (leading to
1571
- // "undefined" in the uuid)
1572
- // - Invalid input values for the RFC `version` or `variant` fields
1573
-
1574
- if (!validate(uuid)) {
1575
- throw TypeError('Stringified UUID is invalid');
1576
- }
1577
-
1578
- return uuid;
1579
- }
1580
-
1581
- /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
1582
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
1583
-
1584
-
1585
-
1586
-
1587
- function v4(options, buf, offset) {
1588
- if (esm_browser_native.randomUUID && !buf && !options) {
1589
- return esm_browser_native.randomUUID();
1590
- }
1591
-
1592
- options = options || {};
1593
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1594
-
1595
- rnds[6] = rnds[6] & 0x0f | 0x40;
1596
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1597
-
1598
- if (buf) {
1599
- offset = offset || 0;
1600
-
1601
- for (let i = 0; i < 16; ++i) {
1602
- buf[offset + i] = rnds[i];
1603
- }
1604
-
1605
- return buf;
1606
- }
1607
-
1608
- return unsafeStringify(rnds);
1609
- }
1610
-
1611
- /* harmony default export */ const esm_browser_v4 = (v4);
1612
1649
  ;// CONCATENATED MODULE: external "lodash/debounce"
1613
1650
  var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1614
1651
  var debounce_y = x => () => x
@@ -2847,7 +2884,7 @@ var getRowKeyNull = function getRowKeyNull(item, props, index) {
2847
2884
  if (props.rowKey === TABLE_ROW_ATTRIBUTE.ROW_INDEX) {
2848
2885
  return "__ROW_INDEX_".concat(index);
2849
2886
  }
2850
- return (0,get_namespaceObject["default"])(item, props.rowKey);
2887
+ return props.rowKey;
2851
2888
  }
2852
2889
  if (typeof props.rowKey === 'function') {
2853
2890
  return Reflect.apply(props.rowKey, _this, [item]);
@@ -2941,7 +2978,7 @@ var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
2941
2978
  for (var i = colIndex; i > 0; i--) {
2942
2979
  var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
2943
2980
  if (colspan > 1) {
2944
- skip = colspan - 1 + i >= colIndex;
2981
+ skip = colspan - 1;
2945
2982
  break;
2946
2983
  }
2947
2984
  }
@@ -3021,7 +3058,7 @@ var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
3021
3058
  var getRowId = function getRowId(row, defVal, props) {
3022
3059
  var key = getRowKey(row, props, defVal);
3023
3060
  if (key !== undefined && row[key] !== undefined) {
3024
- return row[key];
3061
+ return (0,get_namespaceObject["default"])(row, key);
3025
3062
  }
3026
3063
  return defVal;
3027
3064
  };
@@ -3044,6 +3081,147 @@ var getRawData = function getRawData(data) {
3044
3081
  }
3045
3082
  return data;
3046
3083
  };
3084
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-observer-resize.tsx
3085
+
3086
+ /*
3087
+ * Tencent is pleased to support the open source community by making
3088
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3089
+ *
3090
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3091
+ *
3092
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3093
+ *
3094
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3095
+ *
3096
+ * ---------------------------------------------------
3097
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3098
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3099
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3100
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3101
+ *
3102
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3103
+ * the Software.
3104
+ *
3105
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3106
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3107
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3108
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3109
+ * IN THE SOFTWARE.
3110
+ */
3111
+
3112
+
3113
+
3114
+ /* harmony default export */ const use_observer_resize = (function (target, fn) {
3115
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3116
+ var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3117
+ var instance = null;
3118
+ var dispose = function dispose() {
3119
+ if (instance) {
3120
+ instance.disconnect();
3121
+ instance = null;
3122
+ }
3123
+ };
3124
+ (0,external_vue_namespaceObject.watch)(target, function () {
3125
+ if (!(0,shared_namespaceObject.isElement)(target.value)) {
3126
+ return;
3127
+ }
3128
+ dispose();
3129
+ instance = observerResize(target.value, function () {
3130
+ fn === null || fn === void 0 || fn.apply.apply(fn, _toConsumableArray(args));
3131
+ }, 60, true, 'debounce');
3132
+ if (immediate) {
3133
+ instance.start();
3134
+ }
3135
+ }, {
3136
+ flush: 'post',
3137
+ immediate: true
3138
+ });
3139
+ return {
3140
+ instance: instance
3141
+ };
3142
+ });
3143
+ ;// CONCATENATED MODULE: external "../loading"
3144
+ var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3145
+ var loading_y = x => () => x
3146
+ const loading_namespaceObject = loading_x({ ["BkLoadingMode"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingMode, ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"] });
3147
+ ;// CONCATENATED MODULE: external "../loading/loading.less"
3148
+ var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3149
+ var loading_less_y = x => () => x
3150
+ const loading_less_namespaceObject = loading_less_x({ });
3151
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
3152
+
3153
+
3154
+ /*
3155
+ * Tencent is pleased to support the open source community by making
3156
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3157
+ *
3158
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3159
+ *
3160
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3161
+ *
3162
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3163
+ *
3164
+ * ---------------------------------------------------
3165
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3166
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3167
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3168
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3169
+ *
3170
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3171
+ * the Software.
3172
+ *
3173
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3174
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3175
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3176
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3177
+ * IN THE SOFTWARE.
3178
+ */
3179
+
3180
+
3181
+
3182
+
3183
+ /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
3184
+ var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
3185
+ var getLoadingOption = function getLoadingOption() {
3186
+ if (typeof refScrollLoading.value === 'boolean') {
3187
+ return {
3188
+ loading: !!refScrollLoading.value,
3189
+ inline: true,
3190
+ title: '',
3191
+ size: loading_namespaceObject.BkLoadingSize.Normal,
3192
+ mode: loading_namespaceObject.BkLoadingMode.Default,
3193
+ indicator: null
3194
+ };
3195
+ }
3196
+ return refScrollLoading.value;
3197
+ };
3198
+ var isRender = (0,external_vue_namespaceObject.computed)(function () {
3199
+ return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
3200
+ });
3201
+ var renderScrollLoading = function renderScrollLoading() {
3202
+ if (isRender.value) {
3203
+ var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
3204
+ var _getLoadingOption = getLoadingOption(),
3205
+ loading = _getLoadingOption.loading,
3206
+ size = _getLoadingOption.size,
3207
+ mode = _getLoadingOption.mode,
3208
+ title = _getLoadingOption.title,
3209
+ inline = _getLoadingOption.inline,
3210
+ indicator = _getLoadingOption.indicator;
3211
+ return (_ctx$slots$fixedBotto = (_ctx$slots$fixedBotto2 = (_ctx$slots = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto2 === void 0 ? void 0 : _ctx$slots$fixedBotto2.call(_ctx$slots)) !== null && _ctx$slots$fixedBotto !== void 0 ? _ctx$slots$fixedBotto : (0,external_vue_namespaceObject.createVNode)(loading_namespaceObject["default"], {
3212
+ loading: loading,
3213
+ size: size,
3214
+ mode: mode,
3215
+ title: title,
3216
+ inline: inline,
3217
+ indicator: indicator
3218
+ }, null);
3219
+ }
3220
+ };
3221
+ return {
3222
+ renderScrollLoading: renderScrollLoading
3223
+ };
3224
+ });
3047
3225
  ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
3048
3226
 
3049
3227
 
@@ -3271,7 +3449,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3271
3449
 
3272
3450
 
3273
3451
 
3274
- /* harmony default export */ const use_attributes = (function (props) {
3452
+ var tableSchemaResponse = function tableSchemaResponse(props) {
3275
3453
  var t = (0,config_provider_namespaceObject.useLocale)('table');
3276
3454
  var getDefaultSettings = function getDefaultSettings() {
3277
3455
  var _ref, _SETTING_SIZE$size;
@@ -3936,7 +4114,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3936
4114
  formatData: formatData,
3937
4115
  setIndexData: setIndexData
3938
4116
  };
3939
- });
4117
+ };
4118
+ /* harmony default export */ const use_attributes = (tableSchemaResponse);
3940
4119
  ;// CONCATENATED MODULE: ../../packages/table/src/use-column.ts
3941
4120
 
3942
4121
  /*
@@ -3975,6 +4154,11 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3975
4154
  /* harmony default export */ const use_column = (function (props, targetColumns) {
3976
4155
  var _props$columns;
3977
4156
  var resolvedColumns = (0,external_vue_namespaceObject.reactive)((_props$columns = props.columns) !== null && _props$columns !== void 0 ? _props$columns : []);
4157
+ /**
4158
+ * 初始化Column配置
4159
+ * @param column 传入
4160
+ * @param remove 是否移除当前列
4161
+ */
3978
4162
  var initColumns = function initColumns(column) {
3979
4163
  var remove = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3980
4164
  var resolveColumns = [];
@@ -3986,7 +4170,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3986
4170
  if (!remove) {
3987
4171
  resolveColumns.forEach(function (col) {
3988
4172
  var index = targetColumns.findIndex(function (tc) {
3989
- return tc.label === col.label && tc.field === col.field;
4173
+ return tc.label === col.label && tc.field === col.field && tc.uniqueId === col.uniqueId;
3990
4174
  });
3991
4175
  if (index >= 0) {
3992
4176
  Object.assign(targetColumns[index], col);
@@ -4000,7 +4184,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
4000
4184
  } else {
4001
4185
  resolveColumns.forEach(function (col) {
4002
4186
  var matchColIndex = targetColumns.findIndex(function (c) {
4003
- return c.label === col.label && c.field === col.field;
4187
+ return c.label === col.label && c.field === col.field && c.uniqueId === col.uniqueId;
4004
4188
  });
4005
4189
  if (matchColIndex >= 0) {
4006
4190
  targetColumns.splice(matchColIndex, 1);
@@ -4420,14 +4604,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4420
4604
  });
4421
4605
  var resolveSetting = function resolveSetting() {
4422
4606
  if (/boolean|object/.test(typeof_typeof(props.column.showOverflowTooltip)) && props.column.showOverflowTooltip !== null) {
4607
+ var _props$column$showOve = props.column.showOverflowTooltip,
4608
+ _props$column$showOve2 = _props$column$showOve.content,
4609
+ content = _props$column$showOve2 === void 0 ? '' : _props$column$showOve2,
4610
+ _props$column$showOve3 = _props$column$showOve.mode,
4611
+ mode = _props$column$showOve3 === void 0 ? undefined : _props$column$showOve3,
4612
+ _props$column$showOve4 = _props$column$showOve.popoverOption,
4613
+ popoverOption = _props$column$showOve4 === void 0 ? {} : _props$column$showOve4;
4423
4614
  var result = {
4424
4615
  showOverflowTooltip: {
4425
- content: '',
4616
+ content: content,
4426
4617
  disabled: !props.column.showOverflowTooltip,
4427
- mode: undefined,
4618
+ mode: mode,
4428
4619
  resizerWay: undefined,
4429
4620
  watchCellResize: undefined,
4430
- popoverOption: {}
4621
+ popoverOption: popoverOption
4431
4622
  }
4432
4623
  };
4433
4624
  if (props.parentSetting !== null && typeof_typeof(props.parentSetting) === 'object') {
@@ -4445,15 +4636,17 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4445
4636
  showOverflowTooltip: props.parentSetting
4446
4637
  };
4447
4638
  };
4448
- var _resolveSetting = resolveSetting(),
4449
- _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4450
- showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4451
4639
  var bkEllipsisIns = null;
4452
4640
  var resolveTooltipOption = function resolveTooltipOption() {
4641
+ var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
4642
+ var _resolveSetting = resolveSetting(),
4643
+ _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4644
+ showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4453
4645
  var disabled = true;
4454
4646
  var resizerWay = props.resizerWay;
4647
+ var defaultContent = (_getEllipsisTarget$cl = (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 || (_getEllipsisTarget$cl2 = _getEllipsisTarget.cloneNode) === null || _getEllipsisTarget$cl2 === void 0 ? void 0 : _getEllipsisTarget$cl2.call(_getEllipsisTarget, true)) !== null && _getEllipsisTarget$cl !== void 0 ? _getEllipsisTarget$cl : '';
4455
4648
  var content = function content() {
4456
- return refRoot.value.innerText;
4649
+ return defaultContent;
4457
4650
  };
4458
4651
  var popoverOption = {};
4459
4652
  var mode = 'auto';
@@ -4466,7 +4659,7 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4466
4659
  popoverOption = showOverflowTooltip.popoverOption;
4467
4660
  resizerWay = showOverflowTooltip.resizerWay || 'debounce';
4468
4661
  content = function content() {
4469
- return showOverflowTooltip.content || refRoot.value.innerText;
4662
+ return showOverflowTooltip.content || defaultContent;
4470
4663
  };
4471
4664
  if (typeof showOverflowTooltip.content === 'function') {
4472
4665
  content = function content() {
@@ -4492,12 +4685,12 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4492
4685
  }
4493
4686
  }
4494
4687
  if (props.isHead) {
4495
- var _props$column$showOve, _props$column;
4496
- disabled = !((_props$column$showOve = (_props$column = props.column) === null || _props$column === void 0 || (_props$column = _props$column.showOverflowTooltip) === null || _props$column === void 0 ? void 0 : _props$column.showHead) !== null && _props$column$showOve !== void 0 ? _props$column$showOve : true);
4688
+ var _props$column$showOve5, _props$column;
4689
+ disabled = !((_props$column$showOve5 = (_props$column = props.column) === null || _props$column === void 0 || (_props$column = _props$column.showOverflowTooltip) === null || _props$column === void 0 ? void 0 : _props$column.showHead) !== null && _props$column$showOve5 !== void 0 ? _props$column$showOve5 : true);
4497
4690
  mode = 'auto';
4498
4691
  content = function content() {
4499
- var _getEllipsisTarget;
4500
- return (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 ? void 0 : _getEllipsisTarget.innerHTML;
4692
+ var _getEllipsisTarget$cl3, _getEllipsisTarget2, _getEllipsisTarget2$c;
4693
+ return (_getEllipsisTarget$cl3 = (_getEllipsisTarget2 = getEllipsisTarget()) === null || _getEllipsisTarget2 === void 0 || (_getEllipsisTarget2$c = _getEllipsisTarget2.cloneNode) === null || _getEllipsisTarget2$c === void 0 ? void 0 : _getEllipsisTarget2$c.call(_getEllipsisTarget2, true)) !== null && _getEllipsisTarget$cl3 !== void 0 ? _getEllipsisTarget$cl3 : '';
4501
4694
  };
4502
4695
  if (props.headExplain) {
4503
4696
  mode = 'static';
@@ -4773,7 +4966,7 @@ function _isSlot(s) {
4773
4966
  return resolvePropVal(item, ['id', 'field', 'type'], [item, index]);
4774
4967
  };
4775
4968
  var checkAll = (0,external_vue_namespaceObject.ref)(false);
4776
- var isShow = (0,external_vue_namespaceObject.ref)(false);
4969
+ var refSetting = (0,external_vue_namespaceObject.ref)(null);
4777
4970
  var localSettings = (0,external_vue_namespaceObject.computed)(function () {
4778
4971
  var deafultSettings = {
4779
4972
  fields: props.columns.map(function (col) {
@@ -4786,6 +4979,7 @@ function _isSlot(s) {
4786
4979
  size: 'small',
4787
4980
  sizeList: defaultSizeList,
4788
4981
  showLineHeight: true,
4982
+ extCls: '',
4789
4983
  trigger: 'manual'
4790
4984
  };
4791
4985
  if (typeof props.settings === 'boolean') {
@@ -4808,6 +5002,7 @@ function _isSlot(s) {
4808
5002
  checkedFields: localSettings.value.checked || []
4809
5003
  };
4810
5004
  var handleSaveClick = function handleSaveClick() {
5005
+ var _refSetting$value;
4811
5006
  Object.assign(cachedValue, {
4812
5007
  checkAll: checkAll.value,
4813
5008
  activeSize: activeSize.value,
@@ -4820,17 +5015,21 @@ function _isSlot(s) {
4820
5015
  height: activeHeight.value,
4821
5016
  fields: (0,external_vue_namespaceObject.unref)(renderFields)
4822
5017
  });
4823
- isShow.value = false;
5018
+ (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
4824
5019
  };
4825
5020
  var handleCancelClick = function handleCancelClick() {
5021
+ var _refSetting$value2;
4826
5022
  checkAll.value = cachedValue.checkAll;
4827
5023
  activeSize.value = cachedValue.activeSize;
4828
5024
  activeHeight.value = cachedValue.activeHeight;
4829
5025
  checkedFields.value = cachedValue.checkedFields;
4830
- isShow.value = false;
5026
+ (_refSetting$value2 = refSetting.value) === null || _refSetting$value2 === void 0 || _refSetting$value2.hide();
4831
5027
  };
4832
5028
  var handleSettingClick = function handleSettingClick() {
4833
- isShow.value = true;
5029
+ if (localSettings.value.trigger === 'manual') {
5030
+ var _refSetting$value3;
5031
+ (_refSetting$value3 = refSetting.value) === null || _refSetting$value3 === void 0 || _refSetting$value3.show();
5032
+ }
4834
5033
  };
4835
5034
  var handleCheckAllClick = function handleCheckAllClick(e) {
4836
5035
  e.stopImmediatePropagation();
@@ -4925,9 +5124,10 @@ function _isSlot(s) {
4925
5124
  var _localSettings$value$2;
4926
5125
  return props.settings ? (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
4927
5126
  "trigger": (_localSettings$value$2 = localSettings.value.trigger) !== null && _localSettings$value$2 !== void 0 ? _localSettings$value$2 : 'manual',
4928
- "isShow": isShow.value,
4929
5127
  "placement": "bottom-end",
4930
- "arrow": true
5128
+ "ref": refSetting,
5129
+ "arrow": true,
5130
+ "extCls": localSettings.value.extCls
4931
5131
  }, {
4932
5132
  theme: theme
4933
5133
  }), {
@@ -5049,6 +5249,31 @@ function _isSlot(s) {
5049
5249
  if (!props.rowDraggable) {
5050
5250
  return {};
5051
5251
  }
5252
+ var placeDiv = document.createElement('div');
5253
+ placeDiv.style.setProperty('height', '20px');
5254
+ placeDiv.style.setProperty('width', '100%');
5255
+ placeDiv.style.setProperty('background', '#E2EDFF');
5256
+ placeDiv.style.setProperty('cursor', 'move');
5257
+ ['dragenter', 'dragover'].forEach(function (type) {
5258
+ placeDiv.addEventListener(type, function (event) {
5259
+ event.preventDefault();
5260
+ event.stopPropagation();
5261
+ event.dataTransfer.dropEffect = 'move';
5262
+ });
5263
+ });
5264
+ var lastDragRow = null;
5265
+ var lastDragRowClass = '';
5266
+ var insertPlaceDiv = function insertPlaceDiv(target, placement) {
5267
+ if (placement === '--top') {
5268
+ target.parentNode.insertBefore(placeDiv, target);
5269
+ return;
5270
+ }
5271
+ if (target.nextElementSibling === null) {
5272
+ target.parentNode.append(placeDiv);
5273
+ return;
5274
+ }
5275
+ target.parentNode.insertBefore(placeDiv, target.nextElementSibling);
5276
+ };
5052
5277
  var beforeEventFire = function beforeEventFire(fn) {
5053
5278
  if (props.rowDraggable) {
5054
5279
  fn === null || fn === void 0 || fn();
@@ -5062,9 +5287,10 @@ function _isSlot(s) {
5062
5287
  var _target$getBoundingCl = target.getBoundingClientRect(),
5063
5288
  top = _target$getBoundingCl.top,
5064
5289
  bottom = _target$getBoundingCl.bottom;
5065
- var position = y - top > bottom - y ? '--bottom' : '--top';
5290
+ var placement = y - top > bottom - y ? '--bottom' : '--top';
5066
5291
  removeDragClass(target);
5067
- target.classList.add(position);
5292
+ target.classList.add(placement);
5293
+ insertPlaceDiv(target, placement);
5068
5294
  };
5069
5295
  var removeDragClass = function removeDragClass(target) {
5070
5296
  var classList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['--bottom', '--top'];
@@ -5075,45 +5301,59 @@ function _isSlot(s) {
5075
5301
  var onDragstart = function onDragstart(event) {
5076
5302
  beforeEventFire(function () {
5077
5303
  var target = getTargetRow(event);
5304
+ placeDiv.style.setProperty('height', "".concat(target.offsetHeight, "px"));
5305
+ placeDiv.style.setProperty('width', "".concat(target.offsetWidth, "px"));
5078
5306
  target.classList.add('--drag-start');
5307
+ event.dataTransfer.setDragImage(target, 0, 0);
5079
5308
  event.dataTransfer.setData('text/plain', null);
5080
- event.dataTransfer.dropEffect = 'copy';
5309
+ event.dataTransfer.dropEffect = 'move';
5081
5310
  var rowIndex = event.target.dataset.rowIndex;
5082
5311
  event.dataTransfer.setData('data-row-index', rowIndex);
5083
5312
  });
5084
5313
  };
5085
5314
  var onDragenter = function onDragenter(event) {
5315
+ var target = getTargetRow(event);
5316
+ event.preventDefault();
5317
+ event.stopPropagation();
5086
5318
  beforeEventFire(function () {
5087
5319
  event.dataTransfer.dropEffect = 'move';
5088
- var target = getTargetRow(event);
5089
5320
  target.classList.add('--drag-enter');
5090
5321
  setTargetRowPlacement(target, event);
5322
+ lastDragRow = target;
5091
5323
  });
5092
5324
  };
5093
5325
  var onDragleave = function onDragleave(event) {
5094
5326
  beforeEventFire(function () {
5095
5327
  var target = getTargetRow(event);
5328
+ lastDragRowClass = target.classList.contains('--bottom') ? '--bottom' : '--top';
5096
5329
  removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5097
5330
  });
5098
5331
  };
5099
5332
  var onDragover = function onDragover(event) {
5100
5333
  event.preventDefault();
5334
+ event.stopPropagation();
5101
5335
  event.dataTransfer.dropEffect = 'move';
5102
5336
  var target = getTargetRow(event);
5103
5337
  setTargetRowPlacement(target, event);
5104
5338
  };
5105
- var onDrop = function onDrop(event) {
5339
+ var onDragend = function onDragend(event) {
5340
+ var _event$target$dataset;
5106
5341
  event.preventDefault();
5107
5342
  event.stopPropagation();
5108
- var target = getTargetRow(event);
5343
+ placeDiv.remove();
5344
+ if (!lastDragRow) {
5345
+ return;
5346
+ }
5347
+ var target = lastDragRow;
5109
5348
  var rowIndex = target.dataset.rowIndex;
5110
5349
  var targetIndex = Number(rowIndex);
5111
- var sourceIndex = event.dataTransfer.getData('data-row-index');
5112
- if (target.classList.contains('--bottom')) {
5350
+ var sourceIndex = (_event$target$dataset = event.target.dataset) === null || _event$target$dataset === void 0 ? void 0 : _event$target$dataset.rowIndex;
5351
+ if (lastDragRowClass === '--bottom') {
5113
5352
  targetIndex = targetIndex + 1;
5114
5353
  }
5115
5354
  resp.changePageRowIndex(Number(sourceIndex), targetIndex);
5116
- removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5355
+ lastDragRow = null;
5356
+ lastDragRowClass = '';
5117
5357
  ctx.emit(EMIT_EVENTS.DRAG_END, {
5118
5358
  sourceEvent: event,
5119
5359
  data: resp.pageData
@@ -5124,7 +5364,7 @@ function _isSlot(s) {
5124
5364
  onDragleave: onDragleave,
5125
5365
  onDragstart: onDragstart,
5126
5366
  onDragover: onDragover,
5127
- onDrop: onDrop
5367
+ onDragend: onDragend
5128
5368
  };
5129
5369
  });
5130
5370
  ;// CONCATENATED MODULE: external "../input"
@@ -5198,8 +5438,10 @@ function head_filter_isSlot(s) {
5198
5438
  resolveClassName = _usePrefix.resolveClassName;
5199
5439
  var t = (0,config_provider_namespaceObject.useLocale)('table');
5200
5440
  var column = props.column;
5201
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props.column),
5202
- filter = _toRefs.filter;
5441
+ var filter = (0,external_vue_namespaceObject.computed)(function () {
5442
+ var _props$column;
5443
+ return (_props$column = props.column) === null || _props$column === void 0 ? void 0 : _props$column.filter;
5444
+ });
5203
5445
  var checked = (0,external_vue_namespaceObject.computed)(function () {
5204
5446
  var _filter$value$checked, _filter$value;
5205
5447
  return (_filter$value$checked = (_filter$value = filter.value) === null || _filter$value === void 0 ? void 0 : _filter$value.checked) !== null && _filter$value$checked !== void 0 ? _filter$value$checked : [];
@@ -5246,7 +5488,6 @@ function head_filter_isSlot(s) {
5246
5488
  var filterList = list.filter(function (l) {
5247
5489
  return getRegExp(searchValue.value).test(l.value);
5248
5490
  });
5249
- console.log(' filterList: ', filterList);
5250
5491
  return filterList;
5251
5492
  });
5252
5493
  var getRegExp = function getRegExp(val) {
@@ -6100,7 +6341,7 @@ function use_render_isSlot(s) {
6100
6341
  }
6101
6342
  return '';
6102
6343
  };
6103
- var getRowSpanConfig = function getRowSpanConfig(row, index, preRow, col, store) {
6344
+ var getRowSpanConfig = function getRowSpanConfig(row, rowIndex, preRow, col, store) {
6104
6345
  var _store$get$get, _store$get;
6105
6346
  if (!store.has(row)) {
6106
6347
  store.set(row, new WeakMap());
@@ -6115,7 +6356,7 @@ function use_render_isSlot(s) {
6115
6356
  _ref$skipRowLen = _ref.skipRowLen,
6116
6357
  skipRowLen = _ref$skipRowLen === void 0 ? 0 : _ref$skipRowLen;
6117
6358
  var skipRow = false;
6118
- var rowspan = resolveColumnSpan(col, null, row, index, 'rowspan');
6359
+ var rowspan = resolveColumnSpan(col, null, row, rowIndex, 'rowspan');
6119
6360
  if (skipRowLen > 1) {
6120
6361
  skipRowLen = skipRowLen - 1;
6121
6362
  skipRow = true;
@@ -6166,7 +6407,8 @@ function use_render_isSlot(s) {
6166
6407
  return [(0,external_vue_namespaceObject.createVNode)("tr", (0,external_vue_namespaceObject.mergeProps)({
6167
6408
  "style": rowStyle,
6168
6409
  "class": rowClass,
6169
- "key": getRowKeyNull(row, props, rowIndex),
6410
+ "data-row-id": rowId,
6411
+ "key": rowId,
6170
6412
  "data-row-index": rowIndex,
6171
6413
  "onClick": function onClick(e) {
6172
6414
  return handleRowClick(e, row, rowIndex, rows);
@@ -6188,7 +6430,7 @@ function use_render_isSlot(s) {
6188
6430
  rowspan = _resolveCellSpan.rowspan;
6189
6431
  var _tableResp$getColumnA = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SPAN),
6190
6432
  skipCol = _tableResp$getColumnA.skipCol;
6191
- var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, index, preRow, column, rowSpanMap) : {
6433
+ var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, rowIndex, preRow, column, rowSpanMap) : {
6192
6434
  skipRow: false
6193
6435
  },
6194
6436
  skipRow = _ref2.skipRow;
@@ -6538,6 +6780,7 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6538
6780
 
6539
6781
 
6540
6782
 
6783
+
6541
6784
  /* harmony default export */ const table = ((0,external_vue_namespaceObject.defineComponent)({
6542
6785
  // eslint-disable-next-line vue/no-reserved-component-names
6543
6786
  name: 'Table',
@@ -6594,6 +6837,11 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6594
6837
  hasScrollY: hasScrollYRef.value
6595
6838
  };
6596
6839
  });
6840
+ use_observer_resize(root, function () {
6841
+ (0,external_vue_namespaceObject.nextTick)(function () {
6842
+ resolveFixedColumns(tableOffsetRight.value);
6843
+ });
6844
+ });
6597
6845
  var _useRender = use_render(props, ctx, tableSchema, styleRef, head, root, resetTableHeight),
6598
6846
  renderTableBodySchema = _useRender.renderTableBodySchema,
6599
6847
  renderTableFooter = _useRender.renderTableFooter,
@@ -6611,13 +6859,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6611
6859
  }
6612
6860
  };
6613
6861
  var isFirstLoad = (0,external_vue_namespaceObject.ref)(true);
6614
- // const tableWidth = ref(null);
6615
- (0,external_vue_namespaceObject.watch)(function () {
6616
- return [props.data, columns];
6617
- }, function () {
6862
+ (0,external_vue_namespaceObject.watchEffect)(function () {
6863
+ tableSchema.formatDataSchema(props.data);
6864
+ tableSchema.formatColumns(columns);
6865
+ resolveFixedColumns(tableOffsetRight.value);
6618
6866
  tableSchema.setIndexData().then(function () {
6619
- tableSchema.formatColumns(columns);
6620
- tableSchema.formatDataSchema(props.data);
6867
+ // tableSchema.formatDataSchema(props.data);
6621
6868
  tableSchema.resetStartEndIndex();
6622
6869
  if (isFirstLoad.value) {
6623
6870
  tableSchema.resolveByDefColumns();
@@ -6628,7 +6875,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6628
6875
  registerResizeEvent();
6629
6876
  (0,external_vue_namespaceObject.nextTick)(function () {
6630
6877
  updateOffsetRight();
6631
- resolveFixedColumns(tableOffsetRight.value);
6632
6878
  /**
6633
6879
  * 确保在所有数据渲染完毕再执行fix column计算
6634
6880
  */
@@ -6637,9 +6883,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6637
6883
  });
6638
6884
  });
6639
6885
  });
6640
- }, {
6641
- immediate: true,
6642
- deep: true
6643
6886
  });
6644
6887
  (0,external_vue_namespaceObject.watch)(function () {
6645
6888
  return [props.height, props.maxHeight, props.minHeight];