bkui-vue 1.0.3-beta.2 → 1.0.3-beta.20

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 (204) hide show
  1. package/dist/index.cjs.js +71 -71
  2. package/dist/index.esm.js +15086 -13945
  3. package/dist/index.umd.js +70 -70
  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/affix/index.js +1 -0
  16. package/lib/alert/alert.variable.css +3 -0
  17. package/lib/alert/index.js +1 -0
  18. package/lib/animate-number/index.js +1 -0
  19. package/lib/backtop/backtop.variable.css +3 -0
  20. package/lib/backtop/index.js +1 -0
  21. package/lib/badge/badge.variable.css +3 -0
  22. package/lib/badge/index.js +1 -0
  23. package/lib/breadcrumb/breadcrumb.variable.css +3 -0
  24. package/lib/breadcrumb/index.js +1 -0
  25. package/lib/button/button.variable.css +3 -0
  26. package/lib/button/index.js +1 -0
  27. package/lib/card/card.variable.css +3 -0
  28. package/lib/card/index.js +1 -0
  29. package/lib/cascader/cascader.variable.css +3 -0
  30. package/lib/cascader/index.js +1 -0
  31. package/lib/checkbox/checkbox.variable.css +3 -0
  32. package/lib/checkbox/index.js +1 -0
  33. package/lib/code-diff/code-diff.variable.css +3 -0
  34. package/lib/code-diff/index.js +1 -0
  35. package/lib/collapse/collapse.variable.css +3 -0
  36. package/lib/collapse/index.js +1 -0
  37. package/lib/collapse-transition/collapse-transition.variable.css +3 -0
  38. package/lib/collapse-transition/index.js +1 -0
  39. package/lib/color-picker/color-picker.variable.css +3 -0
  40. package/lib/color-picker/index.js +1 -0
  41. package/lib/components.js +0 -4
  42. package/lib/config-provider/config-provider.d.ts +3 -0
  43. package/lib/config-provider/config-provider.variable.css +3 -0
  44. package/lib/config-provider/index.d.ts +4 -0
  45. package/lib/config-provider/index.js +1 -0
  46. package/lib/config-provider/token.d.ts +1 -0
  47. package/lib/container/container.variable.css +3 -0
  48. package/lib/container/index.js +1 -0
  49. package/lib/date-picker/date-picker.variable.css +3 -0
  50. package/lib/date-picker/index.js +1 -0
  51. package/lib/dialog/dialog.variable.css +3 -0
  52. package/lib/dialog/index.js +1 -0
  53. package/lib/directives/index.js +1 -0
  54. package/lib/dist.index.js +0 -1
  55. package/lib/divider/divider.variable.css +3 -0
  56. package/lib/divider/index.js +1 -0
  57. package/lib/dropdown/dropdown.css +3 -1
  58. package/lib/dropdown/dropdown.variable.css +6 -1
  59. package/lib/dropdown/index.js +1 -0
  60. package/lib/exception/exception.variable.css +3 -0
  61. package/lib/exception/index.js +1 -0
  62. package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
  63. package/lib/fixed-navbar/index.js +1 -0
  64. package/lib/form/form.css +1 -0
  65. package/lib/form/form.less +2 -0
  66. package/lib/form/form.variable.css +4 -0
  67. package/lib/form/index.js +1 -0
  68. package/lib/hooks.js +1 -8
  69. package/lib/icon/index.d.ts +1 -0
  70. package/lib/icon/index.js +35 -1
  71. package/lib/icon/text-all.d.ts +4 -0
  72. package/lib/icon/text-all.js +276 -0
  73. package/lib/image/image-viewer.variable.css +3 -0
  74. package/lib/image/image.variable.css +3 -0
  75. package/lib/image/index.js +1 -0
  76. package/lib/index.js +0 -1
  77. package/lib/info-box/index.js +41 -455
  78. package/lib/info-box/info-box.variable.css +3 -0
  79. package/lib/input/index.js +6 -0
  80. package/lib/input/input.variable.css +3 -0
  81. package/lib/link/index.js +1 -0
  82. package/lib/link/link.variable.css +3 -0
  83. package/lib/loading/index.js +1 -0
  84. package/lib/loading/loading.variable.css +3 -0
  85. package/lib/locale/index.js +5 -2
  86. package/lib/locale/lang/en.d.ts +1 -0
  87. package/lib/menu/index.js +1 -0
  88. package/lib/menu/menu.variable.css +3 -0
  89. package/lib/menu/submenu.variable.css +3 -0
  90. package/lib/message/index.js +1 -0
  91. package/lib/message/message.variable.css +3 -0
  92. package/lib/modal/index.d.ts +6 -6
  93. package/lib/modal/index.js +2 -1
  94. package/lib/modal/modal.d.ts +2 -2
  95. package/lib/modal/modal.variable.css +3 -0
  96. package/lib/navigation/index.js +1 -0
  97. package/lib/navigation/navigation.variable.css +3 -0
  98. package/lib/notify/index.js +1 -0
  99. package/lib/notify/notify.variable.css +3 -0
  100. package/lib/overflow-title/index.js +1 -0
  101. package/lib/pagination/index.js +1 -1
  102. package/lib/pagination/pagination.variable.css +3 -0
  103. package/lib/plugin-popover/index.d.ts +1 -1
  104. package/lib/plugin-popover/index.js +20 -12
  105. package/lib/plugins/index.js +1 -0
  106. package/lib/pop-confirm/index.js +1 -0
  107. package/lib/pop-confirm/pop-confirm.variable.css +3 -0
  108. package/lib/popover/content.d.ts +1 -1
  109. package/lib/popover/index.js +20 -12
  110. package/lib/popover/popover.css +3 -1
  111. package/lib/popover/popover.less +4 -1
  112. package/lib/popover/popover.variable.css +6 -1
  113. package/lib/popover2/index.js +1 -0
  114. package/lib/preset.d.ts +2 -0
  115. package/lib/preset.js +14 -20
  116. package/lib/process/index.js +1 -0
  117. package/lib/process/process.variable.css +3 -0
  118. package/lib/progress/index.js +1 -0
  119. package/lib/progress/progress.variable.css +3 -0
  120. package/lib/radio/index.js +1 -0
  121. package/lib/radio/radio.variable.css +3 -0
  122. package/lib/rate/index.js +1 -0
  123. package/lib/rate/rate.variable.css +3 -0
  124. package/lib/rate/star.variable.css +3 -0
  125. package/lib/resize-layout/index.js +1 -0
  126. package/lib/resize-layout/resize-layout.variable.css +3 -0
  127. package/lib/search-select/index.js +1 -0
  128. package/lib/search-select/search-select.variable.css +3 -0
  129. package/lib/select/index.d.ts +68 -6
  130. package/lib/select/index.js +1327 -68
  131. package/lib/select/option.d.ts +3 -1
  132. package/lib/select/pinyin/core.d.ts +14 -0
  133. package/lib/select/pinyin/dict.d.ts +34 -0
  134. package/lib/select/pinyin/index.d.ts +2 -0
  135. package/lib/select/select.css +36 -7
  136. package/lib/select/select.d.ts +28 -2
  137. package/lib/select/select.less +43 -13
  138. package/lib/select/select.variable.css +39 -7
  139. package/lib/select/type.d.ts +2 -3
  140. package/lib/shared/index.js +2 -2
  141. package/lib/sideslider/index.d.ts +6 -6
  142. package/lib/sideslider/index.js +1 -0
  143. package/lib/sideslider/sideslider.d.ts +2 -2
  144. package/lib/sideslider/sideslider.variable.css +3 -0
  145. package/lib/slider/index.js +1 -0
  146. package/lib/slider/slider.variable.css +3 -0
  147. package/lib/steps/index.js +1 -0
  148. package/lib/steps/steps.variable.css +3 -0
  149. package/lib/styles/mixins/animate.variable.css +3 -0
  150. package/lib/styles/mixins/popper.variable.css +3 -0
  151. package/lib/styles/mixins/scroll.variable.css +3 -0
  152. package/lib/styles/reset.css +3 -1
  153. package/lib/styles/reset.less +3 -1
  154. package/lib/styles/reset.variable.css +6 -1
  155. package/lib/styles/themes/themes.less +5 -0
  156. package/lib/swiper/index.js +1 -0
  157. package/lib/swiper/swiper.variable.css +3 -0
  158. package/lib/switcher/index.js +1 -0
  159. package/lib/switcher/switcher.variable.css +3 -0
  160. package/lib/tab/index.js +1 -0
  161. package/lib/tab/tab.variable.css +3 -0
  162. package/lib/table/components/table-column.d.ts +2 -0
  163. package/lib/table/index.d.ts +17 -0
  164. package/lib/table/index.js +1323 -1100
  165. package/lib/table/plugins/head-filter.variable.css +3 -0
  166. package/lib/table/plugins/head-sort.d.ts +7 -0
  167. package/lib/table/plugins/head-sort.variable.css +3 -0
  168. package/lib/table/plugins/settings.variable.css +3 -0
  169. package/lib/table/plugins/use-draggable.d.ts +2 -2
  170. package/lib/table/plugins/use-observer-resize.d.ts +5 -0
  171. package/lib/table/props.d.ts +13 -2
  172. package/lib/table/table.css +17 -17
  173. package/lib/table/table.d.ts +7 -0
  174. package/lib/table/table.less +26 -14
  175. package/lib/table/table.variable.css +20 -17
  176. package/lib/table/use-attributes.d.ts +5 -43
  177. package/lib/table/use-common.d.ts +1 -0
  178. package/lib/table/utils.d.ts +5 -4
  179. package/lib/table-column/index.d.ts +112 -106
  180. package/lib/table-column/index.js +44 -4
  181. package/lib/tag/index.js +1 -0
  182. package/lib/tag/tag.variable.css +3 -0
  183. package/lib/tag-input/index.d.ts +4 -4
  184. package/lib/tag-input/index.js +1 -0
  185. package/lib/tag-input/tag-input.d.ts +2 -2
  186. package/lib/tag-input/tag-input.variable.css +3 -0
  187. package/lib/tag-input/tag-props.d.ts +1 -1
  188. package/lib/tag-input/tag-render.d.ts +1 -1
  189. package/lib/time-picker/index.d.ts +35 -35
  190. package/lib/time-picker/index.js +1 -0
  191. package/lib/time-picker/time-picker.variable.css +3 -0
  192. package/lib/timeline/index.js +1 -0
  193. package/lib/timeline/timeline.variable.css +3 -0
  194. package/lib/transfer/index.js +1 -0
  195. package/lib/transfer/transfer.variable.css +3 -0
  196. package/lib/tree/index.js +1 -0
  197. package/lib/tree/tree.variable.css +3 -0
  198. package/lib/upload/index.js +1 -0
  199. package/lib/upload/upload.variable.css +3 -0
  200. package/lib/virtual-render/index.d.ts +9 -9
  201. package/lib/virtual-render/index.js +1 -0
  202. package/lib/virtual-render/virtual-render.d.ts +3 -3
  203. package/lib/virtual-render/virtual-render.variable.css +3 -0
  204. package/package.json +3 -2
@@ -1,3 +1,4 @@
1
+ import "../styles/reset.css";
1
2
  import "./table.less";
2
3
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
3
4
  import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
@@ -7,10 +8,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_virtual_render_927587a8__ fro
7
8
  import "../virtual-render/virtual-render.less";
8
9
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__ from "lodash/isElement";
9
10
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
10
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
11
- import "../loading/loading.less";
12
11
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
13
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";
14
15
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../checkbox";
15
16
  import "../checkbox/checkbox.less";
16
17
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
@@ -24,6 +25,8 @@ import "../button/button.less";
24
25
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53__ from "../icon/";
25
26
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
26
27
  import "../popover/popover.less";
28
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__ from "../input";
29
+ import "../input/input.less";
27
30
  /******/ // The require scope
28
31
  /******/ var __webpack_require__ = {};
29
32
  /******/
@@ -119,7 +122,7 @@ function defineProperty_defineProperty(obj, key, value) {
119
122
  ;// CONCATENATED MODULE: external "vue"
120
123
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
121
124
  var external_vue_y = x => () => x
122
- 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, ["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 });
123
126
  ;// CONCATENATED MODULE: ../../packages/table/src/const.ts
124
127
 
125
128
  /*
@@ -451,6 +454,13 @@ var tableProps = {
451
454
  * 是否显示Head
452
455
  */
453
456
  showHead: shared_namespaceObject.PropTypes.bool.def(true),
457
+ /**
458
+ * 排序时对需要排序的字符串数值进行格式化
459
+ * 这里需要配置为正则或者回调函数,(str) => string | number | boolean
460
+ * 如果配置为正则,程序会提取匹配到的第一个结果尝试转换为数值
461
+ * 如果为多个,程序会顺序执行所有正则表达式,直到转换成功
462
+ */
463
+ sortValFormat: shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.any).def(['']),
454
464
  /**
455
465
  * table header config
456
466
  */
@@ -694,18 +704,38 @@ var TableColumnProp = {
694
704
  var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
695
705
  field: props.prop || props.field
696
706
  }));
707
+ var isIndexPropChanged = (0,external_vue_namespaceObject.ref)(false);
708
+ var setIsIndexChanged = function setIsIndexChanged(val) {
709
+ isIndexPropChanged.value = val;
710
+ };
697
711
  return {
712
+ isIndexPropChanged: isIndexPropChanged,
713
+ setIsIndexChanged: setIsIndexChanged,
698
714
  initColumns: initColumns,
699
715
  bkTableCache: bkTableCache,
700
716
  column: column
701
717
  };
702
718
  },
719
+ watch: {
720
+ index: {
721
+ handler: function handler() {
722
+ this.setIsIndexChanged(!this.isIndexPropChanged);
723
+ },
724
+ deep: true
725
+ }
726
+ },
703
727
  unmounted: function unmounted() {
704
728
  this.updateColumnDefine(true);
705
729
  },
706
730
  mounted: function mounted() {
707
731
  this.updateColumnDefine();
708
732
  },
733
+ updated: function updated() {
734
+ if (this.isIndexPropChanged) {
735
+ this.updateColumnDefineByParent();
736
+ this.setIsIndexChanged(!this.isIndexPropChanged);
737
+ }
738
+ },
709
739
  methods: {
710
740
  updateColumnDefine: function updateColumnDefine() {
711
741
  var unmounted = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
@@ -728,7 +758,19 @@ var TableColumnProp = {
728
758
  var fn = function fn() {
729
759
  // @ts-ignore
730
760
  var selfVnode = _this._;
731
- var colList = selfVnode.parent.vnode.children["default"]() || [];
761
+ var getTableNode = function getTableNode() {
762
+ var _parentVnode$type;
763
+ var parentVnode = selfVnode.parent;
764
+ if (((_parentVnode$type = parentVnode.type) === null || _parentVnode$type === void 0 ? void 0 : _parentVnode$type.name) === 'Table') {
765
+ return parentVnode.vnode;
766
+ }
767
+ return getTableNode();
768
+ };
769
+ var tableNode = getTableNode();
770
+ if (!tableNode) {
771
+ return;
772
+ }
773
+ var colList = tableNode.children["default"]() || [];
732
774
  var sortColumns = [];
733
775
  var index = 0;
734
776
  var reduceColumns = function reduceColumns(nodes) {
@@ -736,7 +778,7 @@ var TableColumnProp = {
736
778
  return;
737
779
  }
738
780
  nodes.forEach(function (node) {
739
- var _node$type, _node$children2;
781
+ var _node$type, _node$children2, _node$type2;
740
782
  if (Array.isArray(node)) {
741
783
  reduceColumns(node);
742
784
  return;
@@ -754,7 +796,7 @@ var TableColumnProp = {
754
796
  sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
755
797
  index = index + 1;
756
798
  }
757
- if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0) {
799
+ if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0 && ((_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : _node$type2.name) !== 'Table') {
758
800
  reduceColumns(node.children);
759
801
  }
760
802
  });
@@ -1429,629 +1471,270 @@ function _toConsumableArray(arr) {
1429
1471
  updateFixClass: updateFixClass
1430
1472
  };
1431
1473
  });
1432
- ;// CONCATENATED MODULE: external "../loading"
1433
- var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1434
- var loading_y = x => () => x
1435
- 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"] });
1436
- ;// CONCATENATED MODULE: external "../loading/loading.less"
1437
- var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1438
- var loading_less_y = x => () => x
1439
- const loading_less_namespaceObject = loading_less_x({ });
1440
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
1441
-
1442
-
1443
- /*
1444
- * Tencent is pleased to support the open source community by making
1445
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1446
- *
1447
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1448
- *
1449
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1450
- *
1451
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1452
- *
1453
- * ---------------------------------------------------
1454
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1455
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1456
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1457
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1458
- *
1459
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1460
- * the Software.
1461
- *
1462
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1463
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1464
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1465
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1466
- * IN THE SOFTWARE.
1467
- */
1474
+ ;// CONCATENATED MODULE: external "lodash/debounce"
1475
+ var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1476
+ var debounce_y = x => () => x
1477
+ const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
1478
+ ;// CONCATENATED MODULE: external "lodash/get"
1479
+ var get_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1480
+ var get_y = x => () => x
1481
+ const get_namespaceObject = get_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__["default"] });
1482
+ ;// CONCATENATED MODULE: ../../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
1483
+ /**
1484
+ * A collection of shims that provide minimal functionality of the ES6 collections.
1485
+ *
1486
+ * These implementations are not meant to be used outside of the ResizeObserver
1487
+ * modules as they cover only a limited range of use cases.
1488
+ */
1489
+ /* eslint-disable require-jsdoc, valid-jsdoc */
1490
+ var MapShim = (function () {
1491
+ if (typeof Map !== 'undefined') {
1492
+ return Map;
1493
+ }
1494
+ /**
1495
+ * Returns index in provided array that matches the specified key.
1496
+ *
1497
+ * @param {Array<Array>} arr
1498
+ * @param {*} key
1499
+ * @returns {number}
1500
+ */
1501
+ function getIndex(arr, key) {
1502
+ var result = -1;
1503
+ arr.some(function (entry, index) {
1504
+ if (entry[0] === key) {
1505
+ result = index;
1506
+ return true;
1507
+ }
1508
+ return false;
1509
+ });
1510
+ return result;
1511
+ }
1512
+ return /** @class */ (function () {
1513
+ function class_1() {
1514
+ this.__entries__ = [];
1515
+ }
1516
+ Object.defineProperty(class_1.prototype, "size", {
1517
+ /**
1518
+ * @returns {boolean}
1519
+ */
1520
+ get: function () {
1521
+ return this.__entries__.length;
1522
+ },
1523
+ enumerable: true,
1524
+ configurable: true
1525
+ });
1526
+ /**
1527
+ * @param {*} key
1528
+ * @returns {*}
1529
+ */
1530
+ class_1.prototype.get = function (key) {
1531
+ var index = getIndex(this.__entries__, key);
1532
+ var entry = this.__entries__[index];
1533
+ return entry && entry[1];
1534
+ };
1535
+ /**
1536
+ * @param {*} key
1537
+ * @param {*} value
1538
+ * @returns {void}
1539
+ */
1540
+ class_1.prototype.set = function (key, value) {
1541
+ var index = getIndex(this.__entries__, key);
1542
+ if (~index) {
1543
+ this.__entries__[index][1] = value;
1544
+ }
1545
+ else {
1546
+ this.__entries__.push([key, value]);
1547
+ }
1548
+ };
1549
+ /**
1550
+ * @param {*} key
1551
+ * @returns {void}
1552
+ */
1553
+ class_1.prototype.delete = function (key) {
1554
+ var entries = this.__entries__;
1555
+ var index = getIndex(entries, key);
1556
+ if (~index) {
1557
+ entries.splice(index, 1);
1558
+ }
1559
+ };
1560
+ /**
1561
+ * @param {*} key
1562
+ * @returns {void}
1563
+ */
1564
+ class_1.prototype.has = function (key) {
1565
+ return !!~getIndex(this.__entries__, key);
1566
+ };
1567
+ /**
1568
+ * @returns {void}
1569
+ */
1570
+ class_1.prototype.clear = function () {
1571
+ this.__entries__.splice(0);
1572
+ };
1573
+ /**
1574
+ * @param {Function} callback
1575
+ * @param {*} [ctx=null]
1576
+ * @returns {void}
1577
+ */
1578
+ class_1.prototype.forEach = function (callback, ctx) {
1579
+ if (ctx === void 0) { ctx = null; }
1580
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
1581
+ var entry = _a[_i];
1582
+ callback.call(ctx, entry[1], entry[0]);
1583
+ }
1584
+ };
1585
+ return class_1;
1586
+ }());
1587
+ })();
1468
1588
 
1589
+ /**
1590
+ * Detects whether window and document objects are available in current environment.
1591
+ */
1592
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
1469
1593
 
1594
+ // Returns global object of a current environment.
1595
+ var global$1 = (function () {
1596
+ if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
1597
+ return __webpack_require__.g;
1598
+ }
1599
+ if (typeof self !== 'undefined' && self.Math === Math) {
1600
+ return self;
1601
+ }
1602
+ if (typeof window !== 'undefined' && window.Math === Math) {
1603
+ return window;
1604
+ }
1605
+ // eslint-disable-next-line no-new-func
1606
+ return Function('return this')();
1607
+ })();
1470
1608
 
1609
+ /**
1610
+ * A shim for the requestAnimationFrame which falls back to the setTimeout if
1611
+ * first one is not supported.
1612
+ *
1613
+ * @returns {number} Requests' identifier.
1614
+ */
1615
+ var requestAnimationFrame$1 = (function () {
1616
+ if (typeof requestAnimationFrame === 'function') {
1617
+ // It's required to use a bounded function because IE sometimes throws
1618
+ // an "Invalid calling object" error if rAF is invoked without the global
1619
+ // object on the left hand side.
1620
+ return requestAnimationFrame.bind(global$1);
1621
+ }
1622
+ return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
1623
+ })();
1471
1624
 
1472
- /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
1473
- var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
1474
- var getLoadingOption = function getLoadingOption() {
1475
- if (typeof refScrollLoading.value === 'boolean') {
1476
- return {
1477
- loading: !!refScrollLoading.value,
1478
- inline: true,
1479
- title: '',
1480
- size: loading_namespaceObject.BkLoadingSize.Normal,
1481
- mode: loading_namespaceObject.BkLoadingMode.Default,
1482
- indicator: null
1483
- };
1484
- }
1485
- return refScrollLoading.value;
1486
- };
1487
- var isRender = (0,external_vue_namespaceObject.computed)(function () {
1488
- return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
1489
- });
1490
- var renderScrollLoading = function renderScrollLoading() {
1491
- if (isRender.value) {
1492
- var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
1493
- var _getLoadingOption = getLoadingOption(),
1494
- loading = _getLoadingOption.loading,
1495
- size = _getLoadingOption.size,
1496
- mode = _getLoadingOption.mode,
1497
- title = _getLoadingOption.title,
1498
- inline = _getLoadingOption.inline,
1499
- indicator = _getLoadingOption.indicator;
1500
- 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"], {
1501
- loading: loading,
1502
- size: size,
1503
- mode: mode,
1504
- title: title,
1505
- inline: inline,
1506
- indicator: indicator
1507
- }, null);
1508
- }
1509
- };
1510
- return {
1511
- renderScrollLoading: renderScrollLoading
1512
- };
1513
- });
1514
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
1515
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1516
- /* harmony default export */ const esm_browser_native = ({
1517
- randomUUID
1518
- });
1519
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
1520
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1521
- // require the crypto API and do not support built-in fallback to lower quality random number
1522
- // generators (like Math.random()).
1523
- let getRandomValues;
1524
- const rnds8 = new Uint8Array(16);
1525
- function rng() {
1526
- // lazy load so that environments that need to polyfill have a chance to do so
1527
- if (!getRandomValues) {
1528
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1529
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1530
-
1531
- if (!getRandomValues) {
1532
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1533
- }
1534
- }
1535
-
1536
- return getRandomValues(rnds8);
1537
- }
1538
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
1539
-
1540
- /**
1541
- * Convert array of 16 byte values to UUID string format of the form:
1542
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1543
- */
1544
-
1545
- const byteToHex = [];
1546
-
1547
- for (let i = 0; i < 256; ++i) {
1548
- byteToHex.push((i + 0x100).toString(16).slice(1));
1549
- }
1550
-
1551
- function unsafeStringify(arr, offset = 0) {
1552
- // Note: Be careful editing this code! It's been tuned for performance
1553
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1554
- 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]];
1555
- }
1556
-
1557
- function stringify(arr, offset = 0) {
1558
- const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
1559
- // of the following:
1560
- // - One or more input array values don't map to a hex octet (leading to
1561
- // "undefined" in the uuid)
1562
- // - Invalid input values for the RFC `version` or `variant` fields
1563
-
1564
- if (!validate(uuid)) {
1565
- throw TypeError('Stringified UUID is invalid');
1566
- }
1567
-
1568
- return uuid;
1569
- }
1570
-
1571
- /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
1572
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
1573
-
1574
-
1575
-
1576
-
1577
- function v4(options, buf, offset) {
1578
- if (esm_browser_native.randomUUID && !buf && !options) {
1579
- return esm_browser_native.randomUUID();
1580
- }
1581
-
1582
- options = options || {};
1583
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1584
-
1585
- rnds[6] = rnds[6] & 0x0f | 0x40;
1586
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1587
-
1588
- if (buf) {
1589
- offset = offset || 0;
1590
-
1591
- for (let i = 0; i < 16; ++i) {
1592
- buf[offset + i] = rnds[i];
1593
- }
1594
-
1595
- return buf;
1596
- }
1597
-
1598
- return unsafeStringify(rnds);
1625
+ // Defines minimum timeout before adding a trailing call.
1626
+ var trailingTimeout = 2;
1627
+ /**
1628
+ * Creates a wrapper function which ensures that provided callback will be
1629
+ * invoked only once during the specified delay period.
1630
+ *
1631
+ * @param {Function} callback - Function to be invoked after the delay period.
1632
+ * @param {number} delay - Delay after which to invoke callback.
1633
+ * @returns {Function}
1634
+ */
1635
+ function throttle (callback, delay) {
1636
+ var leadingCall = false, trailingCall = false, lastCallTime = 0;
1637
+ /**
1638
+ * Invokes the original callback function and schedules new invocation if
1639
+ * the "proxy" was called during current request.
1640
+ *
1641
+ * @returns {void}
1642
+ */
1643
+ function resolvePending() {
1644
+ if (leadingCall) {
1645
+ leadingCall = false;
1646
+ callback();
1647
+ }
1648
+ if (trailingCall) {
1649
+ proxy();
1650
+ }
1651
+ }
1652
+ /**
1653
+ * Callback invoked after the specified delay. It will further postpone
1654
+ * invocation of the original function delegating it to the
1655
+ * requestAnimationFrame.
1656
+ *
1657
+ * @returns {void}
1658
+ */
1659
+ function timeoutCallback() {
1660
+ requestAnimationFrame$1(resolvePending);
1661
+ }
1662
+ /**
1663
+ * Schedules invocation of the original function.
1664
+ *
1665
+ * @returns {void}
1666
+ */
1667
+ function proxy() {
1668
+ var timeStamp = Date.now();
1669
+ if (leadingCall) {
1670
+ // Reject immediately following calls.
1671
+ if (timeStamp - lastCallTime < trailingTimeout) {
1672
+ return;
1673
+ }
1674
+ // Schedule new call to be in invoked when the pending one is resolved.
1675
+ // This is important for "transitions" which never actually start
1676
+ // immediately so there is a chance that we might miss one if change
1677
+ // happens amids the pending invocation.
1678
+ trailingCall = true;
1679
+ }
1680
+ else {
1681
+ leadingCall = true;
1682
+ trailingCall = false;
1683
+ setTimeout(timeoutCallback, delay);
1684
+ }
1685
+ lastCallTime = timeStamp;
1686
+ }
1687
+ return proxy;
1599
1688
  }
1600
1689
 
1601
- /* harmony default export */ const esm_browser_v4 = (v4);
1602
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
1603
-
1604
-
1605
-
1606
- 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; }
1607
- 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; }
1608
- /*
1609
- * Tencent is pleased to support the open source community by making
1610
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1611
- *
1612
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1613
- *
1614
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1615
- *
1616
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1617
- *
1618
- * ---------------------------------------------------
1619
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1620
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1621
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1622
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1623
- *
1624
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1625
- * the Software.
1626
- *
1627
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1628
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1629
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1630
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1631
- * IN THE SOFTWARE.
1632
- */
1633
-
1634
-
1635
- /**
1636
- * 处理 Prop中的分页配置
1637
- * prop中的配置会覆盖本地的配置
1638
- * @param propPagination 用户传入的配置
1639
- * @param defVal 默认配置
1640
- * @returns 返回值
1641
- */
1642
- var resolvePaginationOption = function resolvePaginationOption(propPagination, defVal) {
1643
- if (!!propPagination) {
1644
- if (typeof_typeof(propPagination) === 'object') {
1645
- var current = Object.prototype.hasOwnProperty.call(propPagination, 'current') ? propPagination.current : propPagination.value;
1646
- if (!/\d+/.test(current)) {
1647
- current = 1;
1648
- }
1649
- return use_pagination_objectSpread(use_pagination_objectSpread(use_pagination_objectSpread({}, defVal), propPagination), {}, {
1650
- current: current
1651
- });
1652
- }
1653
- return defVal;
1654
- }
1655
- return {};
1656
- };
1657
- /* harmony default export */ const use_pagination = (function (props) {
1658
- var startIndex = (0,external_vue_namespaceObject.ref)(0);
1659
- var endIndex = (0,external_vue_namespaceObject.ref)(0);
1660
- /**
1661
- * 分页配置
1662
- * 用于配置分页组件
1663
- * pagination 为Prop传入配置
1664
- * 方便兼容内置分页功能,此处需要单独处理count
1665
- */
1666
- var propsData = (0,external_vue_namespaceObject.computed)(function () {
1667
- return props.data;
1668
- });
1669
- var localPagination = (0,external_vue_namespaceObject.ref)(null);
1670
- var indexData = (0,external_vue_namespaceObject.reactive)([]);
1671
- // 当前分页缓存,用于支持内置前端分页,用户无需接收change事件来自行处理数据分割
1672
- var pagination = (0,external_vue_namespaceObject.reactive)({
1673
- count: 0,
1674
- limit: 10,
1675
- current: 1,
1676
- align: 'right',
1677
- layout: ['total', 'limit', 'list']
1678
- });
1679
- var resolveLocalPagination = function resolveLocalPagination() {
1680
- if (!props.pagination) {
1681
- return;
1682
- }
1683
- localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(use_pagination_objectSpread({}, pagination), {}, {
1684
- count: indexData.length
1685
- });
1686
- };
1687
- /**
1688
- * 重置当前分页开始位置 & 结束位置
1689
- * 如果未启用分页,则开始位置为0,结束位置为 data.length
1690
- * @returns
1691
- */
1692
- var resetStartEndIndex = function resetStartEndIndex() {
1693
- if (!props.pagination || props.remotePagination) {
1694
- startIndex.value = 0;
1695
- endIndex.value = indexData.length;
1696
- return;
1697
- }
1698
- // 如果是前端分页
1699
- startIndex.value = (pagination.current - 1) * pagination.limit;
1700
- endIndex.value = pagination.current * pagination.limit;
1701
- };
1702
- /**
1703
- * 当前页分页数据
1704
- */
1705
- var pageData = (0,external_vue_namespaceObject.reactive)([]);
1706
- var sort = function sort(sourceData, sortFn, column, type, sortScope) {
1707
- if (typeof sortFn === 'function') {
1708
- sourceData.sort(function (a, b) {
1709
- return sortFn(a, b, type, column, sortScope);
1710
- });
1711
- }
1712
- };
1713
- /**
1714
- * 初始化排序动作
1715
- * @param data
1716
- * @param sortColumns
1717
- */
1718
- var multiSort = function multiSort(data, sortColumns) {
1719
- sortColumns.forEach(function (item) {
1720
- 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]);
1721
- });
1722
- };
1723
- var filter = function filter(sourceData, filterFn) {
1724
- if (typeof filterFn === 'function') {
1725
- var filterVals = sourceData.filter(function (row, index) {
1726
- return filterFn(row, index, indexData);
1727
- });
1728
- sourceData.length = 0;
1729
- sourceData.push.apply(sourceData, _toConsumableArray(filterVals));
1730
- }
1731
- return sourceData;
1732
- };
1733
- var resolveIndexData = function resolveIndexData() {
1734
- return new Promise(function (resolve) {
1735
- (0,external_vue_namespaceObject.nextTick)(function () {
1736
- var target = propsData.value.slice();
1737
- indexData.length = 0;
1738
- indexData.push.apply(indexData, _toConsumableArray(target));
1739
- resolve();
1740
- });
1741
- });
1742
- };
1743
- var resolvePageData = function resolvePageData(filterFn, sortFn, column, type, sortScope, multiCol) {
1744
- var sourceData = indexData.slice();
1745
- if (multiCol !== null && multiCol !== void 0 && multiCol.length) {
1746
- multiSort(sourceData, multiCol);
1747
- }
1748
- pageData.length = 0;
1749
- pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
1750
- filter(pageData, filterFn);
1751
- sort(pageData, sortFn, column, type, sortScope);
1752
- resolveLocalPagination();
1753
- };
1754
- var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
1755
- resolvePageData(null, null, null, null, null, multiCol);
1756
- };
1757
- var multiFilter = function multiFilter(filterFnList) {
1758
- var sourceData = indexData.slice();
1759
- var target = filterFnList.reduce(function (result, fn) {
1760
- return filter(result, fn);
1761
- }, sourceData);
1762
- pageData.length = 0;
1763
- pageData.push.apply(pageData, _toConsumableArray(target));
1764
- };
1765
- var handlePaginationChange = function handlePaginationChange() {
1766
- pagination = resolvePaginationOption(props.pagination, pagination);
1767
- resolveLocalPagination();
1768
- resetStartEndIndex();
1769
- resolvePageData();
1770
- };
1771
- handlePaginationChange();
1772
- (0,external_vue_namespaceObject.watch)(function () {
1773
- return [props.pagination];
1774
- }, function () {
1775
- handlePaginationChange();
1776
- }, {
1777
- deep: true
1778
- });
1779
- return {
1780
- pageData: pageData,
1781
- indexData: indexData,
1782
- localPagination: localPagination,
1783
- resolvePageData: resolvePageData,
1784
- resolveIndexData: resolveIndexData,
1785
- resolvePageDataBySortList: resolvePageDataBySortList,
1786
- resetStartEndIndex: resetStartEndIndex,
1787
- multiFilter: multiFilter,
1788
- sort: sort
1789
- };
1790
- });
1791
- ;// CONCATENATED MODULE: external "lodash/debounce"
1792
- var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1793
- var debounce_y = x => () => x
1794
- const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
1795
- ;// CONCATENATED MODULE: external "lodash/get"
1796
- var get_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1797
- var get_y = x => () => x
1798
- const get_namespaceObject = get_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__["default"] });
1799
- ;// CONCATENATED MODULE: ../../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
1690
+ // Minimum delay before invoking the update of observers.
1691
+ var REFRESH_DELAY = 20;
1692
+ // A list of substrings of CSS properties used to find transition events that
1693
+ // might affect dimensions of observed elements.
1694
+ var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
1695
+ // Check if MutationObserver is available.
1696
+ var mutationObserverSupported = typeof MutationObserver !== 'undefined';
1800
1697
  /**
1801
- * A collection of shims that provide minimal functionality of the ES6 collections.
1802
- *
1803
- * These implementations are not meant to be used outside of the ResizeObserver
1804
- * modules as they cover only a limited range of use cases.
1698
+ * Singleton controller class which handles updates of ResizeObserver instances.
1805
1699
  */
1806
- /* eslint-disable require-jsdoc, valid-jsdoc */
1807
- var MapShim = (function () {
1808
- if (typeof Map !== 'undefined') {
1809
- return Map;
1810
- }
1700
+ var ResizeObserverController = /** @class */ (function () {
1811
1701
  /**
1812
- * Returns index in provided array that matches the specified key.
1702
+ * Creates a new instance of ResizeObserverController.
1813
1703
  *
1814
- * @param {Array<Array>} arr
1815
- * @param {*} key
1816
- * @returns {number}
1704
+ * @private
1817
1705
  */
1818
- function getIndex(arr, key) {
1819
- var result = -1;
1820
- arr.some(function (entry, index) {
1821
- if (entry[0] === key) {
1822
- result = index;
1823
- return true;
1824
- }
1825
- return false;
1826
- });
1827
- return result;
1828
- }
1829
- return /** @class */ (function () {
1830
- function class_1() {
1831
- this.__entries__ = [];
1832
- }
1833
- Object.defineProperty(class_1.prototype, "size", {
1834
- /**
1835
- * @returns {boolean}
1836
- */
1837
- get: function () {
1838
- return this.__entries__.length;
1839
- },
1840
- enumerable: true,
1841
- configurable: true
1842
- });
1843
- /**
1844
- * @param {*} key
1845
- * @returns {*}
1846
- */
1847
- class_1.prototype.get = function (key) {
1848
- var index = getIndex(this.__entries__, key);
1849
- var entry = this.__entries__[index];
1850
- return entry && entry[1];
1851
- };
1852
- /**
1853
- * @param {*} key
1854
- * @param {*} value
1855
- * @returns {void}
1856
- */
1857
- class_1.prototype.set = function (key, value) {
1858
- var index = getIndex(this.__entries__, key);
1859
- if (~index) {
1860
- this.__entries__[index][1] = value;
1861
- }
1862
- else {
1863
- this.__entries__.push([key, value]);
1864
- }
1865
- };
1706
+ function ResizeObserverController() {
1866
1707
  /**
1867
- * @param {*} key
1868
- * @returns {void}
1708
+ * Indicates whether DOM listeners have been added.
1709
+ *
1710
+ * @private {boolean}
1869
1711
  */
1870
- class_1.prototype.delete = function (key) {
1871
- var entries = this.__entries__;
1872
- var index = getIndex(entries, key);
1873
- if (~index) {
1874
- entries.splice(index, 1);
1875
- }
1876
- };
1712
+ this.connected_ = false;
1877
1713
  /**
1878
- * @param {*} key
1879
- * @returns {void}
1714
+ * Tells that controller has subscribed for Mutation Events.
1715
+ *
1716
+ * @private {boolean}
1880
1717
  */
1881
- class_1.prototype.has = function (key) {
1882
- return !!~getIndex(this.__entries__, key);
1883
- };
1718
+ this.mutationEventsAdded_ = false;
1884
1719
  /**
1885
- * @returns {void}
1720
+ * Keeps reference to the instance of MutationObserver.
1721
+ *
1722
+ * @private {MutationObserver}
1886
1723
  */
1887
- class_1.prototype.clear = function () {
1888
- this.__entries__.splice(0);
1889
- };
1724
+ this.mutationsObserver_ = null;
1890
1725
  /**
1891
- * @param {Function} callback
1892
- * @param {*} [ctx=null]
1893
- * @returns {void}
1726
+ * A list of connected observers.
1727
+ *
1728
+ * @private {Array<ResizeObserverSPI>}
1894
1729
  */
1895
- class_1.prototype.forEach = function (callback, ctx) {
1896
- if (ctx === void 0) { ctx = null; }
1897
- for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
1898
- var entry = _a[_i];
1899
- callback.call(ctx, entry[1], entry[0]);
1900
- }
1901
- };
1902
- return class_1;
1903
- }());
1904
- })();
1905
-
1906
- /**
1907
- * Detects whether window and document objects are available in current environment.
1908
- */
1909
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
1910
-
1911
- // Returns global object of a current environment.
1912
- var global$1 = (function () {
1913
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
1914
- return __webpack_require__.g;
1915
- }
1916
- if (typeof self !== 'undefined' && self.Math === Math) {
1917
- return self;
1918
- }
1919
- if (typeof window !== 'undefined' && window.Math === Math) {
1920
- return window;
1921
- }
1922
- // eslint-disable-next-line no-new-func
1923
- return Function('return this')();
1924
- })();
1925
-
1926
- /**
1927
- * A shim for the requestAnimationFrame which falls back to the setTimeout if
1928
- * first one is not supported.
1929
- *
1930
- * @returns {number} Requests' identifier.
1931
- */
1932
- var requestAnimationFrame$1 = (function () {
1933
- if (typeof requestAnimationFrame === 'function') {
1934
- // It's required to use a bounded function because IE sometimes throws
1935
- // an "Invalid calling object" error if rAF is invoked without the global
1936
- // object on the left hand side.
1937
- return requestAnimationFrame.bind(global$1);
1730
+ this.observers_ = [];
1731
+ this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
1732
+ this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
1938
1733
  }
1939
- return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
1940
- })();
1941
-
1942
- // Defines minimum timeout before adding a trailing call.
1943
- var trailingTimeout = 2;
1944
- /**
1945
- * Creates a wrapper function which ensures that provided callback will be
1946
- * invoked only once during the specified delay period.
1947
- *
1948
- * @param {Function} callback - Function to be invoked after the delay period.
1949
- * @param {number} delay - Delay after which to invoke callback.
1950
- * @returns {Function}
1951
- */
1952
- function throttle (callback, delay) {
1953
- var leadingCall = false, trailingCall = false, lastCallTime = 0;
1954
1734
  /**
1955
- * Invokes the original callback function and schedules new invocation if
1956
- * the "proxy" was called during current request.
1735
+ * Adds observer to observers list.
1957
1736
  *
1958
- * @returns {void}
1959
- */
1960
- function resolvePending() {
1961
- if (leadingCall) {
1962
- leadingCall = false;
1963
- callback();
1964
- }
1965
- if (trailingCall) {
1966
- proxy();
1967
- }
1968
- }
1969
- /**
1970
- * Callback invoked after the specified delay. It will further postpone
1971
- * invocation of the original function delegating it to the
1972
- * requestAnimationFrame.
1973
- *
1974
- * @returns {void}
1975
- */
1976
- function timeoutCallback() {
1977
- requestAnimationFrame$1(resolvePending);
1978
- }
1979
- /**
1980
- * Schedules invocation of the original function.
1981
- *
1982
- * @returns {void}
1983
- */
1984
- function proxy() {
1985
- var timeStamp = Date.now();
1986
- if (leadingCall) {
1987
- // Reject immediately following calls.
1988
- if (timeStamp - lastCallTime < trailingTimeout) {
1989
- return;
1990
- }
1991
- // Schedule new call to be in invoked when the pending one is resolved.
1992
- // This is important for "transitions" which never actually start
1993
- // immediately so there is a chance that we might miss one if change
1994
- // happens amids the pending invocation.
1995
- trailingCall = true;
1996
- }
1997
- else {
1998
- leadingCall = true;
1999
- trailingCall = false;
2000
- setTimeout(timeoutCallback, delay);
2001
- }
2002
- lastCallTime = timeStamp;
2003
- }
2004
- return proxy;
2005
- }
2006
-
2007
- // Minimum delay before invoking the update of observers.
2008
- var REFRESH_DELAY = 20;
2009
- // A list of substrings of CSS properties used to find transition events that
2010
- // might affect dimensions of observed elements.
2011
- var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
2012
- // Check if MutationObserver is available.
2013
- var mutationObserverSupported = typeof MutationObserver !== 'undefined';
2014
- /**
2015
- * Singleton controller class which handles updates of ResizeObserver instances.
2016
- */
2017
- var ResizeObserverController = /** @class */ (function () {
2018
- /**
2019
- * Creates a new instance of ResizeObserverController.
2020
- *
2021
- * @private
2022
- */
2023
- function ResizeObserverController() {
2024
- /**
2025
- * Indicates whether DOM listeners have been added.
2026
- *
2027
- * @private {boolean}
2028
- */
2029
- this.connected_ = false;
2030
- /**
2031
- * Tells that controller has subscribed for Mutation Events.
2032
- *
2033
- * @private {boolean}
2034
- */
2035
- this.mutationEventsAdded_ = false;
2036
- /**
2037
- * Keeps reference to the instance of MutationObserver.
2038
- *
2039
- * @private {MutationObserver}
2040
- */
2041
- this.mutationsObserver_ = null;
2042
- /**
2043
- * A list of connected observers.
2044
- *
2045
- * @private {Array<ResizeObserverSPI>}
2046
- */
2047
- this.observers_ = [];
2048
- this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
2049
- this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
2050
- }
2051
- /**
2052
- * Adds observer to observers list.
2053
- *
2054
- * @param {ResizeObserverSPI} observer - Observer to be added.
1737
+ * @param {ResizeObserverSPI} observer - Observer to be added.
2055
1738
  * @returns {void}
2056
1739
  */
2057
1740
  ResizeObserverController.prototype.addObserver = function (observer) {
@@ -2716,23 +2399,671 @@ var ResizeObserver = /** @class */ (function () {
2716
2399
  };
2717
2400
  });
2718
2401
 
2719
- var index = (function () {
2720
- // Export existing implementation if available.
2721
- if (typeof global$1.ResizeObserver !== 'undefined') {
2722
- return global$1.ResizeObserver;
2723
- }
2724
- return ResizeObserver;
2725
- })();
2402
+ var index = (function () {
2403
+ // Export existing implementation if available.
2404
+ if (typeof global$1.ResizeObserver !== 'undefined') {
2405
+ return global$1.ResizeObserver;
2406
+ }
2407
+ return ResizeObserver;
2408
+ })();
2409
+
2410
+ /* harmony default export */ const ResizeObserver_es = (index);
2411
+
2412
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
2413
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2414
+ /* harmony default export */ const esm_browser_native = ({
2415
+ randomUUID
2416
+ });
2417
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
2418
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
2419
+ // require the crypto API and do not support built-in fallback to lower quality random number
2420
+ // generators (like Math.random()).
2421
+ let getRandomValues;
2422
+ const rnds8 = new Uint8Array(16);
2423
+ function rng() {
2424
+ // lazy load so that environments that need to polyfill have a chance to do so
2425
+ if (!getRandomValues) {
2426
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
2427
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
2428
+
2429
+ if (!getRandomValues) {
2430
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
2431
+ }
2432
+ }
2433
+
2434
+ return getRandomValues(rnds8);
2435
+ }
2436
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
2437
+
2438
+ /**
2439
+ * Convert array of 16 byte values to UUID string format of the form:
2440
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2441
+ */
2442
+
2443
+ const byteToHex = [];
2444
+
2445
+ for (let i = 0; i < 256; ++i) {
2446
+ byteToHex.push((i + 0x100).toString(16).slice(1));
2447
+ }
2448
+
2449
+ function unsafeStringify(arr, offset = 0) {
2450
+ // Note: Be careful editing this code! It's been tuned for performance
2451
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2452
+ 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]];
2453
+ }
2454
+
2455
+ function stringify(arr, offset = 0) {
2456
+ const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
2457
+ // of the following:
2458
+ // - One or more input array values don't map to a hex octet (leading to
2459
+ // "undefined" in the uuid)
2460
+ // - Invalid input values for the RFC `version` or `variant` fields
2461
+
2462
+ if (!validate(uuid)) {
2463
+ throw TypeError('Stringified UUID is invalid');
2464
+ }
2465
+
2466
+ return uuid;
2467
+ }
2468
+
2469
+ /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
2470
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
2471
+
2472
+
2473
+
2474
+
2475
+ function v4(options, buf, offset) {
2476
+ if (esm_browser_native.randomUUID && !buf && !options) {
2477
+ return esm_browser_native.randomUUID();
2478
+ }
2479
+
2480
+ options = options || {};
2481
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2482
+
2483
+ rnds[6] = rnds[6] & 0x0f | 0x40;
2484
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
2485
+
2486
+ if (buf) {
2487
+ offset = offset || 0;
2488
+
2489
+ for (let i = 0; i < 16; ++i) {
2490
+ buf[offset + i] = rnds[i];
2491
+ }
2492
+
2493
+ return buf;
2494
+ }
2495
+
2496
+ return unsafeStringify(rnds);
2497
+ }
2498
+
2499
+ /* harmony default export */ const esm_browser_v4 = (v4);
2500
+ ;// CONCATENATED MODULE: ../../packages/table/src/utils.tsx
2501
+
2502
+
2503
+
2504
+ var _this = undefined;
2505
+ function utils_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; }
2506
+ function utils_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? utils_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : utils_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2507
+ /*
2508
+ * Tencent is pleased to support the open source community by making
2509
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2510
+ *
2511
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2512
+ *
2513
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2514
+ *
2515
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2516
+ *
2517
+ * ---------------------------------------------------
2518
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2519
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2520
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2521
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2522
+ *
2523
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2524
+ * the Software.
2525
+ *
2526
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2527
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2528
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2529
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2530
+ * IN THE SOFTWARE.
2531
+ */
2532
+
2533
+
2534
+
2535
+
2536
+
2537
+
2538
+
2539
+ /**
2540
+ * 解析Prop值 | 可能为多种类型 & 函数返回的场景
2541
+ * @param prop 当前Prop
2542
+ * @param key 要处理的Key
2543
+ * @param args 如果是函数,传递参数
2544
+ * @returns
2545
+ */
2546
+ var resolvePropVal = function resolvePropVal(prop, key, args) {
2547
+ if (prop === undefined || prop === null) {
2548
+ return undefined;
2549
+ }
2550
+ if (typeof key === 'string') {
2551
+ if (Object.prototype.hasOwnProperty.call(prop, key)) {
2552
+ if (typeof prop[key] === 'function') {
2553
+ var _prop$key;
2554
+ return (_prop$key = prop[key]).call.apply(_prop$key, [_this].concat(_toConsumableArray(args)));
2555
+ }
2556
+ return prop[key];
2557
+ }
2558
+ return undefined;
2559
+ }
2560
+ if (Array.isArray(key)) {
2561
+ return key.map(function (_key) {
2562
+ return resolvePropVal(prop, _key, args);
2563
+ }).filter(function (val) {
2564
+ return val !== undefined;
2565
+ }).at(0);
2566
+ }
2567
+ };
2568
+ /**
2569
+ * 处理Props中的ActiveColumn,解析为统一的数组格式
2570
+ * @param props
2571
+ * @returns
2572
+ */
2573
+ var resolveActiveColumns = function resolveActiveColumns(props) {
2574
+ if (props.columnPick !== 'disabled') {
2575
+ if (props.columnPick === 'multi') {
2576
+ return Array.isArray(props.activeColumn) ? props.activeColumn : resolveNumberToNumArray(props.activeColumn);
2577
+ }
2578
+ return Array.isArray(props.activeColumn) ? resolveNumberToNumArray(props.activeColumn[0]) : resolveNumberToNumArray(props.activeColumn);
2579
+ }
2580
+ return [];
2581
+ };
2582
+ /**
2583
+ * 统一处理数字类型参数
2584
+ * @param prop
2585
+ * @returns
2586
+ */
2587
+ var resolveNumberToNumArray = function resolveNumberToNumArray(prop) {
2588
+ if (/^\d+$/.test("".concat(prop))) {
2589
+ return [parseInt("".concat(prop), 10)];
2590
+ }
2591
+ return [];
2592
+ };
2593
+ /*
2594
+ * 解析宽度配置
2595
+ * @param propWidth
2596
+ * @returns
2597
+ */
2598
+ var resolveWidth = function resolveWidth(propWidth) {
2599
+ return resolveNumberOrStringToPix(propWidth, 'auto');
2600
+ };
2601
+ /**
2602
+ * 解析可为数字或者字符串设置的样式配置
2603
+ * @param val 配置值
2604
+ * @param defaultValue 默认值
2605
+ * @param offset 偏移量
2606
+ * @returns 标准化px string
2607
+ */
2608
+ var resolveNumberOrStringToPix = function resolveNumberOrStringToPix(val) {
2609
+ var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '100%';
2610
+ var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2611
+ var target = '';
2612
+ if (/^auto|null|undefined$/gi.test("".concat(val))) {
2613
+ target = defaultValue;
2614
+ } else {
2615
+ target = /^\d+\.?\d+$/.test("".concat(val)) ? "".concat(val, "px") : val;
2616
+ }
2617
+ if (offset) {
2618
+ target = "calc(".concat(target, " - ").concat(offset, ")");
2619
+ }
2620
+ return target;
2621
+ };
2622
+ /**
2623
+ * 格式化Border配置为标准Class
2624
+ * @param val
2625
+ * @returns
2626
+ */
2627
+ var resolvePropBorderToClassStr = function resolvePropBorderToClassStr(val) {
2628
+ var defaultVal = ['row'];
2629
+ if (typeof val === 'string') {
2630
+ defaultVal.push(val);
2631
+ }
2632
+ if (Array.isArray(val)) {
2633
+ defaultVal.push.apply(defaultVal, _toConsumableArray(val.filter(function (str) {
2634
+ return BORDER_OPTIONS.includes(str);
2635
+ })));
2636
+ }
2637
+ return _toConsumableArray(new Set(defaultVal)).map(function (item) {
2638
+ return "bordered-".concat(item);
2639
+ }).join(' ');
2640
+ };
2641
+ /**
2642
+ * 获取当前列实际宽度
2643
+ * width props中设置的默认宽度
2644
+ * calcWidth 计算后的宽度
2645
+ * resizeWidth 拖拽重置之后的宽度
2646
+ * @param colmun 当前列配置
2647
+ * @param orders 获取宽度顺序
2648
+ * @returns
2649
+ */
2650
+ var getColumnReactWidth = function getColumnReactWidth(colmun) {
2651
+ var _ref, _colmun$orders$;
2652
+ var orders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['resizeWidth', 'calcWidth', 'width'];
2653
+ return (_ref = (_colmun$orders$ = colmun[orders[0]]) !== null && _colmun$orders$ !== void 0 ? _colmun$orders$ : colmun[orders[1]]) !== null && _ref !== void 0 ? _ref : colmun[orders[2]];
2654
+ };
2655
+ /**
2656
+ * 监听目标元素的Resize事件
2657
+ * @param root 目标元素
2658
+ * @param callbackFn 执行函数
2659
+ * @param delay 延迟执行时间,默认 60
2660
+ * @param immediate 是否立即执行回调函数
2661
+ * @param resizerWay 执行方式:debounce | throttle
2662
+ * @returns "{ start: () => void, stop: () => void }"
2663
+ */
2664
+ var observerResize = function observerResize(root, callbackFn) {
2665
+ var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
2666
+ var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2667
+ var resizerWay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'throttle';
2668
+ // 设置判定,避免因计算导致的resize死循环
2669
+ var resolveCallbackFn = function resolveCallbackFn() {
2670
+ if (typeof callbackFn === 'function') {
2671
+ callbackFn();
2672
+ }
2673
+ };
2674
+ var execFn = resizerWay === 'debounce' ? (0,debounce_namespaceObject["default"])(resolveCallbackFn, delay) : (0,throttle_namespaceObject["default"])(resolveCallbackFn, delay);
2675
+ var callFn = function callFn() {
2676
+ return Reflect.apply(execFn, _this, []);
2677
+ };
2678
+ var resizeObserver = new ResizeObserver_es(function () {
2679
+ callFn();
2680
+ });
2681
+ if (immediate) {
2682
+ if (typeof callbackFn === 'function') {
2683
+ callbackFn();
2684
+ }
2685
+ }
2686
+ return {
2687
+ start: function start() {
2688
+ resizeObserver.observe(root);
2689
+ },
2690
+ disconnect: function disconnect() {
2691
+ resizeObserver.unobserve(root);
2692
+ resizeObserver.disconnect();
2693
+ }
2694
+ };
2695
+ };
2696
+ /**
2697
+ * 判定为数值 | px | %
2698
+ * @param val
2699
+ * @returns
2700
+ */
2701
+ var isPercentPixOrNumber = function isPercentPixOrNumber(val) {
2702
+ return /^\d+\.?\d*(px|%)?$/.test("".concat(val));
2703
+ };
2704
+ /**
2705
+ * Format Table Head Option
2706
+ * @param props
2707
+ * @returns
2708
+ */
2709
+ var resolveHeadConfig = function resolveHeadConfig(props) {
2710
+ var showHead = props.showHead,
2711
+ headHeight = props.headHeight,
2712
+ _props$thead = props.thead,
2713
+ thead = _props$thead === void 0 ? {} : _props$thead;
2714
+ return Object.assign({}, {
2715
+ isShow: showHead,
2716
+ height: headHeight
2717
+ }, thead);
2718
+ };
2719
+ var getRegExp = function getRegExp(val) {
2720
+ var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ig';
2721
+ return new RegExp("".concat(val).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), flags);
2722
+ };
2723
+ /**
2724
+ * 获取当前行指定列的内容
2725
+ * @param row 当前行
2726
+ * @param key 指定列名
2727
+ * @param column 列配置
2728
+ * @param index 当前行Index
2729
+ * @returns
2730
+ */
2731
+ var getRowText = function getRowText(row, key, format) {
2732
+ var result;
2733
+ if (typeof row === 'string' || typeof row === 'number' || typeof row === 'boolean') {
2734
+ result = row;
2735
+ }
2736
+ if (typeof_typeof(row) === 'object') {
2737
+ result = (0,get_namespaceObject["default"])(row, key);
2738
+ }
2739
+ if (format !== null && format !== void 0 && format.length) {
2740
+ format.forEach(function (reg) {
2741
+ if (typeof reg === 'function') {
2742
+ result = reg(result, row, key);
2743
+ } else if (typeof result === 'string') {
2744
+ var _matches$;
2745
+ var matches = result.match(typeof reg === 'string' ? getRegExp(reg) : reg);
2746
+ result = (_matches$ = matches === null || matches === void 0 ? void 0 : matches[1]) !== null && _matches$ !== void 0 ? _matches$ : result;
2747
+ }
2748
+ });
2749
+ if (/^-?\d+.?\d*$/.test(result)) {
2750
+ result = Number(result);
2751
+ }
2752
+ }
2753
+ return result;
2754
+ };
2755
+ /**
2756
+ * 获取当前行指定列的值
2757
+ * @param row 当前行
2758
+ * @param key 指定列名
2759
+ * @returns
2760
+ */
2761
+ var getRowValue = function getRowValue(row, key) {
2762
+ return (0,get_namespaceObject["default"])(row, key);
2763
+ };
2764
+ /**
2765
+ * 格式化prop配置为标准数组格式
2766
+ * @param prop prop对象值
2767
+ * @param args 如果是function参数
2768
+ * @returns
2769
+ */
2770
+ var formatPropAsArray = function formatPropAsArray(prop, args) {
2771
+ if (Array.isArray(prop)) {
2772
+ return prop;
2773
+ }
2774
+ if (typeof prop === 'string' || typeof_typeof(prop) === 'object') {
2775
+ return [prop];
2776
+ }
2777
+ if (typeof prop === 'function') {
2778
+ return formatPropAsArray(Reflect.apply(prop, _this, args), args);
2779
+ }
2780
+ return [];
2781
+ };
2782
+ var isRenderScrollBottomLoading = function isRenderScrollBottomLoading(props) {
2783
+ if (props.scrollLoading === null) {
2784
+ return false;
2785
+ }
2786
+ return typeof props.scrollLoading === 'boolean' || _typeof(props.scrollLoading) === 'object';
2787
+ };
2788
+ var getRowKey = function getRowKey(item, props, index) {
2789
+ var val = getRowKeyNull(item, props, index);
2790
+ if (val !== null) {
2791
+ return val;
2792
+ }
2793
+ return esm_browser_v4();
2794
+ };
2795
+ var getRowKeyNull = function getRowKeyNull(item, props, index) {
2796
+ if (typeof props.rowKey === 'string') {
2797
+ if (props.rowKey === TABLE_ROW_ATTRIBUTE.ROW_INDEX) {
2798
+ return "__ROW_INDEX_".concat(index);
2799
+ }
2800
+ return (0,get_namespaceObject["default"])(item, props.rowKey);
2801
+ }
2802
+ if (typeof props.rowKey === 'function') {
2803
+ return Reflect.apply(props.rowKey, _this, [item]);
2804
+ }
2805
+ return null;
2806
+ };
2807
+ var hasRootScrollY = function hasRootScrollY(root, querySelector) {
2808
+ var offsetHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2809
+ if (root) {
2810
+ var tableBody = root.querySelector(querySelector);
2811
+ if (tableBody) {
2812
+ return tableBody.offsetHeight > root.offsetHeight - offsetHeight;
2813
+ }
2814
+ }
2815
+ return false;
2816
+ };
2817
+ var getColumnClass = function getColumnClass(column) {
2818
+ var colIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2819
+ var uuid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2820
+ return utils_objectSpread(utils_objectSpread({}, uuid ? _defineProperty({}, "".concat(uuid, "-column-").concat(colIndex), true) : {}), {}, {
2821
+ column_fixed: !!column.fixed,
2822
+ column_fixed_left: !!column.fixed,
2823
+ column_fixed_right: column.fixed === 'right'
2824
+ });
2825
+ };
2826
+ var getElementTextWidth = function getElementTextWidth(element, text) {
2827
+ /**
2828
+ * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
2829
+ *
2830
+ * @param {String} text The text to be rendered.
2831
+ * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
2832
+ *
2833
+ * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
2834
+ */
2835
+ function getTextWidth(text, font) {
2836
+ // re-use canvas object for better performance
2837
+ var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement('canvas'));
2838
+ var context = canvas.getContext('2d');
2839
+ context.font = font;
2840
+ var metrics = context.measureText(text);
2841
+ return metrics.width;
2842
+ }
2843
+ function getCssStyle(element, prop) {
2844
+ return window.getComputedStyle(element, null).getPropertyValue(prop);
2845
+ }
2846
+ function getCanvasFont() {
2847
+ var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
2848
+ var fontWeight = getCssStyle(el, 'font-weight') || 'normal';
2849
+ var fontSize = getCssStyle(el, 'font-size') || '16px';
2850
+ var fontFamily = getCssStyle(el, 'font-family') || 'Times New Roman';
2851
+ return "".concat(fontWeight, " ").concat(fontSize, " ").concat(fontFamily);
2852
+ }
2853
+ return getTextWidth(text || (element === null || element === void 0 ? void 0 : element.innerHTML), getCanvasFont(element));
2854
+ };
2855
+ var isColumnHidden = function isColumnHidden(settingFields, column, checked) {
2856
+ var getFieldValue = function getFieldValue(field) {
2857
+ var _field$field;
2858
+ return (_field$field = field.field) !== null && _field$field !== void 0 ? _field$field : field.id;
2859
+ };
2860
+ var isSettingField = function isSettingField(col) {
2861
+ return settingFields.some(function (field) {
2862
+ return getFieldValue(field) === resolvePropVal(col, ['field', 'type'], [col]);
2863
+ });
2864
+ };
2865
+ return isSettingField(column) && checked.length && !checked.includes(resolvePropVal(column, ['field', 'type'], [column]));
2866
+ };
2867
+ var resolveColumnSpan = function resolveColumnSpan(column, colIndex, row, rowIndex, key) {
2868
+ if (typeof column[key] === 'function') {
2869
+ return Reflect.apply(column[key], _this, [{
2870
+ column: column,
2871
+ colIndex: colIndex,
2872
+ row: row,
2873
+ rowIndex: rowIndex
2874
+ }]);
2875
+ }
2876
+ if (typeof column[key] === 'number') {
2877
+ return column[key];
2878
+ }
2879
+ return 1;
2880
+ };
2881
+ var resolveCellSpan = function resolveCellSpan(column, colIndex, row, rowIndex) {
2882
+ var colspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'colspan');
2883
+ var rowspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'rowspan');
2884
+ return {
2885
+ colspan: colspan,
2886
+ rowspan: rowspan
2887
+ };
2888
+ };
2889
+ var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
2890
+ var skip = false;
2891
+ for (var i = colIndex; i > 0; i--) {
2892
+ var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
2893
+ if (colspan > 1) {
2894
+ skip = colspan - 1;
2895
+ break;
2896
+ }
2897
+ }
2898
+ return skip;
2899
+ };
2900
+ var getSortFn = function getSortFn(column, sortType) {
2901
+ var _column$sort, _column$sort2;
2902
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2903
+ var fieldName = column.field;
2904
+ var getVal = function getVal(row) {
2905
+ return getRowText(row, fieldName, format);
2906
+ };
2907
+ var sortFn0 = function sortFn0(a, b) {
2908
+ var _getVal, _getVal2;
2909
+ var val0 = (_getVal = getVal(a)) !== null && _getVal !== void 0 ? _getVal : '';
2910
+ var val1 = (_getVal2 = getVal(b)) !== null && _getVal2 !== void 0 ? _getVal2 : '';
2911
+ if (typeof val0 === 'number' && typeof val1 === 'number') {
2912
+ return val0 - val1;
2913
+ }
2914
+ return String.prototype.localeCompare.call(val0, val1);
2915
+ };
2916
+ 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;
2917
+ return sortType === SORT_OPTION.NULL ? function (_a, _b) {
2918
+ return true;
2919
+ } : function (_a, _b) {
2920
+ return sortFn(_a, _b) * (sortType === SORT_OPTION.DESC ? -1 : 1);
2921
+ };
2922
+ };
2923
+ var getNextSortType = function getNextSortType(sortType) {
2924
+ var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
2925
+ if (steps[sortType] === undefined) {
2926
+ return SORT_OPTION.ASC;
2927
+ }
2928
+ return Object.keys(steps)[(steps[sortType] + 1) % 3];
2929
+ };
2930
+ var resolveSort = function resolveSort(sort, column) {
2931
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2932
+ if (typeof sort === 'string') {
2933
+ return {
2934
+ value: sort
2935
+ };
2936
+ }
2937
+ if (typeof sort === 'boolean' && sort) {
2938
+ return {
2939
+ value: SORT_OPTION.NULL
2940
+ };
2941
+ }
2942
+ if (typeof_typeof(sort) === 'object' && sort !== null) {
2943
+ var _sort$value;
2944
+ if (typeof sort.sortFn === 'function') {
2945
+ return utils_objectSpread({
2946
+ value: 'custom'
2947
+ }, sort);
2948
+ }
2949
+ return Object.assign({}, {
2950
+ sortFn: getSortFn(column, (_sort$value = sort.value) !== null && _sort$value !== void 0 ? _sort$value : SORT_OPTION.NULL, format)
2951
+ }, sort);
2952
+ }
2953
+ return null;
2954
+ };
2955
+ var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
2956
+ var row = _ref3.row,
2957
+ index = _ref3.index,
2958
+ isCheckAll = _ref3.isCheckAll;
2959
+ if (typeof props.isRowSelectEnable === 'boolean') {
2960
+ return props.isRowSelectEnable !== false;
2961
+ }
2962
+ if (typeof props.isRowSelectEnable === 'function') {
2963
+ return props.isRowSelectEnable({
2964
+ row: row,
2965
+ index: index,
2966
+ isCheckAll: isCheckAll
2967
+ });
2968
+ }
2969
+ return true;
2970
+ };
2971
+ var getRowId = function getRowId(row, defVal, props) {
2972
+ var key = getRowKey(row, props, defVal);
2973
+ if (key !== undefined && row[key] !== undefined) {
2974
+ return row[key];
2975
+ }
2976
+ return defVal;
2977
+ };
2978
+ var resolveColumnSortProp = function resolveColumnSortProp(col, props) {
2979
+ var _resolveSort, _col$sort;
2980
+ var _ref4 = (_resolveSort = resolveSort((_col$sort = col.sort) !== null && _col$sort !== void 0 ? _col$sort : props.defaultSort, col)) !== null && _resolveSort !== void 0 ? _resolveSort : {},
2981
+ value = _ref4.value,
2982
+ sortFn = _ref4.sortFn,
2983
+ sortScope = _ref4.sortScope;
2984
+ return {
2985
+ type: value,
2986
+ fn: sortFn,
2987
+ scope: sortScope,
2988
+ active: !!col.sort
2989
+ };
2990
+ };
2991
+ var getRawData = function getRawData(data) {
2992
+ if ((0,external_vue_namespaceObject.isProxy)(data)) {
2993
+ return (0,external_vue_namespaceObject.toRaw)(data);
2994
+ }
2995
+ return data;
2996
+ };
2997
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-observer-resize.tsx
2998
+
2999
+ /*
3000
+ * Tencent is pleased to support the open source community by making
3001
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3002
+ *
3003
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3004
+ *
3005
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3006
+ *
3007
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3008
+ *
3009
+ * ---------------------------------------------------
3010
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3011
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3012
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3013
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3014
+ *
3015
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3016
+ * the Software.
3017
+ *
3018
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3019
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3020
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3021
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3022
+ * IN THE SOFTWARE.
3023
+ */
2726
3024
 
2727
- /* harmony default export */ const ResizeObserver_es = (index);
2728
3025
 
2729
- ;// CONCATENATED MODULE: ../../packages/table/src/utils.tsx
2730
3026
 
3027
+ /* harmony default export */ const use_observer_resize = (function (target, fn) {
3028
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3029
+ var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3030
+ var instance = null;
3031
+ var dispose = function dispose() {
3032
+ if (instance) {
3033
+ instance.disconnect();
3034
+ instance = null;
3035
+ }
3036
+ };
3037
+ (0,external_vue_namespaceObject.watch)(target, function () {
3038
+ if (!(0,shared_namespaceObject.isElement)(target.value)) {
3039
+ return;
3040
+ }
3041
+ dispose();
3042
+ instance = observerResize(target.value, function () {
3043
+ fn === null || fn === void 0 || fn.apply.apply(fn, _toConsumableArray(args));
3044
+ }, 60, true, 'debounce');
3045
+ if (immediate) {
3046
+ instance.start();
3047
+ }
3048
+ }, {
3049
+ flush: 'post',
3050
+ immediate: true
3051
+ });
3052
+ return {
3053
+ instance: instance
3054
+ };
3055
+ });
3056
+ ;// CONCATENATED MODULE: external "../loading"
3057
+ var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3058
+ var loading_y = x => () => x
3059
+ 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"] });
3060
+ ;// CONCATENATED MODULE: external "../loading/loading.less"
3061
+ var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3062
+ var loading_less_y = x => () => x
3063
+ const loading_less_namespaceObject = loading_less_x({ });
3064
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
2731
3065
 
2732
3066
 
2733
- var _this = undefined;
2734
- function utils_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; }
2735
- function utils_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? utils_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : utils_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2736
3067
  /*
2737
3068
  * Tencent is pleased to support the open source community by making
2738
3069
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -2762,436 +3093,238 @@ function utils_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2762
3093
 
2763
3094
 
2764
3095
 
2765
-
2766
-
2767
- /**
2768
- * 解析Prop值 | 可能为多种类型 & 函数返回的场景
2769
- * @param prop 当前Prop
2770
- * @param key 要处理的Key
2771
- * @param args 如果是函数,传递参数
2772
- * @returns
2773
- */
2774
- var resolvePropVal = function resolvePropVal(prop, key, args) {
2775
- if (prop === undefined || prop === null) {
2776
- return undefined;
2777
- }
2778
- if (typeof key === 'string') {
2779
- if (Object.prototype.hasOwnProperty.call(prop, key)) {
2780
- if (typeof prop[key] === 'function') {
2781
- var _prop$key;
2782
- return (_prop$key = prop[key]).call.apply(_prop$key, [_this].concat(_toConsumableArray(args)));
2783
- }
2784
- return prop[key];
2785
- }
2786
- return undefined;
2787
- }
2788
- if (Array.isArray(key)) {
2789
- return key.map(function (_key) {
2790
- return resolvePropVal(prop, _key, args);
2791
- }).filter(function (val) {
2792
- return val !== undefined;
2793
- }).at(0);
2794
- }
2795
- };
2796
- /**
2797
- * 处理Props中的ActiveColumn,解析为统一的数组格式
2798
- * @param props
2799
- * @returns
2800
- */
2801
- var resolveActiveColumns = function resolveActiveColumns(props) {
2802
- if (props.columnPick !== 'disabled') {
2803
- if (props.columnPick === 'multi') {
2804
- return Array.isArray(props.activeColumn) ? props.activeColumn : resolveNumberToNumArray(props.activeColumn);
2805
- }
2806
- return Array.isArray(props.activeColumn) ? resolveNumberToNumArray(props.activeColumn[0]) : resolveNumberToNumArray(props.activeColumn);
2807
- }
2808
- return [];
2809
- };
2810
- /**
2811
- * 统一处理数字类型参数
2812
- * @param prop
2813
- * @returns
2814
- */
2815
- var resolveNumberToNumArray = function resolveNumberToNumArray(prop) {
2816
- if (/^\d+$/.test("".concat(prop))) {
2817
- return [parseInt("".concat(prop), 10)];
2818
- }
2819
- return [];
2820
- };
2821
- /*
2822
- * 解析宽度配置
2823
- * @param propWidth
2824
- * @returns
2825
- */
2826
- var resolveWidth = function resolveWidth(propWidth) {
2827
- return resolveNumberOrStringToPix(propWidth, 'auto');
2828
- };
2829
- /**
2830
- * 解析可为数字或者字符串设置的样式配置
2831
- * @param val 配置值
2832
- * @param defaultValue 默认值
2833
- * @param offset 偏移量
2834
- * @returns 标准化px string
2835
- */
2836
- var resolveNumberOrStringToPix = function resolveNumberOrStringToPix(val) {
2837
- var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '100%';
2838
- var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2839
- var target = '';
2840
- if (/^auto|null|undefined$/gi.test("".concat(val))) {
2841
- target = defaultValue;
2842
- } else {
2843
- target = /^\d+\.?\d+$/.test("".concat(val)) ? "".concat(val, "px") : val;
2844
- }
2845
- if (offset) {
2846
- target = "calc(".concat(target, " - ").concat(offset, ")");
2847
- }
2848
- return target;
2849
- };
2850
- /**
2851
- * 格式化Border配置为标准Class
2852
- * @param val
2853
- * @returns
2854
- */
2855
- var resolvePropBorderToClassStr = function resolvePropBorderToClassStr(val) {
2856
- var defaultVal = ['row'];
2857
- if (typeof val === 'string') {
2858
- defaultVal.push(val);
2859
- }
2860
- if (Array.isArray(val)) {
2861
- defaultVal.push.apply(defaultVal, _toConsumableArray(val.filter(function (str) {
2862
- return BORDER_OPTIONS.includes(str);
2863
- })));
2864
- }
2865
- return _toConsumableArray(new Set(defaultVal)).map(function (item) {
2866
- return "bordered-".concat(item);
2867
- }).join(' ');
2868
- };
2869
- /**
2870
- * 获取当前列实际宽度
2871
- * width props中设置的默认宽度
2872
- * calcWidth 计算后的宽度
2873
- * resizeWidth 拖拽重置之后的宽度
2874
- * @param colmun 当前列配置
2875
- * @param orders 获取宽度顺序
2876
- * @returns
2877
- */
2878
- var getColumnReactWidth = function getColumnReactWidth(colmun) {
2879
- var _ref, _colmun$orders$;
2880
- var orders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['resizeWidth', 'calcWidth', 'width'];
2881
- return (_ref = (_colmun$orders$ = colmun[orders[0]]) !== null && _colmun$orders$ !== void 0 ? _colmun$orders$ : colmun[orders[1]]) !== null && _ref !== void 0 ? _ref : colmun[orders[2]];
2882
- };
2883
- /**
2884
- * 监听目标元素的Resize事件
2885
- * @param root 目标元素
2886
- * @param callbackFn 执行函数
2887
- * @param delay 延迟执行时间,默认 60
2888
- * @param immediate 是否立即执行回调函数
2889
- * @param resizerWay 执行方式:debounce | throttle
2890
- * @returns "{ start: () => void, stop: () => void }"
2891
- */
2892
- var observerResize = function observerResize(root, callbackFn) {
2893
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
2894
- var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2895
- var resizerWay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'throttle';
2896
- // 设置判定,避免因计算导致的resize死循环
2897
- var resolveCallbackFn = function resolveCallbackFn() {
2898
- if (typeof callbackFn === 'function') {
2899
- callbackFn();
3096
+ /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
3097
+ var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
3098
+ var getLoadingOption = function getLoadingOption() {
3099
+ if (typeof refScrollLoading.value === 'boolean') {
3100
+ return {
3101
+ loading: !!refScrollLoading.value,
3102
+ inline: true,
3103
+ title: '',
3104
+ size: loading_namespaceObject.BkLoadingSize.Normal,
3105
+ mode: loading_namespaceObject.BkLoadingMode.Default,
3106
+ indicator: null
3107
+ };
2900
3108
  }
3109
+ return refScrollLoading.value;
2901
3110
  };
2902
- var execFn = resizerWay === 'debounce' ? (0,debounce_namespaceObject["default"])(resolveCallbackFn, delay) : (0,throttle_namespaceObject["default"])(resolveCallbackFn, delay);
2903
- var callFn = function callFn() {
2904
- return Reflect.apply(execFn, _this, []);
2905
- };
2906
- var resizeObserver = new ResizeObserver_es(function () {
2907
- callFn();
3111
+ var isRender = (0,external_vue_namespaceObject.computed)(function () {
3112
+ return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
2908
3113
  });
2909
- if (immediate) {
2910
- if (typeof callbackFn === 'function') {
2911
- callbackFn();
3114
+ var renderScrollLoading = function renderScrollLoading() {
3115
+ if (isRender.value) {
3116
+ var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
3117
+ var _getLoadingOption = getLoadingOption(),
3118
+ loading = _getLoadingOption.loading,
3119
+ size = _getLoadingOption.size,
3120
+ mode = _getLoadingOption.mode,
3121
+ title = _getLoadingOption.title,
3122
+ inline = _getLoadingOption.inline,
3123
+ indicator = _getLoadingOption.indicator;
3124
+ 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"], {
3125
+ loading: loading,
3126
+ size: size,
3127
+ mode: mode,
3128
+ title: title,
3129
+ inline: inline,
3130
+ indicator: indicator
3131
+ }, null);
2912
3132
  }
2913
- }
3133
+ };
2914
3134
  return {
2915
- start: function start() {
2916
- resizeObserver.observe(root);
2917
- },
2918
- disconnect: function disconnect() {
2919
- resizeObserver.unobserve(root);
2920
- resizeObserver.disconnect();
2921
- }
3135
+ renderScrollLoading: renderScrollLoading
2922
3136
  };
2923
- };
2924
- /**
2925
- * 判定为数值 | px | %
2926
- * @param val
2927
- * @returns
2928
- */
2929
- var isPercentPixOrNumber = function isPercentPixOrNumber(val) {
2930
- return /^\d+\.?\d*(px|%)?$/.test("".concat(val));
2931
- };
2932
- /**
2933
- * Format Table Head Option
2934
- * @param props
2935
- * @returns
2936
- */
2937
- var resolveHeadConfig = function resolveHeadConfig(props) {
2938
- var showHead = props.showHead,
2939
- headHeight = props.headHeight,
2940
- _props$thead = props.thead,
2941
- thead = _props$thead === void 0 ? {} : _props$thead;
2942
- return Object.assign({}, {
2943
- isShow: showHead,
2944
- height: headHeight
2945
- }, thead);
2946
- };
2947
- /**
2948
- * 获取当前行指定列的内容
2949
- * @param row 当前行
2950
- * @param key 指定列名
2951
- * @param column 列配置
2952
- * @param index 当前行Index
2953
- * @returns
2954
- */
2955
- var getRowText = function getRowText(row, key) {
2956
- if (typeof row === 'string' || typeof row === 'number' || typeof row === 'boolean') {
2957
- return row;
2958
- }
2959
- return (0,get_namespaceObject["default"])(row, key);
2960
- };
2961
- /**
2962
- * 获取当前行指定列的值
2963
- * @param row 当前行
2964
- * @param key 指定列名
2965
- * @returns
3137
+ });
3138
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
3139
+
3140
+
3141
+
3142
+ 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; }
3143
+ 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; }
3144
+ /*
3145
+ * Tencent is pleased to support the open source community by making
3146
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3147
+ *
3148
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3149
+ *
3150
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3151
+ *
3152
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3153
+ *
3154
+ * ---------------------------------------------------
3155
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3156
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3157
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3158
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3159
+ *
3160
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3161
+ * the Software.
3162
+ *
3163
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3164
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3165
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3166
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3167
+ * IN THE SOFTWARE.
2966
3168
  */
2967
- var getRowValue = function getRowValue(row, key) {
2968
- return (0,get_namespaceObject["default"])(row, key);
2969
- };
3169
+
3170
+
3171
+
2970
3172
  /**
2971
- * 格式化prop配置为标准数组格式
2972
- * @param prop prop对象值
2973
- * @param args 如果是function参数
2974
- * @returns
3173
+ * 处理 Prop中的分页配置
3174
+ * prop中的配置会覆盖本地的配置
3175
+ * @param propPagination 用户传入的配置
3176
+ * @param defVal 默认配置
3177
+ * @returns 返回值
2975
3178
  */
2976
- var formatPropAsArray = function formatPropAsArray(prop, args) {
2977
- if (Array.isArray(prop)) {
2978
- return prop;
2979
- }
2980
- if (typeof prop === 'string' || typeof_typeof(prop) === 'object') {
2981
- return [prop];
2982
- }
2983
- if (typeof prop === 'function') {
2984
- return formatPropAsArray(Reflect.apply(prop, _this, args), args);
2985
- }
2986
- return [];
2987
- };
2988
- var isRenderScrollBottomLoading = function isRenderScrollBottomLoading(props) {
2989
- if (props.scrollLoading === null) {
2990
- return false;
2991
- }
2992
- return typeof props.scrollLoading === 'boolean' || _typeof(props.scrollLoading) === 'object';
2993
- };
2994
- var getRowKey = function getRowKey(item, props, index) {
2995
- var val = getRowKeyNull(item, props, index);
2996
- if (val !== null) {
2997
- return val;
2998
- }
2999
- return esm_browser_v4();
3000
- };
3001
- var getRowKeyNull = function getRowKeyNull(item, props, index) {
3002
- if (typeof props.rowKey === 'string') {
3003
- if (props.rowKey === TABLE_ROW_ATTRIBUTE.ROW_INDEX) {
3004
- return "__ROW_INDEX_".concat(index);
3005
- }
3006
- return (0,get_namespaceObject["default"])(item, props.rowKey);
3007
- }
3008
- if (typeof props.rowKey === 'function') {
3009
- return Reflect.apply(props.rowKey, _this, [item]);
3010
- }
3011
- return null;
3012
- };
3013
- var hasRootScrollY = function hasRootScrollY(root, querySelector) {
3014
- var offsetHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3015
- if (root) {
3016
- var tableBody = root.querySelector(querySelector);
3017
- if (tableBody) {
3018
- return tableBody.offsetHeight > root.offsetHeight - offsetHeight;
3179
+ var resolvePaginationOption = function resolvePaginationOption(propPagination, defVal) {
3180
+ if (!!propPagination) {
3181
+ if (typeof_typeof(propPagination) === 'object') {
3182
+ var current = Object.prototype.hasOwnProperty.call(propPagination, 'current') ? propPagination.current : propPagination.value;
3183
+ if (!/\d+/.test(current)) {
3184
+ current = 1;
3185
+ }
3186
+ return use_pagination_objectSpread(use_pagination_objectSpread(use_pagination_objectSpread({}, defVal), propPagination), {}, {
3187
+ current: current
3188
+ });
3019
3189
  }
3190
+ return defVal;
3020
3191
  }
3021
- return false;
3022
- };
3023
- var getColumnClass = function getColumnClass(column) {
3024
- var colIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3025
- var uuid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3026
- return utils_objectSpread(utils_objectSpread({}, uuid ? _defineProperty({}, "".concat(uuid, "-column-").concat(colIndex), true) : {}), {}, {
3027
- column_fixed: !!column.fixed,
3028
- column_fixed_left: !!column.fixed,
3029
- column_fixed_right: column.fixed === 'right'
3030
- });
3192
+ return {};
3031
3193
  };
3032
- var getElementTextWidth = function getElementTextWidth(element, text) {
3194
+ /* harmony default export */ const use_pagination = (function (props) {
3195
+ var startIndex = (0,external_vue_namespaceObject.ref)(0);
3196
+ var endIndex = (0,external_vue_namespaceObject.ref)(0);
3033
3197
  /**
3034
- * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
3035
- *
3036
- * @param {String} text The text to be rendered.
3037
- * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
3038
- *
3039
- * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
3198
+ * 分页配置
3199
+ * 用于配置分页组件
3200
+ * pagination 为Prop传入配置
3201
+ * 方便兼容内置分页功能,此处需要单独处理count
3040
3202
  */
3041
- function getTextWidth(text, font) {
3042
- // re-use canvas object for better performance
3043
- var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement('canvas'));
3044
- var context = canvas.getContext('2d');
3045
- context.font = font;
3046
- var metrics = context.measureText(text);
3047
- return metrics.width;
3048
- }
3049
- function getCssStyle(element, prop) {
3050
- return window.getComputedStyle(element, null).getPropertyValue(prop);
3051
- }
3052
- function getCanvasFont() {
3053
- var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
3054
- var fontWeight = getCssStyle(el, 'font-weight') || 'normal';
3055
- var fontSize = getCssStyle(el, 'font-size') || '16px';
3056
- var fontFamily = getCssStyle(el, 'font-family') || 'Times New Roman';
3057
- return "".concat(fontWeight, " ").concat(fontSize, " ").concat(fontFamily);
3058
- }
3059
- return getTextWidth(text || (element === null || element === void 0 ? void 0 : element.innerHTML), getCanvasFont(element));
3060
- };
3061
- var isColumnHidden = function isColumnHidden(settingFields, column, checked) {
3062
- var getFieldValue = function getFieldValue(field) {
3063
- var _field$field;
3064
- return (_field$field = field.field) !== null && _field$field !== void 0 ? _field$field : field.id;
3065
- };
3066
- var isSettingField = function isSettingField(col) {
3067
- return settingFields.some(function (field) {
3068
- return getFieldValue(field) === resolvePropVal(col, ['field', 'type'], [col]);
3069
- });
3070
- };
3071
- return isSettingField(column) && checked.length && !checked.includes(resolvePropVal(column, ['field', 'type'], [column]));
3072
- };
3073
- var resolveColumnSpan = function resolveColumnSpan(column, colIndex, row, rowIndex, key) {
3074
- if (typeof column[key] === 'function') {
3075
- return Reflect.apply(column[key], _this, [{
3076
- column: column,
3077
- colIndex: colIndex,
3078
- row: row,
3079
- rowIndex: rowIndex
3080
- }]);
3081
- }
3082
- if (typeof column[key] === 'number') {
3083
- return column[key];
3084
- }
3085
- return 1;
3086
- };
3087
- var resolveCellSpan = function resolveCellSpan(column, colIndex, row, rowIndex) {
3088
- var colspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'colspan');
3089
- var rowspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'rowspan');
3090
- return {
3091
- colspan: colspan,
3092
- rowspan: rowspan
3203
+ var propsData = (0,external_vue_namespaceObject.computed)(function () {
3204
+ return props.data;
3205
+ });
3206
+ var localPagination = (0,external_vue_namespaceObject.ref)(null);
3207
+ var indexData = (0,external_vue_namespaceObject.reactive)([]);
3208
+ // 当前分页缓存,用于支持内置前端分页,用户无需接收change事件来自行处理数据分割
3209
+ var pagination = (0,external_vue_namespaceObject.reactive)({
3210
+ count: 0,
3211
+ limit: 10,
3212
+ current: 1,
3213
+ align: 'right',
3214
+ layout: ['total', 'limit', 'list']
3215
+ });
3216
+ var resolveLocalPagination = function resolveLocalPagination() {
3217
+ if (!props.pagination) {
3218
+ return;
3219
+ }
3220
+ localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(use_pagination_objectSpread({}, pagination), {}, {
3221
+ count: indexData.length
3222
+ });
3093
3223
  };
3094
- };
3095
- var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
3096
- var skip = false;
3097
- for (var i = colIndex; i > 0; i--) {
3098
- var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
3099
- if (colspan > 1) {
3100
- skip = colspan - 1 + i >= colIndex;
3101
- break;
3224
+ /**
3225
+ * 重置当前分页开始位置 & 结束位置
3226
+ * 如果未启用分页,则开始位置为0,结束位置为 data.length
3227
+ * @returns
3228
+ */
3229
+ var resetStartEndIndex = function resetStartEndIndex() {
3230
+ if (!props.pagination || props.remotePagination) {
3231
+ startIndex.value = 0;
3232
+ endIndex.value = indexData.length;
3233
+ return;
3102
3234
  }
3103
- }
3104
- return skip;
3105
- };
3106
- var getSortFn = function getSortFn(column, sortType) {
3107
- var _column$sort, _column$sort2;
3108
- var fieldName = column.field;
3109
- var getVal = function getVal(row) {
3110
- return getRowText(row, fieldName);
3235
+ // 如果是前端分页
3236
+ startIndex.value = (pagination.current - 1) * pagination.limit;
3237
+ endIndex.value = pagination.current * pagination.limit;
3111
3238
  };
3112
- var sortFn0 = function sortFn0(a, b) {
3113
- var _getVal, _getVal2;
3114
- var val0 = (_getVal = getVal(a)) !== null && _getVal !== void 0 ? _getVal : '';
3115
- var val1 = (_getVal2 = getVal(b)) !== null && _getVal2 !== void 0 ? _getVal2 : '';
3116
- if (typeof val0 === 'number' && typeof val1 === 'number') {
3117
- return val0 - val1;
3239
+ /**
3240
+ * 当前页分页数据
3241
+ */
3242
+ var pageData = (0,external_vue_namespaceObject.reactive)([]);
3243
+ var sort = function sort(sourceData, sortFn, column, type, sortScope) {
3244
+ if (typeof sortFn === 'function') {
3245
+ sourceData.sort(function (a, b) {
3246
+ return sortFn(a, b, type, column, sortScope);
3247
+ });
3118
3248
  }
3119
- return String.prototype.localeCompare.call(val0, val1);
3120
3249
  };
3121
- 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;
3122
- return sortType === SORT_OPTION.NULL ? function (_a, _b) {
3123
- return true;
3124
- } : function (_a, _b) {
3125
- return sortFn(_a, _b) * (sortType === SORT_OPTION.DESC ? -1 : 1);
3250
+ /**
3251
+ * 初始化排序动作
3252
+ * @param data
3253
+ * @param sortColumns
3254
+ */
3255
+ var multiSort = function multiSort(data, sortColumns) {
3256
+ sortColumns.forEach(function (item) {
3257
+ 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]);
3258
+ });
3126
3259
  };
3127
- };
3128
- var getNextSortType = function getNextSortType(sortType) {
3129
- var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
3130
- if (steps[sortType] === undefined) {
3131
- return SORT_OPTION.ASC;
3132
- }
3133
- return Object.keys(steps)[(steps[sortType] + 1) % 3];
3134
- };
3135
- var resolveSort = function resolveSort(sort, column) {
3136
- if (typeof sort === 'string') {
3137
- return {
3138
- value: sort
3139
- };
3140
- }
3141
- if (typeof sort === 'boolean' && sort) {
3142
- return {
3143
- value: SORT_OPTION.NULL
3144
- };
3145
- }
3146
- if (typeof_typeof(sort) === 'object' && sort !== null) {
3147
- var _sort$value;
3148
- if (typeof sort.sortFn === 'function') {
3149
- return utils_objectSpread({
3150
- value: 'custom'
3151
- }, sort);
3260
+ var filter = function filter(sourceData, filterFn) {
3261
+ if (typeof filterFn === 'function') {
3262
+ var filterVals = sourceData.filter(function (row, index) {
3263
+ return filterFn(row, index, indexData);
3264
+ });
3265
+ sourceData.length = 0;
3266
+ sourceData.push.apply(sourceData, _toConsumableArray(filterVals));
3152
3267
  }
3153
- return Object.assign({}, {
3154
- sortFn: getSortFn(column, (_sort$value = sort.value) !== null && _sort$value !== void 0 ? _sort$value : SORT_OPTION.NULL)
3155
- }, sort);
3156
- }
3157
- return null;
3158
- };
3159
- var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
3160
- var row = _ref3.row,
3161
- index = _ref3.index,
3162
- isCheckAll = _ref3.isCheckAll;
3163
- if (typeof props.isRowSelectEnable === 'boolean') {
3164
- return props.isRowSelectEnable !== false;
3165
- }
3166
- if (typeof props.isRowSelectEnable === 'function') {
3167
- return props.isRowSelectEnable({
3168
- row: row,
3169
- index: index,
3170
- isCheckAll: isCheckAll
3268
+ return sourceData;
3269
+ };
3270
+ var resolveIndexData = function resolveIndexData() {
3271
+ return new Promise(function (resolve) {
3272
+ (0,external_vue_namespaceObject.nextTick)(function () {
3273
+ var target = propsData.value.slice();
3274
+ indexData.length = 0;
3275
+ indexData.push.apply(indexData, _toConsumableArray(getRawData(target)));
3276
+ resolve();
3277
+ });
3171
3278
  });
3172
- }
3173
- return true;
3174
- };
3175
- var getRowId = function getRowId(row, defVal, props) {
3176
- var key = getRowKey(row, props, defVal);
3177
- if (key !== undefined && row[key] !== undefined) {
3178
- return row[key];
3179
- }
3180
- return defVal;
3181
- };
3182
- var resolveColumnSortProp = function resolveColumnSortProp(col, props) {
3183
- var _resolveSort, _col$sort;
3184
- var _ref4 = (_resolveSort = resolveSort((_col$sort = col.sort) !== null && _col$sort !== void 0 ? _col$sort : props.defaultSort, col)) !== null && _resolveSort !== void 0 ? _resolveSort : {},
3185
- value = _ref4.value,
3186
- sortFn = _ref4.sortFn,
3187
- sortScope = _ref4.sortScope;
3279
+ };
3280
+ var resolvePageData = function resolvePageData(filterFn, sortFn, column, type, sortScope, multiCol) {
3281
+ var sourceData = indexData.slice();
3282
+ if (multiCol !== null && multiCol !== void 0 && multiCol.length) {
3283
+ multiSort(sourceData, multiCol);
3284
+ }
3285
+ pageData.length = 0;
3286
+ pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
3287
+ filter(pageData, filterFn);
3288
+ sort(pageData, sortFn, column, type, sortScope);
3289
+ resolveLocalPagination();
3290
+ };
3291
+ var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
3292
+ resolvePageData(null, null, null, null, null, multiCol);
3293
+ };
3294
+ var multiFilter = function multiFilter(filterFnList) {
3295
+ var sourceData = indexData.slice();
3296
+ var target = filterFnList.reduce(function (result, fn) {
3297
+ return filter(result, fn);
3298
+ }, sourceData);
3299
+ pageData.length = 0;
3300
+ pageData.push.apply(pageData, _toConsumableArray(getRawData(target)));
3301
+ };
3302
+ var handlePaginationChange = function handlePaginationChange() {
3303
+ pagination = resolvePaginationOption(props.pagination, pagination);
3304
+ resolveLocalPagination();
3305
+ resetStartEndIndex();
3306
+ resolvePageData();
3307
+ };
3308
+ handlePaginationChange();
3309
+ (0,external_vue_namespaceObject.watch)(function () {
3310
+ return [props.pagination];
3311
+ }, function () {
3312
+ handlePaginationChange();
3313
+ }, {
3314
+ deep: true
3315
+ });
3188
3316
  return {
3189
- type: value,
3190
- fn: sortFn,
3191
- scope: sortScope,
3192
- active: !!col.sort
3317
+ pageData: pageData,
3318
+ indexData: indexData,
3319
+ localPagination: localPagination,
3320
+ resolvePageData: resolvePageData,
3321
+ resolveIndexData: resolveIndexData,
3322
+ resolvePageDataBySortList: resolvePageDataBySortList,
3323
+ resetStartEndIndex: resetStartEndIndex,
3324
+ multiFilter: multiFilter,
3325
+ sort: sort
3193
3326
  };
3194
- };
3327
+ });
3195
3328
  ;// CONCATENATED MODULE: ../../packages/table/src/use-attributes.ts
3196
3329
 
3197
3330
 
@@ -3229,7 +3362,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3229
3362
 
3230
3363
 
3231
3364
 
3232
- /* harmony default export */ const use_attributes = (function (props) {
3365
+ var tableSchemaResponse = function tableSchemaResponse(props) {
3233
3366
  var t = (0,config_provider_namespaceObject.useLocale)('table');
3234
3367
  var getDefaultSettings = function getDefaultSettings() {
3235
3368
  var _ref, _SETTING_SIZE$size;
@@ -3579,7 +3712,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3579
3712
  if (typeof item === 'string') {
3580
3713
  return getRowValue(row, item) === item;
3581
3714
  }
3582
- return item === row;
3715
+ return getRawData(item) === getRawData(row);
3583
3716
  });
3584
3717
  }
3585
3718
  return false;
@@ -3605,7 +3738,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3605
3738
  (_formatData$data = formatData.data).push.apply(_formatData$data, _toConsumableArray(data));
3606
3739
  var hasSelectedRow = false;
3607
3740
  var hasUnSelectedRow = false;
3608
- (data || []).forEach(function (row, index) {
3741
+ (data || []).forEach(function (item, index) {
3742
+ var row = getRawData(item);
3609
3743
  var rowId = getRowId(row, esm_browser_v4(), props);
3610
3744
  var isSelected = isRowSelected(row);
3611
3745
  if (isSelected) {
@@ -3646,7 +3780,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3646
3780
  * @param attrName
3647
3781
  * @param attrValue
3648
3782
  */
3649
- var setRowAttribute = function setRowAttribute(row, attrName, attrValue) {
3783
+ var setRowAttribute = function setRowAttribute(item, attrName, attrValue) {
3784
+ var row = getRawData(item);
3650
3785
  var target = formatData.dataSchema.get(row);
3651
3786
  if (target && Object.prototype.hasOwnProperty.call(target, attrName)) {
3652
3787
  target[attrName] = attrValue;
@@ -3687,8 +3822,9 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3687
3822
  var setRowExpand = function setRowExpand(row, isExpand) {
3688
3823
  setRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND, isExpand);
3689
3824
  };
3690
- var getRowAttribute = function getRowAttribute(row, attrName) {
3825
+ var getRowAttribute = function getRowAttribute(item, attrName) {
3691
3826
  var _formatData$dataSchem6;
3827
+ var row = getRawData(item);
3692
3828
  return (_formatData$dataSchem6 = formatData.dataSchema.get(row)) === null || _formatData$dataSchem6 === void 0 ? void 0 : _formatData$dataSchem6[attrName];
3693
3829
  };
3694
3830
  var toggleRowSelection = function toggleRowSelection(row) {
@@ -3891,7 +4027,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3891
4027
  formatData: formatData,
3892
4028
  setIndexData: setIndexData
3893
4029
  };
3894
- });
4030
+ };
4031
+ /* harmony default export */ const use_attributes = (tableSchemaResponse);
3895
4032
  ;// CONCATENATED MODULE: ../../packages/table/src/use-column.ts
3896
4033
 
3897
4034
  /*
@@ -4061,10 +4198,12 @@ var useClass = function useClass(props, targetColumns, root, TableSchema, pageDa
4061
4198
  });
4062
4199
  var config = resolveHeadConfig(props);
4063
4200
  var headStyle = (0,external_vue_namespaceObject.computed)(function () {
4201
+ var _props$thead$color, _props$thead;
4064
4202
  return {
4065
4203
  '--row-height': "".concat(resolvePropVal(config, 'height', ['thead']), "px"),
4066
4204
  '--scroll-head-left': "-".concat(TableSchema.formatData.layout.translateX, "px"),
4067
- '--scroll-left': "".concat(TableSchema.formatData.layout.translateX, "px")
4205
+ '--scroll-left': "".concat(TableSchema.formatData.layout.translateX, "px"),
4206
+ '--background-color': DEF_COLOR[(_props$thead$color = (_props$thead = props.thead) === null || _props$thead === void 0 ? void 0 : _props$thead.color) !== null && _props$thead$color !== void 0 ? _props$thead$color : IHeadColor.DEF1]
4068
4207
  };
4069
4208
  });
4070
4209
  var contentClass = defineProperty_defineProperty({}, resolveClassName('table-body'), true);
@@ -4373,14 +4512,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4373
4512
  });
4374
4513
  var resolveSetting = function resolveSetting() {
4375
4514
  if (/boolean|object/.test(typeof_typeof(props.column.showOverflowTooltip)) && props.column.showOverflowTooltip !== null) {
4515
+ var _props$column$showOve = props.column.showOverflowTooltip,
4516
+ _props$column$showOve2 = _props$column$showOve.content,
4517
+ content = _props$column$showOve2 === void 0 ? '' : _props$column$showOve2,
4518
+ _props$column$showOve3 = _props$column$showOve.mode,
4519
+ mode = _props$column$showOve3 === void 0 ? undefined : _props$column$showOve3,
4520
+ _props$column$showOve4 = _props$column$showOve.popoverOption,
4521
+ popoverOption = _props$column$showOve4 === void 0 ? {} : _props$column$showOve4;
4376
4522
  var result = {
4377
4523
  showOverflowTooltip: {
4378
- content: '',
4524
+ content: content,
4379
4525
  disabled: !props.column.showOverflowTooltip,
4380
- mode: undefined,
4526
+ mode: mode,
4381
4527
  resizerWay: undefined,
4382
4528
  watchCellResize: undefined,
4383
- popoverOption: {}
4529
+ popoverOption: popoverOption
4384
4530
  }
4385
4531
  };
4386
4532
  if (props.parentSetting !== null && typeof_typeof(props.parentSetting) === 'object') {
@@ -4398,15 +4544,17 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4398
4544
  showOverflowTooltip: props.parentSetting
4399
4545
  };
4400
4546
  };
4401
- var _resolveSetting = resolveSetting(),
4402
- _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4403
- showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4404
4547
  var bkEllipsisIns = null;
4405
4548
  var resolveTooltipOption = function resolveTooltipOption() {
4549
+ var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
4550
+ var _resolveSetting = resolveSetting(),
4551
+ _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4552
+ showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4406
4553
  var disabled = true;
4407
4554
  var resizerWay = props.resizerWay;
4555
+ 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 : '';
4408
4556
  var content = function content() {
4409
- return refRoot.value.innerText;
4557
+ return defaultContent;
4410
4558
  };
4411
4559
  var popoverOption = {};
4412
4560
  var mode = 'auto';
@@ -4419,7 +4567,7 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4419
4567
  popoverOption = showOverflowTooltip.popoverOption;
4420
4568
  resizerWay = showOverflowTooltip.resizerWay || 'debounce';
4421
4569
  content = function content() {
4422
- return showOverflowTooltip.content || refRoot.value.innerText;
4570
+ return showOverflowTooltip.content || defaultContent;
4423
4571
  };
4424
4572
  if (typeof showOverflowTooltip.content === 'function') {
4425
4573
  content = function content() {
@@ -4432,21 +4580,6 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4432
4580
  if (typeof disabled === 'function') {
4433
4581
  disabled = Reflect.apply(disabled, _this, [props.column, props.row]);
4434
4582
  }
4435
- if (props.isHead) {
4436
- var _props$column$showOve, _props$column;
4437
- 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);
4438
- mode = 'auto';
4439
- content = function content() {
4440
- var _getEllipsisTarget;
4441
- return (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 ? void 0 : _getEllipsisTarget.innerHTML;
4442
- };
4443
- if (props.headExplain) {
4444
- mode = 'static';
4445
- content = function content() {
4446
- return props.headExplain;
4447
- };
4448
- }
4449
- }
4450
4583
  /**
4451
4584
  * 当表格中的字段或数据需要做解释说明时,可增加 [下划线] 提示,hover 可查看解释说明的 tooltips
4452
4585
  */
@@ -4459,6 +4592,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4459
4592
  };
4460
4593
  }
4461
4594
  }
4595
+ if (props.isHead) {
4596
+ var _props$column$showOve5, _props$column;
4597
+ 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);
4598
+ mode = 'auto';
4599
+ content = function content() {
4600
+ var _getEllipsisTarget$cl3, _getEllipsisTarget2, _getEllipsisTarget2$c;
4601
+ 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 : '';
4602
+ };
4603
+ if (props.headExplain) {
4604
+ mode = 'static';
4605
+ content = function content() {
4606
+ return props.headExplain;
4607
+ };
4608
+ }
4609
+ }
4462
4610
  return {
4463
4611
  disabled: disabled,
4464
4612
  content: content,
@@ -4726,7 +4874,7 @@ function _isSlot(s) {
4726
4874
  return resolvePropVal(item, ['id', 'field', 'type'], [item, index]);
4727
4875
  };
4728
4876
  var checkAll = (0,external_vue_namespaceObject.ref)(false);
4729
- var isShow = (0,external_vue_namespaceObject.ref)(false);
4877
+ var refSetting = (0,external_vue_namespaceObject.ref)(null);
4730
4878
  var localSettings = (0,external_vue_namespaceObject.computed)(function () {
4731
4879
  var deafultSettings = {
4732
4880
  fields: props.columns.map(function (col) {
@@ -4739,6 +4887,7 @@ function _isSlot(s) {
4739
4887
  size: 'small',
4740
4888
  sizeList: defaultSizeList,
4741
4889
  showLineHeight: true,
4890
+ extCls: '',
4742
4891
  trigger: 'manual'
4743
4892
  };
4744
4893
  if (typeof props.settings === 'boolean') {
@@ -4761,6 +4910,7 @@ function _isSlot(s) {
4761
4910
  checkedFields: localSettings.value.checked || []
4762
4911
  };
4763
4912
  var handleSaveClick = function handleSaveClick() {
4913
+ var _refSetting$value;
4764
4914
  Object.assign(cachedValue, {
4765
4915
  checkAll: checkAll.value,
4766
4916
  activeSize: activeSize.value,
@@ -4773,17 +4923,21 @@ function _isSlot(s) {
4773
4923
  height: activeHeight.value,
4774
4924
  fields: (0,external_vue_namespaceObject.unref)(renderFields)
4775
4925
  });
4776
- isShow.value = false;
4926
+ (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
4777
4927
  };
4778
4928
  var handleCancelClick = function handleCancelClick() {
4929
+ var _refSetting$value2;
4779
4930
  checkAll.value = cachedValue.checkAll;
4780
4931
  activeSize.value = cachedValue.activeSize;
4781
4932
  activeHeight.value = cachedValue.activeHeight;
4782
4933
  checkedFields.value = cachedValue.checkedFields;
4783
- isShow.value = false;
4934
+ (_refSetting$value2 = refSetting.value) === null || _refSetting$value2 === void 0 || _refSetting$value2.hide();
4784
4935
  };
4785
4936
  var handleSettingClick = function handleSettingClick() {
4786
- isShow.value = true;
4937
+ if (localSettings.value.trigger === 'manual') {
4938
+ var _refSetting$value3;
4939
+ (_refSetting$value3 = refSetting.value) === null || _refSetting$value3 === void 0 || _refSetting$value3.show();
4940
+ }
4787
4941
  };
4788
4942
  var handleCheckAllClick = function handleCheckAllClick(e) {
4789
4943
  e.stopImmediatePropagation();
@@ -4878,9 +5032,10 @@ function _isSlot(s) {
4878
5032
  var _localSettings$value$2;
4879
5033
  return props.settings ? (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
4880
5034
  "trigger": (_localSettings$value$2 = localSettings.value.trigger) !== null && _localSettings$value$2 !== void 0 ? _localSettings$value$2 : 'manual',
4881
- "isShow": isShow.value,
4882
5035
  "placement": "bottom-end",
4883
- "arrow": true
5036
+ "ref": refSetting,
5037
+ "arrow": true,
5038
+ "extCls": localSettings.value.extCls
4884
5039
  }, {
4885
5040
  theme: theme
4886
5041
  }), {
@@ -5002,6 +5157,31 @@ function _isSlot(s) {
5002
5157
  if (!props.rowDraggable) {
5003
5158
  return {};
5004
5159
  }
5160
+ var placeDiv = document.createElement('div');
5161
+ placeDiv.style.setProperty('height', '20px');
5162
+ placeDiv.style.setProperty('width', '100%');
5163
+ placeDiv.style.setProperty('background', '#E2EDFF');
5164
+ placeDiv.style.setProperty('cursor', 'move');
5165
+ ['dragenter', 'dragover'].forEach(function (type) {
5166
+ placeDiv.addEventListener(type, function (event) {
5167
+ event.preventDefault();
5168
+ event.stopPropagation();
5169
+ event.dataTransfer.dropEffect = 'move';
5170
+ });
5171
+ });
5172
+ var lastDragRow = null;
5173
+ var lastDragRowClass = '';
5174
+ var insertPlaceDiv = function insertPlaceDiv(target, placement) {
5175
+ if (placement === '--top') {
5176
+ target.parentNode.insertBefore(placeDiv, target);
5177
+ return;
5178
+ }
5179
+ if (target.nextElementSibling === null) {
5180
+ target.parentNode.append(placeDiv);
5181
+ return;
5182
+ }
5183
+ target.parentNode.insertBefore(placeDiv, target.nextElementSibling);
5184
+ };
5005
5185
  var beforeEventFire = function beforeEventFire(fn) {
5006
5186
  if (props.rowDraggable) {
5007
5187
  fn === null || fn === void 0 || fn();
@@ -5015,9 +5195,10 @@ function _isSlot(s) {
5015
5195
  var _target$getBoundingCl = target.getBoundingClientRect(),
5016
5196
  top = _target$getBoundingCl.top,
5017
5197
  bottom = _target$getBoundingCl.bottom;
5018
- var position = y - top > bottom - y ? '--bottom' : '--top';
5198
+ var placement = y - top > bottom - y ? '--bottom' : '--top';
5019
5199
  removeDragClass(target);
5020
- target.classList.add(position);
5200
+ target.classList.add(placement);
5201
+ insertPlaceDiv(target, placement);
5021
5202
  };
5022
5203
  var removeDragClass = function removeDragClass(target) {
5023
5204
  var classList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['--bottom', '--top'];
@@ -5028,45 +5209,59 @@ function _isSlot(s) {
5028
5209
  var onDragstart = function onDragstart(event) {
5029
5210
  beforeEventFire(function () {
5030
5211
  var target = getTargetRow(event);
5212
+ placeDiv.style.setProperty('height', "".concat(target.offsetHeight, "px"));
5213
+ placeDiv.style.setProperty('width', "".concat(target.offsetWidth, "px"));
5031
5214
  target.classList.add('--drag-start');
5215
+ event.dataTransfer.setDragImage(target, 0, 0);
5032
5216
  event.dataTransfer.setData('text/plain', null);
5033
- event.dataTransfer.dropEffect = 'copy';
5217
+ event.dataTransfer.dropEffect = 'move';
5034
5218
  var rowIndex = event.target.dataset.rowIndex;
5035
5219
  event.dataTransfer.setData('data-row-index', rowIndex);
5036
5220
  });
5037
5221
  };
5038
5222
  var onDragenter = function onDragenter(event) {
5223
+ var target = getTargetRow(event);
5224
+ event.preventDefault();
5225
+ event.stopPropagation();
5039
5226
  beforeEventFire(function () {
5040
5227
  event.dataTransfer.dropEffect = 'move';
5041
- var target = getTargetRow(event);
5042
5228
  target.classList.add('--drag-enter');
5043
5229
  setTargetRowPlacement(target, event);
5230
+ lastDragRow = target;
5044
5231
  });
5045
5232
  };
5046
5233
  var onDragleave = function onDragleave(event) {
5047
5234
  beforeEventFire(function () {
5048
5235
  var target = getTargetRow(event);
5236
+ lastDragRowClass = target.classList.contains('--bottom') ? '--bottom' : '--top';
5049
5237
  removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5050
5238
  });
5051
5239
  };
5052
5240
  var onDragover = function onDragover(event) {
5053
5241
  event.preventDefault();
5242
+ event.stopPropagation();
5054
5243
  event.dataTransfer.dropEffect = 'move';
5055
5244
  var target = getTargetRow(event);
5056
5245
  setTargetRowPlacement(target, event);
5057
5246
  };
5058
- var onDrop = function onDrop(event) {
5247
+ var onDragend = function onDragend(event) {
5248
+ var _event$target$dataset;
5059
5249
  event.preventDefault();
5060
5250
  event.stopPropagation();
5061
- var target = getTargetRow(event);
5251
+ placeDiv.remove();
5252
+ if (!lastDragRow) {
5253
+ return;
5254
+ }
5255
+ var target = lastDragRow;
5062
5256
  var rowIndex = target.dataset.rowIndex;
5063
5257
  var targetIndex = Number(rowIndex);
5064
- var sourceIndex = event.dataTransfer.getData('data-row-index');
5065
- if (target.classList.contains('--bottom')) {
5258
+ var sourceIndex = (_event$target$dataset = event.target.dataset) === null || _event$target$dataset === void 0 ? void 0 : _event$target$dataset.rowIndex;
5259
+ if (lastDragRowClass === '--bottom') {
5066
5260
  targetIndex = targetIndex + 1;
5067
5261
  }
5068
5262
  resp.changePageRowIndex(Number(sourceIndex), targetIndex);
5069
- removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5263
+ lastDragRow = null;
5264
+ lastDragRowClass = '';
5070
5265
  ctx.emit(EMIT_EVENTS.DRAG_END, {
5071
5266
  sourceEvent: event,
5072
5267
  data: resp.pageData
@@ -5077,9 +5272,17 @@ function _isSlot(s) {
5077
5272
  onDragleave: onDragleave,
5078
5273
  onDragstart: onDragstart,
5079
5274
  onDragover: onDragover,
5080
- onDrop: onDrop
5275
+ onDragend: onDragend
5081
5276
  };
5082
5277
  });
5278
+ ;// CONCATENATED MODULE: external "../input"
5279
+ var input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
5280
+ var input_y = x => () => x
5281
+ const input_namespaceObject = input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__["default"] });
5282
+ ;// CONCATENATED MODULE: external "../input/input.less"
5283
+ var input_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
5284
+ var input_less_y = x => () => x
5285
+ const input_less_namespaceObject = input_less_x({ });
5083
5286
  ;// CONCATENATED MODULE: ../../packages/table/src/plugins/head-filter.tsx
5084
5287
 
5085
5288
 
@@ -5125,6 +5328,8 @@ function _isSlot(s) {
5125
5328
 
5126
5329
 
5127
5330
 
5331
+
5332
+
5128
5333
  function head_filter_isSlot(s) {
5129
5334
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
5130
5335
  }
@@ -5141,12 +5346,15 @@ function head_filter_isSlot(s) {
5141
5346
  resolveClassName = _usePrefix.resolveClassName;
5142
5347
  var t = (0,config_provider_namespaceObject.useLocale)('table');
5143
5348
  var column = props.column;
5144
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props.column),
5145
- filter = _toRefs.filter;
5349
+ var filter = (0,external_vue_namespaceObject.computed)(function () {
5350
+ var _props$column;
5351
+ return (_props$column = props.column) === null || _props$column === void 0 ? void 0 : _props$column.filter;
5352
+ });
5146
5353
  var checked = (0,external_vue_namespaceObject.computed)(function () {
5147
5354
  var _filter$value$checked, _filter$value;
5148
5355
  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 : [];
5149
5356
  });
5357
+ var searchValue = (0,external_vue_namespaceObject.ref)('');
5150
5358
  var state = (0,external_vue_namespaceObject.reactive)({
5151
5359
  isOpen: false,
5152
5360
  checked: checked.value
@@ -5177,21 +5385,28 @@ function head_filter_isSlot(s) {
5177
5385
  isOpen && setTimeout(function () {
5178
5386
  refVirtualRender.value.reset();
5179
5387
  });
5388
+ if (!isOpen) {
5389
+ searchValue.value = '';
5390
+ }
5180
5391
  };
5181
5392
  var theme = "light ".concat(resolveClassName('table-head-filter'));
5182
5393
  var localData = (0,external_vue_namespaceObject.computed)(function () {
5183
5394
  var _filter$value$list = filter.value.list,
5184
5395
  list = _filter$value$list === void 0 ? [] : _filter$value$list;
5185
- return list;
5396
+ var filterList = list.filter(function (l) {
5397
+ return getRegExp(searchValue.value).test(l.value);
5398
+ });
5399
+ console.log(' filterList: ', filterList);
5400
+ return filterList;
5186
5401
  });
5187
- var getRegExp = function getRegExp(searchValue) {
5402
+ var getRegExp = function getRegExp(val) {
5188
5403
  var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ig';
5189
- return new RegExp("".concat(searchValue).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), flags);
5404
+ return new RegExp("".concat(val).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), flags);
5190
5405
  };
5191
5406
  var defaultFilterFn = function defaultFilterFn(checked, row) {
5192
5407
  var match = filter.value.match;
5193
5408
  var matchText = getRowText(row, resolvePropVal(column, 'field', [column, row]));
5194
- if (match === 'full') {
5409
+ if (match !== 'fuzzy') {
5195
5410
  return checked.includes(matchText);
5196
5411
  }
5197
5412
  return checked.some(function (str) {
@@ -5355,7 +5570,14 @@ function head_filter_isSlot(s) {
5355
5570
  content: function content() {
5356
5571
  return (0,external_vue_namespaceObject.createVNode)("div", {
5357
5572
  "class": headFilterContentClass
5358
- }, [(0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject.BkCheckboxGroup, {
5573
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
5574
+ "style": "padding: 4px 10px;"
5575
+ }, [(0,external_vue_namespaceObject.createVNode)(input_namespaceObject["default"], {
5576
+ "modelValue": searchValue.value,
5577
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
5578
+ return searchValue.value = $event;
5579
+ }
5580
+ }, null)]), (0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject.BkCheckboxGroup, {
5359
5581
  "class": "content-list"
5360
5582
  }, {
5361
5583
  "default": function _default() {
@@ -5464,7 +5686,8 @@ function _slicedToArray(arr, i) {
5464
5686
  props: {
5465
5687
  column: IColumnType,
5466
5688
  defaultSort: shared_namespaceObject.PropTypes.oneOf(SORT_OPTIONS).def(SORT_OPTION.NULL),
5467
- active: shared_namespaceObject.PropTypes.bool
5689
+ active: shared_namespaceObject.PropTypes.bool,
5690
+ sortValFormat: shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.any).def([''])
5468
5691
  },
5469
5692
  emits: ['change'],
5470
5693
  setup: function setup(props, _ref) {
@@ -5502,8 +5725,8 @@ function _slicedToArray(arr, i) {
5502
5725
  if (sortType.value === type) {
5503
5726
  currentSort = SORT_OPTION.NULL;
5504
5727
  }
5505
- var execFn = getSortFn(props.column, currentSort);
5506
- var sort = resolveSort(props.column.sort, props.column);
5728
+ var execFn = getSortFn(props.column, currentSort, props.sortValFormat);
5729
+ var sort = resolveSort(props.column.sort, props.column, props.sortValFormat);
5507
5730
  if ((sort === null || sort === void 0 ? void 0 : sort.value) === 'custom') {
5508
5731
  var _sort$sortFn;
5509
5732
  emit('change', (_sort$sortFn = sort === null || sort === void 0 ? void 0 : sort.sortFn) !== null && _sort$sortFn !== void 0 ? _sort$sortFn : execFn, currentSort);
@@ -5614,7 +5837,7 @@ function use_head_cell_isSlot(s) {
5614
5837
  var type = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE);
5615
5838
  nextSort.value = getNextSortType(type);
5616
5839
  var sortFn = function sortFn(a, b) {
5617
- return getSortFnByColumn(column, getSortFn(column, nextSort.value), a, b);
5840
+ return getSortFnByColumn(column, getSortFn(column, nextSort.value, props.sortValFormat), a, b);
5618
5841
  };
5619
5842
  tableResp.setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE, nextSort.value);
5620
5843
  tableResp.setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_FN, sortFn);
@@ -5700,7 +5923,8 @@ function use_head_cell_isSlot(s) {
5700
5923
  "column": column,
5701
5924
  "defaultSort": active.value ? nextSort.value : SORT_OPTION.NULL,
5702
5925
  "onChange": handleSortClick,
5703
- "active": active.value
5926
+ "active": active.value,
5927
+ "sortValFormat": props.sortValFormat
5704
5928
  }, null);
5705
5929
  };
5706
5930
  var getFilterCell = function getFilterCell(column, index) {
@@ -6026,7 +6250,7 @@ function use_render_isSlot(s) {
6026
6250
  }
6027
6251
  return '';
6028
6252
  };
6029
- var getRowSpanConfig = function getRowSpanConfig(row, index, preRow, col, store) {
6253
+ var getRowSpanConfig = function getRowSpanConfig(row, rowIndex, preRow, col, store) {
6030
6254
  var _store$get$get, _store$get;
6031
6255
  if (!store.has(row)) {
6032
6256
  store.set(row, new WeakMap());
@@ -6041,7 +6265,7 @@ function use_render_isSlot(s) {
6041
6265
  _ref$skipRowLen = _ref.skipRowLen,
6042
6266
  skipRowLen = _ref$skipRowLen === void 0 ? 0 : _ref$skipRowLen;
6043
6267
  var skipRow = false;
6044
- var rowspan = resolveColumnSpan(col, null, row, index, 'rowspan');
6268
+ var rowspan = resolveColumnSpan(col, null, row, rowIndex, 'rowspan');
6045
6269
  if (skipRowLen > 1) {
6046
6270
  skipRowLen = skipRowLen - 1;
6047
6271
  skipRow = true;
@@ -6114,7 +6338,7 @@ function use_render_isSlot(s) {
6114
6338
  rowspan = _resolveCellSpan.rowspan;
6115
6339
  var _tableResp$getColumnA = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SPAN),
6116
6340
  skipCol = _tableResp$getColumnA.skipCol;
6117
- var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, index, preRow, column, rowSpanMap) : {
6341
+ var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, rowIndex, preRow, column, rowSpanMap) : {
6118
6342
  skipRow: false
6119
6343
  },
6120
6344
  skipRow = _ref2.skipRow;
@@ -6464,6 +6688,7 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6464
6688
 
6465
6689
 
6466
6690
 
6691
+
6467
6692
  /* harmony default export */ const table = ((0,external_vue_namespaceObject.defineComponent)({
6468
6693
  // eslint-disable-next-line vue/no-reserved-component-names
6469
6694
  name: 'Table',
@@ -6498,7 +6723,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6498
6723
  hasFooter = _useClass.hasFooter,
6499
6724
  footerStyle = _useClass.footerStyle,
6500
6725
  tableBodyClass = _useClass.tableBodyClass,
6501
- fixedBottomBorder = _useClass.fixedBottomBorder,
6502
6726
  resizeColumnClass = _useClass.resizeColumnClass,
6503
6727
  tableBodyContentClass = _useClass.tableBodyContentClass,
6504
6728
  loadingRowClass = _useClass.loadingRowClass,
@@ -6521,6 +6745,11 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6521
6745
  hasScrollY: hasScrollYRef.value
6522
6746
  };
6523
6747
  });
6748
+ use_observer_resize(root, function () {
6749
+ (0,external_vue_namespaceObject.nextTick)(function () {
6750
+ resolveFixedColumns(tableOffsetRight.value);
6751
+ });
6752
+ });
6524
6753
  var _useRender = use_render(props, ctx, tableSchema, styleRef, head, root, resetTableHeight),
6525
6754
  renderTableBodySchema = _useRender.renderTableBodySchema,
6526
6755
  renderTableFooter = _useRender.renderTableFooter,
@@ -6538,13 +6767,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6538
6767
  }
6539
6768
  };
6540
6769
  var isFirstLoad = (0,external_vue_namespaceObject.ref)(true);
6541
- // const tableWidth = ref(null);
6542
- (0,external_vue_namespaceObject.watch)(function () {
6543
- return [props.data, columns];
6544
- }, function () {
6770
+ (0,external_vue_namespaceObject.watchEffect)(function () {
6771
+ tableSchema.formatDataSchema(props.data);
6772
+ tableSchema.formatColumns(columns);
6773
+ resolveFixedColumns(tableOffsetRight.value);
6545
6774
  tableSchema.setIndexData().then(function () {
6546
- tableSchema.formatColumns(columns);
6547
- tableSchema.formatDataSchema(props.data);
6775
+ // tableSchema.formatDataSchema(props.data);
6548
6776
  tableSchema.resetStartEndIndex();
6549
6777
  if (isFirstLoad.value) {
6550
6778
  tableSchema.resolveByDefColumns();
@@ -6555,7 +6783,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6555
6783
  registerResizeEvent();
6556
6784
  (0,external_vue_namespaceObject.nextTick)(function () {
6557
6785
  updateOffsetRight();
6558
- resolveFixedColumns(tableOffsetRight.value);
6559
6786
  /**
6560
6787
  * 确保在所有数据渲染完毕再执行fix column计算
6561
6788
  */
@@ -6564,9 +6791,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6564
6791
  });
6565
6792
  });
6566
6793
  });
6567
- }, {
6568
- immediate: true,
6569
- deep: true
6570
6794
  });
6571
6795
  (0,external_vue_namespaceObject.watch)(function () {
6572
6796
  return [props.height, props.maxHeight, props.minHeight];
@@ -6678,9 +6902,8 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6678
6902
  return renderTableBodySchema(scope.data);
6679
6903
  },
6680
6904
  afterSection: function afterSection() {
6681
- return [(0,external_vue_namespaceObject.createVNode)("div", {
6682
- "class": fixedBottomBorder.value
6683
- }, null), (0,external_vue_namespaceObject.createVNode)("div", {
6905
+ return [// <div class={fixedBottomBorder.value}></div>,
6906
+ (0,external_vue_namespaceObject.createVNode)("div", {
6684
6907
  "class": resizeColumnClass,
6685
6908
  "style": resizeColumnStyle.value
6686
6909
  }, null)];