@aplus-frontend/ui 6.41.2 → 6.41.3

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.
@@ -22,8 +22,6 @@ export interface UsePageListAgGrid extends AgGridProps {
22
22
  * @default true
23
23
  */
24
24
  clearDataOnDeactivated?: boolean;
25
- /** 绑定ref */
26
- onRef?: (expose: AgGridExpose) => void;
27
25
  }
28
26
  /**
29
27
  * 集成了列表页面的AgGrid的默认配置
@@ -1,44 +1,43 @@
1
- import { isFunction as A, merge as F, cloneDeep as R } from "lodash-unified";
2
- import { ref as w } from "vue";
3
- import { useKeepAliveFlag as V } from "./useKeepAliveFlag.mjs";
4
- function W(l) {
5
- const r = w(null), {
1
+ import { isFunction as g, merge as A, cloneDeep as F } from "lodash-unified";
2
+ import { ref as V } from "vue";
3
+ import { useKeepAliveFlag as w } from "./useKeepAliveFlag.mjs";
4
+ function O(l) {
5
+ const r = V(null), {
6
6
  isShowRowSelection: u = !0,
7
7
  clearSelectionOnRequest: d = !0,
8
8
  transformSearchFormValues: o,
9
- api: s,
10
- tableRefresh: n = !0,
9
+ api: a,
10
+ tableRefresh: s = !0,
11
11
  clearDataOnDeactivated: f = !0,
12
- onRef: m,
13
- ...p
12
+ ...m
14
13
  } = l || {};
15
- let a = null;
14
+ let n = null;
16
15
  const i = () => {
17
16
  r.value?.rowSelection?.clearAll();
18
17
  }, c = (e) => {
19
18
  r.value?.submitWith(e);
20
- }, g = () => {
19
+ }, p = () => {
21
20
  r.value?.reset();
22
- }, { isDeactivated: h } = V({
21
+ }, { isDeactivated: h } = w({
23
22
  afterActivated() {
24
- (A(n) ? n() : n) && c();
23
+ (g(s) ? s() : s) && c();
25
24
  },
26
25
  afterDeactivated: c
27
26
  });
28
- return [F(
27
+ return [A(
29
28
  {
30
29
  // scroll,tableLayout,columnResizable设置表格可拖动
31
30
  columnResizable: !0,
32
- request: s ? async (e) => {
31
+ request: a ? async (e) => {
33
32
  if (h() && f)
34
33
  return {
35
34
  data: [],
36
35
  total: 0
37
36
  };
38
- a = e.sort, console.log("_sortedInfo", a);
37
+ n = e.sort;
39
38
  const t = o ? o(e) : e;
40
- if (!s) throw new Error("api is not defined");
41
- const { records: v, total: S } = await s(t);
39
+ if (!a) throw new Error("api is not defined");
40
+ const { records: v, total: S } = await a(t);
42
41
  return d && i(), {
43
42
  data: v,
44
43
  total: S
@@ -48,16 +47,17 @@ function W(l) {
48
47
  fixed: "left",
49
48
  columnWidth: 38
50
49
  } : void 0,
51
- ref(e) {
52
- r.value = e, m?.(e);
50
+ /** Jackie 推荐方法 */
51
+ onVnodeBeforeMount(e) {
52
+ r.value = e.component?.exposed;
53
53
  },
54
54
  // 新UI规范,需要都添加分割线
55
55
  card: !0
56
56
  },
57
- p
57
+ m
58
58
  ), {
59
59
  reload: c,
60
- reset: g,
60
+ reset: p,
61
61
  getSearchFormValues: (e = !0) => {
62
62
  const t = r.value?.getSearchFormValues(!!e) || {};
63
63
  return o ? o(t) : t;
@@ -65,11 +65,11 @@ function W(l) {
65
65
  getAgGridInstance: () => r.value,
66
66
  getSearchFormValuesAndSorted: (e = !0) => {
67
67
  const t = r.value?.getSearchFormValues(!!e) || {};
68
- return t.sort = a && R(a), o ? o(t) : t;
68
+ return t.sort = n && F(n), o ? o(t) : t;
69
69
  },
70
70
  clearSelection: i
71
71
  }];
72
72
  }
73
73
  export {
74
- W as usePageListAgGrid
74
+ O as usePageListAgGrid
75
75
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "6.41.2";
1
+ declare const _default: "6.41.3";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "6.41.2";
1
+ const e = "6.41.3";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -22,8 +22,6 @@ export interface UsePageListAgGrid extends AgGridProps {
22
22
  * @default true
23
23
  */
24
24
  clearDataOnDeactivated?: boolean;
25
- /** 绑定ref */
26
- onRef?: (expose: AgGridExpose) => void;
27
25
  }
28
26
  /**
29
27
  * 集成了列表页面的AgGrid的默认配置
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash-unified"),R=require("vue"),q=require("./useKeepAliveFlag.js");function w(u){const r=R.ref(null),{isShowRowSelection:d=!0,clearSelectionOnRequest:f=!0,transformSearchFormValues:o,api:s,tableRefresh:n=!0,clearDataOnDeactivated:g=!0,onRef:v,...S}=u||{};let a=null;const l=()=>{r.value?.rowSelection?.clearAll()},i=e=>{r.value?.submitWith(e)},h=()=>{r.value?.reset()},{isDeactivated:p}=q.useKeepAliveFlag({afterActivated(){(c.isFunction(n)?n():n)&&i()},afterDeactivated:i}),m=async e=>{if(p()&&g)return{data:[],total:0};a=e.sort,console.log("_sortedInfo",a);const t=o?o(e):e;if(!s)throw new Error("api is not defined");const{records:A,total:F}=await s(t);return f&&l(),{data:A,total:F}};return[c.merge({columnResizable:!0,request:s?m:void 0,rowSelection:d?{fixed:"left",columnWidth:38}:void 0,ref(e){r.value=e,v?.(e)},card:!0},S),{reload:i,reset:h,getSearchFormValues:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return o?o(t):t},getAgGridInstance:()=>r.value,getSearchFormValuesAndSorted:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return t.sort=a&&c.cloneDeep(a),o?o(t):t},clearSelection:l}]}exports.usePageListAgGrid=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash-unified"),F=require("vue"),V=require("./useKeepAliveFlag.js");function q(l){const r=F.ref(null),{isShowRowSelection:d=!0,clearSelectionOnRequest:f=!0,transformSearchFormValues:o,api:a,tableRefresh:s=!0,clearDataOnDeactivated:g=!0,...v}=l||{};let n=null;const u=()=>{r.value?.rowSelection?.clearAll()},i=e=>{r.value?.submitWith(e)},p=()=>{r.value?.reset()},{isDeactivated:S}=V.useKeepAliveFlag({afterActivated(){(c.isFunction(s)?s():s)&&i()},afterDeactivated:i}),h=async e=>{if(S()&&g)return{data:[],total:0};n=e.sort;const t=o?o(e):e;if(!a)throw new Error("api is not defined");const{records:m,total:A}=await a(t);return f&&u(),{data:m,total:A}};return[c.merge({columnResizable:!0,request:a?h:void 0,rowSelection:d?{fixed:"left",columnWidth:38}:void 0,onVnodeBeforeMount(e){r.value=e.component?.exposed},card:!0},v),{reload:i,reset:p,getSearchFormValues:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return o?o(t):t},getAgGridInstance:()=>r.value,getSearchFormValuesAndSorted:(e=!0)=>{const t=r.value?.getSearchFormValues(!!e)||{};return t.sort=n&&c.cloneDeep(n),o?o(t):t},clearSelection:u}]}exports.usePageListAgGrid=q;
@@ -1,2 +1,2 @@
1
- declare const _default: "6.41.2";
1
+ declare const _default: "6.41.3";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.41.2";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.41.3";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "6.41.2",
3
+ "version": "6.41.3",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [