@aplus-frontend/ui 0.0.39 → 0.1.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.
- package/es/index.mjs +149 -148
- package/es/src/ap-action/item/index.vue2.mjs +19 -20
- package/es/src/ap-action/item-modal/index.vue.mjs +7 -6
- package/es/src/ap-action/style/item.css +10 -25
- package/es/src/ap-field/checkbox/index.vue.mjs +32 -27
- package/es/src/ap-field/checkbox/style.css +7 -0
- package/es/src/ap-field/interface.d.ts +3 -1
- package/es/src/ap-field/radio/index.vue.d.ts +3 -0
- package/es/src/ap-field/radio/index.vue.mjs +44 -29
- package/es/src/ap-field/radio/style.css +4 -0
- package/es/src/ap-field/text-area/index.vue.mjs +9 -10
- package/es/src/ap-form/style/ap-form-item.css +6 -6
- package/es/src/ap-table/ap-table.vue.d.ts +6 -0
- package/es/src/ap-table/ap-table.vue.mjs +124 -124
- package/es/src/ap-table/constants.d.ts +15 -6
- package/es/src/ap-table/style/ap-table.css +1 -21
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +14 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue.mjs +4 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +117 -0
- package/es/src/business/ap-export-group/interface.d.ts +37 -0
- package/es/src/business/ap-export-group/interface.mjs +4 -0
- package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +10 -9
- package/es/src/business/index.d.ts +105 -0
- package/es/src/business/index.mjs +12 -9
- package/es/src/check-card/index.vue2.mjs +44 -48
- package/es/src/check-card/style/index.css +10 -42
- package/es/src/config-provider/config-provider.mjs +22 -17
- package/es/src/design-token/index.mjs +4 -2
- package/es/src/editable-table/form-item.vue.d.ts +4 -0
- package/es/src/editable-table/form-item.vue.mjs +75 -68
- package/es/src/editable-table/index.vue.d.ts +4 -0
- package/es/src/editable-table/index.vue.mjs +79 -72
- package/es/src/editable-table/interface.d.ts +8 -0
- package/es/src/editable-table/style/index.css +1 -21
- package/es/src/editable-table/utils.d.ts +8 -0
- package/es/src/editable-table/utils.mjs +29 -18
- package/es/src/index.mjs +175 -174
- package/es/src/locale/lang/en.mjs +7 -1
- package/es/src/locale/lang/zh-cn.mjs +28 -22
- package/es/src/theme/ap-action/item.css +10 -25
- package/es/src/theme/ap-field/checkbox.css +7 -0
- package/es/src/theme/ap-field/radio.css +4 -0
- package/es/src/theme/ap-form/ap-form-item.css +6 -6
- package/es/src/theme/ap-table/ap-table.css +1 -21
- package/es/src/theme/check-card/index.css +10 -42
- package/es/src/theme/css-var/index.d.ts +7 -0
- package/es/src/theme/css-var/index.mjs +109 -0
- package/es/src/theme/editable-table/index.css +1 -21
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/style/item.css +10 -25
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/style.css +7 -0
- package/lib/src/ap-field/interface.d.ts +3 -1
- package/lib/src/ap-field/radio/index.vue.d.ts +3 -0
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/radio/style.css +4 -0
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/style/ap-form-item.css +6 -6
- package/lib/src/ap-table/ap-table.vue.d.ts +6 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +15 -6
- package/lib/src/ap-table/style/ap-table.css +1 -21
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +14 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue.js +1 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -0
- package/lib/src/business/ap-export-group/interface.d.ts +37 -0
- package/lib/src/business/ap-export-group/interface.js +1 -0
- package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/index.d.ts +105 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/check-card/style/index.css +10 -42
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +4 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +4 -0
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +8 -0
- package/lib/src/editable-table/style/index.css +1 -21
- package/lib/src/editable-table/utils.d.ts +8 -0
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-action/item.css +10 -25
- package/lib/src/theme/ap-field/checkbox.css +7 -0
- package/lib/src/theme/ap-field/radio.css +4 -0
- package/lib/src/theme/ap-form/ap-form-item.css +6 -6
- package/lib/src/theme/ap-table/ap-table.css +1 -21
- package/lib/src/theme/check-card/index.css +10 -42
- package/lib/src/theme/css-var/index.d.ts +7 -0
- package/lib/src/theme/css-var/index.js +1 -0
- package/lib/src/theme/editable-table/index.css +1 -21
- package/package.json +6 -5
|
@@ -11802,6 +11802,10 @@ export declare const apTableRenderItemMap: {
|
|
|
11802
11802
|
options: {
|
|
11803
11803
|
type: PropType<(string | number | RadioGroupChildOption)[]>;
|
|
11804
11804
|
};
|
|
11805
|
+
vertical: {
|
|
11806
|
+
type: PropType<boolean>;
|
|
11807
|
+
default: boolean;
|
|
11808
|
+
};
|
|
11805
11809
|
'onUpdate:value': {
|
|
11806
11810
|
type: PropType<(val: any) => void>;
|
|
11807
11811
|
};
|
|
@@ -11858,6 +11862,10 @@ export declare const apTableRenderItemMap: {
|
|
|
11858
11862
|
options: {
|
|
11859
11863
|
type: PropType<(string | number | RadioGroupChildOption)[]>;
|
|
11860
11864
|
};
|
|
11865
|
+
vertical: {
|
|
11866
|
+
type: PropType<boolean>;
|
|
11867
|
+
default: boolean;
|
|
11868
|
+
};
|
|
11861
11869
|
'onUpdate:value': {
|
|
11862
11870
|
type: PropType<(val: any) => void>;
|
|
11863
11871
|
};
|
|
@@ -11878,6 +11886,7 @@ export declare const apTableRenderItemMap: {
|
|
|
11878
11886
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
11879
11887
|
}, {
|
|
11880
11888
|
mode: FieldMode;
|
|
11889
|
+
vertical: boolean;
|
|
11881
11890
|
emptyText: string;
|
|
11882
11891
|
}, {}>;
|
|
11883
11892
|
select: {
|
|
@@ -16086,9 +16095,6 @@ export declare const apTableRenderItemMap: {
|
|
|
16086
16095
|
rows: {
|
|
16087
16096
|
type: PropType<number>;
|
|
16088
16097
|
};
|
|
16089
|
-
autosize: {
|
|
16090
|
-
type: PropType<boolean | AutoSizeType>;
|
|
16091
|
-
};
|
|
16092
16098
|
autoSize: {
|
|
16093
16099
|
type: PropType<boolean | AutoSizeType>;
|
|
16094
16100
|
};
|
|
@@ -16237,9 +16243,6 @@ export declare const apTableRenderItemMap: {
|
|
|
16237
16243
|
rows: {
|
|
16238
16244
|
type: PropType<number>;
|
|
16239
16245
|
};
|
|
16240
|
-
autosize: {
|
|
16241
|
-
type: PropType<boolean | AutoSizeType>;
|
|
16242
|
-
};
|
|
16243
16246
|
autoSize: {
|
|
16244
16247
|
type: PropType<boolean | AutoSizeType>;
|
|
16245
16248
|
};
|
|
@@ -16290,6 +16293,9 @@ export declare const apTableRenderItemMap: {
|
|
|
16290
16293
|
type: PropType<(string | number | CheckboxOptionType)[]>;
|
|
16291
16294
|
default: () => never[];
|
|
16292
16295
|
};
|
|
16296
|
+
vertical: {
|
|
16297
|
+
type: PropType<boolean>;
|
|
16298
|
+
};
|
|
16293
16299
|
defaultValue: {
|
|
16294
16300
|
type: PropType< CheckboxValueType[]>;
|
|
16295
16301
|
};
|
|
@@ -16338,6 +16344,9 @@ export declare const apTableRenderItemMap: {
|
|
|
16338
16344
|
type: PropType<(string | number | CheckboxOptionType)[]>;
|
|
16339
16345
|
default: () => never[];
|
|
16340
16346
|
};
|
|
16347
|
+
vertical: {
|
|
16348
|
+
type: PropType<boolean>;
|
|
16349
|
+
};
|
|
16341
16350
|
defaultValue: {
|
|
16342
16351
|
type: PropType< CheckboxValueType[]>;
|
|
16343
16352
|
};
|
|
@@ -48,31 +48,11 @@
|
|
|
48
48
|
flex: 1;
|
|
49
49
|
}
|
|
50
50
|
.aplus-ap-table-table tr > th.ant-table-cell {
|
|
51
|
-
background-color:
|
|
52
|
-
border-bottom-color: #E9EDF3;
|
|
51
|
+
background-color: var(--ap-table-header-bg);
|
|
53
52
|
}
|
|
54
53
|
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
55
54
|
display: none;
|
|
56
55
|
}
|
|
57
|
-
.aplus-ap-table-table tr > td.ant-table-cell {
|
|
58
|
-
border-top-color: #E9EDF3;
|
|
59
|
-
}
|
|
60
|
-
.aplus-ap-table-table-admin .ant-pagination {
|
|
61
|
-
margin-bottom: 0 !important;
|
|
62
|
-
}
|
|
63
|
-
.aplus-ap-table-table-admin .ant-pagination .ant-pagination-total-text {
|
|
64
|
-
flex: 1;
|
|
65
|
-
}
|
|
66
|
-
.aplus-ap-table-table-admin tr > th.ant-table-cell {
|
|
67
|
-
background-color: #FAFAFA;
|
|
68
|
-
border-bottom-color: #E9E9E9;
|
|
69
|
-
}
|
|
70
|
-
.aplus-ap-table-table-admin tr > th.ant-table-cell::before {
|
|
71
|
-
display: none;
|
|
72
|
-
}
|
|
73
|
-
.aplus-ap-table-table-admin tr > td.ant-table-cell {
|
|
74
|
-
border-top-color: #E9E9E9;
|
|
75
|
-
}
|
|
76
56
|
.aplus-ap-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell {
|
|
77
57
|
padding: 12px 16px;
|
|
78
58
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Props } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const _default: DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
|
|
5
|
+
export default _default;
|
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
9
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
10
|
+
} : {
|
|
11
|
+
type: PropType<T[K]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ApExportGroup.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("@aplus-frontend/utils"),k=require("@ant-design/icons-vue"),l=require("ant-design-vue");require("../../config-provider/index.js");const s=require("./interface.js"),L=require("@aplus-frontend/hooks"),N=require("../../config-provider/hooks/use-namespace.js"),A=require("../../config-provider/hooks/use-locale.js"),E=require("../../config-provider/hooks/use-global-config.js"),M=e.defineComponent({__name:"ApExportGroup",props:{selectedRowKeys:{},disabled:{type:Boolean},auth:{},ifShow:{type:Function},text:{},request:{type:Function},getRequestParams:{type:Function}},setup(m){const{hasPermission:h}=L.usePermission(),t=m,{b:w}=N.useNamespace("ap-export-group"),{t:i}=A.useLocale(),C=E.useGlobalConfig("uiMode"),b=e.computed(()=>{const o={aplus:"#0070FF",admin:"#34b77c"};return f.value?"":o[C.value]||o.aplus}),f=e.computed(()=>!!(t!=null&&t.disabled)),v={textAlign:"center"},d=e.ref(!1),y=e.computed(()=>(t==null?void 0:t.selectedRowKeys)||[]),S=e.computed(()=>{let o=t==null?void 0:t.ifShow;return!(t!=null&&t.ifShow)&&(t!=null&&t.auth)&&(o=()=>h(t.auth)),(o==null?void 0:o())??!0});async function _({key:o}){var x;const{getRequestParams:r,request:a}=t||{};let u={};if(o===s.ActionType.SELECT){const n=((r==null?void 0:r())||{}).exportFieldList;u={ids:y.value,exportFieldList:n};for(const c in u)u[c]||delete u[c]}else o===s.ActionType.ALL&&(u=(r==null?void 0:r())||{});try{d.value=!0;const n=await(a==null?void 0:a(u));n.headers&&!((x=n==null?void 0:n.headers)!=null&&x["content-disposition"])?n.data.text().then(c=>{const p=JSON.parse(c||"{}");p.code&&p.code!=="200"&&l.Modal.error({title:i("ap.apExportGroup.exportError"),content:p.message,centered:!0})}):g.formatFileNameAndDownloadFile(n)}finally{d.value=!1}}return(o,r)=>S.value?(e.openBlock(),e.createBlock(e.unref(l.Dropdown),{key:0,class:e.normalizeClass([e.unref(w)()]),overlayStyle:v,disabled:f.value},{overlay:e.withCtx(()=>[e.createVNode(e.unref(l.Menu),{onClick:_},{default:e.withCtx(()=>{var a;return[(e.openBlock(),e.createBlock(e.unref(l.MenuItem),{key:e.unref(s.ActionType).SELECT,disabled:((a=y.value)==null?void 0:a.length)===0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("ap.apExportGroup.exportSelected")),1)]),_:1},8,["disabled"])),(e.openBlock(),e.createBlock(e.unref(l.MenuItem),{key:e.unref(s.ActionType).ALL},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("ap.apExportGroup.exportAll")),1)]),_:1}))]}),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(l.Button),{style:e.normalizeStyle({color:b.value}),loading:d.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(i)("ap.apExportGroup.export"))+" ",1),e.createVNode(e.unref(k.DownOutlined))]),_:1},8,["style","loading"])]),_:1},8,["class","disabled"])):e.createCommentVNode("",!0)}});exports.default=M;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MenuProps } from 'ant-design-vue';
|
|
2
|
+
|
|
3
|
+
export interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* 选中行的Key列表
|
|
6
|
+
*/
|
|
7
|
+
selectedRowKeys?: any[];
|
|
8
|
+
/**
|
|
9
|
+
* 是否禁用
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 权限
|
|
14
|
+
*/
|
|
15
|
+
auth?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 是否显示
|
|
18
|
+
*/
|
|
19
|
+
ifShow?: () => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 导出按钮文案
|
|
22
|
+
*/
|
|
23
|
+
text?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 导出接口
|
|
26
|
+
*/
|
|
27
|
+
request?: (key: any) => Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* 导出接口参数
|
|
30
|
+
*/
|
|
31
|
+
getRequestParams?: () => Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
export declare enum ActionType {
|
|
34
|
+
ALL = "ALL",
|
|
35
|
+
SELECT = "SELECT"
|
|
36
|
+
}
|
|
37
|
+
export type AntMenuInfo = Parameters<Exclude<MenuProps['onClick'], undefined>>[0];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=(e=>(e.ALL="ALL",e.SELECT="SELECT",e))(r||{});exports.ActionType=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");require("./ApStatus.vue.js");const n=require("../../config-provider/hooks/use-namespace.js"),o=require("./ApStatus.vue2.js"),p=e.defineComponent({name:"ApStatusGroup",__name:"ApStatusGroup",props:{padding:{default:8},currentValue:{default:0},statusList:{default:null},style:{},show:{type:Boolean,default:!0}},setup(r){const t=r,a=e.computed(()=>({"padding-left":t.padding+"px","padding-right":t.padding+"px",...t.style})),{b:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");require("./ApStatus.vue.js");const n=require("../../config-provider/hooks/use-namespace.js"),o=require("./ApStatus.vue2.js"),p=e.defineComponent({name:"ApStatusGroup",__name:"ApStatusGroup",props:{padding:{default:8},currentValue:{default:0},statusList:{default:null},style:{},show:{type:Boolean,default:!0}},setup(r){const t=r,a=e.computed(()=>({"padding-left":t.padding+"px","padding-right":t.padding+"px",...t.style})),{b:l}=n.useNamespace("ap-status-group");return(s,c)=>t.statusList?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(l)()]),style:e.normalizeStyle(a.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statusList,u=>(e.openBlock(),e.createBlock(o.default,{key:u.value,show:u.value===s.currentValue,color:u.color,text:u.text,padding:t.padding,style:e.normalizeStyle(t.style)},null,8,["show","color","text","padding","style"]))),128))],6)):e.createCommentVNode("",!0)}});exports.default=p;
|
|
@@ -958,3 +958,108 @@ export declare const ApSelectLayout: (<T extends ApSelectItem>(__VLS_props: {
|
|
|
958
958
|
onClick?: (() => void) | undefined;
|
|
959
959
|
};
|
|
960
960
|
});
|
|
961
|
+
export declare const ApExportGroup: {
|
|
962
|
+
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
963
|
+
selectedRowKeys: {
|
|
964
|
+
type: PropType<any[]>;
|
|
965
|
+
};
|
|
966
|
+
disabled: {
|
|
967
|
+
type: PropType<boolean>;
|
|
968
|
+
};
|
|
969
|
+
auth: {
|
|
970
|
+
type: PropType<string>;
|
|
971
|
+
};
|
|
972
|
+
ifShow: {
|
|
973
|
+
type: PropType<() => boolean>;
|
|
974
|
+
};
|
|
975
|
+
text: {
|
|
976
|
+
type: PropType<string>;
|
|
977
|
+
};
|
|
978
|
+
request: {
|
|
979
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
980
|
+
};
|
|
981
|
+
getRequestParams: {
|
|
982
|
+
type: PropType<() => Record<string, any>>;
|
|
983
|
+
};
|
|
984
|
+
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
985
|
+
selectedRowKeys: {
|
|
986
|
+
type: PropType<any[]>;
|
|
987
|
+
};
|
|
988
|
+
disabled: {
|
|
989
|
+
type: PropType<boolean>;
|
|
990
|
+
};
|
|
991
|
+
auth: {
|
|
992
|
+
type: PropType<string>;
|
|
993
|
+
};
|
|
994
|
+
ifShow: {
|
|
995
|
+
type: PropType<() => boolean>;
|
|
996
|
+
};
|
|
997
|
+
text: {
|
|
998
|
+
type: PropType<string>;
|
|
999
|
+
};
|
|
1000
|
+
request: {
|
|
1001
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
1002
|
+
};
|
|
1003
|
+
getRequestParams: {
|
|
1004
|
+
type: PropType<() => Record<string, any>>;
|
|
1005
|
+
};
|
|
1006
|
+
}>>, {}, true, {}, {}, {
|
|
1007
|
+
P: {};
|
|
1008
|
+
B: {};
|
|
1009
|
+
D: {};
|
|
1010
|
+
C: {};
|
|
1011
|
+
M: {};
|
|
1012
|
+
Defaults: {};
|
|
1013
|
+
}, Readonly< ExtractPropTypes<{
|
|
1014
|
+
selectedRowKeys: {
|
|
1015
|
+
type: PropType<any[]>;
|
|
1016
|
+
};
|
|
1017
|
+
disabled: {
|
|
1018
|
+
type: PropType<boolean>;
|
|
1019
|
+
};
|
|
1020
|
+
auth: {
|
|
1021
|
+
type: PropType<string>;
|
|
1022
|
+
};
|
|
1023
|
+
ifShow: {
|
|
1024
|
+
type: PropType<() => boolean>;
|
|
1025
|
+
};
|
|
1026
|
+
text: {
|
|
1027
|
+
type: PropType<string>;
|
|
1028
|
+
};
|
|
1029
|
+
request: {
|
|
1030
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
1031
|
+
};
|
|
1032
|
+
getRequestParams: {
|
|
1033
|
+
type: PropType<() => Record<string, any>>;
|
|
1034
|
+
};
|
|
1035
|
+
}>>, {}, {}, {}, {}, {}>;
|
|
1036
|
+
__isFragment?: undefined;
|
|
1037
|
+
__isTeleport?: undefined;
|
|
1038
|
+
__isSuspense?: undefined;
|
|
1039
|
+
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
1040
|
+
selectedRowKeys: {
|
|
1041
|
+
type: PropType<any[]>;
|
|
1042
|
+
};
|
|
1043
|
+
disabled: {
|
|
1044
|
+
type: PropType<boolean>;
|
|
1045
|
+
};
|
|
1046
|
+
auth: {
|
|
1047
|
+
type: PropType<string>;
|
|
1048
|
+
};
|
|
1049
|
+
ifShow: {
|
|
1050
|
+
type: PropType<() => boolean>;
|
|
1051
|
+
};
|
|
1052
|
+
text: {
|
|
1053
|
+
type: PropType<string>;
|
|
1054
|
+
};
|
|
1055
|
+
request: {
|
|
1056
|
+
type: PropType<(key: any) => Promise<any>>;
|
|
1057
|
+
};
|
|
1058
|
+
getRequestParams: {
|
|
1059
|
+
type: PropType<() => Record<string, any>>;
|
|
1060
|
+
};
|
|
1061
|
+
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & Plugin & (new (...args: any[]) => {
|
|
1062
|
+
$props: {
|
|
1063
|
+
onClick?: (() => void) | undefined;
|
|
1064
|
+
};
|
|
1065
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@aplus-frontend/utils");require("./title/ApTitle.vue.js");require("./expandAlert/ApExpandAlert.vue.js");require("./ap-label/ApLabel.vue.js");require("./ap-status/ApStatus.vue.js");require("./ap-status/ApStatusGroup.vue.js");require("./ap-select-layout/select-layout.vue.js");require("./ap-export-group/ApExportGroup.vue.js");const e=require("./title/ApTitle.vue2.js"),u=require("./expandAlert/ApExpandAlert.vue2.js"),r=require("./ap-label/ApLabel.vue2.js"),p=require("./ap-status/ApStatus.vue2.js"),_=require("./ap-status/ApStatusGroup.vue2.js"),s=require("./ap-select-layout/select-layout.vue2.js"),l=require("./ap-export-group/ApExportGroup.vue2.js"),a=t.withInstall(e.default),i=u.default,n=t.withInstall(r.default),o=t.withInstall(p.default),c=t.withInstall(_.default),A=t.withInstall(s.default),q=t.withInstall(l.default);exports.ApExpandAlert=i;exports.ApExportGroup=q;exports.ApLabel=n;exports.ApSelectLayout=A;exports.ApStatus=o;exports.ApStatusGroup=c;exports.ApTitle=a;
|
|
@@ -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"),V=require("ant-design-vue");require("../config-provider/index.js");require("../hooks/index.js");const g=require("lodash-unified"),q=require("./context.js");require("./style/index.css");const P=require("./checked.svg.js"),z=require("../config-provider/hooks/use-namespace.js"),S=require("../hooks/useControllableValue.js"),_=["src"],w=e.defineComponent({name:"CheckCard",__name:"index",props:{bordered:{type:Boolean,default:!0},disabled:{type:Boolean},loading:{type:Boolean},size:{default:"middle"},stopPropagation:{type:[Boolean,Function],default:!1},checked:{type:Boolean,default:void 0},"onUpdate:checked":{},defaultChecked:{type:Boolean},value:{type:[String,Number,Boolean]},style:{default:()=>({})},title:{},content:{}},emits:["update:checked"],setup(b,{emit:h}){const n=b,{b:s,m:c,e:i,bm:T,em:p}=z.useNamespace("check-card"),C=h,a=q.useInjectCheckCard(),{value:r,updateValue:f}=S.useControllableValue(n,C,{valuePropName:"checked",defaultValuePropName:"defaultChecked"}),l=e.computed(()=>{const t={...n},o=e.unref(a);return o&&(t.disabled=t.disabled||o.disabled,t.bordered=t.bordered||o.bordered,t.loading=t.loading||o.loading,t.size=t.size||o.size,t.stopPropagation=t.stopPropagation||o.stopPropagation),t}),y=e.computed(()=>{const t=e.unref(l);return[s(),...t.disabled?[]:[s(),e.unref(r)?c("checked"):null],c(t.size),t.bordered?c("bordered"):null,t.disabled?c("disabled"):null]}),m=e.computed(()=>{if(!n.title)return;const t=g.isFunction(n.title)?n.title(e.unref(r)):e.createVNode("span",null,[n.title]);return e.createVNode("div",{class:[i("title"),l.value.disabled?p("title","disabled"):null]},[t])}),v=e.computed(()=>{if(!n.content)return;const t=g.isFunction(n.content)?n.content(e.unref(r)):n.content;return e.createVNode("div",{class:[i("content"),l.value.disabled?p("content","disabled"):null]},[t])});function B(t){const o=e.unref(l).stopPropagation;return o?o===!0?t.target!==t.currentTarget:o(t):!1}function N(t){var o,u;B(t)||l.value.loading||l.value.disabled||(a.value?(u=(o=a.value)==null?void 0:o.toggleOption)==null||u.call(o,n.value):f(!e.unref(r)))}return e.watch(()=>a.value,t=>{if(!t)return;const o=t.multiple?(t.value||[]).includes(n.value):t.value===n.value;f(o)},{immediate:!0}),e.watchEffect(t=>{var o,u;(u=(o=a.value)==null?void 0:o.registerValue)==null||u.call(o,n.value),t(()=>{var d,k;return(k=(d=a.value)==null?void 0:d.cancelValue)==null?void 0:k.call(d,n.value)})}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(t.style),class:e.normalizeClass(y.value),onClick:e.withModifiers(N,["stop"])},[l.value.loading?(e.openBlock(),e.createBlock(e.unref(V.Skeleton),{key:0,active:""})):e.renderSlot(t.$slots,"default",{key:1,checked:e.unref(r)},()=>[m.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.value),{key:0})):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v.value),{key:1})):e.createCommentVNode("",!0)]),e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(i)("checked-icon"))},[e.createElementVNode("img",{src:e.unref(P.default)},null,8,_)],2)):e.createCommentVNode("",!0)],6))}});exports.default=w;
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
cursor: not-allowed;
|
|
8
8
|
}
|
|
9
9
|
.aplus-check-card--bordered {
|
|
10
|
-
outline: 1px solid var(--check-card-
|
|
10
|
+
outline: 1px solid var(--check-card-outline-color);
|
|
11
11
|
}
|
|
12
|
-
.aplus-check-card
|
|
12
|
+
.aplus-check-card:hover {
|
|
13
13
|
cursor: pointer;
|
|
14
|
-
outline: 1px solid
|
|
14
|
+
outline: 1px solid var(--check-card-hover-outline-color);
|
|
15
15
|
}
|
|
16
|
-
.aplus-check-card
|
|
16
|
+
.aplus-check-card::after {
|
|
17
17
|
content: '';
|
|
18
18
|
position: absolute;
|
|
19
19
|
width: 0;
|
|
@@ -25,47 +25,15 @@
|
|
|
25
25
|
border-block-end: 16px solid transparent;
|
|
26
26
|
border-radius: 4px;
|
|
27
27
|
}
|
|
28
|
-
.aplus-check-card
|
|
29
|
-
outline: 2px solid
|
|
28
|
+
.aplus-check-card--checked {
|
|
29
|
+
outline: 2px solid var(--check-card-checked-outline-color);
|
|
30
30
|
}
|
|
31
|
-
.aplus-check-card
|
|
32
|
-
outline: 2px solid
|
|
31
|
+
.aplus-check-card--checked:hover {
|
|
32
|
+
outline: 2px solid var(--check-card-checked-outline-color);
|
|
33
33
|
}
|
|
34
|
-
.aplus-check-card
|
|
34
|
+
.aplus-check-card--checked::after {
|
|
35
35
|
opacity: 1;
|
|
36
|
-
border: 16px solid
|
|
37
|
-
border-inline-start: 16px solid transparent;
|
|
38
|
-
border-block-end: 16px solid transparent;
|
|
39
|
-
inset-block-start: -2px;
|
|
40
|
-
inset-inline-end: -2px;
|
|
41
|
-
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
42
|
-
}
|
|
43
|
-
.aplus-check-card-admin:hover {
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
outline: 1px solid #34b77c;
|
|
46
|
-
}
|
|
47
|
-
.aplus-check-card-admin::after {
|
|
48
|
-
content: '';
|
|
49
|
-
position: absolute;
|
|
50
|
-
width: 0px;
|
|
51
|
-
height: 0px;
|
|
52
|
-
opacity: 0;
|
|
53
|
-
inset-block-start: -2px;
|
|
54
|
-
inset-inline-end: -2px;
|
|
55
|
-
border-inline-start: 16px solid transparent;
|
|
56
|
-
border-block-end: 16px solid transparent;
|
|
57
|
-
border-radius: 4px;
|
|
58
|
-
}
|
|
59
|
-
.aplus-check-card-admin--checked {
|
|
60
|
-
outline: 2px solid #34b77c;
|
|
61
|
-
}
|
|
62
|
-
.aplus-check-card-admin--checked:hover {
|
|
63
|
-
outline: 2px solid #34b77c;
|
|
64
|
-
}
|
|
65
|
-
.aplus-check-card-admin--checked::after {
|
|
66
|
-
content: '';
|
|
67
|
-
opacity: 1;
|
|
68
|
-
border: 16px solid #34b77c;
|
|
36
|
+
border: 16px solid var(--check-card-checked-bg);
|
|
69
37
|
border-inline-start: 16px solid transparent;
|
|
70
38
|
border-block-end: 16px solid transparent;
|
|
71
39
|
inset-block-start: -2px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),c=require("ant-design-vue"),u=require("./hooks/use-global-config.js"),s=require("./config-provider-props.js"),d=require("./constants.js"),f=require("../utils/config-provider-preset.js"),r=require("../theme/css-var/index.js");function g(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!o.isVNode(e)}const a=o.ref({}),C=o.defineComponent({name:"AplusConfigProvider",props:s.configProviderProps(),setup(e,{slots:n}){const l=o.computed(()=>({namespace:e.namespace,aplusLocale:e.aplusLocale,api:e.api,table:{...d.tableDefaultConfig,...e.table||{}},scrollbar:e.scrollbar,uiMode:e.uiMode,apUpload:e.apUpload,apDescriptions:e.apDescriptions})),i=u.provideGlobalConfig(l);return o.watch(()=>e,t=>{a.value=f.mergeAntdProvideConfig(t)},{deep:!0,immediate:!0}),o.watch(()=>e.uiMode,t=>{r.setCSSVariables(t==="aplus"?r.aplusCssVar:r.adminCssVar)},{immediate:!0}),()=>{let t;return o.createVNode(c.ConfigProvider,a.value,g(t=o.renderSlot(n,"default",{config:i==null?void 0:i.value}))?t:{default:()=>[t]})}}});exports.ConfigProvider=C;exports.globalConfigCached=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={borderRadius:4},r={...o,colorPrimary:"#0070FF",colorPrimaryHover:"#66A9FF",colorPrimaryActive:"#338CFF",colorTextBase:"#182948",colorText:"#182948",colorTextSecondary:"#526A90",colorTextTertiary:"#8896B0",colorTextPlaceholder:"#BFBFBF",colorBorder:"#DEE4ED",colorSplit:"#E9EDF3",colorInfo:"#0070FF",colorSuccess:"#2ED1A3",colorError:"#FF4D4F",colorWarning:"#FFA940",colorBgContainerDisabled:"#F9F9FA",wireframe:!1,colorBgLayout:"#F2F6F9",colorBgSpotlight:"#000000cc",controlItemBgActive:"#F5F9FF",controlItemBgActiveHover:"#EAF2FF"},c={...o,colorPrimary:"#34B77C",colorPrimaryHover:"#85D4B0",colorPrimaryActive:"#5DC596",colorBgContainerDisabled:"#f5f5f5",colorText:"#333333",colorTextSecondary:"#666666",colorTextTertiary:"#999999",colorTextPlaceholder:"#ABB7CC",colorBorder:"#D9D9D9",colorSplit:"#E9E9E9",colorInfo:"#1890FF",colorSuccess:"#52C41A",colorError:"#FF4D4F",colorWarning:"#FAAD14",colorLink:"#1890FF",wireframe:!1,colorBgLayout:"#FAFAFA",colorBgSpotlight:"#000000cc",controlItemBgActive:"#f3fbf7",controlItemBgActiveHover:"#e6f6ef"};exports.adminToken=c;exports.aplusToken=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={borderRadius:4},r={...o,colorPrimary:"#0070FF",colorPrimaryHover:"#66A9FF",colorPrimaryActive:"#338CFF",colorTextBase:"#182948",colorText:"#182948",colorTextSecondary:"#526A90",colorTextTertiary:"#8896B0",colorTextPlaceholder:"#BFBFBF",colorBorder:"#DEE4ED",colorSplit:"#E9EDF3",colorInfo:"#0070FF",colorSuccess:"#2ED1A3",colorError:"#FF4D4F",colorWarning:"#FFA940",colorBgContainerDisabled:"#F9F9FA",wireframe:!1,colorBgLayout:"#F2F6F9",colorBgSpotlight:"#000000cc",controlItemBgActive:"#F5F9FF",controlItemBgActiveHover:"#EAF2FF",colorBorderSecondary:"#E9EDF3"},c={...o,colorPrimary:"#34B77C",colorPrimaryHover:"#85D4B0",colorPrimaryActive:"#5DC596",colorBgContainerDisabled:"#f5f5f5",colorText:"#333333",colorTextSecondary:"#666666",colorTextTertiary:"#999999",colorTextPlaceholder:"#ABB7CC",colorBorder:"#D9D9D9",colorSplit:"#E9E9E9",colorInfo:"#1890FF",colorSuccess:"#52C41A",colorError:"#FF4D4F",colorWarning:"#FAAD14",colorLink:"#1890FF",wireframe:!1,colorBgLayout:"#FAFAFA",colorBgSpotlight:"#000000cc",controlItemBgActive:"#f3fbf7",controlItemBgActiveHover:"#e6f6ef",colorBorderSecondary:"#E9E9E9"};exports.adminToken=c;exports.aplusToken=r;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditableColumnType } from './interface';
|
|
2
|
+
import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
|
|
2
3
|
import { ExtractPropTypes, PropType, VNode, RendererNode, RendererElement, CSSProperties, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef } from 'vue';
|
|
3
4
|
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
4
5
|
import { VueTypeValidableDef, VueTypeDef } from '../../node_modules/vue-types';
|
|
@@ -325,6 +326,7 @@ declare const _default: <RecordType = any>(__VLS_props: {
|
|
|
325
326
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
326
327
|
setRowData: (index: number, payload: any) => void;
|
|
327
328
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
|
|
329
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
328
330
|
}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
329
331
|
props: {
|
|
330
332
|
loading?: boolean | Partial< ExtractPropTypes<{
|
|
@@ -600,6 +602,7 @@ declare const _default: <RecordType = any>(__VLS_props: {
|
|
|
600
602
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
601
603
|
setRowData: (index: number, payload: any) => void;
|
|
602
604
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
|
|
605
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
603
606
|
}>): void;
|
|
604
607
|
attrs: any;
|
|
605
608
|
slots: Readonly<{
|
|
@@ -912,6 +915,7 @@ declare const _default: <RecordType = any>(__VLS_props: {
|
|
|
912
915
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
913
916
|
setRowData: (index: number, payload: any) => void;
|
|
914
917
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
|
|
918
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
915
919
|
}>): void;
|
|
916
920
|
attrs: any;
|
|
917
921
|
slots: Readonly<{
|
|
@@ -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"),L=require("ant-design-vue"),h=require("../ap-form/index.js"),d=require("lodash-unified");require("../config-provider/index.js");const _=require("../ap-form/context.js");require("./style/index.css");const f=require("../utils/index.js"),P=require("./hooks/use-get-columns.js"),g=require("./utils.js"),T=require("../config-provider/hooks/use-namespace.js"),V=e.defineComponent({name:"EditableTableInner",__name:"form-item",props:{dropdownPrefixCls:{},pagination:{type:[Boolean,Object],default:!1},loading:{type:[Boolean,Object],default:void 0},size:{default:"middle"},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{default:"fixed"},rowClassName:{},title:{},footer:{},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]},transformCellText:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{default:()=>({})}},setup(x,{expose:C}){var i;const a=x,{internalInstance:l,model:b}=_.useInjectForm(),r=e.ref(((i=e.unref(b))==null?void 0:i[a.name])||[]),w=e.useSlots(),y=h.ApForm.useWatch(a.name);e.watch(()=>y.value,t=>{var n;r.value=t,(n=a.onChange)==null||n.call(a,t)});const{b:R,em:D}=T.useNamespace("editable-table"),c=e.ref(),B=P.default(a);function q(t,n){var s;const o=((s=e.unref(r))==null?void 0:s.length)||0;if(f.isDef(a.maxLength)&&o>=a.maxLength)return;const u=[...e.unref(r)||[]];f.isDef(n)?u.splice(n,0,{...t||{}}):u.push({...t||{}}),l==null||l.setFieldValue(a.name,[...e.unref(r)||[],t||{}])}function v(t,n="suffix"){var p;const o=((p=e.unref(r))==null?void 0:p.length)||0,u=d.isNumber(t)?t:t.length;if(f.isDef(a.maxLength)&&o+u>a.maxLength)return;const s=[...e.unref(r)||[]],m=d.isNumber(t)?new Array(t).fill({}):d.cloneDeep(t);n==="suffix"?s.push(...m):s.unshift(...m),l==null||l.setFieldValue(a.name,s)}function N(t){let n=d.cloneDeep(e.unref(r)||[]);const o=d.isNumber(t)?[t]:t;n=n.filter((u,s)=>!o.includes(s)),l==null||l.setFieldValue(a.name,n)}function F(){return e.unref(r)}function E(t){var n;return(n=e.unref(r))==null?void 0:n[t]}function S(t,n){const o=d.cloneDeep(e.unref(r));o[t]&&(o[t]={...o[t],...n},l==null||l.setFieldValue(a.name,[...o]))}function k(t,n){var u;const o=t==="end"?r.value.length-1:t;g.scrollToRowIndex(o,(u=c.value)==null?void 0:u.$el,n)}return C({add:q,remove:N,getRowData:E,getRowsData:F,setRowData:S,addMultiple:v,scrollTo:k}),(t,n)=>(e.openBlock(),e.createBlock(e.unref(h.ApForm).FormItem,e.mergeProps(t.formItem,{name:t.name,label:t.label}),{default:e.withCtx(()=>[e.createVNode(e.unref(L.Table),e.mergeProps(e.unref(d.omit)(a,["name","maxLength","onChange"]),{class:e.unref(R)(),columns:e.unref(B),"data-source":r.value,ref_key:"tableRef",ref:c}),e.createSlots({headerCell:e.withCtx(({column:o})=>[e.unref(g.getColumnIsRequired)(o)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(D)("header-cell","required"))},"*",2),e.createElementVNode("span",null,e.toDisplayString(o.title),1)],64)):e.createCommentVNode("",!0)]),_:2},[e.renderList(w,(o,u)=>({name:u,fn:e.withCtx(s=>[e.renderSlot(t.$slots,u,e.normalizeProps(e.guardReactiveProps(s||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["name","label"]))}});exports.default=V;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EditableColumnType } from './interface';
|
|
2
2
|
import { NamePath, ValidateOptions } from 'ant-design-vue/es/form/interface';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
|
+
import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
|
|
4
5
|
import { ExtractPropTypes, PropType, VNode, RendererNode, RendererElement, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef } from 'vue';
|
|
5
6
|
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
6
7
|
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
@@ -210,6 +211,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: {
|
|
|
210
211
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
211
212
|
setRowData: (index: number, payload: any) => void;
|
|
212
213
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
|
|
214
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
213
215
|
}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
214
216
|
props: {
|
|
215
217
|
loading?: boolean | Partial< ExtractPropTypes<{
|
|
@@ -371,6 +373,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: {
|
|
|
371
373
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
372
374
|
setRowData: (index: number, payload: any) => void;
|
|
373
375
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
|
|
376
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
374
377
|
}>): void;
|
|
375
378
|
attrs: any;
|
|
376
379
|
slots: Readonly<{
|
|
@@ -569,6 +572,7 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: {
|
|
|
569
572
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
570
573
|
setRowData: (index: number, payload: any) => void;
|
|
571
574
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: 'prefix' | 'suffix') => void;
|
|
575
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
572
576
|
}>): void;
|
|
573
577
|
attrs: any;
|
|
574
578
|
slots: Readonly<{
|
|
@@ -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"),P=require("ant-design-vue"),m=require("../ap-form/index.js"),c=require("lodash-unified");require("../config-provider/index.js");require("../hooks/index.js");const p=require("../utils/index.js"),g=require("./utils.js"),j=require("./hooks/use-get-columns.js");require("./style/index.css");const z=require("../config-provider/hooks/use-namespace.js"),I=require("../hooks/useControllableValue.js"),O=e.defineComponent({name:"EditableTable",__name:"index",props:{dropdownPrefixCls:{},pagination:{type:[Boolean,Object],default:!1},loading:{type:[Boolean,Object],default:void 0},size:{default:"middle"},bordered:{type:Boolean,default:!1},locale:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{default:"fixed"},rowClassName:{},title:{},footer:{},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]},transformCellText:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(C,{expose:w,emit:b}){const l=C,{b:v,em:y}=z.useNamespace("editable-table"),R=e.useSlots(),D=b,h=e.ref(),{value:u,updateValue:B}=I.useControllableValue(l,D),s=e.ref(),F=m.ApForm.useWatch(l.name,s);e.watch(()=>F.value,n=>{var a;B(n),(a=l.onChange)==null||a.call(l,n)});const q=j.default(l);function N(){var n;(n=s.value)==null||n.resetFields()}async function _(n,a){var t;const o=await((t=s.value)==null?void 0:t.validateFields(n,a));return o==null?void 0:o[l.name]}function V(n,a){var r,i,d;const o=((r=e.unref(u))==null?void 0:r.length)||0;if(p.isDef(l.maxLength)&&o>=l.maxLength)return;const t=[...e.unref(u)||[]];p.isDef(a)?t.splice(a,0,{...n||{}}):t.push({...n||{}}),(d=(i=s.value)==null?void 0:i.setFieldValue)==null||d.call(i,l.name,t)}function k(n,a="suffix"){var d,f,x;const o=((d=e.unref(u))==null?void 0:d.length)||0,t=c.isNumber(n)?n:n.length;if(p.isDef(l.maxLength)&&o+t>l.maxLength)return;const r=[...e.unref(u)||[]],i=c.isNumber(n)?new Array(n).fill({}):c.cloneDeep(n);a==="suffix"?r.push(...i):r.unshift(...i),(x=(f=s.value)==null?void 0:f.setFieldValue)==null||x.call(f,l.name,r)}function E(n){var t,r;let a=c.cloneDeep(e.unref(u)||[]);const o=c.isNumber(n)?[n]:n;a=a.filter((i,d)=>!o.includes(d)),(r=(t=s.value)==null?void 0:t.setFieldValue)==null||r.call(t,l.name,a)}function S(){return e.unref(u)}function L(n){var a;return(a=e.unref(u))==null?void 0:a[n]}function T(n,a){var t,r;const o=c.cloneDeep(e.unref(u));o[n]&&(o[n]={...o[n],...a},(r=(t=s.value)==null?void 0:t.setFieldValue)==null||r.call(t,l.name,[...o]))}function A(n,a){var t;const o=n==="end"?u.value.length-1:n;g.scrollToRowIndex(o,(t=h.value)==null?void 0:t.$el,a)}return w({resetFields:N,validateFields:_,add:V,remove:E,getRowData:L,getRowsData:S,setRowData:T,addMultiple:k,scrollTo:A}),(n,a)=>(e.openBlock(),e.createBlock(e.unref(m.ApForm),{"initial-values":{[l.name]:e.unref(u)},ref_key:"formRef",ref:s},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ApForm).FormItem,{name:n.name,"no-style":""},{default:e.withCtx(()=>[e.createVNode(e.unref(P.Table),e.mergeProps(e.unref(c.omit)(l,["name","value","onUpdate:value","maxLength","onChange"]),{class:e.unref(v)(),columns:e.unref(q),"data-source":e.unref(u),ref_key:"tableRef",ref:h}),e.createSlots({headerCell:e.withCtx(({column:o})=>[e.unref(g.getColumnIsRequired)(o)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(y)("header-cell","required"))},"*",2),e.createElementVNode("span",null,e.toDisplayString(o.title),1)],64)):e.createCommentVNode("",!0)]),_:2},[e.renderList(R,(o,t)=>({name:t,fn:e.withCtx(r=>[e.renderSlot(n.$slots,t,e.normalizeProps(e.guardReactiveProps(r||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=O;
|
|
@@ -5,6 +5,7 @@ import { DataIndex } from 'ant-design-vue/es/vc-table/interface';
|
|
|
5
5
|
import { FormItemProps } from 'ant-design-vue';
|
|
6
6
|
import { VNode } from 'vue';
|
|
7
7
|
import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
|
|
8
|
+
import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
|
|
8
9
|
|
|
9
10
|
export type EditableColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? Omit<ColumnType<RecordType>, 'children' | 'customRender' | 'ellipsis'> & {
|
|
10
11
|
children?: EditableColumnType<RecordType, ValueType>;
|
|
@@ -158,6 +159,13 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
|
|
|
158
159
|
* @returns
|
|
159
160
|
*/
|
|
160
161
|
setRowData: (index: number, data: Partial<RecordType>) => void;
|
|
162
|
+
/**
|
|
163
|
+
* 滚动到表格的某行
|
|
164
|
+
* @param index
|
|
165
|
+
* @param options
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
168
|
+
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
161
169
|
};
|
|
162
170
|
/**
|
|
163
171
|
* 可编辑表格作为表单项暴露的实例
|
|
@@ -12,31 +12,11 @@
|
|
|
12
12
|
flex: 1;
|
|
13
13
|
}
|
|
14
14
|
.aplus-editable-table tr > th.ant-table-cell {
|
|
15
|
-
background-color:
|
|
16
|
-
border-bottom-color: #E9EDF3;
|
|
15
|
+
background-color: var(--ap-table-header-bg);
|
|
17
16
|
}
|
|
18
17
|
.aplus-editable-table tr > th.ant-table-cell::before {
|
|
19
18
|
display: none;
|
|
20
19
|
}
|
|
21
|
-
.aplus-editable-table tr > td.ant-table-cell {
|
|
22
|
-
border-top-color: #E9EDF3;
|
|
23
|
-
}
|
|
24
|
-
.aplus-editable-table-admin .ant-pagination {
|
|
25
|
-
margin-bottom: 0 !important;
|
|
26
|
-
}
|
|
27
|
-
.aplus-editable-table-admin .ant-pagination .ant-pagination-total-text {
|
|
28
|
-
flex: 1;
|
|
29
|
-
}
|
|
30
|
-
.aplus-editable-table-admin tr > th.ant-table-cell {
|
|
31
|
-
background-color: #FAFAFA;
|
|
32
|
-
border-bottom-color: #E9E9E9;
|
|
33
|
-
}
|
|
34
|
-
.aplus-editable-table-admin tr > th.ant-table-cell::before {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
.aplus-editable-table-admin tr > td.ant-table-cell {
|
|
38
|
-
border-top-color: #E9E9E9;
|
|
39
|
-
}
|
|
40
20
|
.aplus-editable-table .ant-table.ant-table-middle .ant-table-row .ant-table-cell:has(.is-editable) {
|
|
41
21
|
padding: 20px 16px 0px;
|
|
42
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditableColumnType } from './interface';
|
|
2
|
+
import { StandardBehaviorOptions } from '../../node_modules/scroll-into-view-if-needed';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 获取编辑模式下默认映射的组件
|
|
@@ -20,3 +21,10 @@ export declare function getColumnIsRequired(column: EditableColumnType<any, 'tex
|
|
|
20
21
|
*/
|
|
21
22
|
export declare function getRawDisplayValue(column: EditableColumnType, value: any): any;
|
|
22
23
|
export declare function mergeClass(current: string, classNames?: string | string[]): string;
|
|
24
|
+
/**
|
|
25
|
+
* 滚动到表格的某行
|
|
26
|
+
* @param index
|
|
27
|
+
* @param container
|
|
28
|
+
* @param options
|
|
29
|
+
*/
|
|
30
|
+
export declare function scrollToRowIndex(index: number, container?: HTMLElement, options?: StandardBehaviorOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lodash-unified"),i=require("../ap-table/constants.js"),s=require("../utils/index.js"),l=require("../ap-field/number/helper.js"),u=require("scroll-into-view-if-needed");function d(r){const e=i.apTableFormItemMap[r];return e||console.warn(`${r} can not render because of no default renderer, use customRender instead.`),e}function f(r){if(!r.fieldProps)return!1;const e=n.isFunction(r.fieldProps)?r.fieldProps({}):r.fieldProps;return s.isDef(e.required)?e.required:(n.isArray(e.rules)?e.rules:e.rules?[e.rules]:[]).some(o=>o.required)}function a(r,e){if(r.valueType==="text"||r.valueType==="textArea")return e||"--";if(r.valueType==="number"){const t=r.fieldProps?n.isFunction(r.fieldProps)?r.fieldProps({}):r.fieldProps:{};return l.getValueStr(e,t)||"--"}return e}function c(r,e){const t=[r];if(e){const o=n.isArray(e)?e:[e];t.unshift(...o)}return t.join(" ")}function p(r,e=document.body,t={}){const o=e.querySelectorAll("tr.ant-table-row")[r];console.log(o),o&&u(o,{scrollMode:"if-needed",block:"nearest",behavior:"smooth",...t})}exports.getColumnIsRequired=f;exports.getEditableComponent=d;exports.getRawDisplayValue=a;exports.mergeClass=c;exports.scrollToRowIndex=p;
|