@aplus-frontend/ui 0.1.28 → 0.1.30
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 +78 -76
- package/es/src/ap-field/date-range/index.vue.mjs +154 -109
- package/es/src/ap-field/interface.d.ts +4 -0
- package/es/src/ap-field/select/index.vue.mjs +4 -2
- package/es/src/ap-form/ap-form.vue.d.ts +1 -1
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/es/src/ap-form/style/ap-form-item.css +2 -0
- package/es/src/ap-table/ap-table.vue.mjs +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -97
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +37 -33
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +5 -6
- package/es/src/ap-table/components/setting/utils.d.ts +7 -1
- package/es/src/ap-table/components/setting/utils.mjs +37 -22
- package/es/src/ap-table/constants.d.ts +12 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +101 -33
- package/es/src/ap-table/interface.d.ts +8 -1
- package/es/src/ap-table/utils.mjs +42 -42
- package/es/src/business/ap-action-button/ApActionButton.vue.d.ts +43 -0
- package/es/src/business/ap-action-button/ApActionButton.vue.mjs +4 -0
- package/es/src/business/ap-action-button/ApActionButton.vue2.mjs +97 -0
- package/es/src/business/ap-action-button/index.css +6 -0
- package/es/src/business/ap-action-button/interface.d.ts +6 -0
- package/es/src/business/ap-action-button/interface.mjs +1 -0
- package/es/src/business/index.d.ts +265 -0
- package/es/src/business/index.mjs +25 -21
- package/es/src/editable-table/form-item.vue.d.ts +2 -1
- package/es/src/editable-table/form-item.vue.mjs +69 -65
- package/es/src/editable-table/index.vue.d.ts +2 -1
- package/es/src/editable-table/index.vue.mjs +84 -79
- package/es/src/editable-table/interface.d.ts +6 -0
- package/es/src/index.mjs +209 -207
- package/es/src/theme/ap-action-button/ap-action-button.css +6 -0
- package/es/src/theme/ap-form/ap-form-item.css +2 -0
- package/es/src/work-order-modal/index.mjs +4 -3
- package/es/src/work-order-modal/interfaces.d.ts +3 -0
- package/es/src/work-order-modal/interfaces.mjs +6 -1
- package/es/src/work-order-modal/work-order-modal.vue.mjs +28 -28
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +4 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
- package/lib/src/ap-form/style/ap-form-item.css +2 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +7 -1
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/constants.d.ts +12 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +6 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/interface.d.ts +8 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-action-button/ApActionButton.vue.d.ts +43 -0
- package/lib/src/business/ap-action-button/ApActionButton.vue.js +1 -0
- package/lib/src/business/ap-action-button/ApActionButton.vue2.js +1 -0
- package/lib/src/business/ap-action-button/index.css +6 -0
- package/lib/src/business/ap-action-button/interface.d.ts +6 -0
- package/lib/src/business/ap-action-button/interface.js +1 -0
- package/lib/src/business/index.d.ts +265 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +2 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +2 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +6 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-action-button/ap-action-button.css +6 -0
- package/lib/src/theme/ap-form/ap-form-item.css +2 -0
- package/lib/src/work-order-modal/index.js +1 -1
- package/lib/src/work-order-modal/interfaces.d.ts +3 -0
- package/lib/src/work-order-modal/interfaces.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ export type { ApExportGroupProps } from './ap-export-group/interface';
|
|
|
30
30
|
export type { ApLadderProps, ApLadderLabelValue, CurrencyCode, TooltipNeedProps } from './ap-ladder/interface';
|
|
31
31
|
export * from './ap-batch-action-group/interface';
|
|
32
32
|
export type { AttachmentItemProps, ApAttachmentProps } from './ap-attachment';
|
|
33
|
+
export * from './ap-action-button/interface';
|
|
33
34
|
export declare const ApTitle: {
|
|
34
35
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
35
36
|
title: {
|
|
@@ -2798,5 +2799,269 @@ export declare const ApAttachment: DefineComponent<{
|
|
|
2798
2799
|
attachmentList: AttachmentItemProps[];
|
|
2799
2800
|
fileMorePopoverPlacement: TooltipPlacement;
|
|
2800
2801
|
}, {}>;
|
|
2802
|
+
export declare const ApActionButton: {
|
|
2803
|
+
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
2804
|
+
size: {
|
|
2805
|
+
type: PropType<"small" | "large" | "middle">;
|
|
2806
|
+
};
|
|
2807
|
+
type: {
|
|
2808
|
+
type: PropType< ButtonType | "borderLink">;
|
|
2809
|
+
default: string;
|
|
2810
|
+
};
|
|
2811
|
+
title: {
|
|
2812
|
+
type: PropType<string>;
|
|
2813
|
+
};
|
|
2814
|
+
onClick: {
|
|
2815
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
2816
|
+
};
|
|
2817
|
+
onMousedown: {
|
|
2818
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
2819
|
+
};
|
|
2820
|
+
block: {
|
|
2821
|
+
type: PropType<boolean>;
|
|
2822
|
+
};
|
|
2823
|
+
icon: {
|
|
2824
|
+
type: PropType<any>;
|
|
2825
|
+
};
|
|
2826
|
+
disabled: {
|
|
2827
|
+
type: PropType<boolean>;
|
|
2828
|
+
};
|
|
2829
|
+
minWidth: {
|
|
2830
|
+
type: PropType<string | number | boolean>;
|
|
2831
|
+
default: boolean;
|
|
2832
|
+
};
|
|
2833
|
+
target: {
|
|
2834
|
+
type: PropType<string>;
|
|
2835
|
+
};
|
|
2836
|
+
prefixCls: {
|
|
2837
|
+
type: PropType<string>;
|
|
2838
|
+
};
|
|
2839
|
+
htmlType: {
|
|
2840
|
+
type: PropType<ButtonHTMLType>;
|
|
2841
|
+
};
|
|
2842
|
+
shape: {
|
|
2843
|
+
type: PropType<ButtonShape>;
|
|
2844
|
+
};
|
|
2845
|
+
loading: {
|
|
2846
|
+
type: PropType<boolean | {
|
|
2847
|
+
delay?: number;
|
|
2848
|
+
}>;
|
|
2849
|
+
};
|
|
2850
|
+
ghost: {
|
|
2851
|
+
type: PropType<boolean>;
|
|
2852
|
+
};
|
|
2853
|
+
danger: {
|
|
2854
|
+
type: PropType<boolean>;
|
|
2855
|
+
};
|
|
2856
|
+
href: {
|
|
2857
|
+
type: PropType<string>;
|
|
2858
|
+
};
|
|
2859
|
+
borderLinkColor: {
|
|
2860
|
+
type: PropType<string>;
|
|
2861
|
+
};
|
|
2862
|
+
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
2863
|
+
size: {
|
|
2864
|
+
type: PropType<"small" | "large" | "middle">;
|
|
2865
|
+
};
|
|
2866
|
+
type: {
|
|
2867
|
+
type: PropType< ButtonType | "borderLink">;
|
|
2868
|
+
default: string;
|
|
2869
|
+
};
|
|
2870
|
+
title: {
|
|
2871
|
+
type: PropType<string>;
|
|
2872
|
+
};
|
|
2873
|
+
onClick: {
|
|
2874
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
2875
|
+
};
|
|
2876
|
+
onMousedown: {
|
|
2877
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
2878
|
+
};
|
|
2879
|
+
block: {
|
|
2880
|
+
type: PropType<boolean>;
|
|
2881
|
+
};
|
|
2882
|
+
icon: {
|
|
2883
|
+
type: PropType<any>;
|
|
2884
|
+
};
|
|
2885
|
+
disabled: {
|
|
2886
|
+
type: PropType<boolean>;
|
|
2887
|
+
};
|
|
2888
|
+
minWidth: {
|
|
2889
|
+
type: PropType<string | number | boolean>;
|
|
2890
|
+
default: boolean;
|
|
2891
|
+
};
|
|
2892
|
+
target: {
|
|
2893
|
+
type: PropType<string>;
|
|
2894
|
+
};
|
|
2895
|
+
prefixCls: {
|
|
2896
|
+
type: PropType<string>;
|
|
2897
|
+
};
|
|
2898
|
+
htmlType: {
|
|
2899
|
+
type: PropType<ButtonHTMLType>;
|
|
2900
|
+
};
|
|
2901
|
+
shape: {
|
|
2902
|
+
type: PropType<ButtonShape>;
|
|
2903
|
+
};
|
|
2904
|
+
loading: {
|
|
2905
|
+
type: PropType<boolean | {
|
|
2906
|
+
delay?: number;
|
|
2907
|
+
}>;
|
|
2908
|
+
};
|
|
2909
|
+
ghost: {
|
|
2910
|
+
type: PropType<boolean>;
|
|
2911
|
+
};
|
|
2912
|
+
danger: {
|
|
2913
|
+
type: PropType<boolean>;
|
|
2914
|
+
};
|
|
2915
|
+
href: {
|
|
2916
|
+
type: PropType<string>;
|
|
2917
|
+
};
|
|
2918
|
+
borderLinkColor: {
|
|
2919
|
+
type: PropType<string>;
|
|
2920
|
+
};
|
|
2921
|
+
}>>, {
|
|
2922
|
+
type: ButtonType | "borderLink";
|
|
2923
|
+
minWidth: boolean | number | string;
|
|
2924
|
+
}, true, {}, {}, {
|
|
2925
|
+
P: {};
|
|
2926
|
+
B: {};
|
|
2927
|
+
D: {};
|
|
2928
|
+
C: {};
|
|
2929
|
+
M: {};
|
|
2930
|
+
Defaults: {};
|
|
2931
|
+
}, Readonly< ExtractPropTypes<{
|
|
2932
|
+
size: {
|
|
2933
|
+
type: PropType<"small" | "large" | "middle">;
|
|
2934
|
+
};
|
|
2935
|
+
type: {
|
|
2936
|
+
type: PropType< ButtonType | "borderLink">;
|
|
2937
|
+
default: string;
|
|
2938
|
+
};
|
|
2939
|
+
title: {
|
|
2940
|
+
type: PropType<string>;
|
|
2941
|
+
};
|
|
2942
|
+
onClick: {
|
|
2943
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
2944
|
+
};
|
|
2945
|
+
onMousedown: {
|
|
2946
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
2947
|
+
};
|
|
2948
|
+
block: {
|
|
2949
|
+
type: PropType<boolean>;
|
|
2950
|
+
};
|
|
2951
|
+
icon: {
|
|
2952
|
+
type: PropType<any>;
|
|
2953
|
+
};
|
|
2954
|
+
disabled: {
|
|
2955
|
+
type: PropType<boolean>;
|
|
2956
|
+
};
|
|
2957
|
+
minWidth: {
|
|
2958
|
+
type: PropType<string | number | boolean>;
|
|
2959
|
+
default: boolean;
|
|
2960
|
+
};
|
|
2961
|
+
target: {
|
|
2962
|
+
type: PropType<string>;
|
|
2963
|
+
};
|
|
2964
|
+
prefixCls: {
|
|
2965
|
+
type: PropType<string>;
|
|
2966
|
+
};
|
|
2967
|
+
htmlType: {
|
|
2968
|
+
type: PropType<ButtonHTMLType>;
|
|
2969
|
+
};
|
|
2970
|
+
shape: {
|
|
2971
|
+
type: PropType<ButtonShape>;
|
|
2972
|
+
};
|
|
2973
|
+
loading: {
|
|
2974
|
+
type: PropType<boolean | {
|
|
2975
|
+
delay?: number;
|
|
2976
|
+
}>;
|
|
2977
|
+
};
|
|
2978
|
+
ghost: {
|
|
2979
|
+
type: PropType<boolean>;
|
|
2980
|
+
};
|
|
2981
|
+
danger: {
|
|
2982
|
+
type: PropType<boolean>;
|
|
2983
|
+
};
|
|
2984
|
+
href: {
|
|
2985
|
+
type: PropType<string>;
|
|
2986
|
+
};
|
|
2987
|
+
borderLinkColor: {
|
|
2988
|
+
type: PropType<string>;
|
|
2989
|
+
};
|
|
2990
|
+
}>>, {}, {}, {}, {}, {
|
|
2991
|
+
type: ButtonType | "borderLink";
|
|
2992
|
+
minWidth: boolean | number | string;
|
|
2993
|
+
}>;
|
|
2994
|
+
__isFragment?: never;
|
|
2995
|
+
__isTeleport?: never;
|
|
2996
|
+
__isSuspense?: never;
|
|
2997
|
+
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
2998
|
+
size: {
|
|
2999
|
+
type: PropType<"small" | "large" | "middle">;
|
|
3000
|
+
};
|
|
3001
|
+
type: {
|
|
3002
|
+
type: PropType< ButtonType | "borderLink">;
|
|
3003
|
+
default: string;
|
|
3004
|
+
};
|
|
3005
|
+
title: {
|
|
3006
|
+
type: PropType<string>;
|
|
3007
|
+
};
|
|
3008
|
+
onClick: {
|
|
3009
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
3010
|
+
};
|
|
3011
|
+
onMousedown: {
|
|
3012
|
+
type: PropType< MouseEventHandler | MouseEventHandler[]>;
|
|
3013
|
+
};
|
|
3014
|
+
block: {
|
|
3015
|
+
type: PropType<boolean>;
|
|
3016
|
+
};
|
|
3017
|
+
icon: {
|
|
3018
|
+
type: PropType<any>;
|
|
3019
|
+
};
|
|
3020
|
+
disabled: {
|
|
3021
|
+
type: PropType<boolean>;
|
|
3022
|
+
};
|
|
3023
|
+
minWidth: {
|
|
3024
|
+
type: PropType<string | number | boolean>;
|
|
3025
|
+
default: boolean;
|
|
3026
|
+
};
|
|
3027
|
+
target: {
|
|
3028
|
+
type: PropType<string>;
|
|
3029
|
+
};
|
|
3030
|
+
prefixCls: {
|
|
3031
|
+
type: PropType<string>;
|
|
3032
|
+
};
|
|
3033
|
+
htmlType: {
|
|
3034
|
+
type: PropType<ButtonHTMLType>;
|
|
3035
|
+
};
|
|
3036
|
+
shape: {
|
|
3037
|
+
type: PropType<ButtonShape>;
|
|
3038
|
+
};
|
|
3039
|
+
loading: {
|
|
3040
|
+
type: PropType<boolean | {
|
|
3041
|
+
delay?: number;
|
|
3042
|
+
}>;
|
|
3043
|
+
};
|
|
3044
|
+
ghost: {
|
|
3045
|
+
type: PropType<boolean>;
|
|
3046
|
+
};
|
|
3047
|
+
danger: {
|
|
3048
|
+
type: PropType<boolean>;
|
|
3049
|
+
};
|
|
3050
|
+
href: {
|
|
3051
|
+
type: PropType<string>;
|
|
3052
|
+
};
|
|
3053
|
+
borderLinkColor: {
|
|
3054
|
+
type: PropType<string>;
|
|
3055
|
+
};
|
|
3056
|
+
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
3057
|
+
type: ButtonType | "borderLink";
|
|
3058
|
+
minWidth: boolean | number | string;
|
|
3059
|
+
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
3060
|
+
$slots: Partial<Record<string, (_: any) => any>>;
|
|
3061
|
+
}) & ( Plugin & (new (...args: any[]) => {
|
|
3062
|
+
$props: {
|
|
3063
|
+
onClick?: () => void;
|
|
3064
|
+
};
|
|
3065
|
+
}));
|
|
2801
3066
|
export { ApTransformDataHelper };
|
|
2802
3067
|
export * from './ap-table-modal';
|
|
@@ -14,13 +14,15 @@ import "./ap-batch-action-group/ApBatchActionGroup.vue.mjs";
|
|
|
14
14
|
import "./ap-image/ApImage.vue.mjs";
|
|
15
15
|
import "./ap-ladder/ApLadder.vue.mjs";
|
|
16
16
|
import p from "./ap-attachment/ApAttachment.mjs";
|
|
17
|
-
import
|
|
17
|
+
import "./ap-action-button/ApActionButton.vue.mjs";
|
|
18
|
+
import { ApTransformDataHelper as so } from "../utils/ap-trans-data/index.mjs";
|
|
18
19
|
import "./ap-batch-action-group/interface.mjs";
|
|
19
|
-
import
|
|
20
|
+
import "./ap-action-button/interface.mjs";
|
|
21
|
+
import { default as Ao } from "./ap-table-modal/index.mjs";
|
|
20
22
|
import r from "./title/ApTitle.vue2.mjs";
|
|
21
23
|
import i from "./ap-expand-alert/ApExpandAlert.vue2.mjs";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
+
import n from "./ap-status/ApStatus.vue2.mjs";
|
|
25
|
+
import a from "./ap-status/ApStatusGroup.vue2.mjs";
|
|
24
26
|
import c from "./ap-select-layout/select-layout.vue2.mjs";
|
|
25
27
|
import f from "./ap-export-group/ApExportGroup.vue2.mjs";
|
|
26
28
|
import s from "./ap-input-radio/ApInputRadio.vue2.mjs";
|
|
@@ -28,22 +30,24 @@ import _ from "./ap-batch-action/ApBatchAction.vue2.mjs";
|
|
|
28
30
|
import A from "./ap-batch-action-group/ApBatchActionGroup.vue2.mjs";
|
|
29
31
|
import e from "./ap-image/ApImage.vue2.mjs";
|
|
30
32
|
import l from "./ap-ladder/ApLadder.vue2.mjs";
|
|
31
|
-
|
|
33
|
+
import u from "./ap-action-button/ApActionButton.vue2.mjs";
|
|
34
|
+
const Q = o(r), U = i, V = o(t), W = o(n), X = o(a), Y = o(c), Z = o(f), oo = s, to = _, mo = m, po = A, ro = e, io = o(l), no = p, ao = o(u);
|
|
32
35
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
ao as ApActionButton,
|
|
37
|
+
no as ApAttachment,
|
|
38
|
+
to as ApBatchAction,
|
|
39
|
+
po as ApBatchActionGroup,
|
|
40
|
+
U as ApExpandAlert,
|
|
41
|
+
Z as ApExportGroup,
|
|
42
|
+
ro as ApImage,
|
|
43
|
+
oo as ApInputRadio,
|
|
44
|
+
V as ApLabel,
|
|
45
|
+
mo as ApLabelGroup,
|
|
46
|
+
io as ApLadder,
|
|
47
|
+
Y as ApSelectLayout,
|
|
48
|
+
W as ApStatus,
|
|
49
|
+
X as ApStatusGroup,
|
|
50
|
+
Ao as ApTableModal,
|
|
51
|
+
Q as ApTitle,
|
|
52
|
+
so as ApTransformDataHelper
|
|
49
53
|
};
|
|
@@ -9,9 +9,10 @@ declare const _default: <RecordType = any>(__VLS_props: NonNullable<Awaited<type
|
|
|
9
9
|
remove: (index: number | number[]) => void;
|
|
10
10
|
getRowData: (index: number) => UnwrapRefSimple<RecordType>;
|
|
11
11
|
getRowsData: () => UnwrapRefSimple<RecordType>[];
|
|
12
|
-
setRowData: (index: number, payload: any) => void;
|
|
12
|
+
setRowData: (index: number, payload: any, merge?: boolean) => void;
|
|
13
13
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
|
|
14
14
|
scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
|
|
15
|
+
setTableData: (nextTableData: RecordType[]) => void;
|
|
15
16
|
}>): void;
|
|
16
17
|
attrs: any;
|
|
17
18
|
slots: Readonly<{
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
1
|
+
import { defineComponent as q, ref as x, unref as l, useSlots as G, watch as H, openBlock as m, createBlock as y, mergeProps as C, withCtx as d, createVNode as b, createSlots as W, createElementBlock as $, normalizeClass as Q, createCommentVNode as w, createElementVNode as U, toDisplayString as I, normalizeStyle as J, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as ee } from "vue";
|
|
2
|
+
import { Table as te, Tooltip as oe } from "ant-design-vue";
|
|
3
3
|
import { ApForm as R } from "../ap-form/index.mjs";
|
|
4
|
-
import { isArray as
|
|
4
|
+
import { isArray as ae, isNumber as i, cloneDeep as f, omit as le } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { useInjectForm as
|
|
6
|
+
import { useInjectForm as ne } from "../ap-form/context.mjs";
|
|
7
7
|
import "./style/index.css";
|
|
8
|
-
import { isDef as
|
|
9
|
-
import
|
|
10
|
-
import { scrollToRowIndex as
|
|
11
|
-
import { QuestionCircleOutlined as
|
|
12
|
-
import { useToken as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useGlobalConfig as
|
|
15
|
-
const
|
|
8
|
+
import { isDef as p } from "../utils/index.mjs";
|
|
9
|
+
import re from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { scrollToRowIndex as ue, getColumnIsRequired as se } from "./utils.mjs";
|
|
11
|
+
import { QuestionCircleOutlined as de } from "@ant-design/icons-vue";
|
|
12
|
+
import { useToken as me } from "ant-design-vue/es/theme/internal";
|
|
13
|
+
import { useNamespace as ie } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
+
const Fe = /* @__PURE__ */ q({
|
|
16
16
|
name: "EditableTableInner",
|
|
17
17
|
__name: "form-item",
|
|
18
18
|
props: {
|
|
@@ -113,116 +113,120 @@ const Le = /* @__PURE__ */ M({
|
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
setup(B, {
|
|
116
|
-
expose:
|
|
116
|
+
expose: D
|
|
117
117
|
}) {
|
|
118
|
-
const
|
|
119
|
-
function
|
|
120
|
-
return
|
|
118
|
+
const n = B;
|
|
119
|
+
function k(e, t) {
|
|
120
|
+
return ae(t) ? t.reduce((o, a) => o == null ? void 0 : o[a], e) : e == null ? void 0 : e[t];
|
|
121
121
|
}
|
|
122
122
|
const {
|
|
123
123
|
internalInstance: r,
|
|
124
|
-
model:
|
|
125
|
-
} =
|
|
126
|
-
|
|
124
|
+
model: T
|
|
125
|
+
} = ne(), u = x(k(l(T), n.name) || []), F = G(), L = R.useWatch(n.name);
|
|
126
|
+
H(() => L.value, (e) => {
|
|
127
127
|
var t;
|
|
128
|
-
|
|
128
|
+
u.value = e, (t = n.onChange) == null || t.call(n, e);
|
|
129
129
|
}, {
|
|
130
130
|
deep: !0
|
|
131
131
|
});
|
|
132
132
|
const {
|
|
133
|
-
b:
|
|
133
|
+
b: E,
|
|
134
134
|
em: N
|
|
135
|
-
} =
|
|
135
|
+
} = ie("editable-table"), c = x(), S = fe("valueTypeMap"), [, V] = me(), _ = re(n, S);
|
|
136
136
|
function v(e, t) {
|
|
137
|
-
var
|
|
138
|
-
const o = ((
|
|
139
|
-
if (
|
|
137
|
+
var s;
|
|
138
|
+
const o = ((s = l(u)) == null ? void 0 : s.length) || 0;
|
|
139
|
+
if (p(n.maxLength) && o >= n.maxLength)
|
|
140
140
|
return;
|
|
141
|
-
const
|
|
142
|
-
|
|
141
|
+
const a = [...l(u) || []];
|
|
142
|
+
p(t) ? a.splice(t, 0, {
|
|
143
143
|
...e || {}
|
|
144
|
-
}) :
|
|
144
|
+
}) : a.push({
|
|
145
145
|
...e || {}
|
|
146
|
-
}), r == null || r.setFieldValue(
|
|
146
|
+
}), r == null || r.setFieldValue(n.name, a);
|
|
147
147
|
}
|
|
148
148
|
function z(e, t = "suffix") {
|
|
149
149
|
var g;
|
|
150
|
-
const o = ((g =
|
|
151
|
-
if (
|
|
150
|
+
const o = ((g = l(u)) == null ? void 0 : g.length) || 0, a = i(e) ? e : e.length;
|
|
151
|
+
if (p(n.maxLength) && o + a > n.maxLength)
|
|
152
152
|
return;
|
|
153
|
-
const
|
|
154
|
-
t === "suffix" ?
|
|
153
|
+
const s = [...l(u) || []], h = i(e) ? new Array(e).fill({}) : f(e);
|
|
154
|
+
t === "suffix" ? s.push(...h) : s.unshift(...h), r == null || r.setFieldValue(n.name, s);
|
|
155
155
|
}
|
|
156
156
|
function P(e) {
|
|
157
|
-
let t = f(
|
|
157
|
+
let t = f(l(u) || []);
|
|
158
158
|
const o = i(e) ? [e] : e;
|
|
159
|
-
t = t.filter((
|
|
159
|
+
t = t.filter((a, s) => !o.includes(s)), r == null || r.setFieldValue(n.name, t);
|
|
160
160
|
}
|
|
161
161
|
function j() {
|
|
162
|
-
return
|
|
162
|
+
return l(u);
|
|
163
163
|
}
|
|
164
164
|
function A(e) {
|
|
165
165
|
var t;
|
|
166
|
-
return (t =
|
|
166
|
+
return (t = l(u)) == null ? void 0 : t[e];
|
|
167
167
|
}
|
|
168
|
-
function O(e, t) {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
...o[e],
|
|
168
|
+
function O(e, t, o = !0) {
|
|
169
|
+
const a = f(l(u));
|
|
170
|
+
a[e] && (a[e] = {
|
|
171
|
+
...o ? a[e] : {},
|
|
172
172
|
...t
|
|
173
|
-
}, r == null || r.setFieldValue(
|
|
173
|
+
}, r == null || r.setFieldValue(n.name, [...a]));
|
|
174
174
|
}
|
|
175
|
-
function K(e
|
|
176
|
-
|
|
177
|
-
const o = e === "end" ? s.value.length - 1 : e;
|
|
178
|
-
re(o, (n = p.value) == null ? void 0 : n.$el, t);
|
|
175
|
+
function K(e) {
|
|
176
|
+
r == null || r.setFieldValue(n.name, e);
|
|
179
177
|
}
|
|
180
|
-
|
|
178
|
+
function M(e, t) {
|
|
179
|
+
var a;
|
|
180
|
+
const o = e === "end" ? u.value.length - 1 : e;
|
|
181
|
+
ue(o, (a = c.value) == null ? void 0 : a.$el, t);
|
|
182
|
+
}
|
|
183
|
+
return D({
|
|
181
184
|
add: v,
|
|
182
185
|
remove: P,
|
|
183
186
|
getRowData: A,
|
|
184
187
|
getRowsData: j,
|
|
185
188
|
setRowData: O,
|
|
186
189
|
addMultiple: z,
|
|
187
|
-
scrollTo:
|
|
188
|
-
|
|
190
|
+
scrollTo: M,
|
|
191
|
+
setTableData: K
|
|
192
|
+
}), (e, t) => (m(), y(l(R).FormItem, C(e.formItem, {
|
|
189
193
|
name: e.name,
|
|
190
194
|
label: e.label
|
|
191
195
|
}), {
|
|
192
|
-
default: d(() => [b(
|
|
193
|
-
class:
|
|
194
|
-
columns:
|
|
195
|
-
"data-source":
|
|
196
|
+
default: d(() => [b(l(te), C(l(le)(n, ["name", "maxLength", "onChange"]), {
|
|
197
|
+
class: l(E)(),
|
|
198
|
+
columns: l(_),
|
|
199
|
+
"data-source": u.value,
|
|
196
200
|
ref_key: "tableRef",
|
|
197
|
-
ref:
|
|
198
|
-
}),
|
|
201
|
+
ref: c
|
|
202
|
+
}), W({
|
|
199
203
|
headerCell: d(({
|
|
200
204
|
column: o
|
|
201
|
-
}) => [
|
|
205
|
+
}) => [l(se)(o) ? (m(), $("span", {
|
|
202
206
|
key: 0,
|
|
203
|
-
class:
|
|
204
|
-
}, "*", 2)) : w("", !0),
|
|
207
|
+
class: Q(l(N)("header-cell", "required"))
|
|
208
|
+
}, "*", 2)) : w("", !0), U("span", null, I(o.title), 1), o.tooltip ? (m(), y(l(oe), {
|
|
205
209
|
key: 1,
|
|
206
210
|
title: o.tooltip,
|
|
207
211
|
placement: "bottom"
|
|
208
212
|
}, {
|
|
209
|
-
default: d(() => [b(
|
|
210
|
-
style:
|
|
213
|
+
default: d(() => [b(l(de), {
|
|
214
|
+
style: J({
|
|
211
215
|
paddingLeft: "4px",
|
|
212
|
-
color:
|
|
216
|
+
color: l(V).colorPrimary
|
|
213
217
|
})
|
|
214
218
|
}, null, 8, ["style"])]),
|
|
215
219
|
_: 2
|
|
216
220
|
}, 1032, ["title"])) : w("", !0)]),
|
|
217
221
|
_: 2
|
|
218
|
-
}, [
|
|
219
|
-
name:
|
|
220
|
-
fn: d((
|
|
222
|
+
}, [X(F, (o, a) => ({
|
|
223
|
+
name: a,
|
|
224
|
+
fn: d((s) => [Y(e.$slots, a, Z(ee(s || {})))])
|
|
221
225
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
222
226
|
_: 3
|
|
223
227
|
}, 16, ["name", "label"]));
|
|
224
228
|
}
|
|
225
229
|
});
|
|
226
230
|
export {
|
|
227
|
-
|
|
231
|
+
Fe as default
|
|
228
232
|
};
|
|
@@ -16,10 +16,11 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
|
|
|
16
16
|
remove: (index: number | number[]) => void;
|
|
17
17
|
getRowData: (index: number) => RecordType;
|
|
18
18
|
getRowsData: () => RecordType[];
|
|
19
|
-
setRowData: (index: number, payload: any) => void;
|
|
19
|
+
setRowData: (index: number, payload: any, merge?: boolean) => void;
|
|
20
20
|
addMultiple: (list: number | Partial<RecordType>[], insetIn?: "prefix" | "suffix") => void;
|
|
21
21
|
scrollTo: (index: number | "end", options?: StandardBehaviorOptions) => void;
|
|
22
22
|
clear: () => void;
|
|
23
|
+
setTableData: (nextTableData: RecordType[]) => void;
|
|
23
24
|
}>): void;
|
|
24
25
|
attrs: any;
|
|
25
26
|
slots: Readonly<{
|