bkui-vue 1.0.3-beta.17 → 1.0.3-beta.19

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.
@@ -561,6 +561,7 @@ var InfoBox = function InfoBox(config) {
561
561
  var modalFuncProps = (0,external_vue_namespaceObject.shallowRef)(config);
562
562
  var isShow = (0,external_vue_namespaceObject.ref)(modalFuncProps.value.isShow !== false);
563
563
  var app;
564
+ var dialogConfirm;
564
565
  var dialog = (0,external_vue_namespaceObject.defineComponent)({
565
566
  name: 'DialogConfirm',
566
567
  setup: function setup(_props, _ref) {
@@ -674,6 +675,7 @@ var InfoBox = function InfoBox(config) {
674
675
  return fn();
675
676
  });
676
677
  beforeHiddenFn.length = 0;
678
+ unmountApp();
677
679
  container.remove();
678
680
  };
679
681
  return function () {
@@ -696,9 +698,15 @@ var InfoBox = function InfoBox(config) {
696
698
  var beforeShow = function beforeShow() {
697
699
  if (!app) {
698
700
  document.body.append(container);
699
- app = (0,external_vue_namespaceObject.createApp)(dialog).mount(container);
701
+ app = (0,external_vue_namespaceObject.createApp)(dialog);
702
+ dialogConfirm = app.mount(container);
700
703
  }
701
704
  };
705
+ var unmountApp = function unmountApp() {
706
+ var _app;
707
+ (_app = app) === null || _app === void 0 || _app.unmount();
708
+ app = null;
709
+ };
702
710
  if (isShow.value) {
703
711
  beforeShow();
704
712
  }
@@ -709,17 +717,16 @@ var InfoBox = function InfoBox(config) {
709
717
  },
710
718
  hide: function hide() {
711
719
  isShow.value = false;
720
+ unmountApp();
712
721
  },
713
722
  update: function update(config) {
714
- var _app;
723
+ var _dialogConfirm;
715
724
  beforeShow();
716
- (_app = app) === null || _app === void 0 || _app.update(config);
725
+ (_dialogConfirm = dialogConfirm) === null || _dialogConfirm === void 0 || _dialogConfirm.update(config);
717
726
  },
718
727
  destroy: function destroy() {
719
- var _app2;
720
728
  container.remove();
721
- (_app2 = app) === null || _app2 === void 0 || _app2.unmount();
722
- app = null;
729
+ unmountApp();
723
730
  }
724
731
  };
725
732
  };
@@ -576,7 +576,7 @@ var propsMixin = {
576
576
  // 是否允许点击遮罩关闭弹窗
577
577
  quickClose: shared_namespaceObject.PropTypes.bool.def(true),
578
578
  // 是否显示在body内(即与id#app同级
579
- transfer: shared_namespaceObject.PropTypes.oneOfType([Boolean, String, HTMLElement]).def(false),
579
+ transfer: shared_namespaceObject.PropTypes.oneOfType([Boolean, String, HTMLElement]).def(true),
580
580
  // 弹出层z-index,实际显示的值会自动+1。为了抱证在遮罩上正常显示
581
581
  zIndex: shared_namespaceObject.PropTypes.oneOfType([String, Number]),
582
582
  // 内容区最大高度
@@ -3087,6 +3087,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3087
3087
  var delay = resolvePopoverDelay()[0];
3088
3088
  // 设置settimeout避免hidePopover导致显示问题
3089
3089
  popShowTimerId = setTimeout(function () {
3090
+ // if (popHideTimerId) {
3091
+ // clearTimeout(popHideTimerId);
3092
+ // }
3090
3093
  if (!props.disabled) {
3091
3094
  localIsShow.value = true;
3092
3095
  }
@@ -3097,7 +3100,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3097
3100
  popHideTimerId = setTimeout(function () {
3098
3101
  popShowTimerId && clearTimeout(popShowTimerId);
3099
3102
  localIsShow.value = false;
3100
- }, delay + 10);
3103
+ }, delay);
3101
3104
  };
3102
3105
  var handlePopoverShow = function handlePopoverShow() {
3103
3106
  var _refContent$value2;
@@ -3090,6 +3090,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3090
3090
  var delay = resolvePopoverDelay()[0];
3091
3091
  // 设置settimeout避免hidePopover导致显示问题
3092
3092
  popShowTimerId = setTimeout(function () {
3093
+ // if (popHideTimerId) {
3094
+ // clearTimeout(popHideTimerId);
3095
+ // }
3093
3096
  if (!props.disabled) {
3094
3097
  localIsShow.value = true;
3095
3098
  }
@@ -3100,7 +3103,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3100
3103
  popHideTimerId = setTimeout(function () {
3101
3104
  popShowTimerId && clearTimeout(popShowTimerId);
3102
3105
  localIsShow.value = false;
3103
- }, delay + 10);
3106
+ }, delay);
3104
3107
  };
3105
3108
  var handlePopoverShow = function handlePopoverShow() {
3106
3109
  var _refContent$value2;
@@ -122,7 +122,7 @@ function defineProperty_defineProperty(obj, key, value) {
122
122
  ;// CONCATENATED MODULE: external "vue"
123
123
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
124
124
  var external_vue_y = x => () => x
125
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
125
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
126
126
  ;// CONCATENATED MODULE: ../../packages/table/src/const.ts
127
127
 
128
128
  /*
@@ -3362,7 +3362,7 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
3362
3362
 
3363
3363
 
3364
3364
 
3365
- /* harmony default export */ const use_attributes = (function (props) {
3365
+ var tableSchemaResponse = function tableSchemaResponse(props) {
3366
3366
  var t = (0,config_provider_namespaceObject.useLocale)('table');
3367
3367
  var getDefaultSettings = function getDefaultSettings() {
3368
3368
  var _ref, _SETTING_SIZE$size;
@@ -4027,7 +4027,8 @@ function use_attributes_objectSpread(e) { for (var r = 1; r < arguments.length;
4027
4027
  formatData: formatData,
4028
4028
  setIndexData: setIndexData
4029
4029
  };
4030
- });
4030
+ };
4031
+ /* harmony default export */ const use_attributes = (tableSchemaResponse);
4031
4032
  ;// CONCATENATED MODULE: ../../packages/table/src/use-column.ts
4032
4033
 
4033
4034
  /*
@@ -4873,7 +4874,7 @@ function _isSlot(s) {
4873
4874
  return resolvePropVal(item, ['id', 'field', 'type'], [item, index]);
4874
4875
  };
4875
4876
  var checkAll = (0,external_vue_namespaceObject.ref)(false);
4876
- var isShow = (0,external_vue_namespaceObject.ref)(false);
4877
+ var refSetting = (0,external_vue_namespaceObject.ref)(null);
4877
4878
  var localSettings = (0,external_vue_namespaceObject.computed)(function () {
4878
4879
  var deafultSettings = {
4879
4880
  fields: props.columns.map(function (col) {
@@ -4886,6 +4887,7 @@ function _isSlot(s) {
4886
4887
  size: 'small',
4887
4888
  sizeList: defaultSizeList,
4888
4889
  showLineHeight: true,
4890
+ extCls: '',
4889
4891
  trigger: 'manual'
4890
4892
  };
4891
4893
  if (typeof props.settings === 'boolean') {
@@ -4908,6 +4910,7 @@ function _isSlot(s) {
4908
4910
  checkedFields: localSettings.value.checked || []
4909
4911
  };
4910
4912
  var handleSaveClick = function handleSaveClick() {
4913
+ var _refSetting$value;
4911
4914
  Object.assign(cachedValue, {
4912
4915
  checkAll: checkAll.value,
4913
4916
  activeSize: activeSize.value,
@@ -4920,17 +4923,21 @@ function _isSlot(s) {
4920
4923
  height: activeHeight.value,
4921
4924
  fields: (0,external_vue_namespaceObject.unref)(renderFields)
4922
4925
  });
4923
- isShow.value = false;
4926
+ (_refSetting$value = refSetting.value) === null || _refSetting$value === void 0 || _refSetting$value.hide();
4924
4927
  };
4925
4928
  var handleCancelClick = function handleCancelClick() {
4929
+ var _refSetting$value2;
4926
4930
  checkAll.value = cachedValue.checkAll;
4927
4931
  activeSize.value = cachedValue.activeSize;
4928
4932
  activeHeight.value = cachedValue.activeHeight;
4929
4933
  checkedFields.value = cachedValue.checkedFields;
4930
- isShow.value = false;
4934
+ (_refSetting$value2 = refSetting.value) === null || _refSetting$value2 === void 0 || _refSetting$value2.hide();
4931
4935
  };
4932
4936
  var handleSettingClick = function handleSettingClick() {
4933
- isShow.value = true;
4937
+ if (localSettings.value.trigger === 'manual') {
4938
+ var _refSetting$value3;
4939
+ (_refSetting$value3 = refSetting.value) === null || _refSetting$value3 === void 0 || _refSetting$value3.show();
4940
+ }
4934
4941
  };
4935
4942
  var handleCheckAllClick = function handleCheckAllClick(e) {
4936
4943
  e.stopImmediatePropagation();
@@ -5025,9 +5032,10 @@ function _isSlot(s) {
5025
5032
  var _localSettings$value$2;
5026
5033
  return props.settings ? (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
5027
5034
  "trigger": (_localSettings$value$2 = localSettings.value.trigger) !== null && _localSettings$value$2 !== void 0 ? _localSettings$value$2 : 'manual',
5028
- "isShow": isShow.value,
5029
5035
  "placement": "bottom-end",
5030
- "arrow": true
5036
+ "ref": refSetting,
5037
+ "arrow": true,
5038
+ "extCls": localSettings.value.extCls
5031
5039
  }, {
5032
5040
  theme: theme
5033
5041
  }), {
@@ -6759,12 +6767,10 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6759
6767
  }
6760
6768
  };
6761
6769
  var isFirstLoad = (0,external_vue_namespaceObject.ref)(true);
6762
- // const tableWidth = ref(null);
6763
- (0,external_vue_namespaceObject.watch)(function () {
6764
- return [props.data, columns];
6765
- }, function () {
6770
+ (0,external_vue_namespaceObject.watchEffect)(function () {
6771
+ tableSchema.formatColumns(columns);
6772
+ resolveFixedColumns(tableOffsetRight.value);
6766
6773
  tableSchema.setIndexData().then(function () {
6767
- tableSchema.formatColumns(columns);
6768
6774
  tableSchema.formatDataSchema(props.data);
6769
6775
  tableSchema.resetStartEndIndex();
6770
6776
  if (isFirstLoad.value) {
@@ -6776,7 +6782,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6776
6782
  registerResizeEvent();
6777
6783
  (0,external_vue_namespaceObject.nextTick)(function () {
6778
6784
  updateOffsetRight();
6779
- resolveFixedColumns(tableOffsetRight.value);
6780
6785
  /**
6781
6786
  * 确保在所有数据渲染完毕再执行fix column计算
6782
6787
  */
@@ -6785,9 +6790,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
6785
6790
  });
6786
6791
  });
6787
6792
  });
6788
- }, {
6789
- immediate: true,
6790
- deep: true
6791
6793
  });
6792
6794
  (0,external_vue_namespaceObject.watch)(function () {
6793
6795
  return [props.height, props.maxHeight, props.minHeight];
@@ -104,6 +104,7 @@ export type Settings = {
104
104
  size?: string;
105
105
  sizeList?: SizeItem[];
106
106
  showLineHeight?: boolean;
107
+ extCls?: string;
107
108
  trigger: 'manual';
108
109
  };
109
110
  export type ISettingPropType = Settings | boolean;
@@ -1,5 +1,5 @@
1
1
  import { IEmptyObject } from './const';
2
- import { Column, Field, Settings, SortScope, TablePropTypes } from './props';
2
+ import { Column, Field, Settings, TablePropTypes } from './props';
3
3
  export type ITableFormatData = {
4
4
  data: any[];
5
5
  dataSchema: WeakMap<object, any>;
@@ -18,46 +18,7 @@ export type ITableFormatData = {
18
18
  translateY: number;
19
19
  };
20
20
  };
21
- export type ITableResponse = {
22
- setIndexData: () => Promise<void>;
23
- formatColumns: (columns: Column[]) => void;
24
- formatDataSchema: (data: any[]) => void;
25
- setRowSelection: (row: any, isSelected: boolean) => void;
26
- setRowExpand: (row: any, isExpand: boolean) => void;
27
- setRowIndex: (row: any, index: number) => void;
28
- setColumnAttribute: (col: Column, attrName: string, attrValue: ((...args: any[]) => boolean | number | void | string) | string | boolean | number) => void;
29
- setColumnAttributeBySettings: (settings: Settings, checkedVal?: string[]) => void;
30
- setAllColumnAttribute: (attrName: string, attrValue: ((...args: any[]) => boolean | number | void | string) | string | boolean | number) => void;
31
- getColumnAttribute: (col: Column, attributeName: string) => string | boolean | Record<string, any>;
32
- getColumnId: (col: Column) => string;
33
- getColumnOrderWidth: (column: Column, orders?: string[]) => number;
34
- isActiveColumn: (col: Column) => boolean;
35
- isHiddenColumn: (col: Column) => boolean;
36
- resolvePageData: (filterFn?: any, sortFn?: any, column?: Column, type?: string, sortScope?: SortScope) => void;
37
- resolveByDefColumns: () => void;
38
- resetStartEndIndex: () => void;
39
- toggleRowSelection: (row: any) => void;
40
- toggleAllSelection: (value?: boolean) => void;
41
- setAllRowExpand: (value?: boolean) => void;
42
- clearSelection: () => void;
43
- clearColumnSort: (reset?: boolean) => void;
44
- setColumnSortActive: (column: Column, active: boolean) => void;
45
- getRowAttribute: (row: any | IEmptyObject, attrName: string) => any;
46
- getRowSelection: () => any[];
47
- resolveColumnWidth: (root: HTMLElement, autoWidth?: any, offsetWidth?: any) => void;
48
- filter: () => void;
49
- sortData: (column: Column) => void;
50
- isCheckedAll: () => boolean;
51
- hasCheckedRow: () => boolean;
52
- setRowSelectionAll: (val: boolean) => void;
53
- setRowIndeterminate: () => void;
54
- updateSettings: (settings?: Settings, rowHeight?: number) => void;
55
- changePageRowIndex: (sourceIndex: number, targetIndex: number) => void;
56
- pageData: any[];
57
- localPagination: any;
58
- formatData: ITableFormatData;
59
- };
60
- declare const _default: (props: TablePropTypes) => {
21
+ declare const tableSchemaResponse: (props: TablePropTypes) => {
61
22
  formatColumns: (columns: Column[]) => void;
62
23
  formatDataSchema: (data: any[]) => void;
63
24
  setRowSelection: (row: any, isSelected: boolean) => void;
@@ -96,4 +57,5 @@ declare const _default: (props: TablePropTypes) => {
96
57
  formatData: ITableFormatData;
97
58
  setIndexData: () => Promise<void>;
98
59
  };
99
- export default _default;
60
+ export type ITableResponse = ReturnType<typeof tableSchemaResponse>;
61
+ export default tableSchemaResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "1.0.3-beta.17",
3
+ "version": "1.0.3-beta.19",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",