@aplus-frontend/ui 7.19.6 → 7.19.8
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/es/src/ag-grid/editable/form-item.vue.mjs +66 -62
- package/es/src/ag-grid/editable/index.vue.mjs +56 -52
- package/es/src/ag-grid/editable/interface.d.ts +9 -0
- package/es/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-editable-api.mjs +117 -99
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +125 -107
- package/es/src/ap-button/ap-button.vue.mjs +23 -23
- package/es/src/ap-button/interface.d.ts +1 -1
- package/es/src/ap-button/utils/index.d.ts +1 -1
- package/es/src/ap-button/utils/index.mjs +7 -7
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +24 -22
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +49 -47
- package/es/src/business/ag-grid-modal/interface.d.ts +2 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +24 -22
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +9 -0
- package/lib/src/ag-grid/hooks/use-editable-api.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-button/interface.d.ts +1 -1
- package/lib/src/ap-button/utils/index.d.ts +1 -1
- package/lib/src/ap-button/utils/index.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("lodash-unified"),w=require("vue");require("../../utils/index.js");const S=require("../editable/utils.js"),a=require("../../utils/is.js");let T=0;function m(){return`_ag_grid${T++}`}const A=(u,K,f,h)=>{const g=w.shallowRef([]),d=w.computed(()=>w.isRef(K)?w.unref(K):K);function x(n,r){const s=w.unref(f)?.length||0;if(a.isDef(u.maxLength)&&s>=u.maxLength||!n&&v.isFunction(u.rowKey))return;const i={...n||{[u.rowKey]:m()}};d.value?.setFieldValue?.(u.name,i,!0,(t,l)=>{const e=c(i,void 0,u.rowKey);if(t[l]?t[l][e]=i:t[l]={[e]:i},!f.value){f.value=[i];return}v.isUndefined(r)?f.value.push(i):(g.value=f.value.map((o,y)=>y<r?null:c(o,y,u.rowKey)).filter(Boolean),f.value.splice(r,0,i))})}function R(n,r="suffix"){const s=w.unref(f)?.length||0,i=v.isNumber(n)?n:n.length;if(a.isDef(u.maxLength)&&s+i>u.maxLength||v.isNumber(n)&&v.isFunction(u.rowKey))return;const t=v.isNumber(n)?new Array(n).fill(0).map(()=>({[u.rowKey]:m()})):v.cloneDeep(n),l=S.arrayToObject(t,u.rowKey);d.value?.setFieldValue?.(u.name,t,!0,(e,o)=>{if(e[o]?Object.assign(e[o],l):e[o]=l,!f.value){f.value=[...t];return}r==="suffix"?f.value.push(...t):(g.value=f.value.map((y,L)=>c(y,L,u.rowKey)),f.value.unshift(...t))})}function F(n){const r=v.isArray(n)?n:[n];d.value?.setFieldValue?.(u.name,void 0,!0,(s,i)=>{for(const e of r){const o=c(e,void 0,u.rowKey);delete s[i][o]}const t=f.value.filter(e=>!r.includes(e)),l=f.value.findIndex(e=>r.includes(e));g.value=f.value.map((e,o)=>o<=l?null:c(e,o,u.rowKey)).filter(Boolean),h?.(t)})}function c(n,r,s){if(s)return v.isString(s)?n[s]:s(n,r)}function j(n){const r=new Set(v.isArray(n)?n:[n]);r.size!==0&&d.value?.setFieldValue?.(u.name,void 0,!0,(s,i)=>{for(const e of r)delete s[i][e];const t=f.value.filter((e,o)=>!r.has(c(e,o,u.rowKey))),l=f.value.findIndex((e,o)=>r.has(c(e,o,u.rowKey)));g.value=f.value.map((e,o)=>o<=l?null:c(e,o,u.rowKey)).filter(Boolean),h?.(t)})}function I(n){return w.unref(f)?.[n]}function O(n){return f.value?.find((r,s)=>c(r,s,u.rowKey)===n)}function k(){return w.unref(f)}function B(n,r,s=!0){d.value?.setFieldValue?.(u.name,void 0,!0,(i,t)=>{const l=f.value.findIndex((o,y)=>n===y);if(!~l)return;const e=c(f.value[l],l,u.rowKey);if(e&&!(!i[t]||!i[t][e])){if(!s){const o=Object.keys(i[t][e]);for(const y of o)y!==u.rowKey&&delete i[t][e][y]}Object.assign(i[t][e],{...r})}})}function V(n,r,s=!0){d.value?.setFieldValue?.(u.name,void 0,!0,(i,t)=>{if(!(!i[t]||!i[t][n])){if(!s){const l=Object.keys(i[t][n]);for(const e of l)e!==u.rowKey&&delete i[t][e][e]}Object.assign(i[t][n],{...r})}})}function q(){d.value?.setFieldValue?.(u.name,{}),h?.([])}return{add:x,addMultiple:R,remove:F,removeByKey:j,getRowData:I,getRowsData:k,setRowDataByKey:V,setRowData:B,clear:q,refreshRowIds:g,getRowDataByKey:O}};exports.useEditableApi=A;
|
|
@@ -10,6 +10,7 @@ export declare const useEditableFormItemApi: <RecordType>(props: EditableAgGridP
|
|
|
10
10
|
removeByKey: (key: Key | Key[]) => void;
|
|
11
11
|
getRowData: (index: number) => RecordType;
|
|
12
12
|
getRowsData: () => RecordType[];
|
|
13
|
+
setRowDataByKey: (key: any, payload: any, merge?: boolean) => void;
|
|
13
14
|
setRowData: (index: number, payload: any, merge?: boolean) => void;
|
|
14
15
|
clear: () => void;
|
|
15
16
|
refreshRowIds: ShallowRef<string[], string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("lodash-unified"),h=require("vue");require("../../utils/index.js");const v=require("../editable/utils.js"),V=require("../../utils/is.js");let U=0;function x(){return`_ag_grid${U++}`}const E=(f,y,i,w)=>{const R=h.shallowRef([]);function j(u,s){const c=h.unref(i)?.length||0;if(V.isDef(f.maxLength)&&c>=f.maxLength||!u&&g.isFunction(f.rowKey))return;const n={...u||{[f.rowKey]:x()}};y?.setFieldValue(w,n,!1,(l,o)=>{const e=v.getRowKey(n,void 0,f.rowKey);l[o]?l[o][e]=n:l[o]={[e]:n},i.value?g.isUndefined(s)?i.value.push(n):(R.value=i.value.map((t,r)=>r<s?null:v.getRowKey(t,r,f.rowKey)).filter(Boolean),i.value.splice(s,0,n)):i.value=[n],y?.setFieldValue(f.name,n,!0,(t,r)=>{if(!t[r]){t[r]=[n];return}g.isUndefined(s)?t[r].push(n):t[r].splice(s,0,n)})})}function F(u,s="suffix",c=!1){if(!u)return;const n=h.unref(i)?.length||0,l=g.isNumber(u)?u:u.length;if(V.isDef(f.maxLength)&&n+l>f.maxLength||g.isNumber(u)&&g.isFunction(f.rowKey))return;const o=g.isNumber(u)?new Array(u).fill(0).map(()=>({[f.rowKey]:x()})):g.cloneDeep(u),e=v.arrayToObject(o,f.rowKey);y?.setFieldValue(w,e,!1,(t,r)=>{t[r]?Object.assign(t[r],e):t[r]=e,i.value?s==="suffix"?i.value.push(...o):(R.value=i.value.map((K,d)=>v.getRowKey(K,d,f.rowKey)),i.value.unshift(...o)):i.value=[...o],y?.setFieldValue(f.name,o,!0,(K,d)=>{if(!K[d]||c){K[d]=[...o];return}s==="suffix"?K[d].push(...o):K[d].unshift(...o)})})}function O(u,s="suffix"){F(u,s,!1)}function I(u){const s=g.isArray(u)?u:[u];y?.setFieldValue(w,void 0,!1,(c,n)=>{for(const e of s){const t=v.getRowKey(e,void 0,f.rowKey);delete c[n][t]}const l=i.value.filter(e=>!s.includes(e)),o=i.value.findIndex(e=>s.includes(e));R.value=i.value.map((e,t)=>t<=o?null:v.getRowKey(e,t,f.rowKey)).filter(Boolean),l.length?i.value=l:i.value.splice(0,i.value.length),y.setFieldValue(f.name,void 0,!0,(e,t)=>{e[t]=[...l]})})}function B(u){const s=new Set(g.isArray(u)?u:[u]);s.size!==0&&y?.setFieldValue(w,void 0,!1,(c,n)=>{for(const e of s)delete c[n][e];const l=i.value.filter((e,t)=>!s.has(v.getRowKey(e,t,f.rowKey))),o=i.value.findIndex((e,t)=>s.has(v.getRowKey(e,t,f.rowKey)));R.value=i.value.map((e,t)=>t<=o?null:v.getRowKey(e,t,f.rowKey)).filter(Boolean),l.length?i.value=l:i.value.splice(0,i.value.length),y.setFieldValue(f.name,void 0,!0,(e,t)=>{e[t]=[...l]})})}function T(u){return h.unref(i)?.[u]}function _(u){return i.value?.find((s,c)=>v.getRowKey(s,c,f.rowKey)===u)}function k(){return h.unref(i)}function q(u,s,c=!0){y?.setFieldValue?.(w,void 0,!1,(n,l)=>{const o=i.value.findIndex((t,r)=>u===r);if(!~o)return;const e=v.getRowKey(i.value[o],o,f.rowKey);if(e&&!(!n[l]||!n[l][e])){if(!c){const t=Object.keys(n[l][e]);for(const r of t)r!==f.rowKey&&delete n[l][e][r]}Object.assign(n[l][e],{...s})}})}function L(u,s,c=!0){y?.setFieldValue?.(w,void 0,!1,(n,l)=>{if(!(!n[l]||!n[l][u])){if(!c){const o=Object.keys(n[l][u]);for(const e of o)e!==f.rowKey&&delete n[l][u][e]}Object.assign(n[l][u],{...s})}})}function S(){y?.setFieldValue(w,{}),y?.setFieldValue(f.name,[])}return{add:j,addMultiple:O,__addMultiple:F,remove:I,removeByKey:B,getRowData:T,getRowsData:k,setRowDataByKey:L,setRowData:q,clear:S,refreshRowIds:R,getRowDataByKey:_}};exports.useEditableFormItemApi=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),B=require("@aplus-frontend/antdv"),W=require("@aplus-frontend/utils"),z=require("lodash-unified");require("../config-provider/index.js");const L=require("./style/index.js"),p=require("./utils/index.js"),q=require("../config-provider/hooks/use-namespace.js"),_=72,w=300,P=e.defineComponent({__name:"ap-button",props:{prefixCls:{},htmlType:{},shape:{},size:{},loading:{type:[Boolean,Object],default:void 0},disabled:{type:Boolean},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},type:{default:"default"},borderLinkColor:{},minWidth:{type:[Boolean,Number,String],default:!1},lazy:{type:[Boolean,Number],default:!0},onClick:{}},setup(f){const y=e.useSlots(),t=f,{b:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),B=require("@aplus-frontend/antdv"),W=require("@aplus-frontend/utils"),z=require("lodash-unified");require("../config-provider/index.js");const L=require("./style/index.js"),p=require("./utils/index.js"),q=require("../config-provider/hooks/use-namespace.js"),_=72,w=300,P=e.defineComponent({__name:"ap-button",props:{prefixCls:{},htmlType:{},shape:{},size:{},loading:{type:[Boolean,Object],default:void 0},disabled:{type:Boolean},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},type:{default:"default"},borderLinkColor:{},minWidth:{type:[Boolean,Number,String],default:!1},lazy:{type:[Boolean,Number],default:!0},onClick:{}},setup(f){const y=e.useSlots(),t=f,{b:i}=q.useNamespace("ap-action-button"),m=L.default("ap-action-button"),a=e.ref(!1),b=e.computed(()=>t.borderLinkColor||"var(--ap-button-border-link-color)"),l=e.computed(()=>t.type==="borderLink"&&!t.disabled?b.value:void 0),u=e.computed(()=>p.transferOpacityColor(l.value)),v=e.computed(()=>t.minWidth===!0?`${_}px`:typeof t.minWidth=="number"?`${t.minWidth}px`:typeof t.minWidth=="string"?t.minWidth:void 0),h=e.computed(()=>(t.type==="borderLink"?"default":t.type)||"default"),s=e.computed(()=>t.loading??a.value??!1),c=e.computed(()=>t.lazy===!0?w:typeof t.lazy=="number"&&t.lazy>=0?t.lazy:0);function g(){const o=z.omit(t,["type","borderLinkColor","minWidth","onClick","loading"]);return o?{...o,type:h.value,onclick:k}:{}}async function k(o){if(s.value)return;const r=p.isAsynchronous(t.onClick,o),d=Date.now();try{r&&(a.value=!0,await r)}finally{if(r){const n=Date.now()-d;n<c.value&&await W.wait(c.value-n),a.value=!1}}}return(o,r)=>(e.openBlock(),e.createBlock(e.unref(B.Button),e.mergeProps({class:{[e.unref(i)()]:!0,[`${e.unref(i)()}-border-link`]:u.value,[`${e.unref(m)}`]:!0}},{...o.$attrs,...g()},{style:{color:l.value,minWidth:v.value,"--button-border-color":u.value},loading:s.value}),e.createSlots({_:2},[e.renderList(y,(d,n)=>({name:n,fn:e.withCtx(C=>[e.renderSlot(o.$slots,n,e.normalizeProps(e.guardReactiveProps(C||{})))])}))]),1040,["class","style","loading"]))}});exports.default=P;
|
|
@@ -4,7 +4,7 @@ export type ApButtonProps = Omit<ButtonProps, 'type' | 'onClick'> & {
|
|
|
4
4
|
borderLinkColor?: string;
|
|
5
5
|
minWidth?: boolean | number | string;
|
|
6
6
|
lazy?: boolean | number;
|
|
7
|
-
onClick?: () => any | Promise<any>;
|
|
7
|
+
onClick?: (e: MouseEvent) => any | Promise<any>;
|
|
8
8
|
};
|
|
9
9
|
export type ApActionButtonProps = ApButtonProps;
|
|
10
10
|
export type ApButtonSlots = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModalFuncProps } from '@aplus-frontend/antdv';
|
|
2
2
|
export declare function isPromise(fn: any): any;
|
|
3
|
-
export declare const isAsynchronous: (fn: any) => any;
|
|
3
|
+
export declare const isAsynchronous: (fn: any, e: MouseEvent) => any;
|
|
4
4
|
export declare const transferOpacityColor: (thisColor?: string, thisOpacity?: string) => string | undefined;
|
|
5
5
|
export declare const confirmHandle: (ModalFuncProps: ModalFuncProps) => Promise<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@aplus-frontend/antdv"),l=require("lodash-unified");function c(e){return typeof e=="object"&&typeof e.then=="function"?e:!1}const f=e=>typeof e=="function"&&c(e?.()),u=(e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@aplus-frontend/antdv"),l=require("lodash-unified");function c(e){return typeof e=="object"&&typeof e.then=="function"?e:!1}const f=(e,n)=>typeof e=="function"&&c(e?.(n)),u=(e,n="0.7")=>{try{let t=e?.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(t.length===4){let o="#";for(let s=1;s<4;s+=1)o+=t.slice(s,s+1).concat(t.slice(s,s+1));t=o}const r=[];for(let o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgba("+r.join(",")+","+n+")"}if(t&&t.startsWith("rgb")){let r=t.match(/(\d(\.\d+)?)+/g);return r=r?.slice(0,3)?.concat(n),"rgba("+r.join(",")+")"}return t}catch{return}},h=e=>{const{onOk:n=()=>({})}=e;return new Promise((t,i)=>{a.Modal.confirm({onOk:async()=>{try{await n(),t(!0)}catch(r){i(r)}},onCancel:()=>{t(!1)},...l.omit(e,["onOk"])})})};exports.confirmHandle=h;exports.isAsynchronous=f;exports.isPromise=c;exports.transferOpacityColor=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),i=require("lodash-unified");require("../../../ag-grid/index.js");const _=require("../../../ap-modal/index.js"),q=require("../utils.js");require("../wrapper/index.vue.js");const y=require("./use-ag-grid-instance.js"),C=require("../wrapper/index.vue2.js"),P=require("../../../ag-grid/index.vue.js");function H(r){let o=null,s=null;const[n,f]=y.useAgGridInstance(),l=q.genRequest(r.api,r.getRowKey,n.setDataSourceLength),d=t=>{const{title:e,width:u,modalProps:p,...c}=i.isFunction(t)?t(r):t;i.isEmpty(c)||s?.(c);const g=i.omitBy({title:e,width:u,modalProps:p},i.isUndefined);i.isEmpty(g)||o?.update(g)},m=a.defineComponent({name:"AgGridModalPreviewContent",props:{modalConfig:{type:Object,required:!0}},setup(t){const e=a.ref(t.modalConfig);return s=u=>{e.value={...e.value,...u}},()=>a.createVNode(f,null,{default:()=>[a.createVNode(C.default,{height:e.value.height,rowHeight:e.value.rowHeight,minHeight:e.value.minHeight,maxHeight:e.value.maxHeight},{default:()=>[e.value.renderHeader?.(i.omit(n,"setInstance"),{updateProps:d}),a.createVNode(P.default,a.mergeProps({ref:n.setInstance,searchForm:{sortable:!1,resize:{target:"form"}},rowKey:e.value.getRowKey,request:l.request,style:{padding:"0px"},rowHeight:e.value.rowHeight,columns:e.value.columns,autoHeight:!!e.value.height},r.gridProps),e.value.gridSlots)]})]})}});function h(){o=_.ApModal.createModal({title:r.title,width:r.width,destroyOnClose:!0,maskClosable:!1,footer:null,afterOpenChange(t){t===!1&&(n.setInstance(void 0),n.setDataSourceLength(0),o=null)},content:a.createVNode(m,{modalConfig:r},null),...r.modalProps||{}})}function v(t){l.setExtraParams(t?.extraParams),h()}return{open:v,refresh:n.refresh,getAgGridInstance:n.getInstance,updateProps:d}}exports.useAgGridModal=H;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),I=require("@aplus-frontend/antdv"),r=require("lodash-unified");require("../../../ag-grid/index.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),I=require("@aplus-frontend/antdv"),r=require("lodash-unified");require("../../../ag-grid/index.js");const H=require("../../../ap-modal/index.js");require("../../../config-provider/index.js");const O=require("../constants.js");require("../modal-layout/index.vue.js");const c=require("../utils.js");require("../wrapper/index.vue.js");const p=require("./use-ag-grid-instance.js"),F=require("./use-modal-title.js"),G=require("../../../config-provider/hooks/use-locale.js"),L=require("../wrapper/index.vue2.js"),T=require("../modal-layout/index.vue2.js"),j=require("../../../ag-grid/index.vue.js");function N(n){let d,m=null,y=null;const g=new c.AsyncCallback,[q,x]=F.useModalTitle(),{t:S}=G.useLocale(),[u,b]=p.useAgGridInstance({onSelectedRows(e){x.setCount(e?.length||0)}}),w=c.genRequest(n.api,n.getRowKey,u.setDataSourceLength),h=e=>{const{title:t,width:l,modalProps:o,...a}=r.isFunction(e)?e(r.cloneDeep(n)):e;r.isEmpty(a)||y?.(a);const s=r.omitBy({title:t,width:l,modalProps:o},r.isUndefined);r.isEmpty(s)||m?.update(s)},f=r.isFunction(n.getRowKey)?n.getRowKey:e=>e[n.getRowKey],v=()=>{const e=n.mergeRule||"old",t=u.getSelectedRows()||[];return{keys:P(t),rows:t.map(a=>{const s=f(a);return e==="old"&&d?.[s]?d[s]:c.delRowKeyField(a)})}},C=async()=>{const e=v(),t=n.maxCount||1/0;return e.keys.length>t?(I.message.warning(S("ap.apTableModal.messageMaxCount",{maxCount:t})),Promise.reject()):(await n.beforeOk?.(e),n.finishCallback?.(e),g.resolve(e),e)},K=()=>{g.reject("modal is closed!")},k=i.defineComponent({name:"AgGridModalSelectContent",props:{modalConfig:{type:Object,required:!0},selectedRows:{type:Array,default:()=>[]}},setup(e){const t=i.ref(e.modalConfig);return y=l=>{t.value={...t.value,...l}},()=>{const l=e.selectedRows?.map(s=>c.addRowKeyField(s,t.value.getRowKey)),o=t.value,a=c.getModalLayoutConfig(o.modalLayout);return i.createVNode(b,null,{default:()=>[i.createVNode(L.default,{height:o.height,rowHeight:o.rowHeight,minHeight:t.value.minHeight,maxHeight:t.value.maxHeight},{default:()=>[n.renderHeader?.(r.omit(u,"setInstance"),{updateProps:h}),i.createVNode(T.default,a.props,{default:()=>[i.createVNode(j.default,i.mergeProps({ref:u.setInstance,searchForm:{sortable:!1,resize:{target:"form"}},rowKey:r.isFunction(o.getRowKey)?O.ROW_KEY:o.getRowKey,request:w.request,style:{padding:"0px"},rowHeight:o.rowHeight,columns:o.columns,rowSelection:{defaultSelectedRows:l,preserveSelectedRowKeys:!0,type:o.mode||"checkbox",fixed:"left",columnWidth:38,disabled(s){return r.isFunction(o.disabledCheckbox)?o.disabledCheckbox(s,r.omit(u,"setInstance")):o.disabledCheckbox??!1},...n.rowSelection},autoHeight:!!t.value.height},n.gridProps),o.gridSlots)],...a.slots})]})]})}}});function R(e){return i.createVNode(k,{modalConfig:n,selectedRows:e},null)}function M(){const e=Object.values(d||{}),t=R(e);m=H.ApModal.createModal({title:i.createVNode(q,{title:n.title,maxCount:n.maxCount||1/0,isShowDefaultSuffix:n.mode!=="radio"},n.modalTitleSlots),width:n.width,destroyOnClose:!0,maskClosable:!1,onOk:C,onCancel:K,afterOpenChange(l){l===!1&&(u.setInstance(void 0),u.setDataSourceLength(0))},content:t,...n.modalProps||{}})}function P(e){return e?.map(f)||[]}function _(e,t,l=!1){if(d=e?.reduce((o,a)=>{const s=f(a);return o[s]=a,o},{}),w.setExtraParams(t?.extraParams),M(),l)return g.buildPromise()}function A(e,t){return _(e,t,!0)}return i.onUnmounted(()=>{g.reject("component is Unmounted!")}),{open:_,asyncOpen:A,refresh:u.refresh,getAgGridInstance:u.getInstance,genContent:R,validate:C,updateProps:h}}exports.useAgGridSelectModal=N;
|
|
@@ -20,6 +20,8 @@ export interface AgGridModalBasicProps<TableRowType = any> {
|
|
|
20
20
|
}) => VNodeChild;
|
|
21
21
|
rowHeight?: number;
|
|
22
22
|
height?: CSSProperties['height'];
|
|
23
|
+
minHeight?: CSSProperties['height'];
|
|
24
|
+
maxHeight?: CSSProperties['height'];
|
|
23
25
|
}
|
|
24
26
|
/** 刷新方式 */
|
|
25
27
|
export type RefreshType = 'reset' | 'submit' | 'submitWith';
|
|
@@ -2,6 +2,8 @@ import { CSSProperties, DefineComponent, ComponentOptionsMixin, PublicProps, Com
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
rowHeight?: number;
|
|
4
4
|
height?: CSSProperties['height'];
|
|
5
|
+
minHeight?: CSSProperties['height'];
|
|
6
|
+
maxHeight?: CSSProperties['height'];
|
|
5
7
|
};
|
|
6
8
|
declare function __VLS_template(): {
|
|
7
9
|
attrs: Partial<{}>;
|
|
@@ -16,6 +18,8 @@ declare function __VLS_template(): {
|
|
|
16
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
19
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
20
|
height: import("csstype").Property.Height<string | number>;
|
|
21
|
+
maxHeight: import("csstype").Property.Height<string | number>;
|
|
22
|
+
minHeight: import("csstype").Property.Height<string | number>;
|
|
19
23
|
rowHeight: number;
|
|
20
24
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
21
25
|
wrapperContainer: HTMLDivElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("../constants.js"),h=require("../hooks/use-ag-grid-instance.js"),d=e.defineComponent({__name:"index",props:{rowHeight:{default:32},height:{default:void 0},minHeight:{default:s.SMALL_HEIGHT},maxHeight:{default:s.LARGER_HEIGHT}},setup(c){const n=c,i=e.useTemplateRef("wrapperContainer"),g=h.useAgGridModalInject(),a=e.computed(()=>g?.dataSourceLength?.value||0),l=e.ref(n.minHeight),u=()=>{const t=i.value?.clientHeight,o=i.value?.querySelector(".ag-body.ag-layout-normal")?.clientHeight;let r=0;!t||!o?r=0:r=t-o,a.value*n.rowHeight>480-r&&(l.value=n.maxHeight)};return e.watch(()=>a.value,()=>{u()}),e.onMounted(()=>{u()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperContainer",ref:i,style:e.normalizeStyle({minHeight:t.height?"unset":n.minHeight,height:t.height??l.value,display:"flex",flexDirection:"column"})},[e.renderSlot(t.$slots,"default")],4))}});exports.default=d;
|
|
@@ -76,7 +76,7 @@ declare const ApBatchActionGroup: {
|
|
|
76
76
|
borderLinkColor?: string;
|
|
77
77
|
minWidth?: boolean | number | string;
|
|
78
78
|
lazy?: boolean | number;
|
|
79
|
-
onClick?: () => any | Promise<any>;
|
|
79
|
+
onClick?: (e: MouseEvent) => any | Promise<any>;
|
|
80
80
|
} & {
|
|
81
81
|
content?: VNodeChild;
|
|
82
82
|
}) | ({
|
|
@@ -398,7 +398,7 @@ declare const ApBatchActionGroup: {
|
|
|
398
398
|
borderLinkColor?: string;
|
|
399
399
|
minWidth?: boolean | number | string;
|
|
400
400
|
lazy?: boolean | number;
|
|
401
|
-
onClick?: () => any | Promise<any>;
|
|
401
|
+
onClick?: (e: MouseEvent) => any | Promise<any>;
|
|
402
402
|
} & {
|
|
403
403
|
content?: VNodeChild;
|
|
404
404
|
}) | ({
|
|
@@ -717,7 +717,7 @@ declare const ApBatchActionGroup: {
|
|
|
717
717
|
borderLinkColor?: string;
|
|
718
718
|
minWidth?: boolean | number | string;
|
|
719
719
|
lazy?: boolean | number;
|
|
720
|
-
onClick?: () => any | Promise<any>;
|
|
720
|
+
onClick?: (e: MouseEvent) => any | Promise<any>;
|
|
721
721
|
} & {
|
|
722
722
|
content?: VNodeChild;
|
|
723
723
|
}) | ({
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.19.
|
|
1
|
+
declare const _default: "7.19.8";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.19.8";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "7.19.
|
|
3
|
+
"version": "7.19.8",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
42
42
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
43
43
|
"vuedraggable": "^4.1.0",
|
|
44
|
-
"@aplus-frontend/
|
|
45
|
-
"@aplus-frontend/
|
|
44
|
+
"@aplus-frontend/hooks": "1.0.7",
|
|
45
|
+
"@aplus-frontend/utils": "1.0.66"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@aplus-frontend/antdv": "^2.1.4",
|