bkui-vue 1.0.3-beta.3 → 1.0.3-beta.30

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 (162) hide show
  1. package/dist/index.cjs.js +71 -71
  2. package/dist/index.esm.js +16194 -15009
  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/alert/alert.variable.css +3 -0
  16. package/lib/backtop/backtop.variable.css +3 -0
  17. package/lib/badge/badge.variable.css +3 -0
  18. package/lib/breadcrumb/breadcrumb.variable.css +3 -0
  19. package/lib/button/button.variable.css +3 -0
  20. package/lib/card/card.variable.css +3 -0
  21. package/lib/cascader/cascader.variable.css +3 -0
  22. package/lib/checkbox/checkbox.variable.css +3 -0
  23. package/lib/code-diff/code-diff.variable.css +3 -0
  24. package/lib/collapse/collapse.variable.css +3 -0
  25. package/lib/collapse-transition/collapse-transition.variable.css +3 -0
  26. package/lib/color-picker/color-picker.variable.css +3 -0
  27. package/lib/components.js +0 -4
  28. package/lib/config-provider/config-provider.d.ts +3 -0
  29. package/lib/config-provider/config-provider.variable.css +3 -0
  30. package/lib/config-provider/index.d.ts +4 -0
  31. package/lib/config-provider/token.d.ts +1 -0
  32. package/lib/container/container.variable.css +3 -0
  33. package/lib/date-picker/date-picker.d.ts +1 -0
  34. package/lib/date-picker/date-picker.variable.css +3 -0
  35. package/lib/date-picker/index.d.ts +3 -0
  36. package/lib/date-picker/index.js +9 -3
  37. package/lib/date-picker/time-picker.d.ts +1 -0
  38. package/lib/dialog/dialog.d.ts +11 -0
  39. package/lib/dialog/dialog.variable.css +3 -0
  40. package/lib/dialog/index.d.ts +23 -0
  41. package/lib/dialog/index.js +3 -1
  42. package/lib/dialog/props.d.ts +5 -0
  43. package/lib/dist.index.js +0 -1
  44. package/lib/divider/divider.variable.css +3 -0
  45. package/lib/dropdown/dropdown.css +3 -1
  46. package/lib/dropdown/dropdown.variable.css +6 -1
  47. package/lib/exception/exception.variable.css +3 -0
  48. package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
  49. package/lib/form/form.css +1 -0
  50. package/lib/form/form.less +2 -1
  51. package/lib/form/form.variable.css +4 -0
  52. package/lib/hooks.js +1 -8
  53. package/lib/icon/index.d.ts +1 -0
  54. package/lib/icon/index.js +34 -1
  55. package/lib/icon/text-all.d.ts +4 -0
  56. package/lib/icon/text-all.js +276 -0
  57. package/lib/image/image-viewer.variable.css +3 -0
  58. package/lib/image/image.variable.css +3 -0
  59. package/lib/image/index.js +5 -2
  60. package/lib/index.js +0 -1
  61. package/lib/info-box/index.js +40 -455
  62. package/lib/info-box/info-box.variable.css +3 -0
  63. package/lib/input/index.js +5 -0
  64. package/lib/input/input.variable.css +3 -0
  65. package/lib/link/link.variable.css +3 -0
  66. package/lib/loading/loading.variable.css +3 -0
  67. package/lib/locale/index.js +4 -2
  68. package/lib/locale/lang/en.d.ts +1 -0
  69. package/lib/menu/menu.variable.css +3 -0
  70. package/lib/menu/submenu.variable.css +3 -0
  71. package/lib/message/message.variable.css +3 -0
  72. package/lib/modal/index.d.ts +34 -6
  73. package/lib/modal/index.js +8 -6
  74. package/lib/modal/modal.d.ts +13 -2
  75. package/lib/modal/modal.variable.css +3 -0
  76. package/lib/modal/props.mixin.d.ts +5 -0
  77. package/lib/navigation/navigation.variable.css +3 -0
  78. package/lib/notify/notify.variable.css +3 -0
  79. package/lib/pagination/index.js +2 -2
  80. package/lib/pagination/pagination.variable.css +3 -0
  81. package/lib/plugin-popover/index.d.ts +1 -1
  82. package/lib/plugin-popover/index.js +55 -31
  83. package/lib/pop-confirm/pop-confirm.variable.css +3 -0
  84. package/lib/popover/content.d.ts +1 -1
  85. package/lib/popover/index.js +55 -31
  86. package/lib/popover/plugin-popover.d.ts +4 -1
  87. package/lib/popover/popover.css +3 -1
  88. package/lib/popover/popover.less +4 -1
  89. package/lib/popover/popover.variable.css +6 -1
  90. package/lib/preset.d.ts +2 -0
  91. package/lib/preset.js +14 -20
  92. package/lib/process/process.variable.css +3 -0
  93. package/lib/progress/progress.variable.css +3 -0
  94. package/lib/radio/radio.variable.css +3 -0
  95. package/lib/rate/rate.variable.css +3 -0
  96. package/lib/rate/star.variable.css +3 -0
  97. package/lib/resize-layout/resize-layout.variable.css +3 -0
  98. package/lib/search-select/search-select.variable.css +3 -0
  99. package/lib/select/index.d.ts +68 -6
  100. package/lib/select/index.js +1326 -68
  101. package/lib/select/option.d.ts +3 -1
  102. package/lib/select/pinyin/core.d.ts +14 -0
  103. package/lib/select/pinyin/dict.d.ts +34 -0
  104. package/lib/select/pinyin/index.d.ts +2 -0
  105. package/lib/select/select.css +36 -7
  106. package/lib/select/select.d.ts +28 -2
  107. package/lib/select/select.less +43 -13
  108. package/lib/select/select.variable.css +39 -7
  109. package/lib/select/type.d.ts +2 -3
  110. package/lib/shared/index.js +44 -3
  111. package/lib/shared/utils.d.ts +12 -0
  112. package/lib/sideslider/index.d.ts +29 -6
  113. package/lib/sideslider/index.js +5 -2
  114. package/lib/sideslider/sideslider.d.ts +13 -2
  115. package/lib/sideslider/sideslider.variable.css +3 -0
  116. package/lib/slider/slider.variable.css +3 -0
  117. package/lib/steps/steps.variable.css +3 -0
  118. package/lib/styles/mixins/animate.variable.css +3 -0
  119. package/lib/styles/mixins/popper.variable.css +3 -0
  120. package/lib/styles/mixins/scroll.variable.css +3 -0
  121. package/lib/styles/reset.css +3 -1
  122. package/lib/styles/reset.less +3 -1
  123. package/lib/styles/reset.variable.css +6 -1
  124. package/lib/styles/themes/themes.less +5 -0
  125. package/lib/swiper/swiper.variable.css +3 -0
  126. package/lib/switcher/switcher.variable.css +3 -0
  127. package/lib/tab/tab.variable.css +3 -0
  128. package/lib/table/cache.d.ts +11 -3
  129. package/lib/table/components/table-column.d.ts +7 -4
  130. package/lib/table/index.d.ts +22 -4
  131. package/lib/table/index.js +1382 -1118
  132. package/lib/table/plugins/head-filter.variable.css +3 -0
  133. package/lib/table/plugins/head-sort.d.ts +7 -0
  134. package/lib/table/plugins/head-sort.variable.css +3 -0
  135. package/lib/table/plugins/settings.variable.css +3 -0
  136. package/lib/table/plugins/use-draggable.d.ts +2 -2
  137. package/lib/table/plugins/use-observer-resize.d.ts +5 -0
  138. package/lib/table/props.d.ts +15 -4
  139. package/lib/table/table.css +6 -12
  140. package/lib/table/table.d.ts +7 -0
  141. package/lib/table/table.less +12 -9
  142. package/lib/table/table.variable.css +9 -12
  143. package/lib/table/use-attributes.d.ts +5 -43
  144. package/lib/table/utils.d.ts +5 -4
  145. package/lib/table-column/index.d.ts +125 -116
  146. package/lib/table-column/index.js +97 -26
  147. package/lib/tag/tag.variable.css +3 -0
  148. package/lib/tag-input/index.d.ts +4 -4
  149. package/lib/tag-input/tag-input.d.ts +2 -2
  150. package/lib/tag-input/tag-input.variable.css +3 -0
  151. package/lib/tag-input/tag-props.d.ts +1 -1
  152. package/lib/tag-input/tag-render.d.ts +1 -1
  153. package/lib/time-picker/index.d.ts +38 -35
  154. package/lib/time-picker/time-picker.variable.css +3 -0
  155. package/lib/timeline/timeline.variable.css +3 -0
  156. package/lib/transfer/transfer.variable.css +3 -0
  157. package/lib/tree/tree.variable.css +3 -0
  158. package/lib/upload/upload.variable.css +3 -0
  159. package/lib/virtual-render/index.d.ts +9 -9
  160. package/lib/virtual-render/virtual-render.d.ts +3 -3
  161. package/lib/virtual-render/virtual-render.variable.css +3 -0
  162. package/package.json +3 -2
@@ -8,10 +8,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_virtual_render_927587a8__ fro
8
8
  import "../virtual-render/virtual-render.less";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_isElement_e6b2a6ce__ from "lodash/isElement";
10
10
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
11
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
12
- import "../loading/loading.less";
13
11
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
14
12
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__ from "lodash/get";
13
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__ from "../loading";
14
+ import "../loading/loading.less";
15
15
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../checkbox";
16
16
  import "../checkbox/checkbox.less";
17
17
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
@@ -25,6 +25,8 @@ import "../button/button.less";
25
25
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon__3efece53__ from "../icon/";
26
26
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
27
27
  import "../popover/popover.less";
28
+ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__ from "../input";
29
+ import "../input/input.less";
28
30
  /******/ // The require scope
29
31
  /******/ var __webpack_require__ = {};
30
32
  /******/
@@ -120,7 +122,7 @@ function defineProperty_defineProperty(obj, key, value) {
120
122
  ;// CONCATENATED MODULE: external "vue"
121
123
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
122
124
  var external_vue_y = x => () => x
123
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
125
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
124
126
  ;// CONCATENATED MODULE: ../../packages/table/src/const.ts
125
127
 
126
128
  /*
@@ -300,7 +302,7 @@ var ColumnTypeEnum;
300
302
  ColumnTypeEnum["SELECTION"] = "selection";
301
303
  ColumnTypeEnum["INDEX"] = "index";
302
304
  ColumnTypeEnum["EXPAND"] = "expand";
303
- ColumnTypeEnum["NONE"] = "none";
305
+ ColumnTypeEnum["NONE"] = "__COL_TYPE_NONE";
304
306
  })(ColumnTypeEnum || (ColumnTypeEnum = {}));
305
307
  var TableAlignEnum;
306
308
  (function (TableAlignEnum) {
@@ -452,6 +454,13 @@ var tableProps = {
452
454
  * 是否显示Head
453
455
  */
454
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(['']),
455
464
  /**
456
465
  * table header config
457
466
  */
@@ -631,6 +640,7 @@ var tableProps = {
631
640
  ;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
632
641
 
633
642
 
643
+
634
644
  /*
635
645
  * Tencent is pleased to support the open source community by making
636
646
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -695,18 +705,38 @@ var TableColumnProp = {
695
705
  var column = (0,external_vue_namespaceObject.reactive)(Object.assign({}, props, {
696
706
  field: props.prop || props.field
697
707
  }));
708
+ var isIndexPropChanged = (0,external_vue_namespaceObject.ref)(false);
709
+ var setIsIndexChanged = function setIsIndexChanged(val) {
710
+ isIndexPropChanged.value = val;
711
+ };
698
712
  return {
713
+ isIndexPropChanged: isIndexPropChanged,
714
+ setIsIndexChanged: setIsIndexChanged,
699
715
  initColumns: initColumns,
700
716
  bkTableCache: bkTableCache,
701
717
  column: column
702
718
  };
703
719
  },
720
+ watch: {
721
+ index: {
722
+ handler: function handler() {
723
+ this.setIsIndexChanged(!this.isIndexPropChanged);
724
+ },
725
+ deep: true
726
+ }
727
+ },
704
728
  unmounted: function unmounted() {
705
729
  this.updateColumnDefine(true);
706
730
  },
707
731
  mounted: function mounted() {
708
732
  this.updateColumnDefine();
709
733
  },
734
+ updated: function updated() {
735
+ if (this.isIndexPropChanged) {
736
+ this.updateColumnDefineByParent();
737
+ this.setIsIndexChanged(!this.isIndexPropChanged);
738
+ }
739
+ },
710
740
  methods: {
711
741
  updateColumnDefine: function updateColumnDefine() {
712
742
  var unmounted = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
@@ -724,43 +754,86 @@ var TableColumnProp = {
724
754
  return Object.assign(result, defineProperty_defineProperty({}, target, props[key]));
725
755
  }, {});
726
756
  },
757
+ rsolveIndexedColumn: function rsolveIndexedColumn() {
758
+ // 如果是设置了Index,则先添加Index列,不做自动递归读取Column
759
+ if (/\d+\.?\d*/.test("".concat(this.$props.index))) {
760
+ var resolveProp = Object.assign({}, this.copyProps(this.$props), {
761
+ field: this.$props.prop || this.$props.field,
762
+ render: this.$slots["default"]
763
+ });
764
+ this.initColumns(resolveProp);
765
+ return false;
766
+ }
767
+ return true;
768
+ },
727
769
  updateColumnDefineByParent: function updateColumnDefineByParent() {
728
770
  var _this = this;
771
+ if (!this.rsolveIndexedColumn()) {
772
+ return;
773
+ }
729
774
  var fn = function fn() {
730
775
  // @ts-ignore
731
776
  var selfVnode = _this._;
732
- var colList = selfVnode.parent.vnode.children["default"]() || [];
777
+ var getTableNode = function getTableNode(root) {
778
+ var _parentVnode$type;
779
+ if (root === document.body || !root) {
780
+ return null;
781
+ }
782
+ var parentVnode = root.parent;
783
+ if (((_parentVnode$type = parentVnode.type) === null || _parentVnode$type === void 0 ? void 0 : _parentVnode$type.name) === 'Table') {
784
+ return parentVnode.vnode;
785
+ }
786
+ return getTableNode(parentVnode);
787
+ };
788
+ var tableNode = getTableNode(selfVnode);
789
+ if (!tableNode) {
790
+ return;
791
+ }
733
792
  var sortColumns = [];
734
793
  var index = 0;
794
+ var resolveChildNode = function resolveChildNode(node) {
795
+ var _node$type;
796
+ if (!node) {
797
+ return null;
798
+ }
799
+ if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
800
+ var _node$children;
801
+ var resolveProp = Object.assign({
802
+ index: index
803
+ }, _this.copyProps(node.props), {
804
+ field: node.props.prop || node.props.field,
805
+ render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
806
+ });
807
+ sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
808
+ index = index + 1;
809
+ return null;
810
+ }
811
+ if (Array.isArray(node.children)) {
812
+ return node.children;
813
+ }
814
+ if ((0,external_vue_namespaceObject.isVNode)(node) && typeof_typeof(node.children) === 'object') {
815
+ return Object.keys(node.children).map(function (key) {
816
+ return node.children[key];
817
+ });
818
+ }
819
+ if (typeof node === 'function') {
820
+ return node();
821
+ }
822
+ return null;
823
+ };
735
824
  var reduceColumns = function reduceColumns(nodes) {
736
825
  if (!Array.isArray(nodes)) {
826
+ var children = resolveChildNode(nodes);
827
+ if (children) {
828
+ reduceColumns(children);
829
+ }
737
830
  return;
738
831
  }
739
- nodes.forEach(function (node) {
740
- var _node$type, _node$children2;
741
- if (Array.isArray(node)) {
742
- reduceColumns(node);
743
- return;
744
- }
745
- var skipValidateKey0 = true;
746
- if (((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) === 'TableColumn') {
747
- var _node$children;
748
- skipValidateKey0 = Object.hasOwnProperty.call(node.props || {}, 'key');
749
- var resolveProp = Object.assign({
750
- index: index
751
- }, _this.copyProps(node.props), {
752
- field: node.props.prop || node.props.field,
753
- render: (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children["default"]
754
- });
755
- sortColumns.push((0,external_vue_namespaceObject.unref)(resolveProp));
756
- index = index + 1;
757
- }
758
- if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length && skipValidateKey0) {
759
- reduceColumns(node.children);
760
- }
832
+ nodes === null || nodes === void 0 || nodes.forEach(function (node) {
833
+ return reduceColumns(node);
761
834
  });
762
835
  };
763
- reduceColumns(colList);
836
+ reduceColumns(tableNode);
764
837
  _this.initColumns(sortColumns);
765
838
  };
766
839
  if (typeof this.bkTableCache.queueStack === 'function') {
@@ -852,21 +925,41 @@ var BkTableCache = /*#__PURE__*/function () {
852
925
  function BkTableCache() {
853
926
  _classCallCheck(this, BkTableCache);
854
927
  defineProperty_defineProperty(this, "storage", undefined);
855
- this.storage = {};
928
+ defineProperty_defineProperty(this, "defKey", Symbol('bk-table-cache-def-key'));
929
+ this.storage = new WeakMap();
856
930
  }
857
931
  _createClass(BkTableCache, [{
858
932
  key: "queueStack",
859
933
  value: function queueStack(methodName) {
934
+ var _target$methodName;
860
935
  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
861
- this.storage[methodName] && clearTimeout(this.storage[methodName]);
862
- this.storage[methodName] = setTimeout(function () {
863
- return fn();
864
- });
936
+ var key = arguments.length > 2 ? arguments[2] : undefined;
937
+ var stackKey = key !== null && key !== void 0 ? key : this.defKey;
938
+ if (!this.storage.has(stackKey)) {
939
+ this.storage.set(stackKey, {});
940
+ }
941
+ var target = this.storage.get(stackKey);
942
+ if ((_target$methodName = target[methodName]) !== null && _target$methodName !== void 0 && _target$methodName.timerId) {
943
+ var _target$methodName2;
944
+ clearTimeout((_target$methodName2 = target[methodName]) === null || _target$methodName2 === void 0 ? void 0 : _target$methodName2.timerId);
945
+ }
946
+ Object.assign(target, defineProperty_defineProperty({}, methodName, {
947
+ timerId: setTimeout(fn),
948
+ fn: fn
949
+ }));
865
950
  }
866
951
  }, {
867
952
  key: "clearQueueStack",
868
- value: function clearQueueStack(methodName) {
869
- this.storage[methodName] && clearTimeout(this.storage[methodName]);
953
+ value: function clearQueueStack(methodName, key) {
954
+ var stackKey = key !== null && key !== void 0 ? key : this.defKey;
955
+ if (this.storage.has(stackKey)) {
956
+ var _target$methodName3;
957
+ var target = this.storage.get(stackKey);
958
+ if ((_target$methodName3 = target[methodName]) !== null && _target$methodName3 !== void 0 && _target$methodName3.timerId) {
959
+ var _target$methodName4;
960
+ clearTimeout((_target$methodName4 = target[methodName]) === null || _target$methodName4 === void 0 ? void 0 : _target$methodName4.timerId);
961
+ }
962
+ }
870
963
  }
871
964
  }]);
872
965
  return BkTableCache;
@@ -1430,624 +1523,265 @@ function _toConsumableArray(arr) {
1430
1523
  updateFixClass: updateFixClass
1431
1524
  };
1432
1525
  });
1433
- ;// CONCATENATED MODULE: external "../loading"
1434
- var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1435
- var loading_y = x => () => x
1436
- const loading_namespaceObject = loading_x({ ["BkLoadingMode"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingMode, ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"] });
1437
- ;// CONCATENATED MODULE: external "../loading/loading.less"
1438
- var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1439
- var loading_less_y = x => () => x
1440
- const loading_less_namespaceObject = loading_less_x({ });
1441
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
1442
-
1443
-
1444
- /*
1445
- * Tencent is pleased to support the open source community by making
1446
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1447
- *
1448
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1449
- *
1450
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1451
- *
1452
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1453
- *
1454
- * ---------------------------------------------------
1455
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1456
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1457
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1458
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1459
- *
1460
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1461
- * the Software.
1462
- *
1463
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1464
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1465
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1466
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1467
- * IN THE SOFTWARE.
1468
- */
1526
+ ;// CONCATENATED MODULE: external "lodash/debounce"
1527
+ var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1528
+ var debounce_y = x => () => x
1529
+ const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
1530
+ ;// CONCATENATED MODULE: external "lodash/get"
1531
+ var get_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1532
+ var get_y = x => () => x
1533
+ const get_namespaceObject = get_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__["default"] });
1534
+ ;// CONCATENATED MODULE: ../../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
1535
+ /**
1536
+ * A collection of shims that provide minimal functionality of the ES6 collections.
1537
+ *
1538
+ * These implementations are not meant to be used outside of the ResizeObserver
1539
+ * modules as they cover only a limited range of use cases.
1540
+ */
1541
+ /* eslint-disable require-jsdoc, valid-jsdoc */
1542
+ var MapShim = (function () {
1543
+ if (typeof Map !== 'undefined') {
1544
+ return Map;
1545
+ }
1546
+ /**
1547
+ * Returns index in provided array that matches the specified key.
1548
+ *
1549
+ * @param {Array<Array>} arr
1550
+ * @param {*} key
1551
+ * @returns {number}
1552
+ */
1553
+ function getIndex(arr, key) {
1554
+ var result = -1;
1555
+ arr.some(function (entry, index) {
1556
+ if (entry[0] === key) {
1557
+ result = index;
1558
+ return true;
1559
+ }
1560
+ return false;
1561
+ });
1562
+ return result;
1563
+ }
1564
+ return /** @class */ (function () {
1565
+ function class_1() {
1566
+ this.__entries__ = [];
1567
+ }
1568
+ Object.defineProperty(class_1.prototype, "size", {
1569
+ /**
1570
+ * @returns {boolean}
1571
+ */
1572
+ get: function () {
1573
+ return this.__entries__.length;
1574
+ },
1575
+ enumerable: true,
1576
+ configurable: true
1577
+ });
1578
+ /**
1579
+ * @param {*} key
1580
+ * @returns {*}
1581
+ */
1582
+ class_1.prototype.get = function (key) {
1583
+ var index = getIndex(this.__entries__, key);
1584
+ var entry = this.__entries__[index];
1585
+ return entry && entry[1];
1586
+ };
1587
+ /**
1588
+ * @param {*} key
1589
+ * @param {*} value
1590
+ * @returns {void}
1591
+ */
1592
+ class_1.prototype.set = function (key, value) {
1593
+ var index = getIndex(this.__entries__, key);
1594
+ if (~index) {
1595
+ this.__entries__[index][1] = value;
1596
+ }
1597
+ else {
1598
+ this.__entries__.push([key, value]);
1599
+ }
1600
+ };
1601
+ /**
1602
+ * @param {*} key
1603
+ * @returns {void}
1604
+ */
1605
+ class_1.prototype.delete = function (key) {
1606
+ var entries = this.__entries__;
1607
+ var index = getIndex(entries, key);
1608
+ if (~index) {
1609
+ entries.splice(index, 1);
1610
+ }
1611
+ };
1612
+ /**
1613
+ * @param {*} key
1614
+ * @returns {void}
1615
+ */
1616
+ class_1.prototype.has = function (key) {
1617
+ return !!~getIndex(this.__entries__, key);
1618
+ };
1619
+ /**
1620
+ * @returns {void}
1621
+ */
1622
+ class_1.prototype.clear = function () {
1623
+ this.__entries__.splice(0);
1624
+ };
1625
+ /**
1626
+ * @param {Function} callback
1627
+ * @param {*} [ctx=null]
1628
+ * @returns {void}
1629
+ */
1630
+ class_1.prototype.forEach = function (callback, ctx) {
1631
+ if (ctx === void 0) { ctx = null; }
1632
+ for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
1633
+ var entry = _a[_i];
1634
+ callback.call(ctx, entry[1], entry[0]);
1635
+ }
1636
+ };
1637
+ return class_1;
1638
+ }());
1639
+ })();
1469
1640
 
1641
+ /**
1642
+ * Detects whether window and document objects are available in current environment.
1643
+ */
1644
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
1470
1645
 
1646
+ // Returns global object of a current environment.
1647
+ var global$1 = (function () {
1648
+ if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
1649
+ return __webpack_require__.g;
1650
+ }
1651
+ if (typeof self !== 'undefined' && self.Math === Math) {
1652
+ return self;
1653
+ }
1654
+ if (typeof window !== 'undefined' && window.Math === Math) {
1655
+ return window;
1656
+ }
1657
+ // eslint-disable-next-line no-new-func
1658
+ return Function('return this')();
1659
+ })();
1471
1660
 
1661
+ /**
1662
+ * A shim for the requestAnimationFrame which falls back to the setTimeout if
1663
+ * first one is not supported.
1664
+ *
1665
+ * @returns {number} Requests' identifier.
1666
+ */
1667
+ var requestAnimationFrame$1 = (function () {
1668
+ if (typeof requestAnimationFrame === 'function') {
1669
+ // It's required to use a bounded function because IE sometimes throws
1670
+ // an "Invalid calling object" error if rAF is invoked without the global
1671
+ // object on the left hand side.
1672
+ return requestAnimationFrame.bind(global$1);
1673
+ }
1674
+ return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
1675
+ })();
1472
1676
 
1473
- /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
1474
- var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
1475
- var getLoadingOption = function getLoadingOption() {
1476
- if (typeof refScrollLoading.value === 'boolean') {
1477
- return {
1478
- loading: !!refScrollLoading.value,
1479
- inline: true,
1480
- title: '',
1481
- size: loading_namespaceObject.BkLoadingSize.Normal,
1482
- mode: loading_namespaceObject.BkLoadingMode.Default,
1483
- indicator: null
1484
- };
1485
- }
1486
- return refScrollLoading.value;
1487
- };
1488
- var isRender = (0,external_vue_namespaceObject.computed)(function () {
1489
- return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
1490
- });
1491
- var renderScrollLoading = function renderScrollLoading() {
1492
- if (isRender.value) {
1493
- var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
1494
- var _getLoadingOption = getLoadingOption(),
1495
- loading = _getLoadingOption.loading,
1496
- size = _getLoadingOption.size,
1497
- mode = _getLoadingOption.mode,
1498
- title = _getLoadingOption.title,
1499
- inline = _getLoadingOption.inline,
1500
- indicator = _getLoadingOption.indicator;
1501
- return (_ctx$slots$fixedBotto = (_ctx$slots$fixedBotto2 = (_ctx$slots = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto2 === void 0 ? void 0 : _ctx$slots$fixedBotto2.call(_ctx$slots)) !== null && _ctx$slots$fixedBotto !== void 0 ? _ctx$slots$fixedBotto : (0,external_vue_namespaceObject.createVNode)(loading_namespaceObject["default"], {
1502
- loading: loading,
1503
- size: size,
1504
- mode: mode,
1505
- title: title,
1506
- inline: inline,
1507
- indicator: indicator
1508
- }, null);
1509
- }
1510
- };
1511
- return {
1512
- renderScrollLoading: renderScrollLoading
1513
- };
1514
- });
1515
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
1516
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1517
- /* harmony default export */ const esm_browser_native = ({
1518
- randomUUID
1519
- });
1520
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
1521
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1522
- // require the crypto API and do not support built-in fallback to lower quality random number
1523
- // generators (like Math.random()).
1524
- let getRandomValues;
1525
- const rnds8 = new Uint8Array(16);
1526
- function rng() {
1527
- // lazy load so that environments that need to polyfill have a chance to do so
1528
- if (!getRandomValues) {
1529
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1530
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1531
-
1532
- if (!getRandomValues) {
1533
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1534
- }
1535
- }
1536
-
1537
- return getRandomValues(rnds8);
1538
- }
1539
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
1540
-
1541
- /**
1542
- * Convert array of 16 byte values to UUID string format of the form:
1543
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1544
- */
1545
-
1546
- const byteToHex = [];
1547
-
1548
- for (let i = 0; i < 256; ++i) {
1549
- byteToHex.push((i + 0x100).toString(16).slice(1));
1550
- }
1551
-
1552
- function unsafeStringify(arr, offset = 0) {
1553
- // Note: Be careful editing this code! It's been tuned for performance
1554
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1555
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
1556
- }
1557
-
1558
- function stringify(arr, offset = 0) {
1559
- const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
1560
- // of the following:
1561
- // - One or more input array values don't map to a hex octet (leading to
1562
- // "undefined" in the uuid)
1563
- // - Invalid input values for the RFC `version` or `variant` fields
1564
-
1565
- if (!validate(uuid)) {
1566
- throw TypeError('Stringified UUID is invalid');
1567
- }
1568
-
1569
- return uuid;
1570
- }
1571
-
1572
- /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
1573
- ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
1574
-
1575
-
1576
-
1577
-
1578
- function v4(options, buf, offset) {
1579
- if (esm_browser_native.randomUUID && !buf && !options) {
1580
- return esm_browser_native.randomUUID();
1581
- }
1582
-
1583
- options = options || {};
1584
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1585
-
1586
- rnds[6] = rnds[6] & 0x0f | 0x40;
1587
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1588
-
1589
- if (buf) {
1590
- offset = offset || 0;
1591
-
1592
- for (let i = 0; i < 16; ++i) {
1593
- buf[offset + i] = rnds[i];
1594
- }
1595
-
1596
- return buf;
1597
- }
1598
-
1599
- return unsafeStringify(rnds);
1677
+ // Defines minimum timeout before adding a trailing call.
1678
+ var trailingTimeout = 2;
1679
+ /**
1680
+ * Creates a wrapper function which ensures that provided callback will be
1681
+ * invoked only once during the specified delay period.
1682
+ *
1683
+ * @param {Function} callback - Function to be invoked after the delay period.
1684
+ * @param {number} delay - Delay after which to invoke callback.
1685
+ * @returns {Function}
1686
+ */
1687
+ function throttle (callback, delay) {
1688
+ var leadingCall = false, trailingCall = false, lastCallTime = 0;
1689
+ /**
1690
+ * Invokes the original callback function and schedules new invocation if
1691
+ * the "proxy" was called during current request.
1692
+ *
1693
+ * @returns {void}
1694
+ */
1695
+ function resolvePending() {
1696
+ if (leadingCall) {
1697
+ leadingCall = false;
1698
+ callback();
1699
+ }
1700
+ if (trailingCall) {
1701
+ proxy();
1702
+ }
1703
+ }
1704
+ /**
1705
+ * Callback invoked after the specified delay. It will further postpone
1706
+ * invocation of the original function delegating it to the
1707
+ * requestAnimationFrame.
1708
+ *
1709
+ * @returns {void}
1710
+ */
1711
+ function timeoutCallback() {
1712
+ requestAnimationFrame$1(resolvePending);
1713
+ }
1714
+ /**
1715
+ * Schedules invocation of the original function.
1716
+ *
1717
+ * @returns {void}
1718
+ */
1719
+ function proxy() {
1720
+ var timeStamp = Date.now();
1721
+ if (leadingCall) {
1722
+ // Reject immediately following calls.
1723
+ if (timeStamp - lastCallTime < trailingTimeout) {
1724
+ return;
1725
+ }
1726
+ // Schedule new call to be in invoked when the pending one is resolved.
1727
+ // This is important for "transitions" which never actually start
1728
+ // immediately so there is a chance that we might miss one if change
1729
+ // happens amids the pending invocation.
1730
+ trailingCall = true;
1731
+ }
1732
+ else {
1733
+ leadingCall = true;
1734
+ trailingCall = false;
1735
+ setTimeout(timeoutCallback, delay);
1736
+ }
1737
+ lastCallTime = timeStamp;
1738
+ }
1739
+ return proxy;
1600
1740
  }
1601
1741
 
1602
- /* harmony default export */ const esm_browser_v4 = (v4);
1603
- ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
1604
-
1605
-
1606
-
1607
- function use_pagination_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1608
- function use_pagination_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? use_pagination_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : use_pagination_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1609
- /*
1610
- * Tencent is pleased to support the open source community by making
1611
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1612
- *
1613
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1614
- *
1615
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1616
- *
1617
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1618
- *
1619
- * ---------------------------------------------------
1620
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1621
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1622
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1623
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1624
- *
1625
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1626
- * the Software.
1627
- *
1628
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1629
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1630
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1631
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1632
- * IN THE SOFTWARE.
1633
- */
1634
-
1635
-
1636
- /**
1637
- * 处理 Prop中的分页配置
1638
- * prop中的配置会覆盖本地的配置
1639
- * @param propPagination 用户传入的配置
1640
- * @param defVal 默认配置
1641
- * @returns 返回值
1642
- */
1643
- var resolvePaginationOption = function resolvePaginationOption(propPagination, defVal) {
1644
- if (!!propPagination) {
1645
- if (typeof_typeof(propPagination) === 'object') {
1646
- var current = Object.prototype.hasOwnProperty.call(propPagination, 'current') ? propPagination.current : propPagination.value;
1647
- if (!/\d+/.test(current)) {
1648
- current = 1;
1649
- }
1650
- return use_pagination_objectSpread(use_pagination_objectSpread(use_pagination_objectSpread({}, defVal), propPagination), {}, {
1651
- current: current
1652
- });
1653
- }
1654
- return defVal;
1655
- }
1656
- return {};
1657
- };
1658
- /* harmony default export */ const use_pagination = (function (props) {
1659
- var startIndex = (0,external_vue_namespaceObject.ref)(0);
1660
- var endIndex = (0,external_vue_namespaceObject.ref)(0);
1661
- /**
1662
- * 分页配置
1663
- * 用于配置分页组件
1664
- * pagination 为Prop传入配置
1665
- * 方便兼容内置分页功能,此处需要单独处理count
1666
- */
1667
- var propsData = (0,external_vue_namespaceObject.computed)(function () {
1668
- return props.data;
1669
- });
1670
- var localPagination = (0,external_vue_namespaceObject.ref)(null);
1671
- var indexData = (0,external_vue_namespaceObject.reactive)([]);
1672
- // 当前分页缓存,用于支持内置前端分页,用户无需接收change事件来自行处理数据分割
1673
- var pagination = (0,external_vue_namespaceObject.reactive)({
1674
- count: 0,
1675
- limit: 10,
1676
- current: 1,
1677
- align: 'right',
1678
- layout: ['total', 'limit', 'list']
1679
- });
1680
- var resolveLocalPagination = function resolveLocalPagination() {
1681
- if (!props.pagination) {
1682
- return;
1683
- }
1684
- localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(use_pagination_objectSpread({}, pagination), {}, {
1685
- count: indexData.length
1686
- });
1687
- };
1688
- /**
1689
- * 重置当前分页开始位置 & 结束位置
1690
- * 如果未启用分页,则开始位置为0,结束位置为 data.length
1691
- * @returns
1692
- */
1693
- var resetStartEndIndex = function resetStartEndIndex() {
1694
- if (!props.pagination || props.remotePagination) {
1695
- startIndex.value = 0;
1696
- endIndex.value = indexData.length;
1697
- return;
1698
- }
1699
- // 如果是前端分页
1700
- startIndex.value = (pagination.current - 1) * pagination.limit;
1701
- endIndex.value = pagination.current * pagination.limit;
1702
- };
1703
- /**
1704
- * 当前页分页数据
1705
- */
1706
- var pageData = (0,external_vue_namespaceObject.reactive)([]);
1707
- var sort = function sort(sourceData, sortFn, column, type, sortScope) {
1708
- if (typeof sortFn === 'function') {
1709
- sourceData.sort(function (a, b) {
1710
- return sortFn(a, b, type, column, sortScope);
1711
- });
1712
- }
1713
- };
1714
- /**
1715
- * 初始化排序动作
1716
- * @param data
1717
- * @param sortColumns
1718
- */
1719
- var multiSort = function multiSort(data, sortColumns) {
1720
- sortColumns.forEach(function (item) {
1721
- sort(data, item.schema[COLUMN_ATTRIBUTE.COL_SORT_FN], item.column, item.schema[COLUMN_ATTRIBUTE.COL_SORT_TYPE], item.schema[COLUMN_ATTRIBUTE.COL_SORT_SCOPE]);
1722
- });
1723
- };
1724
- var filter = function filter(sourceData, filterFn) {
1725
- if (typeof filterFn === 'function') {
1726
- var filterVals = sourceData.filter(function (row, index) {
1727
- return filterFn(row, index, indexData);
1728
- });
1729
- sourceData.length = 0;
1730
- sourceData.push.apply(sourceData, _toConsumableArray(filterVals));
1731
- }
1732
- return sourceData;
1733
- };
1734
- var resolveIndexData = function resolveIndexData() {
1735
- return new Promise(function (resolve) {
1736
- (0,external_vue_namespaceObject.nextTick)(function () {
1737
- var target = propsData.value.slice();
1738
- indexData.length = 0;
1739
- indexData.push.apply(indexData, _toConsumableArray(target));
1740
- resolve();
1741
- });
1742
- });
1743
- };
1744
- var resolvePageData = function resolvePageData(filterFn, sortFn, column, type, sortScope, multiCol) {
1745
- var sourceData = indexData.slice();
1746
- if (multiCol !== null && multiCol !== void 0 && multiCol.length) {
1747
- multiSort(sourceData, multiCol);
1748
- }
1749
- pageData.length = 0;
1750
- pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
1751
- filter(pageData, filterFn);
1752
- sort(pageData, sortFn, column, type, sortScope);
1753
- resolveLocalPagination();
1754
- };
1755
- var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
1756
- resolvePageData(null, null, null, null, null, multiCol);
1757
- };
1758
- var multiFilter = function multiFilter(filterFnList) {
1759
- var sourceData = indexData.slice();
1760
- var target = filterFnList.reduce(function (result, fn) {
1761
- return filter(result, fn);
1762
- }, sourceData);
1763
- pageData.length = 0;
1764
- pageData.push.apply(pageData, _toConsumableArray(target));
1765
- };
1766
- var handlePaginationChange = function handlePaginationChange() {
1767
- pagination = resolvePaginationOption(props.pagination, pagination);
1768
- resolveLocalPagination();
1769
- resetStartEndIndex();
1770
- resolvePageData();
1771
- };
1772
- handlePaginationChange();
1773
- (0,external_vue_namespaceObject.watch)(function () {
1774
- return [props.pagination];
1775
- }, function () {
1776
- handlePaginationChange();
1777
- }, {
1778
- deep: true
1779
- });
1780
- return {
1781
- pageData: pageData,
1782
- indexData: indexData,
1783
- localPagination: localPagination,
1784
- resolvePageData: resolvePageData,
1785
- resolveIndexData: resolveIndexData,
1786
- resolvePageDataBySortList: resolvePageDataBySortList,
1787
- resetStartEndIndex: resetStartEndIndex,
1788
- multiFilter: multiFilter,
1789
- sort: sort
1790
- };
1791
- });
1792
- ;// CONCATENATED MODULE: external "lodash/debounce"
1793
- var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1794
- var debounce_y = x => () => x
1795
- const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
1796
- ;// CONCATENATED MODULE: external "lodash/get"
1797
- var get_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1798
- var get_y = x => () => x
1799
- const get_namespaceObject = get_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__["default"] });
1800
- ;// CONCATENATED MODULE: ../../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
1742
+ // Minimum delay before invoking the update of observers.
1743
+ var REFRESH_DELAY = 20;
1744
+ // A list of substrings of CSS properties used to find transition events that
1745
+ // might affect dimensions of observed elements.
1746
+ var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
1747
+ // Check if MutationObserver is available.
1748
+ var mutationObserverSupported = typeof MutationObserver !== 'undefined';
1801
1749
  /**
1802
- * A collection of shims that provide minimal functionality of the ES6 collections.
1803
- *
1804
- * These implementations are not meant to be used outside of the ResizeObserver
1805
- * modules as they cover only a limited range of use cases.
1750
+ * Singleton controller class which handles updates of ResizeObserver instances.
1806
1751
  */
1807
- /* eslint-disable require-jsdoc, valid-jsdoc */
1808
- var MapShim = (function () {
1809
- if (typeof Map !== 'undefined') {
1810
- return Map;
1811
- }
1752
+ var ResizeObserverController = /** @class */ (function () {
1812
1753
  /**
1813
- * Returns index in provided array that matches the specified key.
1754
+ * Creates a new instance of ResizeObserverController.
1814
1755
  *
1815
- * @param {Array<Array>} arr
1816
- * @param {*} key
1817
- * @returns {number}
1756
+ * @private
1818
1757
  */
1819
- function getIndex(arr, key) {
1820
- var result = -1;
1821
- arr.some(function (entry, index) {
1822
- if (entry[0] === key) {
1823
- result = index;
1824
- return true;
1825
- }
1826
- return false;
1827
- });
1828
- return result;
1829
- }
1830
- return /** @class */ (function () {
1831
- function class_1() {
1832
- this.__entries__ = [];
1833
- }
1834
- Object.defineProperty(class_1.prototype, "size", {
1835
- /**
1836
- * @returns {boolean}
1837
- */
1838
- get: function () {
1839
- return this.__entries__.length;
1840
- },
1841
- enumerable: true,
1842
- configurable: true
1843
- });
1844
- /**
1845
- * @param {*} key
1846
- * @returns {*}
1847
- */
1848
- class_1.prototype.get = function (key) {
1849
- var index = getIndex(this.__entries__, key);
1850
- var entry = this.__entries__[index];
1851
- return entry && entry[1];
1852
- };
1853
- /**
1854
- * @param {*} key
1855
- * @param {*} value
1856
- * @returns {void}
1857
- */
1858
- class_1.prototype.set = function (key, value) {
1859
- var index = getIndex(this.__entries__, key);
1860
- if (~index) {
1861
- this.__entries__[index][1] = value;
1862
- }
1863
- else {
1864
- this.__entries__.push([key, value]);
1865
- }
1866
- };
1758
+ function ResizeObserverController() {
1867
1759
  /**
1868
- * @param {*} key
1869
- * @returns {void}
1760
+ * Indicates whether DOM listeners have been added.
1761
+ *
1762
+ * @private {boolean}
1870
1763
  */
1871
- class_1.prototype.delete = function (key) {
1872
- var entries = this.__entries__;
1873
- var index = getIndex(entries, key);
1874
- if (~index) {
1875
- entries.splice(index, 1);
1876
- }
1877
- };
1764
+ this.connected_ = false;
1878
1765
  /**
1879
- * @param {*} key
1880
- * @returns {void}
1766
+ * Tells that controller has subscribed for Mutation Events.
1767
+ *
1768
+ * @private {boolean}
1881
1769
  */
1882
- class_1.prototype.has = function (key) {
1883
- return !!~getIndex(this.__entries__, key);
1884
- };
1770
+ this.mutationEventsAdded_ = false;
1885
1771
  /**
1886
- * @returns {void}
1772
+ * Keeps reference to the instance of MutationObserver.
1773
+ *
1774
+ * @private {MutationObserver}
1887
1775
  */
1888
- class_1.prototype.clear = function () {
1889
- this.__entries__.splice(0);
1890
- };
1776
+ this.mutationsObserver_ = null;
1891
1777
  /**
1892
- * @param {Function} callback
1893
- * @param {*} [ctx=null]
1894
- * @returns {void}
1778
+ * A list of connected observers.
1779
+ *
1780
+ * @private {Array<ResizeObserverSPI>}
1895
1781
  */
1896
- class_1.prototype.forEach = function (callback, ctx) {
1897
- if (ctx === void 0) { ctx = null; }
1898
- for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
1899
- var entry = _a[_i];
1900
- callback.call(ctx, entry[1], entry[0]);
1901
- }
1902
- };
1903
- return class_1;
1904
- }());
1905
- })();
1906
-
1907
- /**
1908
- * Detects whether window and document objects are available in current environment.
1909
- */
1910
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
1911
-
1912
- // Returns global object of a current environment.
1913
- var global$1 = (function () {
1914
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
1915
- return __webpack_require__.g;
1916
- }
1917
- if (typeof self !== 'undefined' && self.Math === Math) {
1918
- return self;
1919
- }
1920
- if (typeof window !== 'undefined' && window.Math === Math) {
1921
- return window;
1922
- }
1923
- // eslint-disable-next-line no-new-func
1924
- return Function('return this')();
1925
- })();
1926
-
1927
- /**
1928
- * A shim for the requestAnimationFrame which falls back to the setTimeout if
1929
- * first one is not supported.
1930
- *
1931
- * @returns {number} Requests' identifier.
1932
- */
1933
- var requestAnimationFrame$1 = (function () {
1934
- if (typeof requestAnimationFrame === 'function') {
1935
- // It's required to use a bounded function because IE sometimes throws
1936
- // an "Invalid calling object" error if rAF is invoked without the global
1937
- // object on the left hand side.
1938
- return requestAnimationFrame.bind(global$1);
1939
- }
1940
- return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
1941
- })();
1942
-
1943
- // Defines minimum timeout before adding a trailing call.
1944
- var trailingTimeout = 2;
1945
- /**
1946
- * Creates a wrapper function which ensures that provided callback will be
1947
- * invoked only once during the specified delay period.
1948
- *
1949
- * @param {Function} callback - Function to be invoked after the delay period.
1950
- * @param {number} delay - Delay after which to invoke callback.
1951
- * @returns {Function}
1952
- */
1953
- function throttle (callback, delay) {
1954
- var leadingCall = false, trailingCall = false, lastCallTime = 0;
1955
- /**
1956
- * Invokes the original callback function and schedules new invocation if
1957
- * the "proxy" was called during current request.
1958
- *
1959
- * @returns {void}
1960
- */
1961
- function resolvePending() {
1962
- if (leadingCall) {
1963
- leadingCall = false;
1964
- callback();
1965
- }
1966
- if (trailingCall) {
1967
- proxy();
1968
- }
1969
- }
1970
- /**
1971
- * Callback invoked after the specified delay. It will further postpone
1972
- * invocation of the original function delegating it to the
1973
- * requestAnimationFrame.
1974
- *
1975
- * @returns {void}
1976
- */
1977
- function timeoutCallback() {
1978
- requestAnimationFrame$1(resolvePending);
1979
- }
1980
- /**
1981
- * Schedules invocation of the original function.
1982
- *
1983
- * @returns {void}
1984
- */
1985
- function proxy() {
1986
- var timeStamp = Date.now();
1987
- if (leadingCall) {
1988
- // Reject immediately following calls.
1989
- if (timeStamp - lastCallTime < trailingTimeout) {
1990
- return;
1991
- }
1992
- // Schedule new call to be in invoked when the pending one is resolved.
1993
- // This is important for "transitions" which never actually start
1994
- // immediately so there is a chance that we might miss one if change
1995
- // happens amids the pending invocation.
1996
- trailingCall = true;
1997
- }
1998
- else {
1999
- leadingCall = true;
2000
- trailingCall = false;
2001
- setTimeout(timeoutCallback, delay);
2002
- }
2003
- lastCallTime = timeStamp;
2004
- }
2005
- return proxy;
2006
- }
2007
-
2008
- // Minimum delay before invoking the update of observers.
2009
- var REFRESH_DELAY = 20;
2010
- // A list of substrings of CSS properties used to find transition events that
2011
- // might affect dimensions of observed elements.
2012
- var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
2013
- // Check if MutationObserver is available.
2014
- var mutationObserverSupported = typeof MutationObserver !== 'undefined';
2015
- /**
2016
- * Singleton controller class which handles updates of ResizeObserver instances.
2017
- */
2018
- var ResizeObserverController = /** @class */ (function () {
2019
- /**
2020
- * Creates a new instance of ResizeObserverController.
2021
- *
2022
- * @private
2023
- */
2024
- function ResizeObserverController() {
2025
- /**
2026
- * Indicates whether DOM listeners have been added.
2027
- *
2028
- * @private {boolean}
2029
- */
2030
- this.connected_ = false;
2031
- /**
2032
- * Tells that controller has subscribed for Mutation Events.
2033
- *
2034
- * @private {boolean}
2035
- */
2036
- this.mutationEventsAdded_ = false;
2037
- /**
2038
- * Keeps reference to the instance of MutationObserver.
2039
- *
2040
- * @private {MutationObserver}
2041
- */
2042
- this.mutationsObserver_ = null;
2043
- /**
2044
- * A list of connected observers.
2045
- *
2046
- * @private {Array<ResizeObserverSPI>}
2047
- */
2048
- this.observers_ = [];
2049
- this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
2050
- this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
1782
+ this.observers_ = [];
1783
+ this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
1784
+ this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
2051
1785
  }
2052
1786
  /**
2053
1787
  * Adds observer to observers list.
@@ -2717,23 +2451,671 @@ var ResizeObserver = /** @class */ (function () {
2717
2451
  };
2718
2452
  });
2719
2453
 
2720
- var index = (function () {
2721
- // Export existing implementation if available.
2722
- if (typeof global$1.ResizeObserver !== 'undefined') {
2723
- return global$1.ResizeObserver;
2724
- }
2725
- return ResizeObserver;
2726
- })();
2454
+ var index = (function () {
2455
+ // Export existing implementation if available.
2456
+ if (typeof global$1.ResizeObserver !== 'undefined') {
2457
+ return global$1.ResizeObserver;
2458
+ }
2459
+ return ResizeObserver;
2460
+ })();
2461
+
2462
+ /* harmony default export */ const ResizeObserver_es = (index);
2463
+
2464
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
2465
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2466
+ /* harmony default export */ const esm_browser_native = ({
2467
+ randomUUID
2468
+ });
2469
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
2470
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
2471
+ // require the crypto API and do not support built-in fallback to lower quality random number
2472
+ // generators (like Math.random()).
2473
+ let getRandomValues;
2474
+ const rnds8 = new Uint8Array(16);
2475
+ function rng() {
2476
+ // lazy load so that environments that need to polyfill have a chance to do so
2477
+ if (!getRandomValues) {
2478
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
2479
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
2480
+
2481
+ if (!getRandomValues) {
2482
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
2483
+ }
2484
+ }
2485
+
2486
+ return getRandomValues(rnds8);
2487
+ }
2488
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
2489
+
2490
+ /**
2491
+ * Convert array of 16 byte values to UUID string format of the form:
2492
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2493
+ */
2494
+
2495
+ const byteToHex = [];
2496
+
2497
+ for (let i = 0; i < 256; ++i) {
2498
+ byteToHex.push((i + 0x100).toString(16).slice(1));
2499
+ }
2500
+
2501
+ function unsafeStringify(arr, offset = 0) {
2502
+ // Note: Be careful editing this code! It's been tuned for performance
2503
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
2504
+ 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]];
2505
+ }
2506
+
2507
+ function stringify(arr, offset = 0) {
2508
+ const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
2509
+ // of the following:
2510
+ // - One or more input array values don't map to a hex octet (leading to
2511
+ // "undefined" in the uuid)
2512
+ // - Invalid input values for the RFC `version` or `variant` fields
2513
+
2514
+ if (!validate(uuid)) {
2515
+ throw TypeError('Stringified UUID is invalid');
2516
+ }
2517
+
2518
+ return uuid;
2519
+ }
2520
+
2521
+ /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
2522
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
2523
+
2524
+
2525
+
2526
+
2527
+ function v4(options, buf, offset) {
2528
+ if (esm_browser_native.randomUUID && !buf && !options) {
2529
+ return esm_browser_native.randomUUID();
2530
+ }
2531
+
2532
+ options = options || {};
2533
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2534
+
2535
+ rnds[6] = rnds[6] & 0x0f | 0x40;
2536
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
2537
+
2538
+ if (buf) {
2539
+ offset = offset || 0;
2540
+
2541
+ for (let i = 0; i < 16; ++i) {
2542
+ buf[offset + i] = rnds[i];
2543
+ }
2544
+
2545
+ return buf;
2546
+ }
2547
+
2548
+ return unsafeStringify(rnds);
2549
+ }
2550
+
2551
+ /* harmony default export */ const esm_browser_v4 = (v4);
2552
+ ;// CONCATENATED MODULE: ../../packages/table/src/utils.tsx
2553
+
2554
+
2555
+
2556
+ var _this = undefined;
2557
+ 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; }
2558
+ 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; }
2559
+ /*
2560
+ * Tencent is pleased to support the open source community by making
2561
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2562
+ *
2563
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2564
+ *
2565
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2566
+ *
2567
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2568
+ *
2569
+ * ---------------------------------------------------
2570
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2571
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2572
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2573
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2574
+ *
2575
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2576
+ * the Software.
2577
+ *
2578
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2579
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2580
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2581
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2582
+ * IN THE SOFTWARE.
2583
+ */
2584
+
2585
+
2586
+
2587
+
2588
+
2589
+
2590
+
2591
+ /**
2592
+ * 解析Prop值 | 可能为多种类型 & 函数返回的场景
2593
+ * @param prop 当前Prop
2594
+ * @param key 要处理的Key
2595
+ * @param args 如果是函数,传递参数
2596
+ * @returns
2597
+ */
2598
+ var resolvePropVal = function resolvePropVal(prop, key, args) {
2599
+ if (prop === undefined || prop === null) {
2600
+ return undefined;
2601
+ }
2602
+ if (typeof key === 'string') {
2603
+ if (Object.prototype.hasOwnProperty.call(prop, key)) {
2604
+ if (typeof prop[key] === 'function') {
2605
+ var _prop$key;
2606
+ return (_prop$key = prop[key]).call.apply(_prop$key, [_this].concat(_toConsumableArray(args)));
2607
+ }
2608
+ return prop[key];
2609
+ }
2610
+ return undefined;
2611
+ }
2612
+ if (Array.isArray(key)) {
2613
+ return key.map(function (_key) {
2614
+ return resolvePropVal(prop, _key, args);
2615
+ }).filter(function (val) {
2616
+ return val !== undefined;
2617
+ }).at(0);
2618
+ }
2619
+ };
2620
+ /**
2621
+ * 处理Props中的ActiveColumn,解析为统一的数组格式
2622
+ * @param props
2623
+ * @returns
2624
+ */
2625
+ var resolveActiveColumns = function resolveActiveColumns(props) {
2626
+ if (props.columnPick !== 'disabled') {
2627
+ if (props.columnPick === 'multi') {
2628
+ return Array.isArray(props.activeColumn) ? props.activeColumn : resolveNumberToNumArray(props.activeColumn);
2629
+ }
2630
+ return Array.isArray(props.activeColumn) ? resolveNumberToNumArray(props.activeColumn[0]) : resolveNumberToNumArray(props.activeColumn);
2631
+ }
2632
+ return [];
2633
+ };
2634
+ /**
2635
+ * 统一处理数字类型参数
2636
+ * @param prop
2637
+ * @returns
2638
+ */
2639
+ var resolveNumberToNumArray = function resolveNumberToNumArray(prop) {
2640
+ if (/^\d+$/.test("".concat(prop))) {
2641
+ return [parseInt("".concat(prop), 10)];
2642
+ }
2643
+ return [];
2644
+ };
2645
+ /*
2646
+ * 解析宽度配置
2647
+ * @param propWidth
2648
+ * @returns
2649
+ */
2650
+ var resolveWidth = function resolveWidth(propWidth) {
2651
+ return resolveNumberOrStringToPix(propWidth, 'auto');
2652
+ };
2653
+ /**
2654
+ * 解析可为数字或者字符串设置的样式配置
2655
+ * @param val 配置值
2656
+ * @param defaultValue 默认值
2657
+ * @param offset 偏移量
2658
+ * @returns 标准化px string
2659
+ */
2660
+ var resolveNumberOrStringToPix = function resolveNumberOrStringToPix(val) {
2661
+ var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '100%';
2662
+ var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2663
+ var target = '';
2664
+ if (/^auto|null|undefined$/gi.test("".concat(val))) {
2665
+ target = defaultValue;
2666
+ } else {
2667
+ target = /^\d+\.?\d+$/.test("".concat(val)) ? "".concat(val, "px") : val;
2668
+ }
2669
+ if (offset) {
2670
+ target = "calc(".concat(target, " - ").concat(offset, ")");
2671
+ }
2672
+ return target;
2673
+ };
2674
+ /**
2675
+ * 格式化Border配置为标准Class
2676
+ * @param val
2677
+ * @returns
2678
+ */
2679
+ var resolvePropBorderToClassStr = function resolvePropBorderToClassStr(val) {
2680
+ var defaultVal = ['row'];
2681
+ if (typeof val === 'string') {
2682
+ defaultVal.push(val);
2683
+ }
2684
+ if (Array.isArray(val)) {
2685
+ defaultVal.push.apply(defaultVal, _toConsumableArray(val.filter(function (str) {
2686
+ return BORDER_OPTIONS.includes(str);
2687
+ })));
2688
+ }
2689
+ return _toConsumableArray(new Set(defaultVal)).map(function (item) {
2690
+ return "bordered-".concat(item);
2691
+ }).join(' ');
2692
+ };
2693
+ /**
2694
+ * 获取当前列实际宽度
2695
+ * width props中设置的默认宽度
2696
+ * calcWidth 计算后的宽度
2697
+ * resizeWidth 拖拽重置之后的宽度
2698
+ * @param colmun 当前列配置
2699
+ * @param orders 获取宽度顺序
2700
+ * @returns
2701
+ */
2702
+ var getColumnReactWidth = function getColumnReactWidth(colmun) {
2703
+ var _ref, _colmun$orders$;
2704
+ var orders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['resizeWidth', 'calcWidth', 'width'];
2705
+ 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]];
2706
+ };
2707
+ /**
2708
+ * 监听目标元素的Resize事件
2709
+ * @param root 目标元素
2710
+ * @param callbackFn 执行函数
2711
+ * @param delay 延迟执行时间,默认 60
2712
+ * @param immediate 是否立即执行回调函数
2713
+ * @param resizerWay 执行方式:debounce | throttle
2714
+ * @returns "{ start: () => void, stop: () => void }"
2715
+ */
2716
+ var observerResize = function observerResize(root, callbackFn) {
2717
+ var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
2718
+ var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2719
+ var resizerWay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'throttle';
2720
+ // 设置判定,避免因计算导致的resize死循环
2721
+ var resolveCallbackFn = function resolveCallbackFn() {
2722
+ if (typeof callbackFn === 'function') {
2723
+ callbackFn();
2724
+ }
2725
+ };
2726
+ var execFn = resizerWay === 'debounce' ? (0,debounce_namespaceObject["default"])(resolveCallbackFn, delay) : (0,throttle_namespaceObject["default"])(resolveCallbackFn, delay);
2727
+ var callFn = function callFn() {
2728
+ return Reflect.apply(execFn, _this, []);
2729
+ };
2730
+ var resizeObserver = new ResizeObserver_es(function () {
2731
+ callFn();
2732
+ });
2733
+ if (immediate) {
2734
+ if (typeof callbackFn === 'function') {
2735
+ callbackFn();
2736
+ }
2737
+ }
2738
+ return {
2739
+ start: function start() {
2740
+ resizeObserver.observe(root);
2741
+ },
2742
+ disconnect: function disconnect() {
2743
+ resizeObserver.unobserve(root);
2744
+ resizeObserver.disconnect();
2745
+ }
2746
+ };
2747
+ };
2748
+ /**
2749
+ * 判定为数值 | px | %
2750
+ * @param val
2751
+ * @returns
2752
+ */
2753
+ var isPercentPixOrNumber = function isPercentPixOrNumber(val) {
2754
+ return /^\d+\.?\d*(px|%)?$/.test("".concat(val));
2755
+ };
2756
+ /**
2757
+ * Format Table Head Option
2758
+ * @param props
2759
+ * @returns
2760
+ */
2761
+ var resolveHeadConfig = function resolveHeadConfig(props) {
2762
+ var showHead = props.showHead,
2763
+ headHeight = props.headHeight,
2764
+ _props$thead = props.thead,
2765
+ thead = _props$thead === void 0 ? {} : _props$thead;
2766
+ return Object.assign({}, {
2767
+ isShow: showHead,
2768
+ height: headHeight
2769
+ }, thead);
2770
+ };
2771
+ var getRegExp = function getRegExp(val) {
2772
+ var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ig';
2773
+ return new RegExp("".concat(val).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), flags);
2774
+ };
2775
+ /**
2776
+ * 获取当前行指定列的内容
2777
+ * @param row 当前行
2778
+ * @param key 指定列名
2779
+ * @param column 列配置
2780
+ * @param index 当前行Index
2781
+ * @returns
2782
+ */
2783
+ var getRowText = function getRowText(row, key, format) {
2784
+ var result;
2785
+ if (typeof row === 'string' || typeof row === 'number' || typeof row === 'boolean') {
2786
+ result = row;
2787
+ }
2788
+ if (typeof_typeof(row) === 'object') {
2789
+ result = (0,get_namespaceObject["default"])(row, key);
2790
+ }
2791
+ if (format !== null && format !== void 0 && format.length) {
2792
+ format.forEach(function (reg) {
2793
+ if (typeof reg === 'function') {
2794
+ result = reg(result, row, key);
2795
+ } else if (typeof result === 'string') {
2796
+ var _matches$;
2797
+ var matches = result.match(typeof reg === 'string' ? getRegExp(reg) : reg);
2798
+ result = (_matches$ = matches === null || matches === void 0 ? void 0 : matches[1]) !== null && _matches$ !== void 0 ? _matches$ : result;
2799
+ }
2800
+ });
2801
+ if (/^-?\d+.?\d*$/.test(result)) {
2802
+ result = Number(result);
2803
+ }
2804
+ }
2805
+ return result;
2806
+ };
2807
+ /**
2808
+ * 获取当前行指定列的值
2809
+ * @param row 当前行
2810
+ * @param key 指定列名
2811
+ * @returns
2812
+ */
2813
+ var getRowValue = function getRowValue(row, key) {
2814
+ return (0,get_namespaceObject["default"])(row, key);
2815
+ };
2816
+ /**
2817
+ * 格式化prop配置为标准数组格式
2818
+ * @param prop prop对象值
2819
+ * @param args 如果是function参数
2820
+ * @returns
2821
+ */
2822
+ var formatPropAsArray = function formatPropAsArray(prop, args) {
2823
+ if (Array.isArray(prop)) {
2824
+ return prop;
2825
+ }
2826
+ if (typeof prop === 'string' || typeof_typeof(prop) === 'object') {
2827
+ return [prop];
2828
+ }
2829
+ if (typeof prop === 'function') {
2830
+ return formatPropAsArray(Reflect.apply(prop, _this, args), args);
2831
+ }
2832
+ return [];
2833
+ };
2834
+ var isRenderScrollBottomLoading = function isRenderScrollBottomLoading(props) {
2835
+ if (props.scrollLoading === null) {
2836
+ return false;
2837
+ }
2838
+ return typeof props.scrollLoading === 'boolean' || _typeof(props.scrollLoading) === 'object';
2839
+ };
2840
+ var getRowKey = function getRowKey(item, props, index) {
2841
+ var val = getRowKeyNull(item, props, index);
2842
+ if (val !== null) {
2843
+ return val;
2844
+ }
2845
+ return esm_browser_v4();
2846
+ };
2847
+ var getRowKeyNull = function getRowKeyNull(item, props, index) {
2848
+ if (typeof props.rowKey === 'string') {
2849
+ if (props.rowKey === TABLE_ROW_ATTRIBUTE.ROW_INDEX) {
2850
+ return "__ROW_INDEX_".concat(index);
2851
+ }
2852
+ return (0,get_namespaceObject["default"])(item, props.rowKey);
2853
+ }
2854
+ if (typeof props.rowKey === 'function') {
2855
+ return Reflect.apply(props.rowKey, _this, [item]);
2856
+ }
2857
+ return null;
2858
+ };
2859
+ var hasRootScrollY = function hasRootScrollY(root, querySelector) {
2860
+ var offsetHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2861
+ if (root) {
2862
+ var tableBody = root.querySelector(querySelector);
2863
+ if (tableBody) {
2864
+ return tableBody.offsetHeight > root.offsetHeight - offsetHeight;
2865
+ }
2866
+ }
2867
+ return false;
2868
+ };
2869
+ var getColumnClass = function getColumnClass(column) {
2870
+ var colIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2871
+ var uuid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2872
+ return utils_objectSpread(utils_objectSpread({}, uuid ? _defineProperty({}, "".concat(uuid, "-column-").concat(colIndex), true) : {}), {}, {
2873
+ column_fixed: !!column.fixed,
2874
+ column_fixed_left: !!column.fixed,
2875
+ column_fixed_right: column.fixed === 'right'
2876
+ });
2877
+ };
2878
+ var getElementTextWidth = function getElementTextWidth(element, text) {
2879
+ /**
2880
+ * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
2881
+ *
2882
+ * @param {String} text The text to be rendered.
2883
+ * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
2884
+ *
2885
+ * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
2886
+ */
2887
+ function getTextWidth(text, font) {
2888
+ // re-use canvas object for better performance
2889
+ var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement('canvas'));
2890
+ var context = canvas.getContext('2d');
2891
+ context.font = font;
2892
+ var metrics = context.measureText(text);
2893
+ return metrics.width;
2894
+ }
2895
+ function getCssStyle(element, prop) {
2896
+ return window.getComputedStyle(element, null).getPropertyValue(prop);
2897
+ }
2898
+ function getCanvasFont() {
2899
+ var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
2900
+ var fontWeight = getCssStyle(el, 'font-weight') || 'normal';
2901
+ var fontSize = getCssStyle(el, 'font-size') || '16px';
2902
+ var fontFamily = getCssStyle(el, 'font-family') || 'Times New Roman';
2903
+ return "".concat(fontWeight, " ").concat(fontSize, " ").concat(fontFamily);
2904
+ }
2905
+ return getTextWidth(text || (element === null || element === void 0 ? void 0 : element.innerHTML), getCanvasFont(element));
2906
+ };
2907
+ var isColumnHidden = function isColumnHidden(settingFields, column, checked) {
2908
+ var getFieldValue = function getFieldValue(field) {
2909
+ var _field$field;
2910
+ return (_field$field = field.field) !== null && _field$field !== void 0 ? _field$field : field.id;
2911
+ };
2912
+ var isSettingField = function isSettingField(col) {
2913
+ return settingFields.some(function (field) {
2914
+ return getFieldValue(field) === resolvePropVal(col, ['field', 'type'], [col]);
2915
+ });
2916
+ };
2917
+ return isSettingField(column) && checked.length && !checked.includes(resolvePropVal(column, ['field', 'type'], [column]));
2918
+ };
2919
+ var resolveColumnSpan = function resolveColumnSpan(column, colIndex, row, rowIndex, key) {
2920
+ if (typeof column[key] === 'function') {
2921
+ return Reflect.apply(column[key], _this, [{
2922
+ column: column,
2923
+ colIndex: colIndex,
2924
+ row: row,
2925
+ rowIndex: rowIndex
2926
+ }]);
2927
+ }
2928
+ if (typeof column[key] === 'number') {
2929
+ return column[key];
2930
+ }
2931
+ return 1;
2932
+ };
2933
+ var resolveCellSpan = function resolveCellSpan(column, colIndex, row, rowIndex) {
2934
+ var colspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'colspan');
2935
+ var rowspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'rowspan');
2936
+ return {
2937
+ colspan: colspan,
2938
+ rowspan: rowspan
2939
+ };
2940
+ };
2941
+ var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
2942
+ var skip = false;
2943
+ for (var i = colIndex; i > 0; i--) {
2944
+ var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
2945
+ if (colspan > 1) {
2946
+ skip = colspan - 1;
2947
+ break;
2948
+ }
2949
+ }
2950
+ return skip;
2951
+ };
2952
+ var getSortFn = function getSortFn(column, sortType) {
2953
+ var _column$sort, _column$sort2;
2954
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2955
+ var fieldName = column.field;
2956
+ var getVal = function getVal(row) {
2957
+ return getRowText(row, fieldName, format);
2958
+ };
2959
+ var sortFn0 = function sortFn0(a, b) {
2960
+ var _getVal, _getVal2;
2961
+ var val0 = (_getVal = getVal(a)) !== null && _getVal !== void 0 ? _getVal : '';
2962
+ var val1 = (_getVal2 = getVal(b)) !== null && _getVal2 !== void 0 ? _getVal2 : '';
2963
+ if (typeof val0 === 'number' && typeof val1 === 'number') {
2964
+ return val0 - val1;
2965
+ }
2966
+ return String.prototype.localeCompare.call(val0, val1);
2967
+ };
2968
+ 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;
2969
+ return sortType === SORT_OPTION.NULL ? function (_a, _b) {
2970
+ return true;
2971
+ } : function (_a, _b) {
2972
+ return sortFn(_a, _b) * (sortType === SORT_OPTION.DESC ? -1 : 1);
2973
+ };
2974
+ };
2975
+ var getNextSortType = function getNextSortType(sortType) {
2976
+ var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
2977
+ if (steps[sortType] === undefined) {
2978
+ return SORT_OPTION.ASC;
2979
+ }
2980
+ return Object.keys(steps)[(steps[sortType] + 1) % 3];
2981
+ };
2982
+ var resolveSort = function resolveSort(sort, column) {
2983
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2984
+ if (typeof sort === 'string') {
2985
+ return {
2986
+ value: sort
2987
+ };
2988
+ }
2989
+ if (typeof sort === 'boolean' && sort) {
2990
+ return {
2991
+ value: SORT_OPTION.NULL
2992
+ };
2993
+ }
2994
+ if (typeof_typeof(sort) === 'object' && sort !== null) {
2995
+ var _sort$value;
2996
+ if (typeof sort.sortFn === 'function') {
2997
+ return utils_objectSpread({
2998
+ value: 'custom'
2999
+ }, sort);
3000
+ }
3001
+ return Object.assign({}, {
3002
+ sortFn: getSortFn(column, (_sort$value = sort.value) !== null && _sort$value !== void 0 ? _sort$value : SORT_OPTION.NULL, format)
3003
+ }, sort);
3004
+ }
3005
+ return null;
3006
+ };
3007
+ var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
3008
+ var row = _ref3.row,
3009
+ index = _ref3.index,
3010
+ isCheckAll = _ref3.isCheckAll;
3011
+ if (typeof props.isRowSelectEnable === 'boolean') {
3012
+ return props.isRowSelectEnable !== false;
3013
+ }
3014
+ if (typeof props.isRowSelectEnable === 'function') {
3015
+ return props.isRowSelectEnable({
3016
+ row: row,
3017
+ index: index,
3018
+ isCheckAll: isCheckAll
3019
+ });
3020
+ }
3021
+ return true;
3022
+ };
3023
+ var getRowId = function getRowId(row, defVal, props) {
3024
+ var key = getRowKey(row, props, defVal);
3025
+ if (key !== undefined && row[key] !== undefined) {
3026
+ return row[key];
3027
+ }
3028
+ return defVal;
3029
+ };
3030
+ var resolveColumnSortProp = function resolveColumnSortProp(col, props) {
3031
+ var _resolveSort, _col$sort;
3032
+ var _ref4 = (_resolveSort = resolveSort((_col$sort = col.sort) !== null && _col$sort !== void 0 ? _col$sort : props.defaultSort, col)) !== null && _resolveSort !== void 0 ? _resolveSort : {},
3033
+ value = _ref4.value,
3034
+ sortFn = _ref4.sortFn,
3035
+ sortScope = _ref4.sortScope;
3036
+ return {
3037
+ type: value,
3038
+ fn: sortFn,
3039
+ scope: sortScope,
3040
+ active: !!col.sort
3041
+ };
3042
+ };
3043
+ var getRawData = function getRawData(data) {
3044
+ if ((0,external_vue_namespaceObject.isProxy)(data)) {
3045
+ return (0,external_vue_namespaceObject.toRaw)(data);
3046
+ }
3047
+ return data;
3048
+ };
3049
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-observer-resize.tsx
3050
+
3051
+ /*
3052
+ * Tencent is pleased to support the open source community by making
3053
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3054
+ *
3055
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3056
+ *
3057
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3058
+ *
3059
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3060
+ *
3061
+ * ---------------------------------------------------
3062
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3063
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3064
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3065
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3066
+ *
3067
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3068
+ * the Software.
3069
+ *
3070
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3071
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3072
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3073
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3074
+ * IN THE SOFTWARE.
3075
+ */
2727
3076
 
2728
- /* harmony default export */ const ResizeObserver_es = (index);
2729
3077
 
2730
- ;// CONCATENATED MODULE: ../../packages/table/src/utils.tsx
2731
3078
 
3079
+ /* harmony default export */ const use_observer_resize = (function (target, fn) {
3080
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3081
+ var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3082
+ var instance = null;
3083
+ var dispose = function dispose() {
3084
+ if (instance) {
3085
+ instance.disconnect();
3086
+ instance = null;
3087
+ }
3088
+ };
3089
+ (0,external_vue_namespaceObject.watch)(target, function () {
3090
+ if (!(0,shared_namespaceObject.isElement)(target.value)) {
3091
+ return;
3092
+ }
3093
+ dispose();
3094
+ instance = observerResize(target.value, function () {
3095
+ fn === null || fn === void 0 || fn.apply.apply(fn, _toConsumableArray(args));
3096
+ }, 60, true, 'debounce');
3097
+ if (immediate) {
3098
+ instance.start();
3099
+ }
3100
+ }, {
3101
+ flush: 'post',
3102
+ immediate: true
3103
+ });
3104
+ return {
3105
+ instance: instance
3106
+ };
3107
+ });
3108
+ ;// CONCATENATED MODULE: external "../loading"
3109
+ var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3110
+ var loading_y = x => () => x
3111
+ 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"] });
3112
+ ;// CONCATENATED MODULE: external "../loading/loading.less"
3113
+ var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
3114
+ var loading_less_y = x => () => x
3115
+ const loading_less_namespaceObject = loading_less_x({ });
3116
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-scroll-loading.tsx
2732
3117
 
2733
3118
 
2734
- var _this = undefined;
2735
- 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; }
2736
- 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; }
2737
3119
  /*
2738
3120
  * Tencent is pleased to support the open source community by making
2739
3121
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -2763,436 +3145,238 @@ function utils_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2763
3145
 
2764
3146
 
2765
3147
 
2766
-
2767
-
2768
- /**
2769
- * 解析Prop值 | 可能为多种类型 & 函数返回的场景
2770
- * @param prop 当前Prop
2771
- * @param key 要处理的Key
2772
- * @param args 如果是函数,传递参数
2773
- * @returns
2774
- */
2775
- var resolvePropVal = function resolvePropVal(prop, key, args) {
2776
- if (prop === undefined || prop === null) {
2777
- return undefined;
2778
- }
2779
- if (typeof key === 'string') {
2780
- if (Object.prototype.hasOwnProperty.call(prop, key)) {
2781
- if (typeof prop[key] === 'function') {
2782
- var _prop$key;
2783
- return (_prop$key = prop[key]).call.apply(_prop$key, [_this].concat(_toConsumableArray(args)));
2784
- }
2785
- return prop[key];
2786
- }
2787
- return undefined;
2788
- }
2789
- if (Array.isArray(key)) {
2790
- return key.map(function (_key) {
2791
- return resolvePropVal(prop, _key, args);
2792
- }).filter(function (val) {
2793
- return val !== undefined;
2794
- }).at(0);
2795
- }
2796
- };
2797
- /**
2798
- * 处理Props中的ActiveColumn,解析为统一的数组格式
2799
- * @param props
2800
- * @returns
2801
- */
2802
- var resolveActiveColumns = function resolveActiveColumns(props) {
2803
- if (props.columnPick !== 'disabled') {
2804
- if (props.columnPick === 'multi') {
2805
- return Array.isArray(props.activeColumn) ? props.activeColumn : resolveNumberToNumArray(props.activeColumn);
2806
- }
2807
- return Array.isArray(props.activeColumn) ? resolveNumberToNumArray(props.activeColumn[0]) : resolveNumberToNumArray(props.activeColumn);
2808
- }
2809
- return [];
2810
- };
2811
- /**
2812
- * 统一处理数字类型参数
2813
- * @param prop
2814
- * @returns
2815
- */
2816
- var resolveNumberToNumArray = function resolveNumberToNumArray(prop) {
2817
- if (/^\d+$/.test("".concat(prop))) {
2818
- return [parseInt("".concat(prop), 10)];
2819
- }
2820
- return [];
2821
- };
2822
- /*
2823
- * 解析宽度配置
2824
- * @param propWidth
2825
- * @returns
2826
- */
2827
- var resolveWidth = function resolveWidth(propWidth) {
2828
- return resolveNumberOrStringToPix(propWidth, 'auto');
2829
- };
2830
- /**
2831
- * 解析可为数字或者字符串设置的样式配置
2832
- * @param val 配置值
2833
- * @param defaultValue 默认值
2834
- * @param offset 偏移量
2835
- * @returns 标准化px string
2836
- */
2837
- var resolveNumberOrStringToPix = function resolveNumberOrStringToPix(val) {
2838
- var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '100%';
2839
- var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2840
- var target = '';
2841
- if (/^auto|null|undefined$/gi.test("".concat(val))) {
2842
- target = defaultValue;
2843
- } else {
2844
- target = /^\d+\.?\d+$/.test("".concat(val)) ? "".concat(val, "px") : val;
2845
- }
2846
- if (offset) {
2847
- target = "calc(".concat(target, " - ").concat(offset, ")");
2848
- }
2849
- return target;
2850
- };
2851
- /**
2852
- * 格式化Border配置为标准Class
2853
- * @param val
2854
- * @returns
2855
- */
2856
- var resolvePropBorderToClassStr = function resolvePropBorderToClassStr(val) {
2857
- var defaultVal = ['row'];
2858
- if (typeof val === 'string') {
2859
- defaultVal.push(val);
2860
- }
2861
- if (Array.isArray(val)) {
2862
- defaultVal.push.apply(defaultVal, _toConsumableArray(val.filter(function (str) {
2863
- return BORDER_OPTIONS.includes(str);
2864
- })));
2865
- }
2866
- return _toConsumableArray(new Set(defaultVal)).map(function (item) {
2867
- return "bordered-".concat(item);
2868
- }).join(' ');
2869
- };
2870
- /**
2871
- * 获取当前列实际宽度
2872
- * width props中设置的默认宽度
2873
- * calcWidth 计算后的宽度
2874
- * resizeWidth 拖拽重置之后的宽度
2875
- * @param colmun 当前列配置
2876
- * @param orders 获取宽度顺序
2877
- * @returns
2878
- */
2879
- var getColumnReactWidth = function getColumnReactWidth(colmun) {
2880
- var _ref, _colmun$orders$;
2881
- var orders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['resizeWidth', 'calcWidth', 'width'];
2882
- 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]];
2883
- };
2884
- /**
2885
- * 监听目标元素的Resize事件
2886
- * @param root 目标元素
2887
- * @param callbackFn 执行函数
2888
- * @param delay 延迟执行时间,默认 60
2889
- * @param immediate 是否立即执行回调函数
2890
- * @param resizerWay 执行方式:debounce | throttle
2891
- * @returns "{ start: () => void, stop: () => void }"
2892
- */
2893
- var observerResize = function observerResize(root, callbackFn) {
2894
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
2895
- var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
2896
- var resizerWay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'throttle';
2897
- // 设置判定,避免因计算导致的resize死循环
2898
- var resolveCallbackFn = function resolveCallbackFn() {
2899
- if (typeof callbackFn === 'function') {
2900
- callbackFn();
3148
+ /* harmony default export */ const use_scroll_loading = (function (props, ctx) {
3149
+ var refScrollLoading = (0,external_vue_namespaceObject.toRef)(props, 'scrollLoading');
3150
+ var getLoadingOption = function getLoadingOption() {
3151
+ if (typeof refScrollLoading.value === 'boolean') {
3152
+ return {
3153
+ loading: !!refScrollLoading.value,
3154
+ inline: true,
3155
+ title: '',
3156
+ size: loading_namespaceObject.BkLoadingSize.Normal,
3157
+ mode: loading_namespaceObject.BkLoadingMode.Default,
3158
+ indicator: null
3159
+ };
2901
3160
  }
3161
+ return refScrollLoading.value;
2902
3162
  };
2903
- var execFn = resizerWay === 'debounce' ? (0,debounce_namespaceObject["default"])(resolveCallbackFn, delay) : (0,throttle_namespaceObject["default"])(resolveCallbackFn, delay);
2904
- var callFn = function callFn() {
2905
- return Reflect.apply(execFn, _this, []);
2906
- };
2907
- var resizeObserver = new ResizeObserver_es(function () {
2908
- callFn();
3163
+ var isRender = (0,external_vue_namespaceObject.computed)(function () {
3164
+ return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
2909
3165
  });
2910
- if (immediate) {
2911
- if (typeof callbackFn === 'function') {
2912
- callbackFn();
3166
+ var renderScrollLoading = function renderScrollLoading() {
3167
+ if (isRender.value) {
3168
+ var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
3169
+ var _getLoadingOption = getLoadingOption(),
3170
+ loading = _getLoadingOption.loading,
3171
+ size = _getLoadingOption.size,
3172
+ mode = _getLoadingOption.mode,
3173
+ title = _getLoadingOption.title,
3174
+ inline = _getLoadingOption.inline,
3175
+ indicator = _getLoadingOption.indicator;
3176
+ 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"], {
3177
+ loading: loading,
3178
+ size: size,
3179
+ mode: mode,
3180
+ title: title,
3181
+ inline: inline,
3182
+ indicator: indicator
3183
+ }, null);
2913
3184
  }
2914
- }
3185
+ };
2915
3186
  return {
2916
- start: function start() {
2917
- resizeObserver.observe(root);
2918
- },
2919
- disconnect: function disconnect() {
2920
- resizeObserver.unobserve(root);
2921
- resizeObserver.disconnect();
2922
- }
3187
+ renderScrollLoading: renderScrollLoading
2923
3188
  };
2924
- };
2925
- /**
2926
- * 判定为数值 | px | %
2927
- * @param val
2928
- * @returns
2929
- */
2930
- var isPercentPixOrNumber = function isPercentPixOrNumber(val) {
2931
- return /^\d+\.?\d*(px|%)?$/.test("".concat(val));
2932
- };
2933
- /**
2934
- * Format Table Head Option
2935
- * @param props
2936
- * @returns
2937
- */
2938
- var resolveHeadConfig = function resolveHeadConfig(props) {
2939
- var showHead = props.showHead,
2940
- headHeight = props.headHeight,
2941
- _props$thead = props.thead,
2942
- thead = _props$thead === void 0 ? {} : _props$thead;
2943
- return Object.assign({}, {
2944
- isShow: showHead,
2945
- height: headHeight
2946
- }, thead);
2947
- };
2948
- /**
2949
- * 获取当前行指定列的内容
2950
- * @param row 当前行
2951
- * @param key 指定列名
2952
- * @param column 列配置
2953
- * @param index 当前行Index
2954
- * @returns
2955
- */
2956
- var getRowText = function getRowText(row, key) {
2957
- if (typeof row === 'string' || typeof row === 'number' || typeof row === 'boolean') {
2958
- return row;
2959
- }
2960
- return (0,get_namespaceObject["default"])(row, key);
2961
- };
2962
- /**
2963
- * 获取当前行指定列的值
2964
- * @param row 当前行
2965
- * @param key 指定列名
2966
- * @returns
3189
+ });
3190
+ ;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-pagination.tsx
3191
+
3192
+
3193
+
3194
+ 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; }
3195
+ 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; }
3196
+ /*
3197
+ * Tencent is pleased to support the open source community by making
3198
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3199
+ *
3200
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3201
+ *
3202
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3203
+ *
3204
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3205
+ *
3206
+ * ---------------------------------------------------
3207
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3208
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3209
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3210
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3211
+ *
3212
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3213
+ * the Software.
3214
+ *
3215
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3216
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3217
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3218
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3219
+ * IN THE SOFTWARE.
2967
3220
  */
2968
- var getRowValue = function getRowValue(row, key) {
2969
- return (0,get_namespaceObject["default"])(row, key);
2970
- };
3221
+
3222
+
3223
+
2971
3224
  /**
2972
- * 格式化prop配置为标准数组格式
2973
- * @param prop prop对象值
2974
- * @param args 如果是function参数
2975
- * @returns
3225
+ * 处理 Prop中的分页配置
3226
+ * prop中的配置会覆盖本地的配置
3227
+ * @param propPagination 用户传入的配置
3228
+ * @param defVal 默认配置
3229
+ * @returns 返回值
2976
3230
  */
2977
- var formatPropAsArray = function formatPropAsArray(prop, args) {
2978
- if (Array.isArray(prop)) {
2979
- return prop;
2980
- }
2981
- if (typeof prop === 'string' || typeof_typeof(prop) === 'object') {
2982
- return [prop];
2983
- }
2984
- if (typeof prop === 'function') {
2985
- return formatPropAsArray(Reflect.apply(prop, _this, args), args);
2986
- }
2987
- return [];
2988
- };
2989
- var isRenderScrollBottomLoading = function isRenderScrollBottomLoading(props) {
2990
- if (props.scrollLoading === null) {
2991
- return false;
2992
- }
2993
- return typeof props.scrollLoading === 'boolean' || _typeof(props.scrollLoading) === 'object';
2994
- };
2995
- var getRowKey = function getRowKey(item, props, index) {
2996
- var val = getRowKeyNull(item, props, index);
2997
- if (val !== null) {
2998
- return val;
2999
- }
3000
- return esm_browser_v4();
3001
- };
3002
- var getRowKeyNull = function getRowKeyNull(item, props, index) {
3003
- if (typeof props.rowKey === 'string') {
3004
- if (props.rowKey === TABLE_ROW_ATTRIBUTE.ROW_INDEX) {
3005
- return "__ROW_INDEX_".concat(index);
3006
- }
3007
- return (0,get_namespaceObject["default"])(item, props.rowKey);
3008
- }
3009
- if (typeof props.rowKey === 'function') {
3010
- return Reflect.apply(props.rowKey, _this, [item]);
3011
- }
3012
- return null;
3013
- };
3014
- var hasRootScrollY = function hasRootScrollY(root, querySelector) {
3015
- var offsetHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3016
- if (root) {
3017
- var tableBody = root.querySelector(querySelector);
3018
- if (tableBody) {
3019
- return tableBody.offsetHeight > root.offsetHeight - offsetHeight;
3231
+ var resolvePaginationOption = function resolvePaginationOption(propPagination, defVal) {
3232
+ if (!!propPagination) {
3233
+ if (typeof_typeof(propPagination) === 'object') {
3234
+ var current = Object.prototype.hasOwnProperty.call(propPagination, 'current') ? propPagination.current : propPagination.value;
3235
+ if (!/\d+/.test(current)) {
3236
+ current = 1;
3237
+ }
3238
+ return use_pagination_objectSpread(use_pagination_objectSpread(use_pagination_objectSpread({}, defVal), propPagination), {}, {
3239
+ current: current
3240
+ });
3020
3241
  }
3242
+ return defVal;
3021
3243
  }
3022
- return false;
3023
- };
3024
- var getColumnClass = function getColumnClass(column) {
3025
- var colIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3026
- var uuid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3027
- return utils_objectSpread(utils_objectSpread({}, uuid ? _defineProperty({}, "".concat(uuid, "-column-").concat(colIndex), true) : {}), {}, {
3028
- column_fixed: !!column.fixed,
3029
- column_fixed_left: !!column.fixed,
3030
- column_fixed_right: column.fixed === 'right'
3031
- });
3244
+ return {};
3032
3245
  };
3033
- var getElementTextWidth = function getElementTextWidth(element, text) {
3246
+ /* harmony default export */ const use_pagination = (function (props) {
3247
+ var startIndex = (0,external_vue_namespaceObject.ref)(0);
3248
+ var endIndex = (0,external_vue_namespaceObject.ref)(0);
3034
3249
  /**
3035
- * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
3036
- *
3037
- * @param {String} text The text to be rendered.
3038
- * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
3039
- *
3040
- * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
3250
+ * 分页配置
3251
+ * 用于配置分页组件
3252
+ * pagination 为Prop传入配置
3253
+ * 方便兼容内置分页功能,此处需要单独处理count
3041
3254
  */
3042
- function getTextWidth(text, font) {
3043
- // re-use canvas object for better performance
3044
- var canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement('canvas'));
3045
- var context = canvas.getContext('2d');
3046
- context.font = font;
3047
- var metrics = context.measureText(text);
3048
- return metrics.width;
3049
- }
3050
- function getCssStyle(element, prop) {
3051
- return window.getComputedStyle(element, null).getPropertyValue(prop);
3052
- }
3053
- function getCanvasFont() {
3054
- var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
3055
- var fontWeight = getCssStyle(el, 'font-weight') || 'normal';
3056
- var fontSize = getCssStyle(el, 'font-size') || '16px';
3057
- var fontFamily = getCssStyle(el, 'font-family') || 'Times New Roman';
3058
- return "".concat(fontWeight, " ").concat(fontSize, " ").concat(fontFamily);
3059
- }
3060
- return getTextWidth(text || (element === null || element === void 0 ? void 0 : element.innerHTML), getCanvasFont(element));
3061
- };
3062
- var isColumnHidden = function isColumnHidden(settingFields, column, checked) {
3063
- var getFieldValue = function getFieldValue(field) {
3064
- var _field$field;
3065
- return (_field$field = field.field) !== null && _field$field !== void 0 ? _field$field : field.id;
3066
- };
3067
- var isSettingField = function isSettingField(col) {
3068
- return settingFields.some(function (field) {
3069
- return getFieldValue(field) === resolvePropVal(col, ['field', 'type'], [col]);
3070
- });
3071
- };
3072
- return isSettingField(column) && checked.length && !checked.includes(resolvePropVal(column, ['field', 'type'], [column]));
3073
- };
3074
- var resolveColumnSpan = function resolveColumnSpan(column, colIndex, row, rowIndex, key) {
3075
- if (typeof column[key] === 'function') {
3076
- return Reflect.apply(column[key], _this, [{
3077
- column: column,
3078
- colIndex: colIndex,
3079
- row: row,
3080
- rowIndex: rowIndex
3081
- }]);
3082
- }
3083
- if (typeof column[key] === 'number') {
3084
- return column[key];
3085
- }
3086
- return 1;
3087
- };
3088
- var resolveCellSpan = function resolveCellSpan(column, colIndex, row, rowIndex) {
3089
- var colspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'colspan');
3090
- var rowspan = resolveColumnSpan(column, colIndex, row, rowIndex, 'rowspan');
3091
- return {
3092
- colspan: colspan,
3093
- rowspan: rowspan
3255
+ var propsData = (0,external_vue_namespaceObject.computed)(function () {
3256
+ return props.data;
3257
+ });
3258
+ var localPagination = (0,external_vue_namespaceObject.ref)(null);
3259
+ var indexData = (0,external_vue_namespaceObject.reactive)([]);
3260
+ // 当前分页缓存,用于支持内置前端分页,用户无需接收change事件来自行处理数据分割
3261
+ var pagination = (0,external_vue_namespaceObject.reactive)({
3262
+ count: 0,
3263
+ limit: 10,
3264
+ current: 1,
3265
+ align: 'right',
3266
+ layout: ['total', 'limit', 'list']
3267
+ });
3268
+ var resolveLocalPagination = function resolveLocalPagination() {
3269
+ if (!props.pagination) {
3270
+ return;
3271
+ }
3272
+ localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(use_pagination_objectSpread({}, pagination), {}, {
3273
+ count: indexData.length
3274
+ });
3094
3275
  };
3095
- };
3096
- var skipThisColumn = function skipThisColumn(columns, colIndex, row, rowIndex) {
3097
- var skip = false;
3098
- for (var i = colIndex; i > 0; i--) {
3099
- var colspan = resolveColumnSpan(columns[i], i, row, rowIndex, 'colspan');
3100
- if (colspan > 1) {
3101
- skip = colspan - 1 + i >= colIndex;
3102
- break;
3276
+ /**
3277
+ * 重置当前分页开始位置 & 结束位置
3278
+ * 如果未启用分页,则开始位置为0,结束位置为 data.length
3279
+ * @returns
3280
+ */
3281
+ var resetStartEndIndex = function resetStartEndIndex() {
3282
+ if (!props.pagination || props.remotePagination) {
3283
+ startIndex.value = 0;
3284
+ endIndex.value = indexData.length;
3285
+ return;
3103
3286
  }
3104
- }
3105
- return skip;
3106
- };
3107
- var getSortFn = function getSortFn(column, sortType) {
3108
- var _column$sort, _column$sort2;
3109
- var fieldName = column.field;
3110
- var getVal = function getVal(row) {
3111
- return getRowText(row, fieldName);
3287
+ // 如果是前端分页
3288
+ startIndex.value = (pagination.current - 1) * pagination.limit;
3289
+ endIndex.value = pagination.current * pagination.limit;
3112
3290
  };
3113
- var sortFn0 = function sortFn0(a, b) {
3114
- var _getVal, _getVal2;
3115
- var val0 = (_getVal = getVal(a)) !== null && _getVal !== void 0 ? _getVal : '';
3116
- var val1 = (_getVal2 = getVal(b)) !== null && _getVal2 !== void 0 ? _getVal2 : '';
3117
- if (typeof val0 === 'number' && typeof val1 === 'number') {
3118
- return val0 - val1;
3291
+ /**
3292
+ * 当前页分页数据
3293
+ */
3294
+ var pageData = (0,external_vue_namespaceObject.reactive)([]);
3295
+ var sort = function sort(sourceData, sortFn, column, type, sortScope) {
3296
+ if (typeof sortFn === 'function') {
3297
+ sourceData.sort(function (a, b) {
3298
+ return sortFn(a, b, type, column, sortScope);
3299
+ });
3119
3300
  }
3120
- return String.prototype.localeCompare.call(val0, val1);
3121
3301
  };
3122
- var sortFn = typeof ((_column$sort = column.sort) === null || _column$sort === void 0 ? void 0 : _column$sort.sortFn) === 'function' ? (_column$sort2 = column.sort) === null || _column$sort2 === void 0 ? void 0 : _column$sort2.sortFn : sortFn0;
3123
- return sortType === SORT_OPTION.NULL ? function (_a, _b) {
3124
- return true;
3125
- } : function (_a, _b) {
3126
- return sortFn(_a, _b) * (sortType === SORT_OPTION.DESC ? -1 : 1);
3302
+ /**
3303
+ * 初始化排序动作
3304
+ * @param data
3305
+ * @param sortColumns
3306
+ */
3307
+ var multiSort = function multiSort(data, sortColumns) {
3308
+ sortColumns.forEach(function (item) {
3309
+ 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]);
3310
+ });
3127
3311
  };
3128
- };
3129
- var getNextSortType = function getNextSortType(sortType) {
3130
- var steps = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SORT_OPTION.NULL, 3), SORT_OPTION.ASC, 1), SORT_OPTION.DESC, 2);
3131
- if (steps[sortType] === undefined) {
3132
- return SORT_OPTION.ASC;
3133
- }
3134
- return Object.keys(steps)[(steps[sortType] + 1) % 3];
3135
- };
3136
- var resolveSort = function resolveSort(sort, column) {
3137
- if (typeof sort === 'string') {
3138
- return {
3139
- value: sort
3140
- };
3141
- }
3142
- if (typeof sort === 'boolean' && sort) {
3143
- return {
3144
- value: SORT_OPTION.NULL
3145
- };
3146
- }
3147
- if (typeof_typeof(sort) === 'object' && sort !== null) {
3148
- var _sort$value;
3149
- if (typeof sort.sortFn === 'function') {
3150
- return utils_objectSpread({
3151
- value: 'custom'
3152
- }, sort);
3312
+ var filter = function filter(sourceData, filterFn) {
3313
+ if (typeof filterFn === 'function') {
3314
+ var filterVals = sourceData.filter(function (row, index) {
3315
+ return filterFn(row, index, indexData);
3316
+ });
3317
+ sourceData.length = 0;
3318
+ sourceData.push.apply(sourceData, _toConsumableArray(filterVals));
3153
3319
  }
3154
- return Object.assign({}, {
3155
- sortFn: getSortFn(column, (_sort$value = sort.value) !== null && _sort$value !== void 0 ? _sort$value : SORT_OPTION.NULL)
3156
- }, sort);
3157
- }
3158
- return null;
3159
- };
3160
- var isRowSelectEnable = function isRowSelectEnable(props, _ref3) {
3161
- var row = _ref3.row,
3162
- index = _ref3.index,
3163
- isCheckAll = _ref3.isCheckAll;
3164
- if (typeof props.isRowSelectEnable === 'boolean') {
3165
- return props.isRowSelectEnable !== false;
3166
- }
3167
- if (typeof props.isRowSelectEnable === 'function') {
3168
- return props.isRowSelectEnable({
3169
- row: row,
3170
- index: index,
3171
- isCheckAll: isCheckAll
3320
+ return sourceData;
3321
+ };
3322
+ var resolveIndexData = function resolveIndexData() {
3323
+ return new Promise(function (resolve) {
3324
+ (0,external_vue_namespaceObject.nextTick)(function () {
3325
+ var target = propsData.value.slice();
3326
+ indexData.length = 0;
3327
+ indexData.push.apply(indexData, _toConsumableArray(getRawData(target)));
3328
+ resolve();
3329
+ });
3172
3330
  });
3173
- }
3174
- return true;
3175
- };
3176
- var getRowId = function getRowId(row, defVal, props) {
3177
- var key = getRowKey(row, props, defVal);
3178
- if (key !== undefined && row[key] !== undefined) {
3179
- return row[key];
3180
- }
3181
- return defVal;
3182
- };
3183
- var resolveColumnSortProp = function resolveColumnSortProp(col, props) {
3184
- var _resolveSort, _col$sort;
3185
- var _ref4 = (_resolveSort = resolveSort((_col$sort = col.sort) !== null && _col$sort !== void 0 ? _col$sort : props.defaultSort, col)) !== null && _resolveSort !== void 0 ? _resolveSort : {},
3186
- value = _ref4.value,
3187
- sortFn = _ref4.sortFn,
3188
- sortScope = _ref4.sortScope;
3331
+ };
3332
+ var resolvePageData = function resolvePageData(filterFn, sortFn, column, type, sortScope, multiCol) {
3333
+ var sourceData = indexData.slice();
3334
+ if (multiCol !== null && multiCol !== void 0 && multiCol.length) {
3335
+ multiSort(sourceData, multiCol);
3336
+ }
3337
+ pageData.length = 0;
3338
+ pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
3339
+ filter(pageData, filterFn);
3340
+ sort(pageData, sortFn, column, type, sortScope);
3341
+ resolveLocalPagination();
3342
+ };
3343
+ var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
3344
+ resolvePageData(null, null, null, null, null, multiCol);
3345
+ };
3346
+ var multiFilter = function multiFilter(filterFnList) {
3347
+ var sourceData = indexData.slice();
3348
+ var target = filterFnList.reduce(function (result, fn) {
3349
+ return filter(result, fn);
3350
+ }, sourceData);
3351
+ pageData.length = 0;
3352
+ pageData.push.apply(pageData, _toConsumableArray(getRawData(target)));
3353
+ };
3354
+ var handlePaginationChange = function handlePaginationChange() {
3355
+ pagination = resolvePaginationOption(props.pagination, pagination);
3356
+ resolveLocalPagination();
3357
+ resetStartEndIndex();
3358
+ resolvePageData();
3359
+ };
3360
+ handlePaginationChange();
3361
+ (0,external_vue_namespaceObject.watch)(function () {
3362
+ return [props.pagination];
3363
+ }, function () {
3364
+ handlePaginationChange();
3365
+ }, {
3366
+ deep: true
3367
+ });
3189
3368
  return {
3190
- type: value,
3191
- fn: sortFn,
3192
- scope: sortScope,
3193
- active: !!col.sort
3369
+ pageData: pageData,
3370
+ indexData: indexData,
3371
+ localPagination: localPagination,
3372
+ resolvePageData: resolvePageData,
3373
+ resolveIndexData: resolveIndexData,
3374
+ resolvePageDataBySortList: resolvePageDataBySortList,
3375
+ resetStartEndIndex: resetStartEndIndex,
3376
+ multiFilter: multiFilter,
3377
+ sort: sort
3194
3378
  };
3195
- };
3379
+ });
3196
3380
  ;// CONCATENATED MODULE: ../../packages/table/src/use-attributes.ts
3197
3381
 
3198
3382
 
@@ -3230,7 +3414,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3230
3414
 
3231
3415
 
3232
3416
 
3233
- /* harmony default export */ const use_attributes = (function (props) {
3417
+ var tableSchemaResponse = function tableSchemaResponse(props) {
3234
3418
  var t = (0,config_provider_namespaceObject.useLocale)('table');
3235
3419
  var getDefaultSettings = function getDefaultSettings() {
3236
3420
  var _ref, _SETTING_SIZE$size;
@@ -3580,7 +3764,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3580
3764
  if (typeof item === 'string') {
3581
3765
  return getRowValue(row, item) === item;
3582
3766
  }
3583
- return item === row;
3767
+ return getRawData(item) === getRawData(row);
3584
3768
  });
3585
3769
  }
3586
3770
  return false;
@@ -3606,7 +3790,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3606
3790
  (_formatData$data = formatData.data).push.apply(_formatData$data, _toConsumableArray(data));
3607
3791
  var hasSelectedRow = false;
3608
3792
  var hasUnSelectedRow = false;
3609
- (data || []).forEach(function (row, index) {
3793
+ (data || []).forEach(function (item, index) {
3794
+ var row = getRawData(item);
3610
3795
  var rowId = getRowId(row, esm_browser_v4(), props);
3611
3796
  var isSelected = isRowSelected(row);
3612
3797
  if (isSelected) {
@@ -3647,7 +3832,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3647
3832
  * @param attrName
3648
3833
  * @param attrValue
3649
3834
  */
3650
- var setRowAttribute = function setRowAttribute(row, attrName, attrValue) {
3835
+ var setRowAttribute = function setRowAttribute(item, attrName, attrValue) {
3836
+ var row = getRawData(item);
3651
3837
  var target = formatData.dataSchema.get(row);
3652
3838
  if (target && Object.prototype.hasOwnProperty.call(target, attrName)) {
3653
3839
  target[attrName] = attrValue;
@@ -3688,8 +3874,9 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3688
3874
  var setRowExpand = function setRowExpand(row, isExpand) {
3689
3875
  setRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_EXPAND, isExpand);
3690
3876
  };
3691
- var getRowAttribute = function getRowAttribute(row, attrName) {
3877
+ var getRowAttribute = function getRowAttribute(item, attrName) {
3692
3878
  var _formatData$dataSchem6;
3879
+ var row = getRawData(item);
3693
3880
  return (_formatData$dataSchem6 = formatData.dataSchema.get(row)) === null || _formatData$dataSchem6 === void 0 ? void 0 : _formatData$dataSchem6[attrName];
3694
3881
  };
3695
3882
  var toggleRowSelection = function toggleRowSelection(row) {
@@ -3892,7 +4079,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3892
4079
  formatData: formatData,
3893
4080
  setIndexData: setIndexData
3894
4081
  };
3895
- });
4082
+ };
4083
+ /* harmony default export */ const use_attributes = (tableSchemaResponse);
3896
4084
  ;// CONCATENATED MODULE: ../../packages/table/src/use-column.ts
3897
4085
 
3898
4086
  /*
@@ -3931,6 +4119,11 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3931
4119
  /* harmony default export */ const use_column = (function (props, targetColumns) {
3932
4120
  var _props$columns;
3933
4121
  var resolvedColumns = (0,external_vue_namespaceObject.reactive)((_props$columns = props.columns) !== null && _props$columns !== void 0 ? _props$columns : []);
4122
+ /**
4123
+ * 初始化Column配置
4124
+ * @param column 传入
4125
+ * @param remove 是否移除当前列
4126
+ */
3934
4127
  var initColumns = function initColumns(column) {
3935
4128
  var remove = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3936
4129
  var resolveColumns = [];
@@ -4376,14 +4569,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4376
4569
  });
4377
4570
  var resolveSetting = function resolveSetting() {
4378
4571
  if (/boolean|object/.test(typeof_typeof(props.column.showOverflowTooltip)) && props.column.showOverflowTooltip !== null) {
4572
+ var _props$column$showOve = props.column.showOverflowTooltip,
4573
+ _props$column$showOve2 = _props$column$showOve.content,
4574
+ content = _props$column$showOve2 === void 0 ? '' : _props$column$showOve2,
4575
+ _props$column$showOve3 = _props$column$showOve.mode,
4576
+ mode = _props$column$showOve3 === void 0 ? undefined : _props$column$showOve3,
4577
+ _props$column$showOve4 = _props$column$showOve.popoverOption,
4578
+ popoverOption = _props$column$showOve4 === void 0 ? {} : _props$column$showOve4;
4379
4579
  var result = {
4380
4580
  showOverflowTooltip: {
4381
- content: '',
4581
+ content: content,
4382
4582
  disabled: !props.column.showOverflowTooltip,
4383
- mode: undefined,
4583
+ mode: mode,
4384
4584
  resizerWay: undefined,
4385
4585
  watchCellResize: undefined,
4386
- popoverOption: {}
4586
+ popoverOption: popoverOption
4387
4587
  }
4388
4588
  };
4389
4589
  if (props.parentSetting !== null && typeof_typeof(props.parentSetting) === 'object') {
@@ -4401,15 +4601,17 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4401
4601
  showOverflowTooltip: props.parentSetting
4402
4602
  };
4403
4603
  };
4404
- var _resolveSetting = resolveSetting(),
4405
- _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4406
- showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4407
4604
  var bkEllipsisIns = null;
4408
4605
  var resolveTooltipOption = function resolveTooltipOption() {
4606
+ var _getEllipsisTarget$cl, _getEllipsisTarget, _getEllipsisTarget$cl2;
4607
+ var _resolveSetting = resolveSetting(),
4608
+ _resolveSetting$showO = _resolveSetting.showOverflowTooltip,
4609
+ showOverflowTooltip = _resolveSetting$showO === void 0 ? false : _resolveSetting$showO;
4409
4610
  var disabled = true;
4410
4611
  var resizerWay = props.resizerWay;
4612
+ var defaultContent = (_getEllipsisTarget$cl = (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 || (_getEllipsisTarget$cl2 = _getEllipsisTarget.cloneNode) === null || _getEllipsisTarget$cl2 === void 0 ? void 0 : _getEllipsisTarget$cl2.call(_getEllipsisTarget, true)) !== null && _getEllipsisTarget$cl !== void 0 ? _getEllipsisTarget$cl : '';
4411
4613
  var content = function content() {
4412
- return refRoot.value.innerText;
4614
+ return defaultContent;
4413
4615
  };
4414
4616
  var popoverOption = {};
4415
4617
  var mode = 'auto';
@@ -4422,7 +4624,7 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4422
4624
  popoverOption = showOverflowTooltip.popoverOption;
4423
4625
  resizerWay = showOverflowTooltip.resizerWay || 'debounce';
4424
4626
  content = function content() {
4425
- return showOverflowTooltip.content || refRoot.value.innerText;
4627
+ return showOverflowTooltip.content || defaultContent;
4426
4628
  };
4427
4629
  if (typeof showOverflowTooltip.content === 'function') {
4428
4630
  content = function content() {
@@ -4435,21 +4637,6 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4435
4637
  if (typeof disabled === 'function') {
4436
4638
  disabled = Reflect.apply(disabled, _this, [props.column, props.row]);
4437
4639
  }
4438
- if (props.isHead) {
4439
- var _props$column$showOve, _props$column;
4440
- disabled = !((_props$column$showOve = (_props$column = props.column) === null || _props$column === void 0 || (_props$column = _props$column.showOverflowTooltip) === null || _props$column === void 0 ? void 0 : _props$column.showHead) !== null && _props$column$showOve !== void 0 ? _props$column$showOve : true);
4441
- mode = 'auto';
4442
- content = function content() {
4443
- var _getEllipsisTarget;
4444
- return (_getEllipsisTarget = getEllipsisTarget()) === null || _getEllipsisTarget === void 0 ? void 0 : _getEllipsisTarget.innerHTML;
4445
- };
4446
- if (props.headExplain) {
4447
- mode = 'static';
4448
- content = function content() {
4449
- return props.headExplain;
4450
- };
4451
- }
4452
- }
4453
4640
  /**
4454
4641
  * 当表格中的字段或数据需要做解释说明时,可增加 [下划线] 提示,hover 可查看解释说明的 tooltips
4455
4642
  */
@@ -4462,6 +4649,21 @@ const directives_namespaceObject = directives_x({ ["bkEllipsisInstance"]: () =>
4462
4649
  };
4463
4650
  }
4464
4651
  }
4652
+ if (props.isHead) {
4653
+ var _props$column$showOve5, _props$column;
4654
+ 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);
4655
+ mode = 'auto';
4656
+ content = function content() {
4657
+ var _getEllipsisTarget$cl3, _getEllipsisTarget2, _getEllipsisTarget2$c;
4658
+ 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 : '';
4659
+ };
4660
+ if (props.headExplain) {
4661
+ mode = 'static';
4662
+ content = function content() {
4663
+ return props.headExplain;
4664
+ };
4665
+ }
4666
+ }
4465
4667
  return {
4466
4668
  disabled: disabled,
4467
4669
  content: content,
@@ -4729,7 +4931,7 @@ function _isSlot(s) {
4729
4931
  return resolvePropVal(item, ['id', 'field', 'type'], [item, index]);
4730
4932
  };
4731
4933
  var checkAll = (0,external_vue_namespaceObject.ref)(false);
4732
- var isShow = (0,external_vue_namespaceObject.ref)(false);
4934
+ var refSetting = (0,external_vue_namespaceObject.ref)(null);
4733
4935
  var localSettings = (0,external_vue_namespaceObject.computed)(function () {
4734
4936
  var deafultSettings = {
4735
4937
  fields: props.columns.map(function (col) {
@@ -4742,6 +4944,7 @@ function _isSlot(s) {
4742
4944
  size: 'small',
4743
4945
  sizeList: defaultSizeList,
4744
4946
  showLineHeight: true,
4947
+ extCls: '',
4745
4948
  trigger: 'manual'
4746
4949
  };
4747
4950
  if (typeof props.settings === 'boolean') {
@@ -4764,6 +4967,7 @@ function _isSlot(s) {
4764
4967
  checkedFields: localSettings.value.checked || []
4765
4968
  };
4766
4969
  var handleSaveClick = function handleSaveClick() {
4970
+ var _refSetting$value;
4767
4971
  Object.assign(cachedValue, {
4768
4972
  checkAll: checkAll.value,
4769
4973
  activeSize: activeSize.value,
@@ -4776,17 +4980,21 @@ function _isSlot(s) {
4776
4980
  height: activeHeight.value,
4777
4981
  fields: (0,external_vue_namespaceObject.unref)(renderFields)
4778
4982
  });
4779
- isShow.value = false;
4983
+ (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
4780
4984
  };
4781
4985
  var handleCancelClick = function handleCancelClick() {
4986
+ var _refSetting$value2;
4782
4987
  checkAll.value = cachedValue.checkAll;
4783
4988
  activeSize.value = cachedValue.activeSize;
4784
4989
  activeHeight.value = cachedValue.activeHeight;
4785
4990
  checkedFields.value = cachedValue.checkedFields;
4786
- isShow.value = false;
4991
+ (_refSetting$value2 = refSetting.value) === null || _refSetting$value2 === void 0 || _refSetting$value2.hide();
4787
4992
  };
4788
4993
  var handleSettingClick = function handleSettingClick() {
4789
- isShow.value = true;
4994
+ if (localSettings.value.trigger === 'manual') {
4995
+ var _refSetting$value3;
4996
+ (_refSetting$value3 = refSetting.value) === null || _refSetting$value3 === void 0 || _refSetting$value3.show();
4997
+ }
4790
4998
  };
4791
4999
  var handleCheckAllClick = function handleCheckAllClick(e) {
4792
5000
  e.stopImmediatePropagation();
@@ -4881,9 +5089,10 @@ function _isSlot(s) {
4881
5089
  var _localSettings$value$2;
4882
5090
  return props.settings ? (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
4883
5091
  "trigger": (_localSettings$value$2 = localSettings.value.trigger) !== null && _localSettings$value$2 !== void 0 ? _localSettings$value$2 : 'manual',
4884
- "isShow": isShow.value,
4885
5092
  "placement": "bottom-end",
4886
- "arrow": true
5093
+ "ref": refSetting,
5094
+ "arrow": true,
5095
+ "extCls": localSettings.value.extCls
4887
5096
  }, {
4888
5097
  theme: theme
4889
5098
  }), {
@@ -5005,6 +5214,31 @@ function _isSlot(s) {
5005
5214
  if (!props.rowDraggable) {
5006
5215
  return {};
5007
5216
  }
5217
+ var placeDiv = document.createElement('div');
5218
+ placeDiv.style.setProperty('height', '20px');
5219
+ placeDiv.style.setProperty('width', '100%');
5220
+ placeDiv.style.setProperty('background', '#E2EDFF');
5221
+ placeDiv.style.setProperty('cursor', 'move');
5222
+ ['dragenter', 'dragover'].forEach(function (type) {
5223
+ placeDiv.addEventListener(type, function (event) {
5224
+ event.preventDefault();
5225
+ event.stopPropagation();
5226
+ event.dataTransfer.dropEffect = 'move';
5227
+ });
5228
+ });
5229
+ var lastDragRow = null;
5230
+ var lastDragRowClass = '';
5231
+ var insertPlaceDiv = function insertPlaceDiv(target, placement) {
5232
+ if (placement === '--top') {
5233
+ target.parentNode.insertBefore(placeDiv, target);
5234
+ return;
5235
+ }
5236
+ if (target.nextElementSibling === null) {
5237
+ target.parentNode.append(placeDiv);
5238
+ return;
5239
+ }
5240
+ target.parentNode.insertBefore(placeDiv, target.nextElementSibling);
5241
+ };
5008
5242
  var beforeEventFire = function beforeEventFire(fn) {
5009
5243
  if (props.rowDraggable) {
5010
5244
  fn === null || fn === void 0 || fn();
@@ -5018,9 +5252,10 @@ function _isSlot(s) {
5018
5252
  var _target$getBoundingCl = target.getBoundingClientRect(),
5019
5253
  top = _target$getBoundingCl.top,
5020
5254
  bottom = _target$getBoundingCl.bottom;
5021
- var position = y - top > bottom - y ? '--bottom' : '--top';
5255
+ var placement = y - top > bottom - y ? '--bottom' : '--top';
5022
5256
  removeDragClass(target);
5023
- target.classList.add(position);
5257
+ target.classList.add(placement);
5258
+ insertPlaceDiv(target, placement);
5024
5259
  };
5025
5260
  var removeDragClass = function removeDragClass(target) {
5026
5261
  var classList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['--bottom', '--top'];
@@ -5031,45 +5266,59 @@ function _isSlot(s) {
5031
5266
  var onDragstart = function onDragstart(event) {
5032
5267
  beforeEventFire(function () {
5033
5268
  var target = getTargetRow(event);
5269
+ placeDiv.style.setProperty('height', "".concat(target.offsetHeight, "px"));
5270
+ placeDiv.style.setProperty('width', "".concat(target.offsetWidth, "px"));
5034
5271
  target.classList.add('--drag-start');
5272
+ event.dataTransfer.setDragImage(target, 0, 0);
5035
5273
  event.dataTransfer.setData('text/plain', null);
5036
- event.dataTransfer.dropEffect = 'copy';
5274
+ event.dataTransfer.dropEffect = 'move';
5037
5275
  var rowIndex = event.target.dataset.rowIndex;
5038
5276
  event.dataTransfer.setData('data-row-index', rowIndex);
5039
5277
  });
5040
5278
  };
5041
5279
  var onDragenter = function onDragenter(event) {
5280
+ var target = getTargetRow(event);
5281
+ event.preventDefault();
5282
+ event.stopPropagation();
5042
5283
  beforeEventFire(function () {
5043
5284
  event.dataTransfer.dropEffect = 'move';
5044
- var target = getTargetRow(event);
5045
5285
  target.classList.add('--drag-enter');
5046
5286
  setTargetRowPlacement(target, event);
5287
+ lastDragRow = target;
5047
5288
  });
5048
5289
  };
5049
5290
  var onDragleave = function onDragleave(event) {
5050
5291
  beforeEventFire(function () {
5051
5292
  var target = getTargetRow(event);
5293
+ lastDragRowClass = target.classList.contains('--bottom') ? '--bottom' : '--top';
5052
5294
  removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5053
5295
  });
5054
5296
  };
5055
5297
  var onDragover = function onDragover(event) {
5056
5298
  event.preventDefault();
5299
+ event.stopPropagation();
5057
5300
  event.dataTransfer.dropEffect = 'move';
5058
5301
  var target = getTargetRow(event);
5059
5302
  setTargetRowPlacement(target, event);
5060
5303
  };
5061
- var onDrop = function onDrop(event) {
5304
+ var onDragend = function onDragend(event) {
5305
+ var _event$target$dataset;
5062
5306
  event.preventDefault();
5063
5307
  event.stopPropagation();
5064
- var target = getTargetRow(event);
5308
+ placeDiv.remove();
5309
+ if (!lastDragRow) {
5310
+ return;
5311
+ }
5312
+ var target = lastDragRow;
5065
5313
  var rowIndex = target.dataset.rowIndex;
5066
5314
  var targetIndex = Number(rowIndex);
5067
- var sourceIndex = event.dataTransfer.getData('data-row-index');
5068
- if (target.classList.contains('--bottom')) {
5315
+ var sourceIndex = (_event$target$dataset = event.target.dataset) === null || _event$target$dataset === void 0 ? void 0 : _event$target$dataset.rowIndex;
5316
+ if (lastDragRowClass === '--bottom') {
5069
5317
  targetIndex = targetIndex + 1;
5070
5318
  }
5071
5319
  resp.changePageRowIndex(Number(sourceIndex), targetIndex);
5072
- removeDragClass(target, ['--drag-enter', '--bottom', '--top']);
5320
+ lastDragRow = null;
5321
+ lastDragRowClass = '';
5073
5322
  ctx.emit(EMIT_EVENTS.DRAG_END, {
5074
5323
  sourceEvent: event,
5075
5324
  data: resp.pageData
@@ -5080,9 +5329,17 @@ function _isSlot(s) {
5080
5329
  onDragleave: onDragleave,
5081
5330
  onDragstart: onDragstart,
5082
5331
  onDragover: onDragover,
5083
- onDrop: onDrop
5332
+ onDragend: onDragend
5084
5333
  };
5085
5334
  });
5335
+ ;// CONCATENATED MODULE: external "../input"
5336
+ var input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
5337
+ var input_y = x => () => x
5338
+ const input_namespaceObject = input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_input_d525237e__["default"] });
5339
+ ;// CONCATENATED MODULE: external "../input/input.less"
5340
+ var input_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
5341
+ var input_less_y = x => () => x
5342
+ const input_less_namespaceObject = input_less_x({ });
5086
5343
  ;// CONCATENATED MODULE: ../../packages/table/src/plugins/head-filter.tsx
5087
5344
 
5088
5345
 
@@ -5128,6 +5385,8 @@ function _isSlot(s) {
5128
5385
 
5129
5386
 
5130
5387
 
5388
+
5389
+
5131
5390
  function head_filter_isSlot(s) {
5132
5391
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
5133
5392
  }
@@ -5144,8 +5403,10 @@ function head_filter_isSlot(s) {
5144
5403
  resolveClassName = _usePrefix.resolveClassName;
5145
5404
  var t = (0,config_provider_namespaceObject.useLocale)('table');
5146
5405
  var column = props.column;
5147
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props.column),
5148
- filter = _toRefs.filter;
5406
+ var filter = (0,external_vue_namespaceObject.computed)(function () {
5407
+ var _props$column;
5408
+ return (_props$column = props.column) === null || _props$column === void 0 ? void 0 : _props$column.filter;
5409
+ });
5149
5410
  var checked = (0,external_vue_namespaceObject.computed)(function () {
5150
5411
  var _filter$value$checked, _filter$value;
5151
5412
  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 : [];
@@ -5368,7 +5629,7 @@ function head_filter_isSlot(s) {
5368
5629
  "class": headFilterContentClass
5369
5630
  }, [(0,external_vue_namespaceObject.createVNode)("div", {
5370
5631
  "style": "padding: 4px 10px;"
5371
- }, [(0,external_vue_namespaceObject.createVNode)((0,external_vue_namespaceObject.resolveComponent)("bk-input"), {
5632
+ }, [(0,external_vue_namespaceObject.createVNode)(input_namespaceObject["default"], {
5372
5633
  "modelValue": searchValue.value,
5373
5634
  "onUpdate:modelValue": function onUpdateModelValue($event) {
5374
5635
  return searchValue.value = $event;
@@ -5482,7 +5743,8 @@ function _slicedToArray(arr, i) {
5482
5743
  props: {
5483
5744
  column: IColumnType,
5484
5745
  defaultSort: shared_namespaceObject.PropTypes.oneOf(SORT_OPTIONS).def(SORT_OPTION.NULL),
5485
- active: shared_namespaceObject.PropTypes.bool
5746
+ active: shared_namespaceObject.PropTypes.bool,
5747
+ sortValFormat: shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.any).def([''])
5486
5748
  },
5487
5749
  emits: ['change'],
5488
5750
  setup: function setup(props, _ref) {
@@ -5520,8 +5782,8 @@ function _slicedToArray(arr, i) {
5520
5782
  if (sortType.value === type) {
5521
5783
  currentSort = SORT_OPTION.NULL;
5522
5784
  }
5523
- var execFn = getSortFn(props.column, currentSort);
5524
- var sort = resolveSort(props.column.sort, props.column);
5785
+ var execFn = getSortFn(props.column, currentSort, props.sortValFormat);
5786
+ var sort = resolveSort(props.column.sort, props.column, props.sortValFormat);
5525
5787
  if ((sort === null || sort === void 0 ? void 0 : sort.value) === 'custom') {
5526
5788
  var _sort$sortFn;
5527
5789
  emit('change', (_sort$sortFn = sort === null || sort === void 0 ? void 0 : sort.sortFn) !== null && _sort$sortFn !== void 0 ? _sort$sortFn : execFn, currentSort);
@@ -5632,7 +5894,7 @@ function use_head_cell_isSlot(s) {
5632
5894
  var type = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE);
5633
5895
  nextSort.value = getNextSortType(type);
5634
5896
  var sortFn = function sortFn(a, b) {
5635
- return getSortFnByColumn(column, getSortFn(column, nextSort.value), a, b);
5897
+ return getSortFnByColumn(column, getSortFn(column, nextSort.value, props.sortValFormat), a, b);
5636
5898
  };
5637
5899
  tableResp.setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_TYPE, nextSort.value);
5638
5900
  tableResp.setColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SORT_FN, sortFn);
@@ -5718,7 +5980,8 @@ function use_head_cell_isSlot(s) {
5718
5980
  "column": column,
5719
5981
  "defaultSort": active.value ? nextSort.value : SORT_OPTION.NULL,
5720
5982
  "onChange": handleSortClick,
5721
- "active": active.value
5983
+ "active": active.value,
5984
+ "sortValFormat": props.sortValFormat
5722
5985
  }, null);
5723
5986
  };
5724
5987
  var getFilterCell = function getFilterCell(column, index) {
@@ -6044,7 +6307,7 @@ function use_render_isSlot(s) {
6044
6307
  }
6045
6308
  return '';
6046
6309
  };
6047
- var getRowSpanConfig = function getRowSpanConfig(row, index, preRow, col, store) {
6310
+ var getRowSpanConfig = function getRowSpanConfig(row, rowIndex, preRow, col, store) {
6048
6311
  var _store$get$get, _store$get;
6049
6312
  if (!store.has(row)) {
6050
6313
  store.set(row, new WeakMap());
@@ -6059,7 +6322,7 @@ function use_render_isSlot(s) {
6059
6322
  _ref$skipRowLen = _ref.skipRowLen,
6060
6323
  skipRowLen = _ref$skipRowLen === void 0 ? 0 : _ref$skipRowLen;
6061
6324
  var skipRow = false;
6062
- var rowspan = resolveColumnSpan(col, null, row, index, 'rowspan');
6325
+ var rowspan = resolveColumnSpan(col, null, row, rowIndex, 'rowspan');
6063
6326
  if (skipRowLen > 1) {
6064
6327
  skipRowLen = skipRowLen - 1;
6065
6328
  skipRow = true;
@@ -6132,7 +6395,7 @@ function use_render_isSlot(s) {
6132
6395
  rowspan = _resolveCellSpan.rowspan;
6133
6396
  var _tableResp$getColumnA = tableResp.getColumnAttribute(column, COLUMN_ATTRIBUTE.COL_SPAN),
6134
6397
  skipCol = _tableResp$getColumnA.skipCol;
6135
- var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, index, preRow, column, rowSpanMap) : {
6398
+ var _ref2 = needRowSpan && !isChild ? getRowSpanConfig(row, rowIndex, preRow, column, rowSpanMap) : {
6136
6399
  skipRow: false
6137
6400
  },
6138
6401
  skipRow = _ref2.skipRow;
@@ -6482,6 +6745,7 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6482
6745
 
6483
6746
 
6484
6747
 
6748
+
6485
6749
  /* harmony default export */ const table = ((0,external_vue_namespaceObject.defineComponent)({
6486
6750
  // eslint-disable-next-line vue/no-reserved-component-names
6487
6751
  name: 'Table',
@@ -6538,6 +6802,11 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6538
6802
  hasScrollY: hasScrollYRef.value
6539
6803
  };
6540
6804
  });
6805
+ use_observer_resize(root, function () {
6806
+ (0,external_vue_namespaceObject.nextTick)(function () {
6807
+ resolveFixedColumns(tableOffsetRight.value);
6808
+ });
6809
+ });
6541
6810
  var _useRender = use_render(props, ctx, tableSchema, styleRef, head, root, resetTableHeight),
6542
6811
  renderTableBodySchema = _useRender.renderTableBodySchema,
6543
6812
  renderTableFooter = _useRender.renderTableFooter,
@@ -6555,13 +6824,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6555
6824
  }
6556
6825
  };
6557
6826
  var isFirstLoad = (0,external_vue_namespaceObject.ref)(true);
6558
- // const tableWidth = ref(null);
6559
- (0,external_vue_namespaceObject.watch)(function () {
6560
- return [props.data, columns];
6561
- }, function () {
6827
+ (0,external_vue_namespaceObject.watchEffect)(function () {
6828
+ tableSchema.formatDataSchema(props.data);
6829
+ tableSchema.formatColumns(columns);
6830
+ resolveFixedColumns(tableOffsetRight.value);
6562
6831
  tableSchema.setIndexData().then(function () {
6563
- tableSchema.formatColumns(columns);
6564
- tableSchema.formatDataSchema(props.data);
6832
+ // tableSchema.formatDataSchema(props.data);
6565
6833
  tableSchema.resetStartEndIndex();
6566
6834
  if (isFirstLoad.value) {
6567
6835
  tableSchema.resolveByDefColumns();
@@ -6572,7 +6840,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6572
6840
  registerResizeEvent();
6573
6841
  (0,external_vue_namespaceObject.nextTick)(function () {
6574
6842
  updateOffsetRight();
6575
- resolveFixedColumns(tableOffsetRight.value);
6576
6843
  /**
6577
6844
  * 确保在所有数据渲染完毕再执行fix column计算
6578
6845
  */
@@ -6581,9 +6848,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6581
6848
  });
6582
6849
  });
6583
6850
  });
6584
- }, {
6585
- immediate: true,
6586
- deep: true
6587
6851
  });
6588
6852
  (0,external_vue_namespaceObject.watch)(function () {
6589
6853
  return [props.height, props.maxHeight, props.minHeight];