@gx-design-vue/pro-table 0.2.0-alpha.10 → 0.2.0-alpha.12

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.
package/dist/ProTable.js CHANGED
@@ -19,7 +19,7 @@ import { useTableSize } from "./hooks/useTableSize.js";
19
19
  import "./hooks/index.js";
20
20
  import style_default from "./style/index.js";
21
21
  import { Fragment, Teleport, computed, createVNode, defineComponent, mergeDefaults, mergeProps, ref, toRef, watch } from "vue";
22
- import { useProAppContext } from "@gx-design-vue/pro-app";
22
+ import { useProConfigContext } from "@gx-design-vue/pro-provider";
23
23
  import { classNames, getSlotVNode } from "@gx-design-vue/pro-utils";
24
24
  import { useFullscreen } from "@vueuse/core";
25
25
  import { Pagination, Spin, Table } from "antdv-next";
@@ -65,7 +65,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
65
65
  const { prefixCls } = useBaseConfig("pro-table", props);
66
66
  const rootCls = useCSSVarCls(prefixCls);
67
67
  const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
68
- const appContext = useProAppContext();
68
+ const configContext = useProConfigContext();
69
69
  const rootEl = ref();
70
70
  const { toggle: toggleFullscreen, isFullscreen } = useFullscreen(rootEl);
71
71
  watch(isFullscreen, (val) => {
@@ -224,7 +224,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
224
224
  props,
225
225
  key: "emptyText"
226
226
  });
227
- if (emptyTextSlot !== false && appContext?.emptyText?.value !== false) return emptyTextSlot || appContext?.emptyText?.value;
227
+ if (emptyTextSlot && configContext?.renderEmpty?.value) return emptyTextSlot || configContext?.renderEmpty?.value?.();
228
228
  return null;
229
229
  }
230
230
  function onCustomPaginationChange(currentPage, currentPageSize) {
@@ -283,7 +283,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
283
283
  props,
284
284
  key: "emptyText"
285
285
  });
286
- if (emptyTextRender || appContext?.emptyText?.value) result.emptyText = () => emptyTextRender || appContext?.emptyText?.value;
286
+ if (emptyTextRender || configContext?.renderEmpty?.value) result.emptyText = () => emptyTextRender || configContext?.renderEmpty?.value?.();
287
287
  return result;
288
288
  });
289
289
  expose({
@@ -567,12 +567,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
567
567
  emptyText: {
568
568
  type: [
569
569
  Function,
570
- Object,
571
570
  String,
572
571
  Number,
573
- Boolean,
574
572
  null,
575
- Array
573
+ Object,
574
+ Boolean
576
575
  ],
577
576
  required: false,
578
577
  default: void 0
@@ -580,12 +579,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
580
579
  headerTitle: {
581
580
  type: [
582
581
  Function,
583
- Object,
584
582
  String,
585
583
  Number,
586
- Boolean,
587
584
  null,
588
- Array
585
+ Object,
586
+ Boolean
589
587
  ],
590
588
  required: false,
591
589
  default: void 0
@@ -593,12 +591,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
593
591
  headerTitleTip: {
594
592
  type: [
595
593
  Function,
596
- Object,
597
594
  String,
598
595
  Number,
599
- Boolean,
600
596
  null,
601
- Array
597
+ Object,
598
+ Boolean
602
599
  ],
603
600
  required: false,
604
601
  default: void 0
@@ -606,12 +603,11 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
606
603
  listToolAfter: {
607
604
  type: [
608
605
  Function,
609
- Object,
610
606
  String,
611
607
  Number,
612
- Boolean,
613
608
  null,
614
- Array
609
+ Object,
610
+ Boolean
615
611
  ],
616
612
  required: false,
617
613
  default: void 0
@@ -70,11 +70,11 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
70
70
  };
71
71
  }>> & Readonly<{}>, {
72
72
  readonly always: boolean;
73
- readonly minSize: number;
74
73
  readonly barStyle: {
75
74
  x: CSSProperties;
76
75
  y: CSSProperties;
77
76
  };
77
+ readonly minSize: number;
78
78
  readonly hasScrollY: boolean;
79
79
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
80
80
  //#endregion
@@ -44,9 +44,9 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
44
44
  readonly default: () => {};
45
45
  };
46
46
  }>> & Readonly<{}>, {
47
+ readonly vertical: boolean;
47
48
  readonly always: boolean;
48
49
  readonly barStyle: CSSProperties;
49
- readonly vertical: boolean;
50
50
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
51
51
  //#endregion
52
52
  export { _default as default, thumbProps };
@@ -1,8 +1,8 @@
1
1
  import { useInjectScrollBarContext } from "./context.js";
2
2
  import { BAR_MAP, renderThumbStyle } from "./util.js";
3
3
  import { computed, createVNode, defineComponent, onBeforeUnmount, ref } from "vue";
4
- import { useEventListener } from "@vueuse/core";
5
4
  import { unit } from "@gx-design-vue/pro-provider";
5
+ import { useEventListener } from "@vueuse/core";
6
6
  //#region src/components/ScrollBar/Thumb.tsx
7
7
  const thumbProps = {
8
8
  vertical: Boolean,
@@ -47,9 +47,9 @@ declare const CollapseToggle: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
47
47
  required: true;
48
48
  };
49
49
  }>> & Readonly<{}>, {
50
+ hashId: string;
50
51
  collapsed: boolean;
51
52
  collapseRender: WithFalse<(collapsed?: boolean) => CustomRender>;
52
- hashId: string;
53
53
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
54
54
  //#endregion
55
55
  export { CollapseToggle };
@@ -68,8 +68,8 @@ declare const FormItemContainer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
68
68
  };
69
69
  }>> & Readonly<{}>, {
70
70
  onSubmit: () => void;
71
- autoRequest: boolean;
72
71
  loading: boolean;
72
+ autoRequest: boolean;
73
73
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
74
74
  //#endregion
75
75
  export { FormItemContainer };
@@ -71,10 +71,10 @@ declare const FormItemWrapper: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
71
71
  };
72
72
  }>> & Readonly<{}>, {
73
73
  label: any;
74
- hashId: string;
75
74
  labelWidth: string | number;
76
- labelAlign: "left" | "right" | "center";
75
+ labelAlign: "left" | "center" | "right";
77
76
  colon: boolean;
77
+ hashId: string;
78
78
  formItemStyle: CSSProperties;
79
79
  globalLabelGap: number;
80
80
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
@@ -112,7 +112,6 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
112
112
  };
113
113
  }>> & Readonly<{}>, {
114
114
  onReset: (params: Record<string, any>) => void;
115
- loading: any;
116
115
  formColumns: ProSearchMap<"text", string>[];
117
116
  formConfig: FormConfig;
118
117
  formAutoRequest: boolean;
@@ -122,6 +121,7 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
122
121
  searchText?: string;
123
122
  resetText?: string;
124
123
  };
124
+ loading: any;
125
125
  cardBordered: boolean;
126
126
  proClasses: Record<string, string>;
127
127
  proStyles: Record<string, any>;
@@ -98,14 +98,14 @@ declare const ListToolBar: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
98
98
  }>[];
99
99
  proClasses: Record<string, any>;
100
100
  proStyles: Record<string, any>;
101
+ titleTipText: string;
102
+ actionsPlacement: ToolbarPlacement;
101
103
  headerTitle: any;
104
+ listToolAfter: any;
102
105
  headerTitleTip: any;
103
- titleTipText: string;
104
106
  settings: VNode<_$vue.RendererNode, _$vue.RendererElement, {
105
107
  [key: string]: any;
106
108
  }>[];
107
- actionsPlacement: ToolbarPlacement;
108
- listToolAfter: any;
109
109
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
110
110
  //#endregion
111
111
  export { ListToolBar, ListToolBarSetting };
@@ -92,12 +92,12 @@ declare const Toolbar: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
92
92
  }>[];
93
93
  proClasses: Record<string, any>;
94
94
  proStyles: Record<string, any>;
95
- headerTitle: any;
96
- headerTitleTip: any;
95
+ options: any;
97
96
  titleTipText: string;
98
97
  actionsPlacement: ToolbarPlacement;
98
+ headerTitle: any;
99
99
  listToolAfter: any;
100
- options: any;
100
+ headerTitleTip: any;
101
101
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
102
102
  //#endregion
103
103
  export { Toolbar, Toolbar as default };
@@ -1,5 +1,5 @@
1
1
  import { computed, onScopeDispose, shallowRef, watch } from "vue";
2
- import { getRandomNumber } from "@gx-design-vue/pro-utils";
2
+ import { createUUIDFactory } from "@gx-design-vue/pro-utils";
3
3
  //#region src/hooks/useColumns.ts
4
4
  /** 获取列唯一标识,优先 key,回退 dataIndex */
5
5
  function getColumnKey(col) {
@@ -37,7 +37,7 @@ function createIndexColumn(indexColumn, defaultAlign, firstColumn) {
37
37
  align: config.align ?? defaultAlign,
38
38
  fixed: normalizeFixedValue(config.fixed ?? firstColumn?.fixed),
39
39
  width: config.width ?? 60,
40
- uuid: getRandomNumber().uuid(15),
40
+ uuid: createUUIDFactory().uuid(15),
41
41
  dataIndex: "sortIndex",
42
42
  key: "sortIndex"
43
43
  };
@@ -1,5 +1,5 @@
1
1
  import { computed, onActivated, onDeactivated, onUnmounted, ref, toRaw, watch } from "vue";
2
- import { getRandomNumber, getSortIndex, handleCurrentPage, isArray, isFunction, isObject, merge } from "@gx-design-vue/pro-utils";
2
+ import { createUUIDFactory, getSortIndex, handleCurrentPage, isArray, isFunction, isObject, merge } from "@gx-design-vue/pro-utils";
3
3
  import { useDebounceFn } from "@vueuse/core";
4
4
  //#region src/hooks/useFetchData.ts
5
5
  const EMPTY_ARRAY = [];
@@ -90,7 +90,7 @@ function useFetchData(config, action) {
90
90
  filter: filters,
91
91
  extra
92
92
  });
93
- const currentRequestId = `table_request_${getRandomNumber().uuid(10)}`;
93
+ const currentRequestId = `table_request_${createUUIDFactory().uuid(10)}`;
94
94
  requestId.value = currentRequestId;
95
95
  const controller = new AbortController();
96
96
  abortController.value = controller;