@aplus-frontend/ui 6.13.4 → 6.14.0

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.
@@ -1,7 +1,8 @@
1
1
  import { TableRowSelection } from '@aplus-frontend/antdv/lib/table/interface';
2
2
  import { ComputedRef, Ref } from 'vue';
3
- import { ApTableProps, ApTableRowSelection } from '../../ap-table';
3
+ import { ApTableProps } from '../../ap-table';
4
4
  import { Recordable } from '../../type';
5
+ import { ApGridRowSelection } from '../interface';
5
6
  export interface RowSelectionReturnType<RecordType = any> {
6
7
  rowSelection: ComputedRef<TableRowSelection<RecordType>>;
7
8
  selectedRows: Ref<Partial<RecordType>[]>;
@@ -58,12 +59,12 @@ export interface RowSelectionReturnType<RecordType = any> {
58
59
  unSelectMulti: (items: RecordType[]) => void;
59
60
  /**
60
61
  * VxeTable 表格checkbox-change事件
61
- * @param item
62
62
  * @param select
63
- * @param partRowData
63
+ * @param selectedRows
64
+ * @param reserveSelectedRows
64
65
  * @returns
65
66
  */
66
- selectChange: (item: RecordType, select: boolean, partRowData: RecordType[]) => void;
67
+ selectChange: (select: boolean, selectedRows: RecordType[], reserveSelectedRows: RecordType[]) => void;
67
68
  /**
68
69
  * VxeTable 表格checkbox-all事件
69
70
  * @param item
@@ -86,7 +87,7 @@ export interface RowSelectionReturnType<RecordType = any> {
86
87
  */
87
88
  selectMultiByKeys: (keys: (string | number)[]) => void;
88
89
  }
89
- type RowSelectionParams<T> = Omit<ApTableRowSelection<T>, 'mode'> & {
90
+ type RowSelectionParams<T> = ApGridRowSelection<T> & {
90
91
  /**
91
92
  * 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
92
93
  */
@@ -1,117 +1,132 @@
1
- import { ref as I, computed as v, unref as o } from "vue";
2
- import { isFunction as i, cloneDeep as _ } from "lodash-unified";
3
- function b(a, c) {
4
- return !(c != null && c.length) || i(a) ? [] : c.map((f) => ({ [a]: f }));
1
+ import { ref as F, computed as M, unref as o } from "vue";
2
+ import { isFunction as v, cloneDeep as h } from "lodash-unified";
3
+ function T(a, c) {
4
+ return !(c != null && c.length) || v(a) ? [] : c.map((d) => ({ [a]: d }));
5
5
  }
6
- const F = (a) => {
7
- a.defaultSelectedRowKeys;
8
- const c = I(
9
- b(a.rowKey, a.defaultSelectedRowKeys)
6
+ const m = (a) => {
7
+ const c = F(
8
+ T(a.rowKey, a.defaultSelectedRowKeys)
10
9
  );
11
- function f(e, t) {
10
+ function d(e, t) {
12
11
  c.value = t;
13
12
  }
14
- const l = (e) => i(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = v(() => {
13
+ const u = (e) => v(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = M(() => {
15
14
  const e = /* @__PURE__ */ new Map();
16
15
  return o(c).forEach((t) => {
17
- e.set(l(t), t);
16
+ e.set(u(t), t);
18
17
  }), e;
19
18
  });
20
- function M(e) {
21
- return o(s).has(l(e));
19
+ function w(e) {
20
+ return o(s).has(u(e));
22
21
  }
23
22
  function g(e) {
23
+ if (!f(e))
24
+ return;
24
25
  const t = o(s);
25
- t.set(l(e), e), c.value = [...t.values()];
26
+ t.set(u(e), e), c.value = [...t.values()];
26
27
  }
27
- function h(e) {
28
+ function x(e) {
28
29
  const t = o(s);
29
30
  for (const n of e)
30
- t.set(l(n), n);
31
+ f(n) && t.set(u(n), n);
31
32
  c.value = [...t.values()];
32
33
  }
33
- function w(e) {
34
- if (i(a.rowKey))
34
+ function y(e) {
35
+ if (v(a.rowKey))
35
36
  return;
36
37
  const t = o(s);
37
38
  for (const n of e) {
38
- const u = o(a.dataSource).find(
39
- (r) => l(r) === n
40
- ), S = { [a.rowKey]: n };
41
- t.set(String(n), u || S);
39
+ const l = o(a.dataSource).find(
40
+ (i) => u(i) === n
41
+ ), r = { [a.rowKey]: n };
42
+ f(l || r) && t.set(n, l || r);
42
43
  }
43
44
  c.value = [...t.values()];
44
45
  }
45
- function x(e) {
46
+ function E(e) {
47
+ if (!f(e))
48
+ return;
46
49
  const t = o(s);
47
- t.delete(l(e)), c.value = [...t.values()];
50
+ t.delete(u(e)), c.value = [...t.values()];
48
51
  }
49
- function y(e) {
52
+ function K(e) {
50
53
  const t = o(s);
51
54
  for (const n of e)
52
- t.delete(l(n));
55
+ f(n) && t.delete(u(n));
53
56
  c.value = [...t.values()];
54
57
  }
55
- function d(e, t) {
58
+ function S(e, t) {
56
59
  const n = e;
57
- for (const u of t)
58
- n.set(l(u), u);
60
+ for (const l of t)
61
+ n.set(u(l), l);
59
62
  return n;
60
63
  }
61
- function K(e, t, n) {
62
- const u = o(s);
63
- t ? u.set(l(e), e) : u.delete(l(e)), d(u, n), c.value = [...u.values()];
64
+ function b(e, t, n) {
65
+ const l = o(s);
66
+ e ? S(l, [...n, ...t]) : o(a.dataSource).forEach((r) => {
67
+ const i = u(r);
68
+ t.some((B) => u(B) === i) ? l.set(i, r) : l.delete(i);
69
+ }), c.value = [...l.values()];
64
70
  }
65
71
  function A(e, t) {
66
- c.value = [...t];
72
+ const n = h(o(s));
73
+ e ? S(n, t) : o(a.dataSource).forEach((l) => {
74
+ f(l) && n.delete(u(l));
75
+ }), c.value = [...n.values()];
76
+ }
77
+ function f(e) {
78
+ const t = a.shown, n = a.disabled, l = t ? t(e) : !0, r = n ? n(e) : !1;
79
+ return l && !r;
67
80
  }
68
81
  function C(e, t) {
69
- const n = _(o(s));
70
- o(a.dataSource).forEach((u) => {
71
- e.find((r) => l(r) === l(u)) ? n.set(l(u), u) : n.delete(l(u));
72
- }), d(n, t), c.value = [...n.values()];
82
+ const n = h(o(s));
83
+ o(a.dataSource).forEach((l) => {
84
+ e.find((i) => u(i) === u(l)) ? n.set(u(l), l) : n.delete(u(l));
85
+ }), S(n, t), c.value = [...n.values()];
73
86
  }
74
- function E() {
87
+ function D() {
75
88
  const e = o(s);
76
89
  o(a.dataSource).forEach((t) => {
77
- e.set(l(t), t);
90
+ f(t) && e.set(u(t), t);
78
91
  }), c.value = [...e.values()];
79
92
  }
80
93
  function R(e) {
81
- const t = o(s), n = l(e);
94
+ if (!f(e))
95
+ return;
96
+ const t = o(s), n = u(e);
82
97
  t.has(n) ? t.delete(n) : t.set(n, e), c.value = [...t.values()];
83
98
  }
84
- function D() {
99
+ function I() {
85
100
  const e = o(s);
86
101
  o(a.dataSource).forEach((t) => {
87
- e.delete(l(t));
102
+ f(t) && e.delete(u(t));
88
103
  }), c.value = [...e.values()];
89
104
  }
90
- function m() {
105
+ function k() {
91
106
  c.value = [];
92
107
  }
93
108
  return {
94
109
  select: g,
95
- unSelect: x,
96
- isSelected: M,
97
- selectAll: E,
98
- unSelectAll: D,
99
- clearAll: m,
110
+ unSelect: E,
111
+ isSelected: w,
112
+ selectAll: D,
113
+ unSelectAll: I,
114
+ clearAll: k,
100
115
  toggleSelect: R,
101
116
  selectedRows: c,
102
- selectMulti: h,
103
- unSelectMulti: y,
104
- rowSelection: v(() => ({
117
+ selectMulti: x,
118
+ unSelectMulti: K,
119
+ rowSelection: M(() => ({
105
120
  ...a,
106
- onChange: f,
107
- selectedRowKeys: o(c).map((e) => l(e))
121
+ onChange: d,
122
+ selectedRowKeys: o(c).map((e) => u(e))
108
123
  })),
109
- selectChange: K,
124
+ selectChange: b,
110
125
  selectAllChange: A,
111
126
  selectRangeChange: C,
112
- selectMultiByKeys: w
127
+ selectMultiByKeys: y
113
128
  };
114
129
  };
115
130
  export {
116
- F as default
131
+ m as default
117
132
  };
@@ -252,17 +252,14 @@ const Gt = /* @__PURE__ */ $e({
252
252
  dataSource: Pe,
253
253
  rowKey: o.rowKey
254
254
  }), Te = ({
255
- checked: e,
256
- row: t
255
+ checked: e
257
256
  }) => {
258
- const l = s.value;
259
- if (l && l) {
260
- const r = [
261
- ...l.getCheckboxReserveRecords(),
262
- ...l.getCheckboxRecords()
263
- ];
264
- y.selectChange(t, e, r);
265
- }
257
+ const t = s.value;
258
+ t && t && y.selectChange(
259
+ e,
260
+ t.getCheckboxRecords(),
261
+ t.getCheckboxReserveRecords()
262
+ );
266
263
  }, Ne = ({
267
264
  checked: e
268
265
  }) => {
@@ -1,4 +1,6 @@
1
+ import { ApColumnType } from '../../ap-table/interface';
2
+ import { ApGridColumnType } from './../../ap-grid/interface';
1
3
  import { ColumnType } from '@aplus-frontend/antdv/es/table';
2
- export declare const convertExportField: (columns: ColumnType[], convertField?: {
4
+ export declare const convertExportField: (columns: ColumnType[] | ApGridColumnType[] | ApColumnType[], convertField?: {
3
5
  [key: string]: string[];
4
6
  }) => any[];
@@ -1,2 +1,2 @@
1
- declare const _default: "6.13.4";
1
+ declare const _default: "6.14.0";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.13.4";
1
+ const e = "6.14.0";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1,7 +1,8 @@
1
1
  import { TableRowSelection } from '@aplus-frontend/antdv/lib/table/interface';
2
2
  import { ComputedRef, Ref } from 'vue';
3
- import { ApTableProps, ApTableRowSelection } from '../../ap-table';
3
+ import { ApTableProps } from '../../ap-table';
4
4
  import { Recordable } from '../../type';
5
+ import { ApGridRowSelection } from '../interface';
5
6
  export interface RowSelectionReturnType<RecordType = any> {
6
7
  rowSelection: ComputedRef<TableRowSelection<RecordType>>;
7
8
  selectedRows: Ref<Partial<RecordType>[]>;
@@ -58,12 +59,12 @@ export interface RowSelectionReturnType<RecordType = any> {
58
59
  unSelectMulti: (items: RecordType[]) => void;
59
60
  /**
60
61
  * VxeTable 表格checkbox-change事件
61
- * @param item
62
62
  * @param select
63
- * @param partRowData
63
+ * @param selectedRows
64
+ * @param reserveSelectedRows
64
65
  * @returns
65
66
  */
66
- selectChange: (item: RecordType, select: boolean, partRowData: RecordType[]) => void;
67
+ selectChange: (select: boolean, selectedRows: RecordType[], reserveSelectedRows: RecordType[]) => void;
67
68
  /**
68
69
  * VxeTable 表格checkbox-all事件
69
70
  * @param item
@@ -86,7 +87,7 @@ export interface RowSelectionReturnType<RecordType = any> {
86
87
  */
87
88
  selectMultiByKeys: (keys: (string | number)[]) => void;
88
89
  }
89
- type RowSelectionParams<T> = Omit<ApTableRowSelection<T>, 'mode'> & {
90
+ type RowSelectionParams<T> = ApGridRowSelection<T> & {
90
91
  /**
91
92
  * 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
92
93
  */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue"),r=require("lodash-unified");function b(o,c){return!(c!=null&&c.length)||r.isFunction(o)?[]:c.map(f=>({[o]:f}))}const D=o=>{o.defaultSelectedRowKeys;const c=u.ref(b(o.rowKey,o.defaultSelectedRowKeys));function f(e,t){c.value=t}const l=e=>r.isFunction(o.rowKey)?o.rowKey(e):e[o.rowKey],s=u.computed(()=>{const e=new Map;return u.unref(c).forEach(t=>{e.set(l(t),t)}),e});function v(e){return u.unref(s).has(l(e))}function M(e){const t=u.unref(s);t.set(l(e),e),c.value=[...t.values()]}function g(e){const t=u.unref(s);for(const n of e)t.set(l(n),n);c.value=[...t.values()]}function h(e){if(r.isFunction(o.rowKey))return;const t=u.unref(s);for(const n of e){const a=u.unref(o.dataSource).find(i=>l(i)===n),S={[o.rowKey]:n};t.set(String(n),a||S)}c.value=[...t.values()]}function w(e){const t=u.unref(s);t.delete(l(e)),c.value=[...t.values()]}function x(e){const t=u.unref(s);for(const n of e)t.delete(l(n));c.value=[...t.values()]}function d(e,t){const n=e;for(const a of t)n.set(l(a),a);return n}function y(e,t,n){const a=u.unref(s);t?a.set(l(e),e):a.delete(l(e)),d(a,n),c.value=[...a.values()]}function K(e,t){c.value=[...t]}function A(e,t){const n=r.cloneDeep(u.unref(s));u.unref(o.dataSource).forEach(a=>{e.find(i=>l(i)===l(a))?n.set(l(a),a):n.delete(l(a))}),d(n,t),c.value=[...n.values()]}function C(){const e=u.unref(s);u.unref(o.dataSource).forEach(t=>{e.set(l(t),t)}),c.value=[...e.values()]}function E(e){const t=u.unref(s),n=l(e);t.has(n)?t.delete(n):t.set(n,e),c.value=[...t.values()]}function R(){const e=u.unref(s);u.unref(o.dataSource).forEach(t=>{e.delete(l(t))}),c.value=[...e.values()]}function _(){c.value=[]}return{select:M,unSelect:w,isSelected:v,selectAll:C,unSelectAll:R,clearAll:_,toggleSelect:E,selectedRows:c,selectMulti:g,unSelectMulti:x,rowSelection:u.computed(()=>({...o,onChange:f,selectedRowKeys:u.unref(c).map(e=>l(e))})),selectChange:y,selectAllChange:K,selectRangeChange:A,selectMultiByKeys:h}};exports.default=D;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),d=require("lodash-unified");function _(o,u){return!(u!=null&&u.length)||d.isFunction(o)?[]:u.map(S=>({[o]:S}))}const q=o=>{const u=c.ref(_(o.rowKey,o.defaultSelectedRowKeys));function S(e,n){u.value=n}const a=e=>d.isFunction(o.rowKey)?o.rowKey(e):e[o.rowKey],s=c.computed(()=>{const e=new Map;return c.unref(u).forEach(n=>{e.set(a(n),n)}),e});function M(e){return c.unref(s).has(a(e))}function h(e){if(!r(e))return;const n=c.unref(s);n.set(a(e),e),u.value=[...n.values()]}function g(e){const n=c.unref(s);for(const t of e)r(t)&&n.set(a(t),t);u.value=[...n.values()]}function w(e){if(d.isFunction(o.rowKey))return;const n=c.unref(s);for(const t of e){const l=c.unref(o.dataSource).find(i=>a(i)===t),f={[o.rowKey]:t};r(l||f)&&n.set(t,l||f)}u.value=[...n.values()]}function x(e){if(!r(e))return;const n=c.unref(s);n.delete(a(e)),u.value=[...n.values()]}function y(e){const n=c.unref(s);for(const t of e)r(t)&&n.delete(a(t));u.value=[...n.values()]}function v(e,n){const t=e;for(const l of n)t.set(a(l),l);return t}function b(e,n,t){const l=c.unref(s);e?v(l,[...t,...n]):c.unref(o.dataSource).forEach(f=>{const i=a(f);n.some(R=>a(R)===i)?l.set(i,f):l.delete(i)}),u.value=[...l.values()]}function E(e,n){const t=d.cloneDeep(c.unref(s));e?v(t,n):c.unref(o.dataSource).forEach(l=>{r(l)&&t.delete(a(l))}),u.value=[...t.values()]}function r(e){const n=o.shown,t=o.disabled,l=n?n(e):!0,f=t?t(e):!1;return l&&!f}function K(e,n){const t=d.cloneDeep(c.unref(s));c.unref(o.dataSource).forEach(l=>{e.find(i=>a(i)===a(l))?t.set(a(l),l):t.delete(a(l))}),v(t,n),u.value=[...t.values()]}function D(){const e=c.unref(s);c.unref(o.dataSource).forEach(n=>{r(n)&&e.set(a(n),n)}),u.value=[...e.values()]}function A(e){if(!r(e))return;const n=c.unref(s),t=a(e);n.has(t)?n.delete(t):n.set(t,e),u.value=[...n.values()]}function C(){const e=c.unref(s);c.unref(o.dataSource).forEach(n=>{r(n)&&e.delete(a(n))}),u.value=[...e.values()]}function F(){u.value=[]}return{select:h,unSelect:x,isSelected:M,selectAll:D,unSelectAll:C,clearAll:F,toggleSelect:A,selectedRows:u,selectMulti:g,unSelectMulti:y,rowSelection:c.computed(()=>({...o,onChange:S,selectedRowKeys:c.unref(u).map(e=>a(e))})),selectChange:b,selectAllChange:E,selectRangeChange:K,selectMultiByKeys:w}};exports.default=q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("vxe-table");require("vxe-table/es/style.css");const i=require("lodash-unified"),be=require("../ap-form/index.js");require("../config-provider/index.js");const Re=require("../ap-table/constants.js"),p=require("../ap-table/utils.js"),xe=require("../ap-table/hooks/use-table-paging-ng.js"),b=require("@aplus-frontend/antdv"),ke=require("./hooks/use-inner-params.js"),F=require("./utils/table.js"),Be=require("./hooks/use-row-selection.js"),Fe=require("../ap-table/context.js"),E=require("./constants.js"),Ee=require("./hooks/use-render-columns.js"),Ie=require("@aplus-frontend/antdv/es/theme/internal");require("../scroll-bar/index.js");const Ne=require("../utils/index.js"),Pe=require("../utils/slot.js"),Ve=require("./hooks/use-table-style.js"),qe=require("../config-provider/hooks/use-namespace.js"),ze=require("../config-provider/hooks/use-global-config.js"),Te=require("../config-provider/hooks/use-locale.js"),_e=require("../scroll-bar/index.vue.js"),Ae=e.defineComponent({name:"ApGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!1},prefixCls:{},tableLayout:{},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},round:{type:Boolean,default:void 0},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},rowHighlightable:{type:[Boolean,Function],default:!1},treeConfig:{}},setup(M,{expose:W}){var U;const g=e.useSlots(),o=M,y=(U=e.getCurrentInstance())==null?void 0:U.appContext.app;y&&!y.__VXE_PC_UI_INSTALLED__&&(y.use(v.VxeUI),y.__VXE_PC_UI_INSTALLED__=!0);const{e:S,b:u,be:j}=qe.useNamespace("ap-grid"),H=ze.useGlobalConfig("valueTypeMap"),s=e.ref([]),I=e.ref([]),l=e.ref(),w=e.ref(o.size),G=Ve.useTableStyle(),[,X]=Ie.useToken(),{t:J}=Te.useLocale();v.VxeUI.setConfig({i18n:(t,r)=>J(`ap.${t}`,r)});const{renderConfig:Q,updateSignal:Y}=Ee.useRenderColumns(s);let N=0;const Z=e.computed(()=>{if(l.value)return l.value.$el.querySelector(".vxe-table--header-inner-wrapper")}),P=e.computed(()=>{var t,r,n;return N++,((n=(r=(t=o.columns)==null?void 0:t.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!Re.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:r.sort((a,c)=>{let h=p.getColumnOrder(a.order);return p.getColumnOrder(c.order)-h}))==null?void 0:n.map(a=>{const c=p.updateFormProps(a,p.getFieldProps(a.fieldProps,{})),h={...a,fieldProps:{label:a.title,name:a.dataIndex,bordered:!0,...c||{},_signal:N},renderNode:void 0};return h.renderNode=p.getSearchFormItemRenderNode(h,e.unref(H)),h}))||[]}),ee=e.computed(()=>{var r;return Ne.isDef(o.manual)?o.manual:Pe.getValidVNodeList(((r=g.searchFormExtra)==null?void 0:r.call(g))||[]).some(n=>{var a;return((a=n.type)==null?void 0:a.name)==="ApView"})}),te=e.computed(()=>[u(),o.card?null:u("wrapper"),o.adaptive?u("adaptive"):null,o.sticky?u("sticky"):null].filter(Boolean)),V=e.computed(()=>p.recursionApColumns(e.unref(s),t=>{if(t.sorter===!0)return t.key||t.dataIndex}).filter(Boolean)),q=e.computed(()=>p.recursionApColumns(e.unref(s),t=>{if(t.filters&&!t.onFilter)return t.key||t.dataIndex}).filter(Boolean)),{formRef:m,submit:R,reset:x,refresh:z,data:d,tableProps:T,setDataSource:re,handleTableChangeOptional:oe,getPaging:ae,setPaging:ne,submitWith:_}=xe.useTablePaging({async request(t){var n;if(!f.value.preserveSelectedRowKeys&&i.isUndefined(o.dataSource)&&B(),!i.isUndefined(o.dataSource)){const a=t.pageSize*(t.current-1);return{data:(o.pagination===!1?o.dataSource:o.dataSource.slice(a,a+t.pageSize))||[],total:o.dataSource.length||0}}const r=await((n=o.request)==null?void 0:n.call(o,t));return{data:(r==null?void 0:r.data)||[],total:(r==null?void 0:r.total)||0}},namespace:"ap-grid",filterFields:q,sortFields:V,params:e.toRef(o,"params"),defaultData:o.defaultData,manual:e.unref(ee),formatParams:o.beforeSearchSubmit,pagination:o.pagination,onClickReset:Se,onAfterRequest:$}),{sortChangeEvent:le,filterChangeEvent:se,paginationChangeEvent:ue}=ke.useInnerParams(oe);Fe.useProvideApTable({columns:e.computed(()=>s.value),columnsBackup:e.computed(()=>I.value),size:e.computed(()=>E.sizeMap[w.value]),updateColumns(t){var r;s.value=t,(r=o.onShownColumnsChange)==null||r.call(o,t)},updateSize(t){w.value=E.sizeReverseMap[t]},renderConfig:e.computed(()=>({className:j("table-header","title"),color:X.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(d).records),getSearchFormValues:L,setSearchFormValues:A,submit:R,submitWith:_,reset:x,refresh:z,getSearchFormSorterItems:K,setSearchFormSorterItems:D,resetSearchFormSorterItems:O});const ce=e.computed(()=>s.value.some(t=>t.fixed==="left"||t.fixed===!0)?"left":void 0),ie=e.computed(()=>i.isUndefined(o.loading)?d.loading:o.loading),de=e.computed(()=>i.isUndefined(o.dataSource)?d.records:o.dataSource),{selectedRows:k,rowSelection:f,...C}=Be.default({...o.rowSelection===!0?{}:o.rowSelection,dataSource:de,rowKey:o.rowKey}),fe=({checked:t,row:r})=>{const n=l.value;if(n&&n){const a=[...n.getCheckboxReserveRecords(),...n.getCheckboxRecords()];C.selectChange(r,t,a)}},pe=({checked:t})=>{const r=l.value;r&&C.selectAllChange(t,[...r.getCheckboxReserveRecords(),...r.getCheckboxRecords()])},me=()=>{const t=l.value;t&&C.selectRangeChange(t.getCheckboxRecords(),[...t.getCheckboxReserveRecords(),...t.getCheckboxRecords()])},ge=()=>{const t=l.value;t&&(k.value=[t.getRadioRecord()])},Ce=({row:t})=>{const r=o.rowHighlightable;i.isFunction(r)&&r(t)};function he(){var t;return((t=o.columns)==null?void 0:t.filter(r=>!r.hideInTable))||[]}function A(t){var r,n,a;(a=(n=(r=m.value)==null?void 0:r.apForm)==null?void 0:n.setFieldsValue)==null||a.call(n,t)}function L(t=!1){var n,a,c;const r=t?"getFieldsValueTransformed":"getFieldsValue";return(c=(a=(n=m.value)==null?void 0:n.apForm)==null?void 0:a[r])==null?void 0:c.call(a,!0)}function K(){var t;return((t=m.value)==null?void 0:t.getSorterItems())||[]}function D(t){var r;(r=m.value)==null||r.setSorterItems(t)}function O(){var t;(t=m.value)==null||t.resetSorterItems()}function B(){C.clearAll();const t=l.value;t&&(f.value.type==="radio"?(t.clearRadioRow(),t.clearRadioReserve()):(t.clearCheckboxRow(),t.clearCheckboxReserve()))}function ve(t){i.isFunction(o.rowKey)||(C.selectMultiByKeys(t),$())}function ye(t){const r=l.value;if(!r)return;const n=String(t[o.rowKey]),a=r.getRowById(n);r.setCurrentRow(a)}function Se(){const t=l.value;t&&(t.clearSort(),t.clearFilter())}function $(){e.nextTick(()=>{var t,r;f.value.type==="radio"?(t=l.value)==null||t.setRadioRowKey(f.value.selectedRowKeys[0]):(r=l.value)==null||r.setCheckboxRowKey(f.value.selectedRowKeys,!0)})}async function we(t,r){var a;const n=d.records[t];if(n)return(a=l.value)==null?void 0:a.scrollToRow(n,r)}return e.watch(()=>[o.columnResizable,o.columns],()=>{var r;const t=he();s.value=t,(r=o.onShownColumnsChange)==null||r.call(o,t),I.value=t},{deep:!0,immediate:!0}),e.watch(()=>o.dataSource,t=>{re(t)},{immediate:!0,deep:!0}),e.watch(()=>e.unref(d).loading,t=>{var r;(r=o.onLoadingChange)==null||r.call(o,t)}),e.watch(()=>o.size,t=>{w.value=t}),W({submit:R,reset:x,refresh:z,submitWith:_,setSearchFormValues:A,getSearchFormValues:L,getShowColumns:()=>e.unref(s),rowSelection:{selectedRows:e.computed(()=>k.value),setSelectedRowKeys:ve,clearAll:B},scrollToRow:we,getDataSource:()=>e.unref(d.records),setCurrentRow:ye,getPaging:ae,setPaging:ne,getSearchFormSorterItems:K,setSearchFormSorterItems:D,resetSearchFormSorterItems:O}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(te.value),style:e.normalizeStyle(t.wrapperStyle)},[e.unref(i.isUndefined)(t.dataSource)&&t.searchForm!==!1&&P.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.card?e.unref(S)("search-wrapper"):null),style:e.normalizeStyle(t.searchFormWrapperStyle)},[e.createVNode(e.unref(be.ApForm).SearchForm,e.mergeProps(t.searchForm||{},{ref_key:"formRef",ref:m,"custom-reset":"","submit-loading":e.unref(T).loading,onSubmit:e.unref(R),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode),{key:n.dataIndex}))),128))]),_:2},[g.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(S)("table-wrapper"),t.card?e.unref(S)("table-wrapper-card"):null]),style:e.normalizeStyle(t.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("header-wrapper"))},[e.renderSlot(t.$slots,"title",{selectedRows:e.unref(k),selectedRowKeys:e.unref(f).selectedRowKeys,shownColumns:s.value,clearAll:B})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("vxe-wrapper"))},[(e.openBlock(),e.createBlock(e.unref(v.VxeTable),e.mergeProps(e.unref(F.toVxeProps)(o),{ref_key:"tableRef",ref:l,key:e.unref(Y),data:e.unref(d).records,"sort-config":{remote:V.value.length>0,trigger:"cell"},"filter-config":{remote:q.value.length>0},loading:ie.value,style:e.unref(G),size:w.value,onSortChange:e.unref(le),onFilterChange:e.unref(se),onCheckboxChange:fe,onCheckboxRangeChange:me,onCheckboxAll:pe,onRadioChange:ge,onCurrentChange:Ce}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(b.Empty),{image:e.unref(b.Empty).PRESENTED_IMAGE_SIMPLE},null,8,["image"])]),loading:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(S)("table-loading-wrapper"))},[e.createVNode(e.unref(b.Spin))],2)]),default:e.withCtx(()=>[o.expandable&&s.value.length?(e.openBlock(),e.createBlock(e.unref(v.VxeColumn),e.mergeProps({key:0},e.unref(F.getRowExpandProps)(t.expandable),{fixed:ce.value}),{content:e.withCtx(n=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.expandable.renderContent(n))))]),_:1},16,["fixed"])):e.createCommentVNode("",!0),o.rowSelection&&s.value.length?(e.openBlock(),e.createBlock(e.unref(v.VxeColumn),e.mergeProps({key:1},e.unref(F.getRowSelectionProps)(e.unref(f),s.value),{field:e.unref(E.ROW_SELECTION_FIELD)}),null,16,["field"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Q),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{key:n.props.colId}))),128))]),_:2},[e.renderList(e.unref(i.omit)(g,["searchFormExtra"]),(n,a)=>({name:a,fn:e.withCtx(c=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040,["data","sort-config","filter-config","loading","style","size","onSortChange","onFilterChange"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("pagination-wrapper"))},[t.sticky?(e.openBlock(),e.createBlock(e.unref(_e.default),{key:0,direction:"horizontal","scroll-container":Z.value,"extra-size":-4.2,"bar-color":"var(--ap-scrollbar-thumb-color-base)","track-color":"var(--ap-table-header-bg, #f2f6f9)"},null,8,["scroll-container"])):e.createCommentVNode("",!0),t.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(b.Pagination),e.mergeProps({key:1,class:e.unref(u)("pagination")},e.unref(T).pagination,{onChange:e.unref(ue)}),null,16,["class","onChange"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=Ae;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("vxe-table");require("vxe-table/es/style.css");const i=require("lodash-unified"),be=require("../ap-form/index.js");require("../config-provider/index.js");const Re=require("../ap-table/constants.js"),p=require("../ap-table/utils.js"),xe=require("../ap-table/hooks/use-table-paging-ng.js"),b=require("@aplus-frontend/antdv"),ke=require("./hooks/use-inner-params.js"),F=require("./utils/table.js"),Be=require("./hooks/use-row-selection.js"),Fe=require("../ap-table/context.js"),E=require("./constants.js"),Ee=require("./hooks/use-render-columns.js"),Ie=require("@aplus-frontend/antdv/es/theme/internal");require("../scroll-bar/index.js");const Ne=require("../utils/index.js"),Pe=require("../utils/slot.js"),Ve=require("./hooks/use-table-style.js"),qe=require("../config-provider/hooks/use-namespace.js"),ze=require("../config-provider/hooks/use-global-config.js"),Te=require("../config-provider/hooks/use-locale.js"),_e=require("../scroll-bar/index.vue.js"),Ae=e.defineComponent({name:"ApGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!1},prefixCls:{},tableLayout:{},title:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object],default:!1},transformCellText:{},rowClassName:{},stripe:{type:Boolean},headerRowClassName:{},footerRowClassName:{},cellClassName:{},headerCellClassName:{},footerCellClassName:{},rowStyle:{},headerRowStyle:{},footerRowStyle:{},cellStyle:{},headerCellStyle:{},footerCellStyle:{},height:{},minHeight:{},maxHeight:{},mergeCells:{},mergeFooterItems:{},cellConfig:{},loading:{type:Boolean,default:void 0},loadingConfig:{},headerCellConfig:{},footerCellConfig:{},round:{type:Boolean,default:void 0},columns:{},rowSelection:{type:Boolean},card:{type:Boolean,default:!1},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean,default:!1},columnResizable:{type:[Boolean,Object],default:!1},rowKey:{default:"key"},footer:{},virtual:{type:[Boolean,Object],default:void 0},expandable:{},value:{},rowHighlightable:{type:[Boolean,Function],default:!1},treeConfig:{}},setup(M,{expose:W}){var U;const g=e.useSlots(),o=M,y=(U=e.getCurrentInstance())==null?void 0:U.appContext.app;y&&!y.__VXE_PC_UI_INSTALLED__&&(y.use(v.VxeUI),y.__VXE_PC_UI_INSTALLED__=!0);const{e:S,b:u,be:j}=qe.useNamespace("ap-grid"),H=ze.useGlobalConfig("valueTypeMap"),s=e.ref([]),I=e.ref([]),l=e.ref(),w=e.ref(o.size),G=Ve.useTableStyle(),[,X]=Ie.useToken(),{t:J}=Te.useLocale();v.VxeUI.setConfig({i18n:(t,r)=>J(`ap.${t}`,r)});const{renderConfig:Q,updateSignal:Y}=Ee.useRenderColumns(s);let N=0;const Z=e.computed(()=>{if(l.value)return l.value.$el.querySelector(".vxe-table--header-inner-wrapper")}),P=e.computed(()=>{var t,r,n;return N++,((n=(r=(t=o.columns)==null?void 0:t.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!Re.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:r.sort((a,c)=>{let h=p.getColumnOrder(a.order);return p.getColumnOrder(c.order)-h}))==null?void 0:n.map(a=>{const c=p.updateFormProps(a,p.getFieldProps(a.fieldProps,{})),h={...a,fieldProps:{label:a.title,name:a.dataIndex,bordered:!0,...c||{},_signal:N},renderNode:void 0};return h.renderNode=p.getSearchFormItemRenderNode(h,e.unref(H)),h}))||[]}),ee=e.computed(()=>{var r;return Ne.isDef(o.manual)?o.manual:Pe.getValidVNodeList(((r=g.searchFormExtra)==null?void 0:r.call(g))||[]).some(n=>{var a;return((a=n.type)==null?void 0:a.name)==="ApView"})}),te=e.computed(()=>[u(),o.card?null:u("wrapper"),o.adaptive?u("adaptive"):null,o.sticky?u("sticky"):null].filter(Boolean)),V=e.computed(()=>p.recursionApColumns(e.unref(s),t=>{if(t.sorter===!0)return t.key||t.dataIndex}).filter(Boolean)),q=e.computed(()=>p.recursionApColumns(e.unref(s),t=>{if(t.filters&&!t.onFilter)return t.key||t.dataIndex}).filter(Boolean)),{formRef:m,submit:R,reset:x,refresh:z,data:d,tableProps:T,setDataSource:re,handleTableChangeOptional:oe,getPaging:ae,setPaging:ne,submitWith:_}=xe.useTablePaging({async request(t){var n;if(!f.value.preserveSelectedRowKeys&&i.isUndefined(o.dataSource)&&B(),!i.isUndefined(o.dataSource)){const a=t.pageSize*(t.current-1);return{data:(o.pagination===!1?o.dataSource:o.dataSource.slice(a,a+t.pageSize))||[],total:o.dataSource.length||0}}const r=await((n=o.request)==null?void 0:n.call(o,t));return{data:(r==null?void 0:r.data)||[],total:(r==null?void 0:r.total)||0}},namespace:"ap-grid",filterFields:q,sortFields:V,params:e.toRef(o,"params"),defaultData:o.defaultData,manual:e.unref(ee),formatParams:o.beforeSearchSubmit,pagination:o.pagination,onClickReset:Se,onAfterRequest:$}),{sortChangeEvent:le,filterChangeEvent:se,paginationChangeEvent:ue}=ke.useInnerParams(oe);Fe.useProvideApTable({columns:e.computed(()=>s.value),columnsBackup:e.computed(()=>I.value),size:e.computed(()=>E.sizeMap[w.value]),updateColumns(t){var r;s.value=t,(r=o.onShownColumnsChange)==null||r.call(o,t)},updateSize(t){w.value=E.sizeReverseMap[t]},renderConfig:e.computed(()=>({className:j("table-header","title"),color:X.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(d).records),getSearchFormValues:L,setSearchFormValues:A,submit:R,submitWith:_,reset:x,refresh:z,getSearchFormSorterItems:K,setSearchFormSorterItems:D,resetSearchFormSorterItems:O});const ce=e.computed(()=>s.value.some(t=>t.fixed==="left"||t.fixed===!0)?"left":void 0),ie=e.computed(()=>i.isUndefined(o.loading)?d.loading:o.loading),de=e.computed(()=>i.isUndefined(o.dataSource)?d.records:o.dataSource),{selectedRows:k,rowSelection:f,...C}=Be.default({...o.rowSelection===!0?{}:o.rowSelection,dataSource:de,rowKey:o.rowKey}),fe=({checked:t})=>{const r=l.value;r&&r&&C.selectChange(t,r.getCheckboxRecords(),r.getCheckboxReserveRecords())},pe=({checked:t})=>{const r=l.value;r&&C.selectAllChange(t,[...r.getCheckboxReserveRecords(),...r.getCheckboxRecords()])},me=()=>{const t=l.value;t&&C.selectRangeChange(t.getCheckboxRecords(),[...t.getCheckboxReserveRecords(),...t.getCheckboxRecords()])},ge=()=>{const t=l.value;t&&(k.value=[t.getRadioRecord()])},Ce=({row:t})=>{const r=o.rowHighlightable;i.isFunction(r)&&r(t)};function he(){var t;return((t=o.columns)==null?void 0:t.filter(r=>!r.hideInTable))||[]}function A(t){var r,n,a;(a=(n=(r=m.value)==null?void 0:r.apForm)==null?void 0:n.setFieldsValue)==null||a.call(n,t)}function L(t=!1){var n,a,c;const r=t?"getFieldsValueTransformed":"getFieldsValue";return(c=(a=(n=m.value)==null?void 0:n.apForm)==null?void 0:a[r])==null?void 0:c.call(a,!0)}function K(){var t;return((t=m.value)==null?void 0:t.getSorterItems())||[]}function D(t){var r;(r=m.value)==null||r.setSorterItems(t)}function O(){var t;(t=m.value)==null||t.resetSorterItems()}function B(){C.clearAll();const t=l.value;t&&(f.value.type==="radio"?(t.clearRadioRow(),t.clearRadioReserve()):(t.clearCheckboxRow(),t.clearCheckboxReserve()))}function ve(t){i.isFunction(o.rowKey)||(C.selectMultiByKeys(t),$())}function ye(t){const r=l.value;if(!r)return;const n=String(t[o.rowKey]),a=r.getRowById(n);r.setCurrentRow(a)}function Se(){const t=l.value;t&&(t.clearSort(),t.clearFilter())}function $(){e.nextTick(()=>{var t,r;f.value.type==="radio"?(t=l.value)==null||t.setRadioRowKey(f.value.selectedRowKeys[0]):(r=l.value)==null||r.setCheckboxRowKey(f.value.selectedRowKeys,!0)})}async function we(t,r){var a;const n=d.records[t];if(n)return(a=l.value)==null?void 0:a.scrollToRow(n,r)}return e.watch(()=>[o.columnResizable,o.columns],()=>{var r;const t=he();s.value=t,(r=o.onShownColumnsChange)==null||r.call(o,t),I.value=t},{deep:!0,immediate:!0}),e.watch(()=>o.dataSource,t=>{re(t)},{immediate:!0,deep:!0}),e.watch(()=>e.unref(d).loading,t=>{var r;(r=o.onLoadingChange)==null||r.call(o,t)}),e.watch(()=>o.size,t=>{w.value=t}),W({submit:R,reset:x,refresh:z,submitWith:_,setSearchFormValues:A,getSearchFormValues:L,getShowColumns:()=>e.unref(s),rowSelection:{selectedRows:e.computed(()=>k.value),setSelectedRowKeys:ve,clearAll:B},scrollToRow:we,getDataSource:()=>e.unref(d.records),setCurrentRow:ye,getPaging:ae,setPaging:ne,getSearchFormSorterItems:K,setSearchFormSorterItems:D,resetSearchFormSorterItems:O}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(te.value),style:e.normalizeStyle(t.wrapperStyle)},[e.unref(i.isUndefined)(t.dataSource)&&t.searchForm!==!1&&P.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.card?e.unref(S)("search-wrapper"):null),style:e.normalizeStyle(t.searchFormWrapperStyle)},[e.createVNode(e.unref(be.ApForm).SearchForm,e.mergeProps(t.searchForm||{},{ref_key:"formRef",ref:m,"custom-reset":"","submit-loading":e.unref(T).loading,onSubmit:e.unref(R),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode),{key:n.dataIndex}))),128))]),_:2},[g.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(S)("table-wrapper"),t.card?e.unref(S)("table-wrapper-card"):null]),style:e.normalizeStyle(t.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("header-wrapper"))},[e.renderSlot(t.$slots,"title",{selectedRows:e.unref(k),selectedRowKeys:e.unref(f).selectedRowKeys,shownColumns:s.value,clearAll:B})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("vxe-wrapper"))},[(e.openBlock(),e.createBlock(e.unref(v.VxeTable),e.mergeProps(e.unref(F.toVxeProps)(o),{ref_key:"tableRef",ref:l,key:e.unref(Y),data:e.unref(d).records,"sort-config":{remote:V.value.length>0,trigger:"cell"},"filter-config":{remote:q.value.length>0},loading:ie.value,style:e.unref(G),size:w.value,onSortChange:e.unref(le),onFilterChange:e.unref(se),onCheckboxChange:fe,onCheckboxRangeChange:me,onCheckboxAll:pe,onRadioChange:ge,onCurrentChange:Ce}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(b.Empty),{image:e.unref(b.Empty).PRESENTED_IMAGE_SIMPLE},null,8,["image"])]),loading:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(S)("table-loading-wrapper"))},[e.createVNode(e.unref(b.Spin))],2)]),default:e.withCtx(()=>[o.expandable&&s.value.length?(e.openBlock(),e.createBlock(e.unref(v.VxeColumn),e.mergeProps({key:0},e.unref(F.getRowExpandProps)(t.expandable),{fixed:ce.value}),{content:e.withCtx(n=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.expandable.renderContent(n))))]),_:1},16,["fixed"])):e.createCommentVNode("",!0),o.rowSelection&&s.value.length?(e.openBlock(),e.createBlock(e.unref(v.VxeColumn),e.mergeProps({key:1},e.unref(F.getRowSelectionProps)(e.unref(f),s.value),{field:e.unref(E.ROW_SELECTION_FIELD)}),null,16,["field"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Q),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{key:n.props.colId}))),128))]),_:2},[e.renderList(e.unref(i.omit)(g,["searchFormExtra"]),(n,a)=>({name:a,fn:e.withCtx(c=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040,["data","sort-config","filter-config","loading","style","size","onSortChange","onFilterChange"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("pagination-wrapper"))},[t.sticky?(e.openBlock(),e.createBlock(e.unref(_e.default),{key:0,direction:"horizontal","scroll-container":Z.value,"extra-size":-4.2,"bar-color":"var(--ap-scrollbar-thumb-color-base)","track-color":"var(--ap-table-header-bg, #f2f6f9)"},null,8,["scroll-container"])):e.createCommentVNode("",!0),t.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(b.Pagination),e.mergeProps({key:1,class:e.unref(u)("pagination")},e.unref(T).pagination,{onChange:e.unref(ue)}),null,16,["class","onChange"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=Ae;
@@ -1,4 +1,6 @@
1
+ import { ApColumnType } from '../../ap-table/interface';
2
+ import { ApGridColumnType } from './../../ap-grid/interface';
1
3
  import { ColumnType } from '@aplus-frontend/antdv/es/table';
2
- export declare const convertExportField: (columns: ColumnType[], convertField?: {
4
+ export declare const convertExportField: (columns: ColumnType[] | ApGridColumnType[] | ApColumnType[], convertField?: {
3
5
  [key: string]: string[];
4
6
  }) => any[];
@@ -1,2 +1,2 @@
1
- declare const _default: "6.13.4";
1
+ declare const _default: "6.14.0";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.13.4";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.14.0";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "6.13.4",
3
+ "version": "6.14.0",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -264,18 +264,6 @@
264
264
  [data-aplus-ui-mode='aplus'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
265
265
  color: #abb7cc;
266
266
  }
267
- [data-aplus-ui-mode='aplus'] input[disabled].ant-input {
268
- color: var(--ap-text-color-1);
269
- }
270
- [data-aplus-ui-mode='aplus'] textarea[disabled].ant-input {
271
- color: var(--ap-text-color-1);
272
- }
273
- [data-aplus-ui-mode='aplus'] .ant-picker.ant-picker-disabled .ant-picker-input > input[disabled] {
274
- color: var(--ap-text-color-1);
275
- }
276
- [data-aplus-ui-mode='aplus'] .ant-select-disabled .ant-select-selection-item {
277
- color: var(--ap-text-color-1) !important;
278
- }
279
267
  [data-aplus-ui-mode='aplus'] .ant-input-clear-icon {
280
268
  line-height: 18px;
281
269
  }
@@ -555,18 +543,6 @@
555
543
  [data-aplus-ui-mode='admin'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
556
544
  color: #bfbfbf;
557
545
  }
558
- [data-aplus-ui-mode='admin'] input[disabled].ant-input {
559
- color: var(--ap-text-color-1);
560
- }
561
- [data-aplus-ui-mode='admin'] textarea[disabled].ant-input {
562
- color: var(--ap-text-color-1);
563
- }
564
- [data-aplus-ui-mode='admin'] .ant-picker.ant-picker-disabled .ant-picker-input > input[disabled] {
565
- color: var(--ap-text-color-1);
566
- }
567
- [data-aplus-ui-mode='admin'] .ant-select-disabled .ant-select-selection-item {
568
- color: var(--ap-text-color-1) !important;
569
- }
570
546
  [data-aplus-ui-mode='admin'] .ant-input-clear-icon {
571
547
  line-height: 18px;
572
548
  }
@@ -1,5 +1,4 @@
1
1
  @import './mixins/config.less';
2
-
3
2
  @tw: ~'@{ns}-ap-table__table-wrapper';
4
3
  @sb: ~'@{ns}-scroll-bar';
5
4
 
@@ -303,22 +302,6 @@
303
302
  color: #abb7cc;
304
303
  }
305
304
 
306
- input[disabled].ant-input {
307
- color: var(--ap-text-color-1);
308
- }
309
-
310
- textarea[disabled].ant-input {
311
- color: var(--ap-text-color-1);
312
- }
313
-
314
- .ant-picker.ant-picker-disabled .ant-picker-input > input[disabled] {
315
- color: var(--ap-text-color-1);
316
- }
317
-
318
- .ant-select-disabled .ant-select-selection-item {
319
- color: var(--ap-text-color-1) !important;
320
- }
321
-
322
305
  .ant-input-clear-icon {
323
306
  line-height: 18px;
324
307
  }
@@ -637,22 +620,6 @@
637
620
  color: #bfbfbf;
638
621
  }
639
622
 
640
- input[disabled].ant-input {
641
- color: var(--ap-text-color-1);
642
- }
643
-
644
- textarea[disabled].ant-input {
645
- color: var(--ap-text-color-1);
646
- }
647
-
648
- .ant-picker.ant-picker-disabled .ant-picker-input > input[disabled] {
649
- color: var(--ap-text-color-1);
650
- }
651
-
652
- .ant-select-disabled .ant-select-selection-item {
653
- color: var(--ap-text-color-1) !important;
654
- }
655
-
656
623
  .ant-input-clear-icon {
657
624
  line-height: 18px;
658
625
  }
package/theme/css-var.css CHANGED
@@ -23,6 +23,7 @@
23
23
  --ap-color-bg-2: #f3f5f8;
24
24
  --ap-scrollbar-thumb-color-base: #c8d1de;
25
25
  --ap-scrollbar-thumb-color-hover: #959ca7;
26
+ --ap-scrollbar-track-color-hover: #f2f6f9;
26
27
  --ap-text-color-4: #abb7cc;
27
28
  --batch-input-group-trigger-color-disabled: rgba(24, 41, 72, 0.25);
28
29
  --ap-radio-group-item-active-bg-color: rgba(0, 112, 255, 0.12);
@@ -54,6 +55,7 @@
54
55
  --ap-color-bg-2: #f5f5f5;
55
56
  --ap-scrollbar-thumb-color-base: #bfbfbf;
56
57
  --ap-scrollbar-thumb-color-hover: #787878;
58
+ --ap-scrollbar-track-color-hover: #f7f7f7;
57
59
  --ap-text-color-4: #bfbfbf;
58
60
  --batch-input-group-trigger-color-disabled: rgba(0, 0, 0, 0.25);
59
61
  --ap-radio-group-item-active-bg-color: rgba(52, 183, 124, 0.12);
@@ -47,6 +47,8 @@
47
47
  --ap-scrollbar-thumb-color-base: #c8d1de;
48
48
  // 滚动条滑动块hover色
49
49
  --ap-scrollbar-thumb-color-hover: #959ca7;
50
+ // 滚动条轨道颜色
51
+ --ap-scrollbar-track-color-hover: #f2f6f9;
50
52
  // 文本颜色4号色(三级)
51
53
  --ap-text-color-4: #abb7cc;
52
54
  // 批量输入组禁用色
@@ -102,6 +104,8 @@
102
104
  --ap-scrollbar-thumb-color-base: #bfbfbf;
103
105
  // 滚动条滑动块基础色
104
106
  --ap-scrollbar-thumb-color-hover: #787878;
107
+ // 滚动条轨道颜色
108
+ --ap-scrollbar-track-color-hover: #f7f7f7;
105
109
  // 文本颜色4号色(三级)
106
110
  --ap-text-color-4: #bfbfbf;
107
111
  // 批量输入组禁用色
package/theme/index.css CHANGED
@@ -23,6 +23,7 @@
23
23
  --ap-color-bg-2: #f3f5f8;
24
24
  --ap-scrollbar-thumb-color-base: #c8d1de;
25
25
  --ap-scrollbar-thumb-color-hover: #959ca7;
26
+ --ap-scrollbar-track-color-hover: #f2f6f9;
26
27
  --ap-text-color-4: #abb7cc;
27
28
  --batch-input-group-trigger-color-disabled: rgba(24, 41, 72, 0.25);
28
29
  --ap-radio-group-item-active-bg-color: rgba(0, 112, 255, 0.12);
@@ -54,6 +55,7 @@
54
55
  --ap-color-bg-2: #f5f5f5;
55
56
  --ap-scrollbar-thumb-color-base: #bfbfbf;
56
57
  --ap-scrollbar-thumb-color-hover: #787878;
58
+ --ap-scrollbar-track-color-hover: #f7f7f7;
57
59
  --ap-text-color-4: #bfbfbf;
58
60
  --batch-input-group-trigger-color-disabled: rgba(0, 0, 0, 0.25);
59
61
  --ap-radio-group-item-active-bg-color: rgba(52, 183, 124, 0.12);
@@ -331,18 +333,6 @@
331
333
  [data-aplus-ui-mode='aplus'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
332
334
  color: #abb7cc;
333
335
  }
334
- [data-aplus-ui-mode='aplus'] input[disabled].ant-input {
335
- color: var(--ap-text-color-1);
336
- }
337
- [data-aplus-ui-mode='aplus'] textarea[disabled].ant-input {
338
- color: var(--ap-text-color-1);
339
- }
340
- [data-aplus-ui-mode='aplus'] .ant-picker.ant-picker-disabled .ant-picker-input > input[disabled] {
341
- color: var(--ap-text-color-1);
342
- }
343
- [data-aplus-ui-mode='aplus'] .ant-select-disabled .ant-select-selection-item {
344
- color: var(--ap-text-color-1) !important;
345
- }
346
336
  [data-aplus-ui-mode='aplus'] .ant-input-clear-icon {
347
337
  line-height: 18px;
348
338
  }
@@ -622,18 +612,6 @@
622
612
  [data-aplus-ui-mode='admin'] .ant-input-number .ant-input-number-input-wrap > input::placeholder {
623
613
  color: #bfbfbf;
624
614
  }
625
- [data-aplus-ui-mode='admin'] input[disabled].ant-input {
626
- color: var(--ap-text-color-1);
627
- }
628
- [data-aplus-ui-mode='admin'] textarea[disabled].ant-input {
629
- color: var(--ap-text-color-1);
630
- }
631
- [data-aplus-ui-mode='admin'] .ant-picker.ant-picker-disabled .ant-picker-input > input[disabled] {
632
- color: var(--ap-text-color-1);
633
- }
634
- [data-aplus-ui-mode='admin'] .ant-select-disabled .ant-select-selection-item {
635
- color: var(--ap-text-color-1) !important;
636
- }
637
615
  [data-aplus-ui-mode='admin'] .ant-input-clear-icon {
638
616
  line-height: 18px;
639
617
  }
package/theme/reset.css CHANGED
@@ -255,3 +255,21 @@ mark {
255
255
  padding: 0.2em;
256
256
  background-color: #feffe6;
257
257
  }
258
+ ::-webkit-scrollbar {
259
+ width: 10px;
260
+ height: 10px;
261
+ }
262
+ ::-webkit-scrollbar-thumb {
263
+ background-color: var(--ap-scrollbar-thumb-color-base);
264
+ background-clip: content-box;
265
+ border: 1px solid transparent;
266
+ border-radius: 4px;
267
+ }
268
+ ::-webkit-scrollbar-track,
269
+ ::-webkit-scrollbar-corner {
270
+ background-color: var(--ap-scrollbar-track-color-hover, #f2f6f9);
271
+ }
272
+ ::-webkit-scrollbar-thumb:hover,
273
+ ::-webkit-scrollbar-thumb:active {
274
+ background-color: var(--ap-scrollbar-thumb-color-hover);
275
+ }
package/theme/reset.less CHANGED
@@ -118,8 +118,8 @@ code,
118
118
  kbd,
119
119
  samp {
120
120
  font-size: 1em;
121
- font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier,
122
- monospace;
121
+ font-family:
122
+ 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
123
123
  }
124
124
  pre {
125
125
  margin-top: 0;
@@ -255,3 +255,27 @@ mark {
255
255
  padding: 0.2em;
256
256
  background-color: #feffe6;
257
257
  }
258
+
259
+ // scrolbar reset
260
+
261
+ ::-webkit-scrollbar {
262
+ width: 10px;
263
+ height: 10px;
264
+ }
265
+
266
+ ::-webkit-scrollbar-thumb {
267
+ background-color: var(--ap-scrollbar-thumb-color-base);
268
+ background-clip: content-box;
269
+ border: 1px solid transparent;
270
+ border-radius: 4px;
271
+ }
272
+
273
+ ::-webkit-scrollbar-track,
274
+ ::-webkit-scrollbar-corner {
275
+ background-color: var(--ap-scrollbar-track-color-hover, #f2f6f9);
276
+ }
277
+
278
+ ::-webkit-scrollbar-thumb:hover,
279
+ ::-webkit-scrollbar-thumb:active {
280
+ background-color: var(--ap-scrollbar-thumb-color-hover);
281
+ }