bkui-vue 1.0.3-beta.4 → 1.0.3-beta.41

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 (209) hide show
  1. package/dist/index.cjs.js +70 -70
  2. package/dist/index.esm.js +15540 -14307
  3. package/dist/index.umd.js +69 -69
  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/code-diff/code-diff.variable.css +3 -0
  24. package/lib/collapse/collapse.variable.css +3 -0
  25. package/lib/collapse-transition/collapse-transition.variable.css +3 -0
  26. package/lib/color-picker/color-picker.variable.css +3 -0
  27. package/lib/components.js +0 -4
  28. package/lib/config-provider/config-provider.d.ts +3 -0
  29. package/lib/config-provider/config-provider.variable.css +3 -0
  30. package/lib/config-provider/index.d.ts +4 -0
  31. package/lib/config-provider/token.d.ts +1 -0
  32. package/lib/container/container.variable.css +3 -0
  33. package/lib/date-picker/base/month-table.d.ts +2 -2
  34. package/lib/date-picker/date-picker.d.ts +1 -0
  35. package/lib/date-picker/date-picker.variable.css +3 -0
  36. package/lib/date-picker/index.d.ts +3 -0
  37. package/lib/date-picker/index.js +69 -31
  38. package/lib/date-picker/interface.d.ts +1 -1
  39. package/lib/date-picker/time-picker.d.ts +1 -0
  40. package/lib/date-picker/utils.d.ts +4 -0
  41. package/lib/dialog/dialog.css +28 -31
  42. package/lib/dialog/dialog.d.ts +11 -0
  43. package/lib/dialog/dialog.less +18 -17
  44. package/lib/dialog/dialog.variable.css +31 -31
  45. package/lib/dialog/index.d.ts +23 -0
  46. package/lib/dialog/index.js +14 -9
  47. package/lib/dialog/props.d.ts +5 -0
  48. package/lib/directives/index.js +0 -1
  49. package/lib/dist.index.js +0 -1
  50. package/lib/divider/divider.variable.css +3 -0
  51. package/lib/dropdown/dropdown.css +3 -1
  52. package/lib/dropdown/dropdown.variable.css +6 -1
  53. package/lib/exception/exception.variable.css +3 -0
  54. package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
  55. package/lib/form/form.variable.css +3 -0
  56. package/lib/hooks.js +1 -8
  57. package/lib/icon/image-fill.js +82 -167
  58. package/lib/icon/img-error.js +82 -167
  59. package/lib/icon/img-placehoulder.js +82 -167
  60. package/lib/icon/index.d.ts +1 -0
  61. package/lib/icon/index.js +87 -2427
  62. package/lib/icon/info-line.js +82 -167
  63. package/lib/icon/info.js +82 -167
  64. package/lib/icon/left-shape.js +82 -167
  65. package/lib/icon/left-turn-line.js +82 -167
  66. package/lib/icon/loading.js +82 -167
  67. package/lib/icon/narrow-line.js +82 -167
  68. package/lib/icon/original.js +82 -167
  69. package/lib/icon/pdf-fill.js +82 -167
  70. package/lib/icon/play-shape.js +82 -167
  71. package/lib/icon/plus.js +82 -167
  72. package/lib/icon/ppt-fill.js +82 -167
  73. package/lib/icon/qq.js +82 -167
  74. package/lib/icon/right-shape.js +82 -167
  75. package/lib/icon/right-turn-line.js +82 -167
  76. package/lib/icon/search.js +82 -167
  77. package/lib/icon/share.js +82 -167
  78. package/lib/icon/spinner.js +82 -167
  79. package/lib/icon/success.js +82 -167
  80. package/lib/icon/switcher-loading.js +82 -167
  81. package/lib/icon/text-all.d.ts +4 -0
  82. package/lib/icon/text-all.js +191 -0
  83. package/lib/icon/text-file.js +82 -167
  84. package/lib/icon/text-fill.js +82 -167
  85. package/lib/icon/transfer.js +82 -167
  86. package/lib/icon/tree-application-shape.js +82 -167
  87. package/lib/icon/unfull-screen.js +82 -167
  88. package/lib/icon/unvisible.js +82 -167
  89. package/lib/icon/up-shape.js +82 -167
  90. package/lib/icon/upload.js +82 -167
  91. package/lib/icon/video-fill.js +82 -167
  92. package/lib/icon/warn.js +82 -167
  93. package/lib/icon/weixin-pro.js +82 -167
  94. package/lib/icon/weixin.js +82 -167
  95. package/lib/image/image-viewer.variable.css +3 -0
  96. package/lib/image/image.variable.css +3 -0
  97. package/lib/image/index.js +5 -2
  98. package/lib/index.js +0 -1
  99. package/lib/info-box/index.js +40 -455
  100. package/lib/info-box/info-box.css +6 -11
  101. package/lib/info-box/info-box.d.ts +1 -1
  102. package/lib/info-box/info-box.less +6 -10
  103. package/lib/info-box/info-box.variable.css +9 -11
  104. package/lib/input/index.js +5 -0
  105. package/lib/input/input.variable.css +3 -0
  106. package/lib/link/link.variable.css +3 -0
  107. package/lib/loading/loading.variable.css +3 -0
  108. package/lib/locale/index.js +4 -2
  109. package/lib/locale/lang/en.d.ts +1 -0
  110. package/lib/menu/menu.variable.css +3 -0
  111. package/lib/menu/submenu.variable.css +3 -0
  112. package/lib/message/message.variable.css +3 -0
  113. package/lib/modal/index.d.ts +34 -6
  114. package/lib/modal/index.js +14 -15
  115. package/lib/modal/modal.css +10 -15
  116. package/lib/modal/modal.d.ts +13 -2
  117. package/lib/modal/modal.less +5 -5
  118. package/lib/modal/modal.variable.css +13 -15
  119. package/lib/modal/props.mixin.d.ts +5 -0
  120. package/lib/navigation/navigation.variable.css +3 -0
  121. package/lib/notify/notify.variable.css +3 -0
  122. package/lib/pagination/index.js +2 -1
  123. package/lib/pagination/pagination.variable.css +3 -0
  124. package/lib/plugin-popover/index.d.ts +1 -1
  125. package/lib/plugin-popover/index.js +55 -31
  126. package/lib/pop-confirm/pop-confirm.variable.css +3 -0
  127. package/lib/popover/content.d.ts +1 -1
  128. package/lib/popover/index.js +55 -31
  129. package/lib/popover/plugin-popover.d.ts +4 -1
  130. package/lib/popover/popover.css +3 -1
  131. package/lib/popover/popover.less +4 -1
  132. package/lib/popover/popover.variable.css +6 -1
  133. package/lib/preset.d.ts +2 -0
  134. package/lib/preset.js +14 -20
  135. package/lib/process/process.variable.css +3 -0
  136. package/lib/progress/progress.variable.css +3 -0
  137. package/lib/radio/radio.variable.css +3 -0
  138. package/lib/rate/rate.variable.css +3 -0
  139. package/lib/rate/star.variable.css +3 -0
  140. package/lib/resize-layout/resize-layout.variable.css +3 -0
  141. package/lib/search-select/index.js +0 -1
  142. package/lib/search-select/search-select.variable.css +3 -0
  143. package/lib/select/index.d.ts +68 -6
  144. package/lib/select/index.js +1326 -68
  145. package/lib/select/option.d.ts +3 -1
  146. package/lib/select/pinyin/core.d.ts +14 -0
  147. package/lib/select/pinyin/dict.d.ts +34 -0
  148. package/lib/select/pinyin/index.d.ts +2 -0
  149. package/lib/select/select.css +36 -7
  150. package/lib/select/select.d.ts +28 -2
  151. package/lib/select/select.less +43 -13
  152. package/lib/select/select.variable.css +39 -7
  153. package/lib/select/type.d.ts +2 -3
  154. package/lib/shared/index.js +44 -3
  155. package/lib/shared/utils.d.ts +12 -0
  156. package/lib/sideslider/index.d.ts +29 -6
  157. package/lib/sideslider/index.js +5 -2
  158. package/lib/sideslider/sideslider.d.ts +13 -2
  159. package/lib/sideslider/sideslider.variable.css +3 -0
  160. package/lib/slider/slider.variable.css +3 -0
  161. package/lib/steps/steps.variable.css +3 -0
  162. package/lib/styles/mixins/animate.variable.css +3 -0
  163. package/lib/styles/mixins/popper.variable.css +3 -0
  164. package/lib/styles/mixins/scroll.variable.css +3 -0
  165. package/lib/styles/reset.css +1 -3
  166. package/lib/styles/reset.less +3 -6
  167. package/lib/styles/reset.variable.css +4 -3
  168. package/lib/styles/themes/themes.less +5 -0
  169. package/lib/swiper/swiper.variable.css +3 -0
  170. package/lib/switcher/switcher.variable.css +3 -0
  171. package/lib/tab/tab.variable.css +3 -0
  172. package/lib/table/cache.d.ts +11 -3
  173. package/lib/table/components/table-column.d.ts +111 -5
  174. package/lib/table/index.d.ts +66 -5
  175. package/lib/table/index.js +857 -562
  176. package/lib/table/plugins/head-filter.variable.css +3 -0
  177. package/lib/table/plugins/head-sort.d.ts +7 -0
  178. package/lib/table/plugins/head-sort.variable.css +3 -0
  179. package/lib/table/plugins/settings.variable.css +3 -0
  180. package/lib/table/plugins/use-draggable.d.ts +2 -2
  181. package/lib/table/plugins/use-observer-resize.d.ts +5 -0
  182. package/lib/table/props.d.ts +15 -4
  183. package/lib/table/table.css +6 -12
  184. package/lib/table/table.d.ts +7 -0
  185. package/lib/table/table.less +12 -9
  186. package/lib/table/table.variable.css +9 -12
  187. package/lib/table/use-attributes.d.ts +5 -43
  188. package/lib/table/utils.d.ts +5 -4
  189. package/lib/table-column/index.d.ts +235 -119
  190. package/lib/table-column/index.js +221 -30
  191. package/lib/tag/tag.variable.css +3 -0
  192. package/lib/tag-input/index.d.ts +4 -4
  193. package/lib/tag-input/tag-input.d.ts +2 -2
  194. package/lib/tag-input/tag-input.variable.css +3 -0
  195. package/lib/tag-input/tag-props.d.ts +1 -1
  196. package/lib/tag-input/tag-render.d.ts +1 -1
  197. package/lib/time-picker/index.d.ts +38 -35
  198. package/lib/time-picker/time-picker.variable.css +3 -0
  199. package/lib/timeline/index.d.ts +73 -44
  200. package/lib/timeline/index.js +45 -63
  201. package/lib/timeline/timeline.d.ts +42 -29
  202. package/lib/timeline/timeline.variable.css +3 -0
  203. package/lib/transfer/transfer.variable.css +3 -0
  204. package/lib/tree/tree.variable.css +3 -0
  205. package/lib/upload/upload.variable.css +3 -0
  206. package/lib/virtual-render/index.d.ts +9 -9
  207. package/lib/virtual-render/virtual-render.d.ts +3 -3
  208. package/lib/virtual-render/virtual-render.variable.css +3 -0
  209. 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";
@@ -25,6 +25,8 @@ import "../button/button.less";
25
25
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53__ from "../icon/";
26
26
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
27
27
  import "../popover/popover.less";
28
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__ from "../input";
29
+ import "../input/input.less";
28
30
  /******/ // The require scope
29
31
  /******/ var __webpack_require__ = {};
30
32
  /******/
@@ -120,7 +122,95 @@ function defineProperty_defineProperty(obj, key, value) {
120
122
  ;// CONCATENATED MODULE: external "vue"
121
123
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
122
124
  var external_vue_y = x => () => x
123
- 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, ["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, ["resolveComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent, ["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);
124
214
  ;// CONCATENATED MODULE: ../../packages/table/src/const.ts
125
215
 
126
216
  /*
@@ -300,7 +390,7 @@ var ColumnTypeEnum;
300
390
  ColumnTypeEnum["SELECTION"] = "selection";
301
391
  ColumnTypeEnum["INDEX"] = "index";
302
392
  ColumnTypeEnum["EXPAND"] = "expand";
303
- ColumnTypeEnum["NONE"] = "none";
393
+ ColumnTypeEnum["NONE"] = "__COL_TYPE_NONE";
304
394
  })(ColumnTypeEnum || (ColumnTypeEnum = {}));
305
395
  var TableAlignEnum;
306
396
  (function (TableAlignEnum) {
@@ -452,6 +542,13 @@ var tableProps = {
452
542
  * 是否显示Head
453
543
  */
454
544
  showHead: shared_namespaceObject.PropTypes.bool.def(true),
545
+ /**
546
+ * 排序时对需要排序的字符串数值进行格式化
547
+ * 这里需要配置为正则或者回调函数,(str) => string | number | boolean
548
+ * 如果配置为正则,程序会提取匹配到的第一个结果尝试转换为数值
549
+ * 如果为多个,程序会顺序执行所有正则表达式,直到转换成功
550
+ */
551
+ sortValFormat: shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.any).def(['']),
455
552
  /**
456
553
  * table header config
457
554
  */
@@ -631,6 +728,7 @@ var tableProps = {
631
728
  ;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
632
729
 
633
730
 
731
+
634
732
  /*
635
733
  * Tencent is pleased to support the open source community by making
636
734
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -660,6 +758,7 @@ var tableProps = {
660
758
 
661
759
 
662
760
 
761
+
663
762
  var TableColumnProp = {
664
763
  label: LabelFunctionStringType,
665
764
  field: LabelFunctionStringType,
@@ -678,7 +777,10 @@ var TableColumnProp = {
678
777
  align: TableAlign,
679
778
  className: RowClassFunctionStringType,
680
779
  prop: LabelFunctionStringType,
681
- 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
+ })
682
784
  };
683
785
  /* harmony default export */ const table_column = ((0,external_vue_namespaceObject.defineComponent)({
684
786
  name: 'TableColumn',
@@ -695,18 +797,39 @@ var TableColumnProp = {
695
797
  var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
696
798
  field: props.prop || props.field
697
799
  }));
800
+ var isIndexPropChanged = (0,external_vue_namespaceObject.ref)(false);
801
+ var setIsIndexChanged = function setIsIndexChanged(val) {
802
+ isIndexPropChanged.value = val;
803
+ };
698
804
  return {
805
+ isIndexPropChanged: isIndexPropChanged,
806
+ setIsIndexChanged: setIsIndexChanged,
699
807
  initColumns: initColumns,
700
808
  bkTableCache: bkTableCache,
701
809
  column: column
702
810
  };
703
811
  },
812
+ watch: {
813
+ index: {
814
+ handler: function handler() {
815
+ this.setIsIndexChanged(!this.isIndexPropChanged);
816
+ },
817
+ deep: true
818
+ }
819
+ },
704
820
  unmounted: function unmounted() {
705
821
  this.updateColumnDefine(true);
706
822
  },
707
823
  mounted: function mounted() {
824
+ this.setNodeUid();
708
825
  this.updateColumnDefine();
709
826
  },
827
+ updated: function updated() {
828
+ if (this.isIndexPropChanged) {
829
+ this.updateColumnDefineByParent();
830
+ this.setIsIndexChanged(!this.isIndexPropChanged);
831
+ }
832
+ },
710
833
  methods: {
711
834
  updateColumnDefine: function updateColumnDefine() {
712
835
  var unmounted = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
@@ -724,43 +847,110 @@ var TableColumnProp = {
724
847
  return Object.assign(result, defineProperty_defineProperty({}, target, props[key]));
725
848
  }, {});
726
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.getNodeUid(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.uniqueId && !ctx.uniqueId.val) {
868
+ ctx.uniqueId.val = esm_browser_v4();
869
+ }
870
+ if (!ctx.uniqueId) {
871
+ Object.assign(ctx, {
872
+ uniqueId: {
873
+ val: esm_browser_v4()
874
+ }
875
+ });
876
+ }
877
+ },
878
+ getNodeUid: function getNodeUid(ctx) {
879
+ var _ctx$uniqueId;
880
+ return (_ctx$uniqueId = ctx.uniqueId) === null || _ctx$uniqueId === void 0 ? void 0 : _ctx$uniqueId.val;
881
+ },
727
882
  updateColumnDefineByParent: function updateColumnDefineByParent() {
728
883
  var _this = this;
884
+ if (!this.rsolveIndexedColumn()) {
885
+ return;
886
+ }
729
887
  var fn = function fn() {
730
888
  // @ts-ignore
731
- var selfVnode = _this._;
732
- var colList = selfVnode.parent.vnode.children["default"]() || [];
889
+ var selfVnode = _this.$;
890
+ var getTableNode = function getTableNode(root) {
891
+ var _parentVnode$type;
892
+ if (root === document.body || !root) {
893
+ return null;
894
+ }
895
+ var parentVnode = root.parent;
896
+ if (((_parentVnode$type = parentVnode.type) === null || _parentVnode$type === void 0 ? void 0 : _parentVnode$type.name) === 'Table') {
897
+ return parentVnode.vnode;
898
+ }
899
+ return getTableNode(parentVnode);
900
+ };
901
+ var getNodeUid = function getNodeUid(node) {
902
+ return _this.getNodeUid(node.ctx);
903
+ };
904
+ var tableNode = getTableNode(selfVnode);
905
+ if (!tableNode) {
906
+ return;
907
+ }
733
908
  var sortColumns = [];
734
909
  var index = 0;
910
+ var resolveChildNode = function resolveChildNode(node) {
911
+ var _node$type;
912
+ if (!node) {
913
+ return null;
914
+ }
915
+ if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
916
+ var _node$props$render, _node$children;
917
+ var resolveProp = Object.assign({
918
+ index: index
919
+ }, _this.copyProps(node.props), {
920
+ field: node.props.prop || node.props.field,
921
+ 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"],
922
+ uniqueId: getNodeUid(node.ctx)
923
+ });
924
+ sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
925
+ index = index + 1;
926
+ return null;
927
+ }
928
+ if (Array.isArray(node === null || node === void 0 ? void 0 : node.children)) {
929
+ return node.children;
930
+ }
931
+ 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') {
932
+ return Object.keys(node.children).map(function (key) {
933
+ return node.children[key];
934
+ });
935
+ }
936
+ if (typeof node === 'function') {
937
+ return node();
938
+ }
939
+ return null;
940
+ };
735
941
  var reduceColumns = function reduceColumns(nodes) {
736
942
  if (!Array.isArray(nodes)) {
943
+ var children = resolveChildNode(nodes);
944
+ if (children) {
945
+ reduceColumns(children);
946
+ }
737
947
  return;
738
948
  }
739
- nodes.forEach(function (node) {
740
- var _node$type, _node$children2;
741
- if (Array.isArray(node)) {
742
- reduceColumns(node);
743
- return;
744
- }
745
- var skipValidateKey0 = true;
746
- if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
747
- var _node$children;
748
- skipValidateKey0 = Object.hasOwnProperty.call(node.props || {}, 'key');
749
- var resolveProp = Object.assign({
750
- index: index
751
- }, _this.copyProps(node.props), {
752
- field: node.props.prop || node.props.field,
753
- render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
754
- });
755
- sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
756
- index = index + 1;
757
- }
758
- if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0) {
759
- reduceColumns(node.children);
760
- }
949
+ nodes === null || nodes === void 0 || nodes.forEach(function (node) {
950
+ return reduceColumns(node);
761
951
  });
762
952
  };
763
- reduceColumns(colList);
953
+ reduceColumns(tableNode);
764
954
  _this.initColumns(sortColumns);
765
955
  };
766
956
  if (typeof this.bkTableCache.queueStack === 'function') {
@@ -768,9 +958,12 @@ var TableColumnProp = {
768
958
  }
769
959
  },
770
960
  unmountColumn: function unmountColumn() {
961
+ var _props$render2;
962
+ var props = this.$.vnode.props;
771
963
  var resolveProp = Object.assign({}, this.copyProps(this.$props), {
772
- field: this.$props.prop || this.$props.field,
773
- render: this.$slots["default"]
964
+ field: props.prop || props.field,
965
+ render: (_props$render2 = props.render) !== null && _props$render2 !== void 0 ? _props$render2 : this.$slots["default"],
966
+ uniqueId: this.getNodeUid(this.$.ctx)
774
967
  });
775
968
  this.initColumns(resolveProp, true);
776
969
  }
@@ -852,21 +1045,41 @@ var BkTableCache = /*#__PURE__*/function () {
852
1045
  function BkTableCache() {
853
1046
  _classCallCheck(this, BkTableCache);
854
1047
  defineProperty_defineProperty(this, "storage", undefined);
855
- this.storage = {};
1048
+ defineProperty_defineProperty(this, "defKey", Symbol('bk-table-cache-def-key'));
1049
+ this.storage = new WeakMap();
856
1050
  }
857
1051
  _createClass(BkTableCache, [{
858
1052
  key: "queueStack",
859
1053
  value: function queueStack(methodName) {
1054
+ var _target$methodName;
860
1055
  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
861
- this.storage[methodName] && clearTimeout(this.storage[methodName]);
862
- this.storage[methodName] = setTimeout(function () {
863
- return fn();
864
- });
1056
+ var key = arguments.length > 2 ? arguments[2] : undefined;
1057
+ var stackKey = key !== null && key !== void 0 ? key : this.defKey;
1058
+ if (!this.storage.has(stackKey)) {
1059
+ this.storage.set(stackKey, {});
1060
+ }
1061
+ var target = this.storage.get(stackKey);
1062
+ if ((_target$methodName = target[methodName]) !== null && _target$methodName !== void 0 && _target$methodName.timerId) {
1063
+ var _target$methodName2;
1064
+ clearTimeout((_target$methodName2 = target[methodName]) === null || _target$methodName2 === void 0 ? void 0 : _target$methodName2.timerId);
1065
+ }
1066
+ Object.assign(target, defineProperty_defineProperty({}, methodName, {
1067
+ timerId: setTimeout(fn),
1068
+ fn: fn
1069
+ }));
865
1070
  }
866
1071
  }, {
867
1072
  key: "clearQueueStack",
868
- value: function clearQueueStack(methodName) {
869
- this.storage[methodName] && clearTimeout(this.storage[methodName]);
1073
+ value: function clearQueueStack(methodName, key) {
1074
+ var stackKey = key !== null && key !== void 0 ? key : this.defKey;
1075
+ if (this.storage.has(stackKey)) {
1076
+ var _target$methodName3;
1077
+ var target = this.storage.get(stackKey);
1078
+ if ((_target$methodName3 = target[methodName]) !== null && _target$methodName3 !== void 0 && _target$methodName3.timerId) {
1079
+ var _target$methodName4;
1080
+ clearTimeout((_target$methodName4 = target[methodName]) === null || _target$methodName4 === void 0 ? void 0 : _target$methodName4.timerId);
1081
+ }
1082
+ }
870
1083
  }
871
1084
  }]);
872
1085
  return BkTableCache;
@@ -1430,365 +1643,6 @@ function _toConsumableArray(arr) {
1430
1643
  updateFixClass: updateFixClass
1431
1644
  };
1432
1645
  });
1433
- ;// CONCATENATED MODULE: external "../loading"
1434
- var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1435
- var loading_y = x => () => x
1436
- 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"] });
1437
- ;// CONCATENATED MODULE: external "../loading/loading.less"
1438
- var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1439
- var loading_less_y = x => () => x
1440
- const loading_less_namespaceObject = loading_less_x({ });
1441
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
1442
-
1443
-
1444
- /*
1445
- * Tencent is pleased to support the open source community by making
1446
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1447
- *
1448
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1449
- *
1450
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1451
- *
1452
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1453
- *
1454
- * ---------------------------------------------------
1455
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1456
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1457
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1458
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1459
- *
1460
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1461
- * the Software.
1462
- *
1463
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1464
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1465
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1466
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1467
- * IN THE SOFTWARE.
1468
- */
1469
-
1470
-
1471
-
1472
-
1473
- /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
1474
- var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
1475
- var getLoadingOption = function getLoadingOption() {
1476
- if (typeof refScrollLoading.value === 'boolean') {
1477
- return {
1478
- loading: !!refScrollLoading.value,
1479
- inline: true,
1480
- title: '',
1481
- size: loading_namespaceObject.BkLoadingSize.Normal,
1482
- mode: loading_namespaceObject.BkLoadingMode.Default,
1483
- indicator: null
1484
- };
1485
- }
1486
- return refScrollLoading.value;
1487
- };
1488
- var isRender = (0,external_vue_namespaceObject.computed)(function () {
1489
- return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
1490
- });
1491
- var renderScrollLoading = function renderScrollLoading() {
1492
- if (isRender.value) {
1493
- var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
1494
- var _getLoadingOption = getLoadingOption(),
1495
- loading = _getLoadingOption.loading,
1496
- size = _getLoadingOption.size,
1497
- mode = _getLoadingOption.mode,
1498
- title = _getLoadingOption.title,
1499
- inline = _getLoadingOption.inline,
1500
- indicator = _getLoadingOption.indicator;
1501
- 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"], {
1502
- loading: loading,
1503
- size: size,
1504
- mode: mode,
1505
- title: title,
1506
- inline: inline,
1507
- indicator: indicator
1508
- }, null);
1509
- }
1510
- };
1511
- return {
1512
- renderScrollLoading: renderScrollLoading
1513
- };
1514
- });
1515
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
1516
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1517
- /* harmony default export */ const esm_browser_native = ({
1518
- randomUUID
1519
- });
1520
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
1521
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1522
- // require the crypto API and do not support built-in fallback to lower quality random number
1523
- // generators (like Math.random()).
1524
- let getRandomValues;
1525
- const rnds8 = new Uint8Array(16);
1526
- function rng() {
1527
- // lazy load so that environments that need to polyfill have a chance to do so
1528
- if (!getRandomValues) {
1529
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1530
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1531
-
1532
- if (!getRandomValues) {
1533
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1534
- }
1535
- }
1536
-
1537
- return getRandomValues(rnds8);
1538
- }
1539
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
1540
-
1541
- /**
1542
- * Convert array of 16 byte values to UUID string format of the form:
1543
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1544
- */
1545
-
1546
- const byteToHex = [];
1547
-
1548
- for (let i = 0; i < 256; ++i) {
1549
- byteToHex.push((i + 0x100).toString(16).slice(1));
1550
- }
1551
-
1552
- function unsafeStringify(arr, offset = 0) {
1553
- // Note: Be careful editing this code! It's been tuned for performance
1554
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1555
- 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]];
1556
- }
1557
-
1558
- function stringify(arr, offset = 0) {
1559
- const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
1560
- // of the following:
1561
- // - One or more input array values don't map to a hex octet (leading to
1562
- // "undefined" in the uuid)
1563
- // - Invalid input values for the RFC `version` or `variant` fields
1564
-
1565
- if (!validate(uuid)) {
1566
- throw TypeError('Stringified UUID is invalid');
1567
- }
1568
-
1569
- return uuid;
1570
- }
1571
-
1572
- /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
1573
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
1574
-
1575
-
1576
-
1577
-
1578
- function v4(options, buf, offset) {
1579
- if (esm_browser_native.randomUUID && !buf && !options) {
1580
- return esm_browser_native.randomUUID();
1581
- }
1582
-
1583
- options = options || {};
1584
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1585
-
1586
- rnds[6] = rnds[6] & 0x0f | 0x40;
1587
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1588
-
1589
- if (buf) {
1590
- offset = offset || 0;
1591
-
1592
- for (let i = 0; i < 16; ++i) {
1593
- buf[offset + i] = rnds[i];
1594
- }
1595
-
1596
- return buf;
1597
- }
1598
-
1599
- return unsafeStringify(rnds);
1600
- }
1601
-
1602
- /* harmony default export */ const esm_browser_v4 = (v4);
1603
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
1604
-
1605
-
1606
-
1607
- function use_pagination_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1608
- function use_pagination_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? use_pagination_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : use_pagination_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1609
- /*
1610
- * Tencent is pleased to support the open source community by making
1611
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1612
- *
1613
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1614
- *
1615
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1616
- *
1617
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1618
- *
1619
- * ---------------------------------------------------
1620
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1621
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1622
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1623
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1624
- *
1625
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1626
- * the Software.
1627
- *
1628
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1629
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1630
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1631
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1632
- * IN THE SOFTWARE.
1633
- */
1634
-
1635
-
1636
- /**
1637
- * 处理 Prop中的分页配置
1638
- * prop中的配置会覆盖本地的配置
1639
- * @param propPagination 用户传入的配置
1640
- * @param defVal 默认配置
1641
- * @returns 返回值
1642
- */
1643
- var resolvePaginationOption = function resolvePaginationOption(propPagination, defVal) {
1644
- if (!!propPagination) {
1645
- if (typeof_typeof(propPagination) === 'object') {
1646
- var current = Object.prototype.hasOwnProperty.call(propPagination, 'current') ? propPagination.current : propPagination.value;
1647
- if (!/\d+/.test(current)) {
1648
- current = 1;
1649
- }
1650
- return use_pagination_objectSpread(use_pagination_objectSpread(use_pagination_objectSpread({}, defVal), propPagination), {}, {
1651
- current: current
1652
- });
1653
- }
1654
- return defVal;
1655
- }
1656
- return {};
1657
- };
1658
- /* harmony default export */ const use_pagination = (function (props) {
1659
- var startIndex = (0,external_vue_namespaceObject.ref)(0);
1660
- var endIndex = (0,external_vue_namespaceObject.ref)(0);
1661
- /**
1662
- * 分页配置
1663
- * 用于配置分页组件
1664
- * pagination 为Prop传入配置
1665
- * 方便兼容内置分页功能,此处需要单独处理count
1666
- */
1667
- var propsData = (0,external_vue_namespaceObject.computed)(function () {
1668
- return props.data;
1669
- });
1670
- var localPagination = (0,external_vue_namespaceObject.ref)(null);
1671
- var indexData = (0,external_vue_namespaceObject.reactive)([]);
1672
- // 当前分页缓存,用于支持内置前端分页,用户无需接收change事件来自行处理数据分割
1673
- var pagination = (0,external_vue_namespaceObject.reactive)({
1674
- count: 0,
1675
- limit: 10,
1676
- current: 1,
1677
- align: 'right',
1678
- layout: ['total', 'limit', 'list']
1679
- });
1680
- var resolveLocalPagination = function resolveLocalPagination() {
1681
- if (!props.pagination) {
1682
- return;
1683
- }
1684
- localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(use_pagination_objectSpread({}, pagination), {}, {
1685
- count: indexData.length
1686
- });
1687
- };
1688
- /**
1689
- * 重置当前分页开始位置 & 结束位置
1690
- * 如果未启用分页,则开始位置为0,结束位置为 data.length
1691
- * @returns
1692
- */
1693
- var resetStartEndIndex = function resetStartEndIndex() {
1694
- if (!props.pagination || props.remotePagination) {
1695
- startIndex.value = 0;
1696
- endIndex.value = indexData.length;
1697
- return;
1698
- }
1699
- // 如果是前端分页
1700
- startIndex.value = (pagination.current - 1) * pagination.limit;
1701
- endIndex.value = pagination.current * pagination.limit;
1702
- };
1703
- /**
1704
- * 当前页分页数据
1705
- */
1706
- var pageData = (0,external_vue_namespaceObject.reactive)([]);
1707
- var sort = function sort(sourceData, sortFn, column, type, sortScope) {
1708
- if (typeof sortFn === 'function') {
1709
- sourceData.sort(function (a, b) {
1710
- return sortFn(a, b, type, column, sortScope);
1711
- });
1712
- }
1713
- };
1714
- /**
1715
- * 初始化排序动作
1716
- * @param data
1717
- * @param sortColumns
1718
- */
1719
- var multiSort = function multiSort(data, sortColumns) {
1720
- sortColumns.forEach(function (item) {
1721
- sort(data, item.schema[COLUMN_ATTRIBUTE.COL_SORT_FN], item.column, item.schema[COLUMN_ATTRIBUTE.COL_SORT_TYPE], item.schema[COLUMN_ATTRIBUTE.COL_SORT_SCOPE]);
1722
- });
1723
- };
1724
- var filter = function filter(sourceData, filterFn) {
1725
- if (typeof filterFn === 'function') {
1726
- var filterVals = sourceData.filter(function (row, index) {
1727
- return filterFn(row, index, indexData);
1728
- });
1729
- sourceData.length = 0;
1730
- sourceData.push.apply(sourceData, _toConsumableArray(filterVals));
1731
- }
1732
- return sourceData;
1733
- };
1734
- var resolveIndexData = function resolveIndexData() {
1735
- return new Promise(function (resolve) {
1736
- (0,external_vue_namespaceObject.nextTick)(function () {
1737
- var target = propsData.value.slice();
1738
- indexData.length = 0;
1739
- indexData.push.apply(indexData, _toConsumableArray(target));
1740
- resolve();
1741
- });
1742
- });
1743
- };
1744
- var resolvePageData = function resolvePageData(filterFn, sortFn, column, type, sortScope, multiCol) {
1745
- var sourceData = indexData.slice();
1746
- if (multiCol !== null && multiCol !== void 0 && multiCol.length) {
1747
- multiSort(sourceData, multiCol);
1748
- }
1749
- pageData.length = 0;
1750
- pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
1751
- filter(pageData, filterFn);
1752
- sort(pageData, sortFn, column, type, sortScope);
1753
- resolveLocalPagination();
1754
- };
1755
- var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
1756
- resolvePageData(null, null, null, null, null, multiCol);
1757
- };
1758
- var multiFilter = function multiFilter(filterFnList) {
1759
- var sourceData = indexData.slice();
1760
- var target = filterFnList.reduce(function (result, fn) {
1761
- return filter(result, fn);
1762
- }, sourceData);
1763
- pageData.length = 0;
1764
- pageData.push.apply(pageData, _toConsumableArray(target));
1765
- };
1766
- var handlePaginationChange = function handlePaginationChange() {
1767
- pagination = resolvePaginationOption(props.pagination, pagination);
1768
- resolveLocalPagination();
1769
- resetStartEndIndex();
1770
- resolvePageData();
1771
- };
1772
- handlePaginationChange();
1773
- (0,external_vue_namespaceObject.watch)(function () {
1774
- return [props.pagination];
1775
- }, function () {
1776
- handlePaginationChange();
1777
- }, {
1778
- deep: true
1779
- });
1780
- return {
1781
- pageData: pageData,
1782
- indexData: indexData,
1783
- localPagination: localPagination,
1784
- resolvePageData: resolvePageData,
1785
- resolveIndexData: resolveIndexData,
1786
- resolvePageDataBySortList: resolvePageDataBySortList,
1787
- resetStartEndIndex: resetStartEndIndex,
1788
- multiFilter: multiFilter,
1789
- sort: sort
1790
- };
1791
- });
1792
1646
  ;// CONCATENATED MODULE: external "lodash/debounce"
1793
1647
  var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1794
1648
  var debounce_y = x => () => x
@@ -2765,6 +2619,7 @@ function utils_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2765
2619
 
2766
2620
 
2767
2621
 
2622
+
2768
2623
  /**
2769
2624
  * 解析Prop值 | 可能为多种类型 & 函数返回的场景
2770
2625
  * @param prop 当前Prop
@@ -2945,6 +2800,10 @@ var resolveHeadConfig = function resolveHeadConfig(props) {
2945
2800
  height: headHeight
2946
2801
  }, thead);
2947
2802
  };
2803
+ var getRegExp = function getRegExp(val) {
2804
+ var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ig';
2805
+ return new RegExp("".concat(val).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), flags);
2806
+ };
2948
2807
  /**
2949
2808
  * 获取当前行指定列的内容
2950
2809
  * @param row 当前行
@@ -2953,11 +2812,29 @@ var resolveHeadConfig = function resolveHeadConfig(props) {
2953
2812
  * @param index 当前行Index
2954
2813
  * @returns
2955
2814
  */
2956
- var getRowText = function getRowText(row, key) {
2815
+ var getRowText = function getRowText(row, key, format) {
2816
+ var result;
2957
2817
  if (typeof row === 'string' || typeof row === 'number' || typeof row === 'boolean') {
2958
- return row;
2818
+ result = row;
2959
2819
  }
2960
- return (0,get_namespaceObject["default"])(row, key);
2820
+ if (typeof_typeof(row) === 'object') {
2821
+ result = (0,get_namespaceObject["default"])(row, key);
2822
+ }
2823
+ if (format !== null && format !== void 0 && format.length) {
2824
+ format.forEach(function (reg) {
2825
+ if (typeof reg === 'function') {
2826
+ result = reg(result, row, key);
2827
+ } else if (typeof result === 'string') {
2828
+ var _matches$;
2829
+ var matches = result.match(typeof reg === 'string' ? getRegExp(reg) : reg);
2830
+ result = (_matches$ = matches === null || matches === void 0 ? void 0 : matches[1]) !== null && _matches$ !== void 0 ? _matches$ : result;
2831
+ }
2832
+ });
2833
+ if (/^-?\d+.?\d*$/.test(result)) {
2834
+ result = Number(result);
2835
+ }
2836
+ }
2837
+ return result;
2961
2838
  };
2962
2839
  /**
2963
2840
  * 获取当前行指定列的值
@@ -3092,107 +2969,446 @@ var resolveCellSpan = function resolveCellSpan(column, colIndex, row, rowIndex)
3092
2969
  colspan: colspan,
3093
2970
  rowspan: rowspan
3094
2971
  };
3095
- };
3096
- var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
3097
- var skip = false;
3098
- for (var i = colIndex; i > 0; i--) {
3099
- var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
3100
- if (colspan > 1) {
3101
- skip = colspan - 1 + i >= colIndex;
3102
- break;
2972
+ };
2973
+ var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
2974
+ var skip = false;
2975
+ for (var i = colIndex; i > 0; i--) {
2976
+ var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
2977
+ if (colspan > 1) {
2978
+ skip = colspan - 1;
2979
+ break;
2980
+ }
2981
+ }
2982
+ return skip;
2983
+ };
2984
+ var getSortFn = function getSortFn(column, sortType) {
2985
+ var _column$sort, _column$sort2;
2986
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2987
+ var fieldName = column.field;
2988
+ var getVal = function getVal(row) {
2989
+ return getRowText(row, fieldName, format);
2990
+ };
2991
+ var sortFn0 = function sortFn0(a, b) {
2992
+ var _getVal, _getVal2;
2993
+ var val0 = (_getVal = getVal(a)) !== null && _getVal !== void 0 ? _getVal : '';
2994
+ var val1 = (_getVal2 = getVal(b)) !== null && _getVal2 !== void 0 ? _getVal2 : '';
2995
+ if (typeof val0 === 'number' && typeof val1 === 'number') {
2996
+ return val0 - val1;
2997
+ }
2998
+ return String.prototype.localeCompare.call(val0, val1);
2999
+ };
3000
+ var sortFn = typeof ((_column$sort = column.sort) === null || _column$sort === void 0 ? void 0 : _column$sort.sortFn) === 'function' ? (_column$sort2 = column.sort) === null || _column$sort2 === void 0 ? void 0 : _column$sort2.sortFn : sortFn0;
3001
+ return sortType === SORT_OPTION.NULL ? function (_a, _b) {
3002
+ return true;
3003
+ } : function (_a, _b) {
3004
+ return sortFn(_a, _b) * (sortType === SORT_OPTION.DESC ? -1 : 1);
3005
+ };
3006
+ };
3007
+ var getNextSortType = function getNextSortType(sortType) {
3008
+ var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
3009
+ if (steps[sortType] === undefined) {
3010
+ return SORT_OPTION.ASC;
3011
+ }
3012
+ return Object.keys(steps)[(steps[sortType] + 1) % 3];
3013
+ };
3014
+ var resolveSort = function resolveSort(sort, column) {
3015
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3016
+ if (typeof sort === 'string') {
3017
+ return {
3018
+ value: sort
3019
+ };
3020
+ }
3021
+ if (typeof sort === 'boolean' && sort) {
3022
+ return {
3023
+ value: SORT_OPTION.NULL
3024
+ };
3025
+ }
3026
+ if (typeof_typeof(sort) === 'object' && sort !== null) {
3027
+ var _sort$value;
3028
+ if (typeof sort.sortFn === 'function') {
3029
+ return utils_objectSpread({
3030
+ value: 'custom'
3031
+ }, sort);
3032
+ }
3033
+ return Object.assign({}, {
3034
+ sortFn: getSortFn(column, (_sort$value = sort.value) !== null && _sort$value !== void 0 ? _sort$value : SORT_OPTION.NULL, format)
3035
+ }, sort);
3036
+ }
3037
+ return null;
3038
+ };
3039
+ var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
3040
+ var row = _ref3.row,
3041
+ index = _ref3.index,
3042
+ isCheckAll = _ref3.isCheckAll;
3043
+ if (typeof props.isRowSelectEnable === 'boolean') {
3044
+ return props.isRowSelectEnable !== false;
3045
+ }
3046
+ if (typeof props.isRowSelectEnable === 'function') {
3047
+ return props.isRowSelectEnable({
3048
+ row: row,
3049
+ index: index,
3050
+ isCheckAll: isCheckAll
3051
+ });
3052
+ }
3053
+ return true;
3054
+ };
3055
+ var getRowId = function getRowId(row, defVal, props) {
3056
+ var key = getRowKey(row, props, defVal);
3057
+ if (key !== undefined && row[key] !== undefined) {
3058
+ return row[key];
3059
+ }
3060
+ return defVal;
3061
+ };
3062
+ var resolveColumnSortProp = function resolveColumnSortProp(col, props) {
3063
+ var _resolveSort, _col$sort;
3064
+ var _ref4 = (_resolveSort = resolveSort((_col$sort = col.sort) !== null && _col$sort !== void 0 ? _col$sort : props.defaultSort, col)) !== null && _resolveSort !== void 0 ? _resolveSort : {},
3065
+ value = _ref4.value,
3066
+ sortFn = _ref4.sortFn,
3067
+ sortScope = _ref4.sortScope;
3068
+ return {
3069
+ type: value,
3070
+ fn: sortFn,
3071
+ scope: sortScope,
3072
+ active: !!col.sort
3073
+ };
3074
+ };
3075
+ var getRawData = function getRawData(data) {
3076
+ if ((0,external_vue_namespaceObject.isProxy)(data)) {
3077
+ return (0,external_vue_namespaceObject.toRaw)(data);
3078
+ }
3079
+ return data;
3080
+ };
3081
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-observer-resize.tsx
3082
+
3083
+ /*
3084
+ * Tencent is pleased to support the open source community by making
3085
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3086
+ *
3087
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3088
+ *
3089
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3090
+ *
3091
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3092
+ *
3093
+ * ---------------------------------------------------
3094
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3095
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3096
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3097
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3098
+ *
3099
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3100
+ * the Software.
3101
+ *
3102
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3103
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3104
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3105
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3106
+ * IN THE SOFTWARE.
3107
+ */
3108
+
3109
+
3110
+
3111
+ /* harmony default export */ const use_observer_resize = (function (target, fn) {
3112
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3113
+ var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3114
+ var instance = null;
3115
+ var dispose = function dispose() {
3116
+ if (instance) {
3117
+ instance.disconnect();
3118
+ instance = null;
3119
+ }
3120
+ };
3121
+ (0,external_vue_namespaceObject.watch)(target, function () {
3122
+ if (!(0,shared_namespaceObject.isElement)(target.value)) {
3123
+ return;
3124
+ }
3125
+ dispose();
3126
+ instance = observerResize(target.value, function () {
3127
+ fn === null || fn === void 0 || fn.apply.apply(fn, _toConsumableArray(args));
3128
+ }, 60, true, 'debounce');
3129
+ if (immediate) {
3130
+ instance.start();
3131
+ }
3132
+ }, {
3133
+ flush: 'post',
3134
+ immediate: true
3135
+ });
3136
+ return {
3137
+ instance: instance
3138
+ };
3139
+ });
3140
+ ;// CONCATENATED MODULE: external "../loading"
3141
+ var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3142
+ var loading_y = x => () => x
3143
+ 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"] });
3144
+ ;// CONCATENATED MODULE: external "../loading/loading.less"
3145
+ var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3146
+ var loading_less_y = x => () => x
3147
+ const loading_less_namespaceObject = loading_less_x({ });
3148
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
3149
+
3150
+
3151
+ /*
3152
+ * Tencent is pleased to support the open source community by making
3153
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3154
+ *
3155
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3156
+ *
3157
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3158
+ *
3159
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3160
+ *
3161
+ * ---------------------------------------------------
3162
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3163
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3164
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3165
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3166
+ *
3167
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3168
+ * the Software.
3169
+ *
3170
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3171
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3172
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3173
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3174
+ * IN THE SOFTWARE.
3175
+ */
3176
+
3177
+
3178
+
3179
+
3180
+ /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
3181
+ var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
3182
+ var getLoadingOption = function getLoadingOption() {
3183
+ if (typeof refScrollLoading.value === 'boolean') {
3184
+ return {
3185
+ loading: !!refScrollLoading.value,
3186
+ inline: true,
3187
+ title: '',
3188
+ size: loading_namespaceObject.BkLoadingSize.Normal,
3189
+ mode: loading_namespaceObject.BkLoadingMode.Default,
3190
+ indicator: null
3191
+ };
3192
+ }
3193
+ return refScrollLoading.value;
3194
+ };
3195
+ var isRender = (0,external_vue_namespaceObject.computed)(function () {
3196
+ return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
3197
+ });
3198
+ var renderScrollLoading = function renderScrollLoading() {
3199
+ if (isRender.value) {
3200
+ var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
3201
+ var _getLoadingOption = getLoadingOption(),
3202
+ loading = _getLoadingOption.loading,
3203
+ size = _getLoadingOption.size,
3204
+ mode = _getLoadingOption.mode,
3205
+ title = _getLoadingOption.title,
3206
+ inline = _getLoadingOption.inline,
3207
+ indicator = _getLoadingOption.indicator;
3208
+ 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"], {
3209
+ loading: loading,
3210
+ size: size,
3211
+ mode: mode,
3212
+ title: title,
3213
+ inline: inline,
3214
+ indicator: indicator
3215
+ }, null);
3216
+ }
3217
+ };
3218
+ return {
3219
+ renderScrollLoading: renderScrollLoading
3220
+ };
3221
+ });
3222
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
3223
+
3224
+
3225
+
3226
+ function use_pagination_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3227
+ function use_pagination_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? use_pagination_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : use_pagination_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3228
+ /*
3229
+ * Tencent is pleased to support the open source community by making
3230
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3231
+ *
3232
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3233
+ *
3234
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3235
+ *
3236
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3237
+ *
3238
+ * ---------------------------------------------------
3239
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3240
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3241
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3242
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3243
+ *
3244
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3245
+ * the Software.
3246
+ *
3247
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3248
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3249
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3250
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3251
+ * IN THE SOFTWARE.
3252
+ */
3253
+
3254
+
3255
+
3256
+ /**
3257
+ * 处理 Prop中的分页配置
3258
+ * prop中的配置会覆盖本地的配置
3259
+ * @param propPagination 用户传入的配置
3260
+ * @param defVal 默认配置
3261
+ * @returns 返回值
3262
+ */
3263
+ var resolvePaginationOption = function resolvePaginationOption(propPagination, defVal) {
3264
+ if (!!propPagination) {
3265
+ if (typeof_typeof(propPagination) === 'object') {
3266
+ var current = Object.prototype.hasOwnProperty.call(propPagination, 'current') ? propPagination.current : propPagination.value;
3267
+ if (!/\d+/.test(current)) {
3268
+ current = 1;
3269
+ }
3270
+ return use_pagination_objectSpread(use_pagination_objectSpread(use_pagination_objectSpread({}, defVal), propPagination), {}, {
3271
+ current: current
3272
+ });
3273
+ }
3274
+ return defVal;
3275
+ }
3276
+ return {};
3277
+ };
3278
+ /* harmony default export */ const use_pagination = (function (props) {
3279
+ var startIndex = (0,external_vue_namespaceObject.ref)(0);
3280
+ var endIndex = (0,external_vue_namespaceObject.ref)(0);
3281
+ /**
3282
+ * 分页配置
3283
+ * 用于配置分页组件
3284
+ * pagination 为Prop传入配置
3285
+ * 方便兼容内置分页功能,此处需要单独处理count
3286
+ */
3287
+ var propsData = (0,external_vue_namespaceObject.computed)(function () {
3288
+ return props.data;
3289
+ });
3290
+ var localPagination = (0,external_vue_namespaceObject.ref)(null);
3291
+ var indexData = (0,external_vue_namespaceObject.reactive)([]);
3292
+ // 当前分页缓存,用于支持内置前端分页,用户无需接收change事件来自行处理数据分割
3293
+ var pagination = (0,external_vue_namespaceObject.reactive)({
3294
+ count: 0,
3295
+ limit: 10,
3296
+ current: 1,
3297
+ align: 'right',
3298
+ layout: ['total', 'limit', 'list']
3299
+ });
3300
+ var resolveLocalPagination = function resolveLocalPagination() {
3301
+ if (!props.pagination) {
3302
+ return;
3303
+ }
3304
+ localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(use_pagination_objectSpread({}, pagination), {}, {
3305
+ count: indexData.length
3306
+ });
3307
+ };
3308
+ /**
3309
+ * 重置当前分页开始位置 & 结束位置
3310
+ * 如果未启用分页,则开始位置为0,结束位置为 data.length
3311
+ * @returns
3312
+ */
3313
+ var resetStartEndIndex = function resetStartEndIndex() {
3314
+ if (!props.pagination || props.remotePagination) {
3315
+ startIndex.value = 0;
3316
+ endIndex.value = indexData.length;
3317
+ return;
3103
3318
  }
3104
- }
3105
- return skip;
3106
- };
3107
- var getSortFn = function getSortFn(column, sortType) {
3108
- var _column$sort, _column$sort2;
3109
- var fieldName = column.field;
3110
- var getVal = function getVal(row) {
3111
- return getRowText(row, fieldName);
3319
+ // 如果是前端分页
3320
+ startIndex.value = (pagination.current - 1) * pagination.limit;
3321
+ endIndex.value = pagination.current * pagination.limit;
3112
3322
  };
3113
- var sortFn0 = function sortFn0(a, b) {
3114
- var _getVal, _getVal2;
3115
- var val0 = (_getVal = getVal(a)) !== null && _getVal !== void 0 ? _getVal : '';
3116
- var val1 = (_getVal2 = getVal(b)) !== null && _getVal2 !== void 0 ? _getVal2 : '';
3117
- if (typeof val0 === 'number' && typeof val1 === 'number') {
3118
- return val0 - val1;
3323
+ /**
3324
+ * 当前页分页数据
3325
+ */
3326
+ var pageData = (0,external_vue_namespaceObject.reactive)([]);
3327
+ var sort = function sort(sourceData, sortFn, column, type, sortScope) {
3328
+ if (typeof sortFn === 'function') {
3329
+ sourceData.sort(function (a, b) {
3330
+ return sortFn(a, b, type, column, sortScope);
3331
+ });
3119
3332
  }
3120
- return String.prototype.localeCompare.call(val0, val1);
3121
3333
  };
3122
- var sortFn = typeof ((_column$sort = column.sort) === null || _column$sort === void 0 ? void 0 : _column$sort.sortFn) === 'function' ? (_column$sort2 = column.sort) === null || _column$sort2 === void 0 ? void 0 : _column$sort2.sortFn : sortFn0;
3123
- return sortType === SORT_OPTION.NULL ? function (_a, _b) {
3124
- return true;
3125
- } : function (_a, _b) {
3126
- return sortFn(_a, _b) * (sortType === SORT_OPTION.DESC ? -1 : 1);
3334
+ /**
3335
+ * 初始化排序动作
3336
+ * @param data
3337
+ * @param sortColumns
3338
+ */
3339
+ var multiSort = function multiSort(data, sortColumns) {
3340
+ sortColumns.forEach(function (item) {
3341
+ sort(data, item.schema[COLUMN_ATTRIBUTE.COL_SORT_FN], item.column, item.schema[COLUMN_ATTRIBUTE.COL_SORT_TYPE], item.schema[COLUMN_ATTRIBUTE.COL_SORT_SCOPE]);
3342
+ });
3127
3343
  };
3128
- };
3129
- var getNextSortType = function getNextSortType(sortType) {
3130
- var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
3131
- if (steps[sortType] === undefined) {
3132
- return SORT_OPTION.ASC;
3133
- }
3134
- return Object.keys(steps)[(steps[sortType] + 1) % 3];
3135
- };
3136
- var resolveSort = function resolveSort(sort, column) {
3137
- if (typeof sort === 'string') {
3138
- return {
3139
- value: sort
3140
- };
3141
- }
3142
- if (typeof sort === 'boolean' && sort) {
3143
- return {
3144
- value: SORT_OPTION.NULL
3145
- };
3146
- }
3147
- if (typeof_typeof(sort) === 'object' && sort !== null) {
3148
- var _sort$value;
3149
- if (typeof sort.sortFn === 'function') {
3150
- return utils_objectSpread({
3151
- value: 'custom'
3152
- }, sort);
3344
+ var filter = function filter(sourceData, filterFn) {
3345
+ if (typeof filterFn === 'function') {
3346
+ var filterVals = sourceData.filter(function (row, index) {
3347
+ return filterFn(row, index, indexData);
3348
+ });
3349
+ sourceData.length = 0;
3350
+ sourceData.push.apply(sourceData, _toConsumableArray(filterVals));
3153
3351
  }
3154
- return Object.assign({}, {
3155
- sortFn: getSortFn(column, (_sort$value = sort.value) !== null && _sort$value !== void 0 ? _sort$value : SORT_OPTION.NULL)
3156
- }, sort);
3157
- }
3158
- return null;
3159
- };
3160
- var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
3161
- var row = _ref3.row,
3162
- index = _ref3.index,
3163
- isCheckAll = _ref3.isCheckAll;
3164
- if (typeof props.isRowSelectEnable === 'boolean') {
3165
- return props.isRowSelectEnable !== false;
3166
- }
3167
- if (typeof props.isRowSelectEnable === 'function') {
3168
- return props.isRowSelectEnable({
3169
- row: row,
3170
- index: index,
3171
- isCheckAll: isCheckAll
3352
+ return sourceData;
3353
+ };
3354
+ var resolveIndexData = function resolveIndexData() {
3355
+ return new Promise(function (resolve) {
3356
+ (0,external_vue_namespaceObject.nextTick)(function () {
3357
+ var target = propsData.value.slice();
3358
+ indexData.length = 0;
3359
+ indexData.push.apply(indexData, _toConsumableArray(getRawData(target)));
3360
+ resolve();
3361
+ });
3172
3362
  });
3173
- }
3174
- return true;
3175
- };
3176
- var getRowId = function getRowId(row, defVal, props) {
3177
- var key = getRowKey(row, props, defVal);
3178
- if (key !== undefined && row[key] !== undefined) {
3179
- return row[key];
3180
- }
3181
- return defVal;
3182
- };
3183
- var resolveColumnSortProp = function resolveColumnSortProp(col, props) {
3184
- var _resolveSort, _col$sort;
3185
- var _ref4 = (_resolveSort = resolveSort((_col$sort = col.sort) !== null && _col$sort !== void 0 ? _col$sort : props.defaultSort, col)) !== null && _resolveSort !== void 0 ? _resolveSort : {},
3186
- value = _ref4.value,
3187
- sortFn = _ref4.sortFn,
3188
- sortScope = _ref4.sortScope;
3363
+ };
3364
+ var resolvePageData = function resolvePageData(filterFn, sortFn, column, type, sortScope, multiCol) {
3365
+ var sourceData = indexData.slice();
3366
+ if (multiCol !== null && multiCol !== void 0 && multiCol.length) {
3367
+ multiSort(sourceData, multiCol);
3368
+ }
3369
+ pageData.length = 0;
3370
+ pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
3371
+ filter(pageData, filterFn);
3372
+ sort(pageData, sortFn, column, type, sortScope);
3373
+ resolveLocalPagination();
3374
+ };
3375
+ var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
3376
+ resolvePageData(null, null, null, null, null, multiCol);
3377
+ };
3378
+ var multiFilter = function multiFilter(filterFnList) {
3379
+ var sourceData = indexData.slice();
3380
+ var target = filterFnList.reduce(function (result, fn) {
3381
+ return filter(result, fn);
3382
+ }, sourceData);
3383
+ pageData.length = 0;
3384
+ pageData.push.apply(pageData, _toConsumableArray(getRawData(target)));
3385
+ };
3386
+ var handlePaginationChange = function handlePaginationChange() {
3387
+ pagination = resolvePaginationOption(props.pagination, pagination);
3388
+ resolveLocalPagination();
3389
+ resetStartEndIndex();
3390
+ resolvePageData();
3391
+ };
3392
+ handlePaginationChange();
3393
+ (0,external_vue_namespaceObject.watch)(function () {
3394
+ return [props.pagination];
3395
+ }, function () {
3396
+ handlePaginationChange();
3397
+ }, {
3398
+ deep: true
3399
+ });
3189
3400
  return {
3190
- type: value,
3191
- fn: sortFn,
3192
- scope: sortScope,
3193
- active: !!col.sort
3401
+ pageData: pageData,
3402
+ indexData: indexData,
3403
+ localPagination: localPagination,
3404
+ resolvePageData: resolvePageData,
3405
+ resolveIndexData: resolveIndexData,
3406
+ resolvePageDataBySortList: resolvePageDataBySortList,
3407
+ resetStartEndIndex: resetStartEndIndex,
3408
+ multiFilter: multiFilter,
3409
+ sort: sort
3194
3410
  };
3195
- };
3411
+ });
3196
3412
  ;// CONCATENATED MODULE: ../../packages/table/src/use-attributes.ts
3197
3413
 
3198
3414
 
@@ -3230,7 +3446,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3230
3446
 
3231
3447
 
3232
3448
 
3233
- /* harmony default export */ const use_attributes = (function (props) {
3449
+ var tableSchemaResponse = function tableSchemaResponse(props) {
3234
3450
  var t = (0,config_provider_namespaceObject.useLocale)('table');
3235
3451
  var getDefaultSettings = function getDefaultSettings() {
3236
3452
  var _ref, _SETTING_SIZE$size;
@@ -3580,7 +3796,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3580
3796
  if (typeof item === 'string') {
3581
3797
  return getRowValue(row, item) === item;
3582
3798
  }
3583
- return item === row;
3799
+ return getRawData(item) === getRawData(row);
3584
3800
  });
3585
3801
  }
3586
3802
  return false;
@@ -3606,7 +3822,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3606
3822
  (_formatData$data = formatData.data).push.apply(_formatData$data, _toConsumableArray(data));
3607
3823
  var hasSelectedRow = false;
3608
3824
  var hasUnSelectedRow = false;
3609
- (data || []).forEach(function (row, index) {
3825
+ (data || []).forEach(function (item, index) {
3826
+ var row = getRawData(item);
3610
3827
  var rowId = getRowId(row, esm_browser_v4(), props);
3611
3828
  var isSelected = isRowSelected(row);
3612
3829
  if (isSelected) {
@@ -3647,7 +3864,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3647
3864
  * @param attrName
3648
3865
  * @param attrValue
3649
3866
  */
3650
- var setRowAttribute = function setRowAttribute(row, attrName, attrValue) {
3867
+ var setRowAttribute = function setRowAttribute(item, attrName, attrValue) {
3868
+ var row = getRawData(item);
3651
3869
  var target = formatData.dataSchema.get(row);
3652
3870
  if (target && Object.prototype.hasOwnProperty.call(target, attrName)) {
3653
3871
  target[attrName] = attrValue;
@@ -3688,8 +3906,9 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3688
3906
  var setRowExpand = function setRowExpand(row, isExpand) {
3689
3907
  setRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND, isExpand);
3690
3908
  };
3691
- var getRowAttribute = function getRowAttribute(row, attrName) {
3909
+ var getRowAttribute = function getRowAttribute(item, attrName) {
3692
3910
  var _formatData$dataSchem6;
3911
+ var row = getRawData(item);
3693
3912
  return (_formatData$dataSchem6 = formatData.dataSchema.get(row)) === null || _formatData$dataSchem6 === void 0 ? void 0 : _formatData$dataSchem6[attrName];
3694
3913
  };
3695
3914
  var toggleRowSelection = function toggleRowSelection(row) {
@@ -3892,7 +4111,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3892
4111
  formatData: formatData,
3893
4112
  setIndexData: setIndexData
3894
4113
  };
3895
- });
4114
+ };
4115
+ /* harmony default export */ const use_attributes = (tableSchemaResponse);
3896
4116
  ;// CONCATENATED MODULE: ../../packages/table/src/use-column.ts
3897
4117
 
3898
4118
  /*
@@ -3931,6 +4151,11 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3931
4151
  /* harmony default export */ const use_column = (function (props, targetColumns) {
3932
4152
  var _props$columns;
3933
4153
  var resolvedColumns = (0,external_vue_namespaceObject.reactive)((_props$columns = props.columns) !== null && _props$columns !== void 0 ? _props$columns : []);
4154
+ /**
4155
+ * 初始化Column配置
4156
+ * @param column 传入
4157
+ * @param remove 是否移除当前列
4158
+ */
3934
4159
  var initColumns = function initColumns(column) {
3935
4160
  var remove = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3936
4161
  var resolveColumns = [];
@@ -3942,7 +4167,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3942
4167
  if (!remove) {
3943
4168
  resolveColumns.forEach(function (col) {
3944
4169
  var index = targetColumns.findIndex(function (tc) {
3945
- return tc.label === col.label && tc.field === col.field;
4170
+ return tc.label === col.label && tc.field === col.field && tc.uniqueId === col.uniqueId;
3946
4171
  });
3947
4172
  if (index >= 0) {
3948
4173
  Object.assign(targetColumns[index], col);
@@ -3956,7 +4181,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3956
4181
  } else {
3957
4182
  resolveColumns.forEach(function (col) {
3958
4183
  var matchColIndex = targetColumns.findIndex(function (c) {
3959
- return c.label === col.label && c.field === col.field;
4184
+ return c.label === col.label && c.field === col.field && c.uniqueId === col.uniqueId;
3960
4185
  });
3961
4186
  if (matchColIndex >= 0) {
3962
4187
  targetColumns.splice(matchColIndex, 1);
@@ -4376,14 +4601,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4376
4601
  });
4377
4602
  var resolveSetting = function resolveSetting() {
4378
4603
  if (/boolean|object/.test(typeof_typeof(props.column.showOverflowTooltip)) && props.column.showOverflowTooltip !== null) {
4604
+ var _props$column$showOve = props.column.showOverflowTooltip,
4605
+ _props$column$showOve2 = _props$column$showOve.content,
4606
+ content = _props$column$showOve2 === void 0 ? '' : _props$column$showOve2,
4607
+ _props$column$showOve3 = _props$column$showOve.mode,
4608
+ mode = _props$column$showOve3 === void 0 ? undefined : _props$column$showOve3,
4609
+ _props$column$showOve4 = _props$column$showOve.popoverOption,
4610
+ popoverOption = _props$column$showOve4 === void 0 ? {} : _props$column$showOve4;
4379
4611
  var result = {
4380
4612
  showOverflowTooltip: {
4381
- content: '',
4613
+ content: content,
4382
4614
  disabled: !props.column.showOverflowTooltip,
4383
- mode: undefined,
4615
+ mode: mode,
4384
4616
  resizerWay: undefined,
4385
4617
  watchCellResize: undefined,
4386
- popoverOption: {}
4618
+ popoverOption: popoverOption
4387
4619
  }
4388
4620
  };
4389
4621
  if (props.parentSetting !== null && typeof_typeof(props.parentSetting) === 'object') {
@@ -4401,15 +4633,17 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4401
4633
  showOverflowTooltip: props.parentSetting
4402
4634
  };
4403
4635
  };
4404
- var _resolveSetting = resolveSetting(),
4405
- _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4406
- showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4407
4636
  var bkEllipsisIns = null;
4408
4637
  var resolveTooltipOption = function resolveTooltipOption() {
4638
+ var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
4639
+ var _resolveSetting = resolveSetting(),
4640
+ _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4641
+ showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4409
4642
  var disabled = true;
4410
4643
  var resizerWay = props.resizerWay;
4644
+ 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 : '';
4411
4645
  var content = function content() {
4412
- return refRoot.value.innerText;
4646
+ return defaultContent;
4413
4647
  };
4414
4648
  var popoverOption = {};
4415
4649
  var mode = 'auto';
@@ -4422,7 +4656,7 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4422
4656
  popoverOption = showOverflowTooltip.popoverOption;
4423
4657
  resizerWay = showOverflowTooltip.resizerWay || 'debounce';
4424
4658
  content = function content() {
4425
- return showOverflowTooltip.content || refRoot.value.innerText;
4659
+ return showOverflowTooltip.content || defaultContent;
4426
4660
  };
4427
4661
  if (typeof showOverflowTooltip.content === 'function') {
4428
4662
  content = function content() {
@@ -4435,21 +4669,6 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4435
4669
  if (typeof disabled === 'function') {
4436
4670
  disabled = Reflect.apply(disabled, _this, [props.column, props.row]);
4437
4671
  }
4438
- if (props.isHead) {
4439
- var _props$column$showOve, _props$column;
4440
- 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);
4441
- mode = 'auto';
4442
- content = function content() {
4443
- var _getEllipsisTarget;
4444
- return (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 ? void 0 : _getEllipsisTarget.innerHTML;
4445
- };
4446
- if (props.headExplain) {
4447
- mode = 'static';
4448
- content = function content() {
4449
- return props.headExplain;
4450
- };
4451
- }
4452
- }
4453
4672
  /**
4454
4673
  * 当表格中的字段或数据需要做解释说明时,可增加 [下划线] 提示,hover 可查看解释说明的 tooltips
4455
4674
  */
@@ -4462,6 +4681,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4462
4681
  };
4463
4682
  }
4464
4683
  }
4684
+ if (props.isHead) {
4685
+ var _props$column$showOve5, _props$column;
4686
+ 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);
4687
+ mode = 'auto';
4688
+ content = function content() {
4689
+ var _getEllipsisTarget$cl3, _getEllipsisTarget2, _getEllipsisTarget2$c;
4690
+ 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 : '';
4691
+ };
4692
+ if (props.headExplain) {
4693
+ mode = 'static';
4694
+ content = function content() {
4695
+ return props.headExplain;
4696
+ };
4697
+ }
4698
+ }
4465
4699
  return {
4466
4700
  disabled: disabled,
4467
4701
  content: content,
@@ -4729,7 +4963,7 @@ function _isSlot(s) {
4729
4963
  return resolvePropVal(item, ['id', 'field', 'type'], [item, index]);
4730
4964
  };
4731
4965
  var checkAll = (0,external_vue_namespaceObject.ref)(false);
4732
- var isShow = (0,external_vue_namespaceObject.ref)(false);
4966
+ var refSetting = (0,external_vue_namespaceObject.ref)(null);
4733
4967
  var localSettings = (0,external_vue_namespaceObject.computed)(function () {
4734
4968
  var deafultSettings = {
4735
4969
  fields: props.columns.map(function (col) {
@@ -4742,6 +4976,7 @@ function _isSlot(s) {
4742
4976
  size: 'small',
4743
4977
  sizeList: defaultSizeList,
4744
4978
  showLineHeight: true,
4979
+ extCls: '',
4745
4980
  trigger: 'manual'
4746
4981
  };
4747
4982
  if (typeof props.settings === 'boolean') {
@@ -4764,6 +4999,7 @@ function _isSlot(s) {
4764
4999
  checkedFields: localSettings.value.checked || []
4765
5000
  };
4766
5001
  var handleSaveClick = function handleSaveClick() {
5002
+ var _refSetting$value;
4767
5003
  Object.assign(cachedValue, {
4768
5004
  checkAll: checkAll.value,
4769
5005
  activeSize: activeSize.value,
@@ -4776,17 +5012,21 @@ function _isSlot(s) {
4776
5012
  height: activeHeight.value,
4777
5013
  fields: (0,external_vue_namespaceObject.unref)(renderFields)
4778
5014
  });
4779
- isShow.value = false;
5015
+ (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
4780
5016
  };
4781
5017
  var handleCancelClick = function handleCancelClick() {
5018
+ var _refSetting$value2;
4782
5019
  checkAll.value = cachedValue.checkAll;
4783
5020
  activeSize.value = cachedValue.activeSize;
4784
5021
  activeHeight.value = cachedValue.activeHeight;
4785
5022
  checkedFields.value = cachedValue.checkedFields;
4786
- isShow.value = false;
5023
+ (_refSetting$value2 = refSetting.value) === null || _refSetting$value2 === void 0 || _refSetting$value2.hide();
4787
5024
  };
4788
5025
  var handleSettingClick = function handleSettingClick() {
4789
- isShow.value = true;
5026
+ if (localSettings.value.trigger === 'manual') {
5027
+ var _refSetting$value3;
5028
+ (_refSetting$value3 = refSetting.value) === null || _refSetting$value3 === void 0 || _refSetting$value3.show();
5029
+ }
4790
5030
  };
4791
5031
  var handleCheckAllClick = function handleCheckAllClick(e) {
4792
5032
  e.stopImmediatePropagation();
@@ -4881,9 +5121,10 @@ function _isSlot(s) {
4881
5121
  var _localSettings$value$2;
4882
5122
  return props.settings ? (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
4883
5123
  "trigger": (_localSettings$value$2 = localSettings.value.trigger) !== null && _localSettings$value$2 !== void 0 ? _localSettings$value$2 : 'manual',
4884
- "isShow": isShow.value,
4885
5124
  "placement": "bottom-end",
4886
- "arrow": true
5125
+ "ref": refSetting,
5126
+ "arrow": true,
5127
+ "extCls": localSettings.value.extCls
4887
5128
  }, {
4888
5129
  theme: theme
4889
5130
  }), {
@@ -5005,6 +5246,31 @@ function _isSlot(s) {
5005
5246
  if (!props.rowDraggable) {
5006
5247
  return {};
5007
5248
  }
5249
+ var placeDiv = document.createElement('div');
5250
+ placeDiv.style.setProperty('height', '20px');
5251
+ placeDiv.style.setProperty('width', '100%');
5252
+ placeDiv.style.setProperty('background', '#E2EDFF');
5253
+ placeDiv.style.setProperty('cursor', 'move');
5254
+ ['dragenter', 'dragover'].forEach(function (type) {
5255
+ placeDiv.addEventListener(type, function (event) {
5256
+ event.preventDefault();
5257
+ event.stopPropagation();
5258
+ event.dataTransfer.dropEffect = 'move';
5259
+ });
5260
+ });
5261
+ var lastDragRow = null;
5262
+ var lastDragRowClass = '';
5263
+ var insertPlaceDiv = function insertPlaceDiv(target, placement) {
5264
+ if (placement === '--top') {
5265
+ target.parentNode.insertBefore(placeDiv, target);
5266
+ return;
5267
+ }
5268
+ if (target.nextElementSibling === null) {
5269
+ target.parentNode.append(placeDiv);
5270
+ return;
5271
+ }
5272
+ target.parentNode.insertBefore(placeDiv, target.nextElementSibling);
5273
+ };
5008
5274
  var beforeEventFire = function beforeEventFire(fn) {
5009
5275
  if (props.rowDraggable) {
5010
5276
  fn === null || fn === void 0 || fn();
@@ -5018,9 +5284,10 @@ function _isSlot(s) {
5018
5284
  var _target$getBoundingCl = target.getBoundingClientRect(),
5019
5285
  top = _target$getBoundingCl.top,
5020
5286
  bottom = _target$getBoundingCl.bottom;
5021
- var position = y - top > bottom - y ? '--bottom' : '--top';
5287
+ var placement = y - top > bottom - y ? '--bottom' : '--top';
5022
5288
  removeDragClass(target);
5023
- target.classList.add(position);
5289
+ target.classList.add(placement);
5290
+ insertPlaceDiv(target, placement);
5024
5291
  };
5025
5292
  var removeDragClass = function removeDragClass(target) {
5026
5293
  var classList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['--bottom', '--top'];
@@ -5031,45 +5298,59 @@ function _isSlot(s) {
5031
5298
  var onDragstart = function onDragstart(event) {
5032
5299
  beforeEventFire(function () {
5033
5300
  var target = getTargetRow(event);
5301
+ placeDiv.style.setProperty('height', "".concat(target.offsetHeight, "px"));
5302
+ placeDiv.style.setProperty('width', "".concat(target.offsetWidth, "px"));
5034
5303
  target.classList.add('--drag-start');
5304
+ event.dataTransfer.setDragImage(target, 0, 0);
5035
5305
  event.dataTransfer.setData('text/plain', null);
5036
- event.dataTransfer.dropEffect = 'copy';
5306
+ event.dataTransfer.dropEffect = 'move';
5037
5307
  var rowIndex = event.target.dataset.rowIndex;
5038
5308
  event.dataTransfer.setData('data-row-index', rowIndex);
5039
5309
  });
5040
5310
  };
5041
5311
  var onDragenter = function onDragenter(event) {
5312
+ var target = getTargetRow(event);
5313
+ event.preventDefault();
5314
+ event.stopPropagation();
5042
5315
  beforeEventFire(function () {
5043
5316
  event.dataTransfer.dropEffect = 'move';
5044
- var target = getTargetRow(event);
5045
5317
  target.classList.add('--drag-enter');
5046
5318
  setTargetRowPlacement(target, event);
5319
+ lastDragRow = target;
5047
5320
  });
5048
5321
  };
5049
5322
  var onDragleave = function onDragleave(event) {
5050
5323
  beforeEventFire(function () {
5051
5324
  var target = getTargetRow(event);
5325
+ lastDragRowClass = target.classList.contains('--bottom') ? '--bottom' : '--top';
5052
5326
  removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5053
5327
  });
5054
5328
  };
5055
5329
  var onDragover = function onDragover(event) {
5056
5330
  event.preventDefault();
5331
+ event.stopPropagation();
5057
5332
  event.dataTransfer.dropEffect = 'move';
5058
5333
  var target = getTargetRow(event);
5059
5334
  setTargetRowPlacement(target, event);
5060
5335
  };
5061
- var onDrop = function onDrop(event) {
5336
+ var onDragend = function onDragend(event) {
5337
+ var _event$target$dataset;
5062
5338
  event.preventDefault();
5063
5339
  event.stopPropagation();
5064
- var target = getTargetRow(event);
5340
+ placeDiv.remove();
5341
+ if (!lastDragRow) {
5342
+ return;
5343
+ }
5344
+ var target = lastDragRow;
5065
5345
  var rowIndex = target.dataset.rowIndex;
5066
5346
  var targetIndex = Number(rowIndex);
5067
- var sourceIndex = event.dataTransfer.getData('data-row-index');
5068
- if (target.classList.contains('--bottom')) {
5347
+ var sourceIndex = (_event$target$dataset = event.target.dataset) === null || _event$target$dataset === void 0 ? void 0 : _event$target$dataset.rowIndex;
5348
+ if (lastDragRowClass === '--bottom') {
5069
5349
  targetIndex = targetIndex + 1;
5070
5350
  }
5071
5351
  resp.changePageRowIndex(Number(sourceIndex), targetIndex);
5072
- removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5352
+ lastDragRow = null;
5353
+ lastDragRowClass = '';
5073
5354
  ctx.emit(EMIT_EVENTS.DRAG_END, {
5074
5355
  sourceEvent: event,
5075
5356
  data: resp.pageData
@@ -5080,9 +5361,17 @@ function _isSlot(s) {
5080
5361
  onDragleave: onDragleave,
5081
5362
  onDragstart: onDragstart,
5082
5363
  onDragover: onDragover,
5083
- onDrop: onDrop
5364
+ onDragend: onDragend
5084
5365
  };
5085
5366
  });
5367
+ ;// CONCATENATED MODULE: external "../input"
5368
+ var input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
5369
+ var input_y = x => () => x
5370
+ const input_namespaceObject = input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__["default"] });
5371
+ ;// CONCATENATED MODULE: external "../input/input.less"
5372
+ var input_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
5373
+ var input_less_y = x => () => x
5374
+ const input_less_namespaceObject = input_less_x({ });
5086
5375
  ;// CONCATENATED MODULE: ../../packages/table/src/plugins/head-filter.tsx
5087
5376
 
5088
5377
 
@@ -5128,6 +5417,8 @@ function _isSlot(s) {
5128
5417
 
5129
5418
 
5130
5419
 
5420
+
5421
+
5131
5422
  function head_filter_isSlot(s) {
5132
5423
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
5133
5424
  }
@@ -5144,8 +5435,10 @@ function head_filter_isSlot(s) {
5144
5435
  resolveClassName = _usePrefix.resolveClassName;
5145
5436
  var t = (0,config_provider_namespaceObject.useLocale)('table');
5146
5437
  var column = props.column;
5147
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props.column),
5148
- filter = _toRefs.filter;
5438
+ var filter = (0,external_vue_namespaceObject.computed)(function () {
5439
+ var _props$column;
5440
+ return (_props$column = props.column) === null || _props$column === void 0 ? void 0 : _props$column.filter;
5441
+ });
5149
5442
  var checked = (0,external_vue_namespaceObject.computed)(function () {
5150
5443
  var _filter$value$checked, _filter$value;
5151
5444
  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 : [];
@@ -5192,7 +5485,6 @@ function head_filter_isSlot(s) {
5192
5485
  var filterList = list.filter(function (l) {
5193
5486
  return getRegExp(searchValue.value).test(l.value);
5194
5487
  });
5195
- console.log(' filterList: ', filterList);
5196
5488
  return filterList;
5197
5489
  });
5198
5490
  var getRegExp = function getRegExp(val) {
@@ -5368,7 +5660,7 @@ function head_filter_isSlot(s) {
5368
5660
  "class": headFilterContentClass
5369
5661
  }, [(0,external_vue_namespaceObject.createVNode)("div", {
5370
5662
  "style": "padding: 4px 10px;"
5371
- }, [(0,external_vue_namespaceObject.createVNode)((0,external_vue_namespaceObject.resolveComponent)("bk-input"), {
5663
+ }, [(0,external_vue_namespaceObject.createVNode)(input_namespaceObject["default"], {
5372
5664
  "modelValue": searchValue.value,
5373
5665
  "onUpdate:modelValue": function onUpdateModelValue($event) {
5374
5666
  return searchValue.value = $event;
@@ -5482,7 +5774,8 @@ function _slicedToArray(arr, i) {
5482
5774
  props: {
5483
5775
  column: IColumnType,
5484
5776
  defaultSort: shared_namespaceObject.PropTypes.oneOf(SORT_OPTIONS).def(SORT_OPTION.NULL),
5485
- active: shared_namespaceObject.PropTypes.bool
5777
+ active: shared_namespaceObject.PropTypes.bool,
5778
+ sortValFormat: shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.any).def([''])
5486
5779
  },
5487
5780
  emits: ['change'],
5488
5781
  setup: function setup(props, _ref) {
@@ -5520,8 +5813,8 @@ function _slicedToArray(arr, i) {
5520
5813
  if (sortType.value === type) {
5521
5814
  currentSort = SORT_OPTION.NULL;
5522
5815
  }
5523
- var execFn = getSortFn(props.column, currentSort);
5524
- var sort = resolveSort(props.column.sort, props.column);
5816
+ var execFn = getSortFn(props.column, currentSort, props.sortValFormat);
5817
+ var sort = resolveSort(props.column.sort, props.column, props.sortValFormat);
5525
5818
  if ((sort === null || sort === void 0 ? void 0 : sort.value) === 'custom') {
5526
5819
  var _sort$sortFn;
5527
5820
  emit('change', (_sort$sortFn = sort === null || sort === void 0 ? void 0 : sort.sortFn) !== null && _sort$sortFn !== void 0 ? _sort$sortFn : execFn, currentSort);
@@ -5632,7 +5925,7 @@ function use_head_cell_isSlot(s) {
5632
5925
  var type = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE);
5633
5926
  nextSort.value = getNextSortType(type);
5634
5927
  var sortFn = function sortFn(a, b) {
5635
- return getSortFnByColumn(column, getSortFn(column, nextSort.value), a, b);
5928
+ return getSortFnByColumn(column, getSortFn(column, nextSort.value, props.sortValFormat), a, b);
5636
5929
  };
5637
5930
  tableResp.setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE, nextSort.value);
5638
5931
  tableResp.setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_FN, sortFn);
@@ -5718,7 +6011,8 @@ function use_head_cell_isSlot(s) {
5718
6011
  "column": column,
5719
6012
  "defaultSort": active.value ? nextSort.value : SORT_OPTION.NULL,
5720
6013
  "onChange": handleSortClick,
5721
- "active": active.value
6014
+ "active": active.value,
6015
+ "sortValFormat": props.sortValFormat
5722
6016
  }, null);
5723
6017
  };
5724
6018
  var getFilterCell = function getFilterCell(column, index) {
@@ -6044,7 +6338,7 @@ function use_render_isSlot(s) {
6044
6338
  }
6045
6339
  return '';
6046
6340
  };
6047
- var getRowSpanConfig = function getRowSpanConfig(row, index, preRow, col, store) {
6341
+ var getRowSpanConfig = function getRowSpanConfig(row, rowIndex, preRow, col, store) {
6048
6342
  var _store$get$get, _store$get;
6049
6343
  if (!store.has(row)) {
6050
6344
  store.set(row, new WeakMap());
@@ -6059,7 +6353,7 @@ function use_render_isSlot(s) {
6059
6353
  _ref$skipRowLen = _ref.skipRowLen,
6060
6354
  skipRowLen = _ref$skipRowLen === void 0 ? 0 : _ref$skipRowLen;
6061
6355
  var skipRow = false;
6062
- var rowspan = resolveColumnSpan(col, null, row, index, 'rowspan');
6356
+ var rowspan = resolveColumnSpan(col, null, row, rowIndex, 'rowspan');
6063
6357
  if (skipRowLen > 1) {
6064
6358
  skipRowLen = skipRowLen - 1;
6065
6359
  skipRow = true;
@@ -6132,7 +6426,7 @@ function use_render_isSlot(s) {
6132
6426
  rowspan = _resolveCellSpan.rowspan;
6133
6427
  var _tableResp$getColumnA = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SPAN),
6134
6428
  skipCol = _tableResp$getColumnA.skipCol;
6135
- var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, index, preRow, column, rowSpanMap) : {
6429
+ var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, rowIndex, preRow, column, rowSpanMap) : {
6136
6430
  skipRow: false
6137
6431
  },
6138
6432
  skipRow = _ref2.skipRow;
@@ -6482,6 +6776,7 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6482
6776
 
6483
6777
 
6484
6778
 
6779
+
6485
6780
  /* harmony default export */ const table = ((0,external_vue_namespaceObject.defineComponent)({
6486
6781
  // eslint-disable-next-line vue/no-reserved-component-names
6487
6782
  name: 'Table',
@@ -6538,6 +6833,11 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6538
6833
  hasScrollY: hasScrollYRef.value
6539
6834
  };
6540
6835
  });
6836
+ use_observer_resize(root, function () {
6837
+ (0,external_vue_namespaceObject.nextTick)(function () {
6838
+ resolveFixedColumns(tableOffsetRight.value);
6839
+ });
6840
+ });
6541
6841
  var _useRender = use_render(props, ctx, tableSchema, styleRef, head, root, resetTableHeight),
6542
6842
  renderTableBodySchema = _useRender.renderTableBodySchema,
6543
6843
  renderTableFooter = _useRender.renderTableFooter,
@@ -6555,13 +6855,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6555
6855
  }
6556
6856
  };
6557
6857
  var isFirstLoad = (0,external_vue_namespaceObject.ref)(true);
6558
- // const tableWidth = ref(null);
6559
- (0,external_vue_namespaceObject.watch)(function () {
6560
- return [props.data, columns];
6561
- }, function () {
6858
+ (0,external_vue_namespaceObject.watchEffect)(function () {
6859
+ tableSchema.formatDataSchema(props.data);
6860
+ tableSchema.formatColumns(columns);
6861
+ resolveFixedColumns(tableOffsetRight.value);
6562
6862
  tableSchema.setIndexData().then(function () {
6563
- tableSchema.formatColumns(columns);
6564
- tableSchema.formatDataSchema(props.data);
6863
+ // tableSchema.formatDataSchema(props.data);
6565
6864
  tableSchema.resetStartEndIndex();
6566
6865
  if (isFirstLoad.value) {
6567
6866
  tableSchema.resolveByDefColumns();
@@ -6572,7 +6871,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6572
6871
  registerResizeEvent();
6573
6872
  (0,external_vue_namespaceObject.nextTick)(function () {
6574
6873
  updateOffsetRight();
6575
- resolveFixedColumns(tableOffsetRight.value);
6576
6874
  /**
6577
6875
  * 确保在所有数据渲染完毕再执行fix column计算
6578
6876
  */
@@ -6581,9 +6879,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6581
6879
  });
6582
6880
  });
6583
6881
  });
6584
- }, {
6585
- immediate: true,
6586
- deep: true
6587
6882
  });
6588
6883
  (0,external_vue_namespaceObject.watch)(function () {
6589
6884
  return [props.height, props.maxHeight, props.minHeight];