@aplus-frontend/ui 7.12.4 → 7.12.6
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 +21 -20
- package/es/src/ag-grid/editable/index.vue.mjs +9 -8
- package/es/src/ag-grid/editable/interface.d.ts +2 -1
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/es/src/ap-table/constants.d.ts +5 -5
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +61 -61
- package/es/src/business/ap-upload/style/single-file.mjs +2 -2
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.mjs +2 -2
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- 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 +2 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/lib/src/ap-table/constants.d.ts +5 -5
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/style/single-file.js +1 -1
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ import { useEditableFormItemApi as se } from "../hooks/use-editable-form-item-ap
|
|
|
11
11
|
import "../index.vue2.mjs";
|
|
12
12
|
import ie from "../style/editable.mjs";
|
|
13
13
|
import { getShadowName as me } from "../utils.mjs";
|
|
14
|
-
import { getColumnTransformOptions as ue, arrayToObject as
|
|
14
|
+
import { getColumnTransformOptions as ue, arrayToObject as b } from "./utils.mjs";
|
|
15
15
|
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
16
16
|
import { useGlobalConfig as pe } from "../../config-provider/hooks/use-global-config.mjs";
|
|
17
17
|
import ce from "../index.vue.mjs";
|
|
@@ -131,13 +131,13 @@ const _e = /* @__PURE__ */ A({
|
|
|
131
131
|
name: {},
|
|
132
132
|
formItem: {}
|
|
133
133
|
},
|
|
134
|
-
setup(
|
|
134
|
+
setup(C, {
|
|
135
135
|
expose: R
|
|
136
136
|
}) {
|
|
137
|
-
const B = L(), o =
|
|
137
|
+
const B = L(), o = C, {
|
|
138
138
|
b: v
|
|
139
|
-
} = de("editable-aggrid"), x = ie("editable-aggrid"),
|
|
140
|
-
internalInstance:
|
|
139
|
+
} = de("editable-aggrid"), x = ie("editable-aggrid"), l = g(), {
|
|
140
|
+
internalInstance: r
|
|
141
141
|
} = te();
|
|
142
142
|
function I(e) {
|
|
143
143
|
const t = ue(o.columns || []);
|
|
@@ -151,12 +151,12 @@ const _e = /* @__PURE__ */ A({
|
|
|
151
151
|
const i = me(o.name);
|
|
152
152
|
let c = [];
|
|
153
153
|
P(() => {
|
|
154
|
-
const e = o.formItem?.initialValue ?? ne(
|
|
155
|
-
e && (
|
|
154
|
+
const e = o.formItem?.initialValue ?? ne(r?.getInitialValues() ?? {}, o.name);
|
|
155
|
+
e && (r?.updateInitialModel(i, b(u(e), o.rowKey)), c = u(e), _(u(e), "suffix", !0));
|
|
156
156
|
});
|
|
157
|
-
const
|
|
157
|
+
const s = g([]), S = ae(o.name);
|
|
158
158
|
G(() => S.value, (e) => {
|
|
159
|
-
ee(e,
|
|
159
|
+
ee(e, s.value) || f(e ?? u(c));
|
|
160
160
|
}, {
|
|
161
161
|
deep: !0,
|
|
162
162
|
flush: "post"
|
|
@@ -172,9 +172,9 @@ const _e = /* @__PURE__ */ A({
|
|
|
172
172
|
setRowData: O,
|
|
173
173
|
clear: H,
|
|
174
174
|
refreshRowIds: d
|
|
175
|
-
} = se(o,
|
|
175
|
+
} = se(o, r, s, i);
|
|
176
176
|
function K() {
|
|
177
|
-
const e =
|
|
177
|
+
const e = l.value?._internalGridApi;
|
|
178
178
|
if (!d.value?.length || !e)
|
|
179
179
|
return;
|
|
180
180
|
const t = d.value.map((a) => e.getRowNode(a)).filter((a) => !!a);
|
|
@@ -184,16 +184,16 @@ const _e = /* @__PURE__ */ A({
|
|
|
184
184
|
}), d.value = [];
|
|
185
185
|
}
|
|
186
186
|
function f(e) {
|
|
187
|
-
|
|
188
|
-
const t =
|
|
189
|
-
|
|
187
|
+
s.value = [...e];
|
|
188
|
+
const t = b(e, o.rowKey);
|
|
189
|
+
r?.setFieldValue(o.name, [...e]), r?.setFieldValue(i, t);
|
|
190
190
|
}
|
|
191
191
|
function w(e, t) {
|
|
192
|
-
const a = e === "end" ?
|
|
193
|
-
|
|
192
|
+
const a = e === "end" ? s.value.length - 1 : e;
|
|
193
|
+
l.value?.scrollToRow(a, t);
|
|
194
194
|
}
|
|
195
195
|
function M(e, t) {
|
|
196
|
-
|
|
196
|
+
l.value?.scrollToColumn(e, t);
|
|
197
197
|
}
|
|
198
198
|
return R({
|
|
199
199
|
add: F,
|
|
@@ -207,7 +207,8 @@ const _e = /* @__PURE__ */ A({
|
|
|
207
207
|
setTableData: f,
|
|
208
208
|
scrollTo: w,
|
|
209
209
|
scrollToRow: w,
|
|
210
|
-
scrollToColumn: M
|
|
210
|
+
scrollToColumn: M,
|
|
211
|
+
table: l
|
|
211
212
|
}), (e, t) => (U(), W($, null, [p(n(y).FormItem, {
|
|
212
213
|
hidden: "",
|
|
213
214
|
name: e.name,
|
|
@@ -218,11 +219,11 @@ const _e = /* @__PURE__ */ A({
|
|
|
218
219
|
}, {
|
|
219
220
|
default: h(() => [p(ce, q(n(oe)(o, ["name", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
220
221
|
ref_key: "tableRef",
|
|
221
|
-
ref:
|
|
222
|
+
ref: l,
|
|
222
223
|
class: [n(v)(), n(x)],
|
|
223
224
|
size: "mini",
|
|
224
225
|
columns: n(E),
|
|
225
|
-
"data-source":
|
|
226
|
+
"data-source": s.value,
|
|
226
227
|
"search-form": !1,
|
|
227
228
|
onUpdate: K
|
|
228
229
|
}), J({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as M, useSlots as $, ref as
|
|
2
|
-
import { isEqual as te, isArray as
|
|
1
|
+
import { defineComponent as M, useSlots as $, ref as b, watch as q, unref as l, createBlock as J, openBlock as Q, withCtx as m, createVNode as v, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as ee, normalizeProps as oe, guardReactiveProps as ae } from "vue";
|
|
2
|
+
import { isEqual as te, isArray as R, omit as ne } from "lodash-unified";
|
|
3
3
|
import { ApForm as c } from "../../ap-form/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
@@ -137,10 +137,10 @@ const Fe = /* @__PURE__ */ M({
|
|
|
137
137
|
}) {
|
|
138
138
|
const S = $(), a = C, {
|
|
139
139
|
b: T
|
|
140
|
-
} = de("editable-aggrid"), F = se("editable-aggrid"), _ = B, i =
|
|
140
|
+
} = de("editable-aggrid"), F = se("editable-aggrid"), _ = B, i = b(), {
|
|
141
141
|
value: s,
|
|
142
142
|
updateValue: y
|
|
143
|
-
} = ue(a, _), r =
|
|
143
|
+
} = ue(a, _), r = b(), E = c.useWatch(a.name, r);
|
|
144
144
|
q(s, (e) => {
|
|
145
145
|
const o = f(e, a.rowKey);
|
|
146
146
|
te(o, l(E)) || r.value?.setFieldValue(a.name, o);
|
|
@@ -172,7 +172,7 @@ const Fe = /* @__PURE__ */ M({
|
|
|
172
172
|
r.value?.resetFields();
|
|
173
173
|
}
|
|
174
174
|
function w(e) {
|
|
175
|
-
return e ? (
|
|
175
|
+
return e ? (R(e) ? e : [e]).map((t) => R(t) ? [a.name, ...t] : [a.name, t]) : void 0;
|
|
176
176
|
}
|
|
177
177
|
function g(e) {
|
|
178
178
|
try {
|
|
@@ -217,7 +217,8 @@ const Fe = /* @__PURE__ */ M({
|
|
|
217
217
|
setTableData: U,
|
|
218
218
|
scrollTo: h,
|
|
219
219
|
scrollToRow: h,
|
|
220
|
-
scrollToColumn: W
|
|
220
|
+
scrollToColumn: W,
|
|
221
|
+
table: i
|
|
221
222
|
}), (e, o) => (Q(), J(l(c), {
|
|
222
223
|
ref_key: "formRef",
|
|
223
224
|
ref: r,
|
|
@@ -228,11 +229,11 @@ const Fe = /* @__PURE__ */ M({
|
|
|
228
229
|
height: "100%"
|
|
229
230
|
}
|
|
230
231
|
}, {
|
|
231
|
-
default: m(() => [
|
|
232
|
+
default: m(() => [v(l(c).FormItem, {
|
|
232
233
|
name: e.name,
|
|
233
234
|
"no-style": ""
|
|
234
235
|
}, {
|
|
235
|
-
default: m(() => [
|
|
236
|
+
default: m(() => [v(me, X(l(ne)(a, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
236
237
|
ref_key: "tableRef",
|
|
237
238
|
ref: i,
|
|
238
239
|
class: [l(T)(), l(F)],
|
|
@@ -5,7 +5,7 @@ import { ApFormItemProps } from '../../ap-form';
|
|
|
5
5
|
import { ApTableValueFields, ApTableValueTypes, CommonFieldReturnType, FieldPropsType } from '../../ap-table/interface';
|
|
6
6
|
import { EditableTableExpose } from '../../editable-table';
|
|
7
7
|
import { Recordable } from '../../type';
|
|
8
|
-
import { AgGridColumnType, AgGridProps } from '../interface';
|
|
8
|
+
import { AgGridColumnType, AgGridExpose, AgGridProps } from '../interface';
|
|
9
9
|
export type EditableAgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<AgGridColumnType<RecordType, ExtraValueType, ValueType>, 'children' | 'customRender' | 'hideInSearch' | 'customRenderFormItem' | 'fieldProps'> & {
|
|
10
10
|
children?: EditableAgGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
11
11
|
/**
|
|
@@ -85,6 +85,7 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
|
|
|
85
85
|
scrollToColumn: (key: string, position?: 'auto' | 'start' | 'middle' | 'end') => void;
|
|
86
86
|
remove: (data: RecordType | RecordType[]) => void;
|
|
87
87
|
validateFieldsReturnTransformed: EditableTableExpose<ModelType, RecordType>['validateFields'];
|
|
88
|
+
table: AgGridExpose;
|
|
88
89
|
};
|
|
89
90
|
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'>;
|
|
90
91
|
export type EditableAgGridFormItemProps<RecordType = any> = Omit<EditableAgGridProps<RecordType>, 'name' | 'value' | 'onUpdate:value'> & {
|
|
@@ -43,10 +43,10 @@ declare function __VLS_template(): {
|
|
|
43
43
|
readonly value?: ValueType | undefined;
|
|
44
44
|
readonly disabled?: boolean | undefined;
|
|
45
45
|
readonly placeholder?: string | undefined;
|
|
46
|
+
readonly id?: string | undefined;
|
|
46
47
|
readonly prefixCls?: string | undefined;
|
|
47
48
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
48
49
|
readonly name?: string | undefined;
|
|
49
|
-
readonly id?: string | undefined;
|
|
50
50
|
readonly readonly?: boolean | undefined;
|
|
51
51
|
readonly autofocus?: boolean | undefined;
|
|
52
52
|
readonly bordered?: boolean | undefined;
|
|
@@ -564,10 +564,10 @@ declare const __VLS_component: DefineComponent<ApFormItemNumberProps, {
|
|
|
564
564
|
readonly value?: ValueType | undefined;
|
|
565
565
|
readonly disabled?: boolean | undefined;
|
|
566
566
|
readonly placeholder?: string | undefined;
|
|
567
|
+
readonly id?: string | undefined;
|
|
567
568
|
readonly prefixCls?: string | undefined;
|
|
568
569
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
569
570
|
readonly name?: string | undefined;
|
|
570
|
-
readonly id?: string | undefined;
|
|
571
571
|
readonly readonly?: boolean | undefined;
|
|
572
572
|
readonly autofocus?: boolean | undefined;
|
|
573
573
|
readonly bordered?: boolean | undefined;
|
|
@@ -67,12 +67,12 @@ declare function __VLS_template(): {
|
|
|
67
67
|
readonly animation?: string | undefined;
|
|
68
68
|
readonly children?: VueNode[] | undefined;
|
|
69
69
|
readonly placeholder?: any;
|
|
70
|
+
readonly id?: string | undefined;
|
|
70
71
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
71
72
|
readonly prefixCls?: string | undefined;
|
|
72
73
|
readonly virtual?: boolean | undefined;
|
|
73
74
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
74
75
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
75
|
-
readonly id?: string | undefined;
|
|
76
76
|
readonly autofocus?: boolean | undefined;
|
|
77
77
|
readonly loading?: boolean | undefined;
|
|
78
78
|
readonly bordered?: boolean | undefined;
|
|
@@ -725,12 +725,12 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
725
725
|
readonly animation?: string | undefined;
|
|
726
726
|
readonly children?: VueNode[] | undefined;
|
|
727
727
|
readonly placeholder?: any;
|
|
728
|
+
readonly id?: string | undefined;
|
|
728
729
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
729
730
|
readonly prefixCls?: string | undefined;
|
|
730
731
|
readonly virtual?: boolean | undefined;
|
|
731
732
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
732
733
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
733
|
-
readonly id?: string | undefined;
|
|
734
734
|
readonly autofocus?: boolean | undefined;
|
|
735
735
|
readonly loading?: boolean | undefined;
|
|
736
736
|
readonly bordered?: boolean | undefined;
|
|
@@ -47,10 +47,10 @@ declare function __VLS_template(): {
|
|
|
47
47
|
readonly value?: string | number | undefined;
|
|
48
48
|
readonly disabled?: boolean | undefined;
|
|
49
49
|
readonly placeholder?: string | number | undefined;
|
|
50
|
+
readonly id?: string | undefined;
|
|
50
51
|
readonly prefixCls?: string | undefined;
|
|
51
52
|
readonly name?: string | undefined;
|
|
52
53
|
readonly focused?: boolean | undefined;
|
|
53
|
-
readonly id?: string | undefined;
|
|
54
54
|
readonly readonly?: boolean | undefined;
|
|
55
55
|
readonly autofocus?: boolean | undefined;
|
|
56
56
|
readonly autocomplete?: string | undefined;
|
|
@@ -204,10 +204,10 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
204
204
|
readonly value?: string | number | undefined;
|
|
205
205
|
readonly disabled?: boolean | undefined;
|
|
206
206
|
readonly placeholder?: string | number | undefined;
|
|
207
|
+
readonly id?: string | undefined;
|
|
207
208
|
readonly prefixCls?: string | undefined;
|
|
208
209
|
readonly name?: string | undefined;
|
|
209
210
|
readonly focused?: boolean | undefined;
|
|
210
|
-
readonly id?: string | undefined;
|
|
211
211
|
readonly readonly?: boolean | undefined;
|
|
212
212
|
readonly autofocus?: boolean | undefined;
|
|
213
213
|
readonly autocomplete?: string | undefined;
|
|
@@ -48,10 +48,10 @@ declare function __VLS_template(): {
|
|
|
48
48
|
readonly value?: string | number | undefined;
|
|
49
49
|
readonly disabled?: boolean | undefined;
|
|
50
50
|
readonly placeholder?: string | number | undefined;
|
|
51
|
+
readonly id?: string | undefined;
|
|
51
52
|
readonly prefixCls?: string | undefined;
|
|
52
53
|
readonly name?: string | undefined;
|
|
53
54
|
readonly focused?: boolean | undefined;
|
|
54
|
-
readonly id?: string | undefined;
|
|
55
55
|
readonly readonly?: boolean | undefined;
|
|
56
56
|
readonly autofocus?: boolean | undefined;
|
|
57
57
|
readonly autocomplete?: string | undefined;
|
|
@@ -211,10 +211,10 @@ declare const __VLS_component: DefineComponent<ApFormItemTextPasswordProps, {
|
|
|
211
211
|
readonly value?: string | number | undefined;
|
|
212
212
|
readonly disabled?: boolean | undefined;
|
|
213
213
|
readonly placeholder?: string | number | undefined;
|
|
214
|
+
readonly id?: string | undefined;
|
|
214
215
|
readonly prefixCls?: string | undefined;
|
|
215
216
|
readonly name?: string | undefined;
|
|
216
217
|
readonly focused?: boolean | undefined;
|
|
217
|
-
readonly id?: string | undefined;
|
|
218
218
|
readonly readonly?: boolean | undefined;
|
|
219
219
|
readonly autofocus?: boolean | undefined;
|
|
220
220
|
readonly autocomplete?: string | undefined;
|
|
@@ -71,12 +71,12 @@ declare function __VLS_template(): {
|
|
|
71
71
|
readonly animation?: string | undefined;
|
|
72
72
|
readonly children?: VueNode[] | undefined;
|
|
73
73
|
readonly placeholder?: any;
|
|
74
|
+
readonly id?: string | undefined;
|
|
74
75
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
75
76
|
readonly prefixCls?: string | undefined;
|
|
76
77
|
readonly virtual?: boolean | undefined;
|
|
77
78
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
78
79
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
79
|
-
readonly id?: string | undefined;
|
|
80
80
|
readonly autofocus?: boolean | undefined;
|
|
81
81
|
readonly loading?: boolean | undefined;
|
|
82
82
|
readonly bordered?: boolean | undefined;
|
|
@@ -875,12 +875,12 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
875
875
|
readonly animation?: string | undefined;
|
|
876
876
|
readonly children?: VueNode[] | undefined;
|
|
877
877
|
readonly placeholder?: any;
|
|
878
|
+
readonly id?: string | undefined;
|
|
878
879
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
879
880
|
readonly prefixCls?: string | undefined;
|
|
880
881
|
readonly virtual?: boolean | undefined;
|
|
881
882
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
882
883
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
883
|
-
readonly id?: string | undefined;
|
|
884
884
|
readonly autofocus?: boolean | undefined;
|
|
885
885
|
readonly loading?: boolean | undefined;
|
|
886
886
|
readonly bordered?: boolean | undefined;
|
|
@@ -186,10 +186,10 @@ export declare const apTableFormItemMap: {
|
|
|
186
186
|
readonly value?: ValueType | undefined;
|
|
187
187
|
readonly disabled?: boolean | undefined;
|
|
188
188
|
readonly placeholder?: string | undefined;
|
|
189
|
+
readonly id?: string | undefined;
|
|
189
190
|
readonly prefixCls?: string | undefined;
|
|
190
191
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
191
192
|
readonly name?: string | undefined;
|
|
192
|
-
readonly id?: string | undefined;
|
|
193
193
|
readonly readonly?: boolean | undefined;
|
|
194
194
|
readonly autofocus?: boolean | undefined;
|
|
195
195
|
readonly bordered?: boolean | undefined;
|
|
@@ -955,12 +955,12 @@ export declare const apTableFormItemMap: {
|
|
|
955
955
|
readonly animation?: string | undefined;
|
|
956
956
|
readonly children?: VueNode[] | undefined;
|
|
957
957
|
readonly placeholder?: any;
|
|
958
|
+
readonly id?: string | undefined;
|
|
958
959
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
959
960
|
readonly prefixCls?: string | undefined;
|
|
960
961
|
readonly virtual?: boolean | undefined;
|
|
961
962
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
962
963
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
963
|
-
readonly id?: string | undefined;
|
|
964
964
|
readonly autofocus?: boolean | undefined;
|
|
965
965
|
readonly loading?: boolean | undefined;
|
|
966
966
|
readonly bordered?: boolean | undefined;
|
|
@@ -1725,10 +1725,10 @@ export declare const apTableFormItemMap: {
|
|
|
1725
1725
|
readonly value?: string | number | undefined;
|
|
1726
1726
|
readonly disabled?: boolean | undefined;
|
|
1727
1727
|
readonly placeholder?: string | number | undefined;
|
|
1728
|
+
readonly id?: string | undefined;
|
|
1728
1729
|
readonly prefixCls?: string | undefined;
|
|
1729
1730
|
readonly name?: string | undefined;
|
|
1730
1731
|
readonly focused?: boolean | undefined;
|
|
1731
|
-
readonly id?: string | undefined;
|
|
1732
1732
|
readonly readonly?: boolean | undefined;
|
|
1733
1733
|
readonly autofocus?: boolean | undefined;
|
|
1734
1734
|
readonly autocomplete?: string | undefined;
|
|
@@ -2353,10 +2353,10 @@ export declare const apTableFormItemMap: {
|
|
|
2353
2353
|
readonly value?: string | number | undefined;
|
|
2354
2354
|
readonly disabled?: boolean | undefined;
|
|
2355
2355
|
readonly placeholder?: string | number | undefined;
|
|
2356
|
+
readonly id?: string | undefined;
|
|
2356
2357
|
readonly prefixCls?: string | undefined;
|
|
2357
2358
|
readonly name?: string | undefined;
|
|
2358
2359
|
readonly focused?: boolean | undefined;
|
|
2359
|
-
readonly id?: string | undefined;
|
|
2360
2360
|
readonly readonly?: boolean | undefined;
|
|
2361
2361
|
readonly autofocus?: boolean | undefined;
|
|
2362
2362
|
readonly autocomplete?: string | undefined;
|
|
@@ -2567,12 +2567,12 @@ export declare const apTableFormItemMap: {
|
|
|
2567
2567
|
readonly animation?: string | undefined;
|
|
2568
2568
|
readonly children?: VueNode[] | undefined;
|
|
2569
2569
|
readonly placeholder?: any;
|
|
2570
|
+
readonly id?: string | undefined;
|
|
2570
2571
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
2571
2572
|
readonly prefixCls?: string | undefined;
|
|
2572
2573
|
readonly virtual?: boolean | undefined;
|
|
2573
2574
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
2574
2575
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
2575
|
-
readonly id?: string | undefined;
|
|
2576
2576
|
readonly autofocus?: boolean | undefined;
|
|
2577
2577
|
readonly loading?: boolean | undefined;
|
|
2578
2578
|
readonly bordered?: boolean | undefined;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as oe, inject as
|
|
1
|
+
import { defineComponent as oe, inject as s, ref as te, watch as se, nextTick as ae, createElementBlock as N, openBlock as y, normalizeClass as ne, unref as a, createVNode as k, withCtx as U, createElementVNode as D, createTextVNode as re, toDisplayString as L, withModifiers as ie, createCommentVNode as le, createBlock as ce, resolveDynamicComponent as ue } from "vue";
|
|
2
2
|
import { UploadOutlined as pe } from "@ant-design/icons-vue";
|
|
3
3
|
import { message as p, Upload as de, Button as me } from "@aplus-frontend/antdv";
|
|
4
4
|
import { IconApAdLineDownload as fe } from "@aplus-frontend/icon";
|
|
5
5
|
import { ApFilePreview as ge } from "../../ap-file-preview/index.mjs";
|
|
6
6
|
import "../../../config-provider/index.mjs";
|
|
7
|
-
import { useOss as we, getOssInstance as
|
|
7
|
+
import { useOss as we, getOssInstance as S } from "../hooks/useOss.mjs";
|
|
8
8
|
import he from "../style/index.mjs";
|
|
9
9
|
import { fileMatchesAccept as ve, getAcceptText as xe } from "../utils/accept.mjs";
|
|
10
|
-
import { getPath as ye, getName as ke, getReturnData as
|
|
10
|
+
import { getPath as ye, getName as ke, getReturnData as z } from "../utils/returnData.mjs";
|
|
11
11
|
import { useGlobalConfig as be } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useLocale as Ce } from "../../../config-provider/hooks/use-locale.mjs";
|
|
13
13
|
import { useNamespace as Ne } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
-
const Ue = { class: "multiple-file-context" }, Ee = { key: 0 },
|
|
14
|
+
const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, _e = { key: 1 }, qe = /* @__PURE__ */ oe({
|
|
15
15
|
__name: "MultipleFile",
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
16
|
+
setup(Fe, { expose: B }) {
|
|
17
|
+
const E = be(
|
|
18
18
|
"downloadCenterTriggerConfig"
|
|
19
|
-
), { t: i } = Ce(), { b:
|
|
20
|
-
|
|
19
|
+
), { t: i } = Ce(), { b: O } = Ne("ap-upload-multiple-file"), V = he("ap-upload"), { put: q } = we(), j = s("dirName"), $ = s("baseDirName"), b = s("accept") || "*", _ = s("maxSize") ?? 500, G = s("title") || i("ap.apUpload.uploadFile"), f = s("subTitle"), l = s("maxCount") ?? 10, d = s("uploadingCount"), F = s("beforeUpload"), A = s("customRequest"), g = s("getOssAccess"), W = s("maxSizeErrorMsg"), H = s("maxCountErrorMsg"), J = s("acceptErrorMsg"), P = s("onRemove"), C = s("showUploadErrorMsg"), T = s("bucket"), K = s("showDownload") ?? !0, w = s("showPreview") ?? !0, r = s("value"), c = [], h = s("needName"), m = te(null);
|
|
20
|
+
se(
|
|
21
21
|
() => r?.value,
|
|
22
22
|
function(e) {
|
|
23
|
-
!m?.value?.fileList?.length && e &&
|
|
23
|
+
!m?.value?.fileList?.length && e && I(e);
|
|
24
24
|
},
|
|
25
25
|
{ immediate: !0 }
|
|
26
26
|
);
|
|
27
|
-
function
|
|
27
|
+
function I(e) {
|
|
28
28
|
if (!e) {
|
|
29
29
|
u = [], m.value.fileList = [], r.value = void 0, c.splice(0, c.length);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
ae(() => {
|
|
33
33
|
const o = e.map((t) => {
|
|
34
|
-
const n = ye(
|
|
34
|
+
const n = ye(h, t), M = ke(h, t), x = new File(
|
|
35
35
|
[t],
|
|
36
|
-
|
|
36
|
+
M,
|
|
37
37
|
{}
|
|
38
38
|
);
|
|
39
|
-
return
|
|
39
|
+
return x.response = n, x.uid = n, x.status = "done", x;
|
|
40
40
|
});
|
|
41
41
|
if (l && o.length > l) {
|
|
42
42
|
p.warning(
|
|
@@ -54,9 +54,9 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
54
54
|
}), m.value.fileList = o, r.value = e;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
let u = [],
|
|
59
|
-
function
|
|
57
|
+
B({ setValue: I });
|
|
58
|
+
let u = [], R;
|
|
59
|
+
function v(e) {
|
|
60
60
|
setTimeout(() => {
|
|
61
61
|
const o = m.value.fileList.findIndex(
|
|
62
62
|
(t) => t.uid === e.uid
|
|
@@ -66,25 +66,25 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
66
66
|
}
|
|
67
67
|
async function Q(e) {
|
|
68
68
|
if (l && l > 1 && u.length >= l)
|
|
69
|
-
return clearTimeout(
|
|
69
|
+
return clearTimeout(R), R = setTimeout(() => {
|
|
70
70
|
p.warning(
|
|
71
|
-
|
|
71
|
+
H || i("ap.apUpload.maxUploadFiles", {
|
|
72
72
|
maxCount: l
|
|
73
73
|
})
|
|
74
74
|
);
|
|
75
|
-
}),
|
|
76
|
-
if (e.size >
|
|
75
|
+
}), v(e), !1;
|
|
76
|
+
if (e.size > _ * 1024 * 1024)
|
|
77
77
|
return p.warning(
|
|
78
|
-
|
|
79
|
-
maxSize:
|
|
78
|
+
W || i("ap.apUpload.maxUploadFileSize", {
|
|
79
|
+
maxSize: _
|
|
80
80
|
})
|
|
81
|
-
),
|
|
82
|
-
if (!ve(e,
|
|
81
|
+
), v(e), !1;
|
|
82
|
+
if (!ve(e, b))
|
|
83
83
|
return p.warning(
|
|
84
|
-
|
|
85
|
-
),
|
|
84
|
+
J || i("ap.apUpload.fileFormatNotSupported")
|
|
85
|
+
), v(e), !1;
|
|
86
86
|
if (typeof F == "function" && await F(e) === !1)
|
|
87
|
-
return
|
|
87
|
+
return v(e), !1;
|
|
88
88
|
l && l === 1 && (u = [], r.value = void 0), u.push(e);
|
|
89
89
|
}
|
|
90
90
|
async function X(e) {
|
|
@@ -98,7 +98,7 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
98
98
|
});
|
|
99
99
|
},
|
|
100
100
|
onError: (o) => {
|
|
101
|
-
|
|
101
|
+
C && p.warning(o || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
102
102
|
e.onError({
|
|
103
103
|
name: o,
|
|
104
104
|
message: o
|
|
@@ -110,7 +110,7 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
110
110
|
e.onSuccess(o);
|
|
111
111
|
}), r.value = [
|
|
112
112
|
...r.value || [],
|
|
113
|
-
|
|
113
|
+
z(h, o, e.file.name)
|
|
114
114
|
], c.push({
|
|
115
115
|
uid: e.file.uid,
|
|
116
116
|
path: o
|
|
@@ -121,22 +121,22 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
try {
|
|
124
|
-
const o = await (
|
|
125
|
-
e.file.oss = t,
|
|
124
|
+
const o = await (T ? g(T) : g()), t = await S(async () => o);
|
|
125
|
+
e.file.oss = t, q({
|
|
126
126
|
file: e.file,
|
|
127
|
-
dirName:
|
|
127
|
+
dirName: j,
|
|
128
128
|
oss: t,
|
|
129
129
|
successCallBack(n) {
|
|
130
130
|
e.onSuccess(n), r.value = [
|
|
131
131
|
...r.value || [],
|
|
132
|
-
|
|
132
|
+
z(h, n, e.file.name)
|
|
133
133
|
], c.push({
|
|
134
134
|
uid: e.file.uid,
|
|
135
135
|
path: n
|
|
136
136
|
}), d.value--;
|
|
137
137
|
},
|
|
138
138
|
errorCallBack(n) {
|
|
139
|
-
|
|
139
|
+
C && p.warning(n || i("ap.apUpload.networkAnomaly")), e.onError({
|
|
140
140
|
name: n,
|
|
141
141
|
message: n
|
|
142
142
|
}), d.value--;
|
|
@@ -146,11 +146,11 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
146
146
|
percent: n
|
|
147
147
|
});
|
|
148
148
|
},
|
|
149
|
-
baseDirName:
|
|
149
|
+
baseDirName: $,
|
|
150
150
|
bucket: o?.bucket
|
|
151
151
|
});
|
|
152
152
|
} catch (o) {
|
|
153
|
-
|
|
153
|
+
C && p.warning(
|
|
154
154
|
typeof o?.message == "string" ? o.message : i("ap.apUpload.networkAnomaly")
|
|
155
155
|
), e.onError({
|
|
156
156
|
name: o?.message || i("ap.apUpload.networkAnomaly"),
|
|
@@ -159,7 +159,7 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
function Y(e) {
|
|
162
|
-
if (
|
|
162
|
+
if (P && P?.(e), e.response) {
|
|
163
163
|
if (Array.isArray(r.value)) {
|
|
164
164
|
const t = c.findIndex((n) => n.uid === e.uid);
|
|
165
165
|
t >= 0 && (r?.value.splice(t, 1), c.splice(t, 1)), r.value.length === 0 && (r.value = void 0);
|
|
@@ -172,15 +172,15 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
172
172
|
return u.splice(o, 1), Promise.resolve(!0);
|
|
173
173
|
}
|
|
174
174
|
const Z = async (e) => {
|
|
175
|
-
if (
|
|
175
|
+
if (E.value?.trigger) {
|
|
176
176
|
let o = [e].map((t) => ({
|
|
177
177
|
objectName: t.response,
|
|
178
178
|
fileName: t.name
|
|
179
179
|
}));
|
|
180
|
-
|
|
180
|
+
E.value?.trigger?.(o);
|
|
181
181
|
} else {
|
|
182
182
|
const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1], n = o?.[2] ?? e.response;
|
|
183
|
-
(await
|
|
183
|
+
(await S(
|
|
184
184
|
() => t ? g?.(t) : g?.()
|
|
185
185
|
)).downloadFile([
|
|
186
186
|
{
|
|
@@ -190,23 +190,23 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
190
190
|
]);
|
|
191
191
|
}
|
|
192
192
|
}, ee = (e) => {
|
|
193
|
-
ge.createFilePreviewModal({
|
|
193
|
+
(typeof w == "function" ? w(e) : w) && ge.createFilePreviewModal({
|
|
194
194
|
src: e.response,
|
|
195
195
|
fileName: e.name
|
|
196
196
|
});
|
|
197
197
|
};
|
|
198
|
-
return (e, o) => (
|
|
198
|
+
return (e, o) => (y(), N("div", {
|
|
199
199
|
class: ne({
|
|
200
|
-
[
|
|
201
|
-
[
|
|
200
|
+
[a(O)()]: !0,
|
|
201
|
+
[a(V) ?? ""]: !0
|
|
202
202
|
})
|
|
203
203
|
}, [
|
|
204
|
-
|
|
204
|
+
k(a(de), {
|
|
205
205
|
ref_key: "uploadRef",
|
|
206
206
|
ref: m,
|
|
207
|
-
accept:
|
|
207
|
+
accept: a(b),
|
|
208
208
|
multiple: "",
|
|
209
|
-
"max-count":
|
|
209
|
+
"max-count": a(l),
|
|
210
210
|
progress: {
|
|
211
211
|
strokeWidth: 3,
|
|
212
212
|
showInfo: !1,
|
|
@@ -215,33 +215,33 @@ const Ue = { class: "multiple-file-context" }, Ee = { key: 0 }, Fe = { key: 1 },
|
|
|
215
215
|
"before-upload": Q,
|
|
216
216
|
"custom-request": X,
|
|
217
217
|
"show-upload-list": {
|
|
218
|
-
showDownloadIcon:
|
|
218
|
+
showDownloadIcon: a(K),
|
|
219
219
|
showRemoveIcon: !0,
|
|
220
|
-
showPreviewIcon:
|
|
220
|
+
showPreviewIcon: a(w)
|
|
221
221
|
},
|
|
222
222
|
onPreview: ee,
|
|
223
223
|
onRemove: Y,
|
|
224
224
|
onDownload: Z
|
|
225
225
|
}, {
|
|
226
|
-
downloadIcon:
|
|
227
|
-
|
|
226
|
+
downloadIcon: U(() => [
|
|
227
|
+
k(a(fe), { class: "anticon anticon-vertical-align-bottom" })
|
|
228
228
|
]),
|
|
229
|
-
default:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
default:
|
|
233
|
-
|
|
234
|
-
re(" " +
|
|
229
|
+
default: U(() => [
|
|
230
|
+
D("div", Ue, [
|
|
231
|
+
k(a(me), { class: "file-btn" }, {
|
|
232
|
+
default: U(() => [
|
|
233
|
+
k(a(pe)),
|
|
234
|
+
re(" " + L(a(G)), 1)
|
|
235
235
|
]),
|
|
236
236
|
_: 1
|
|
237
237
|
}),
|
|
238
|
-
|
|
238
|
+
D("div", {
|
|
239
239
|
class: "sub-title",
|
|
240
240
|
onClick: o[0] || (o[0] = ie(() => {
|
|
241
241
|
}, ["stop"]))
|
|
242
242
|
}, [
|
|
243
|
-
typeof
|
|
244
|
-
(
|
|
243
|
+
typeof a(f) == "string" ? (y(), N("div", Ee, L(a(f) || `${a(i)("ap.apUpload.supportExtension")}:${a(xe)(a(b))}`), 1)) : a(f) ? (y(), N("div", _e, [
|
|
244
|
+
(y(), ce(ue(a(f))))
|
|
245
245
|
])) : le("", !0)
|
|
246
246
|
])
|
|
247
247
|
])
|
|
@@ -87,8 +87,8 @@ const l = (i) => {
|
|
|
87
87
|
[`${e}-un`]: {
|
|
88
88
|
cursor: "pointer",
|
|
89
89
|
"&:hover": {
|
|
90
|
-
border: `${i.lineWidth} dashed ${i.
|
|
91
|
-
background: i.calc(i.
|
|
90
|
+
border: `${i.lineWidth} dashed ${i.colorLink}`,
|
|
91
|
+
background: i.calc(i.colorLink).colorMix(10)
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
};
|
|
@@ -9,8 +9,8 @@ const a = (e) => {
|
|
|
9
9
|
border: `${e.lineWidth} dashed var(--ap-border-color-base)`,
|
|
10
10
|
height: e.apUploadSingleContainerHeight,
|
|
11
11
|
"&:not(.ant-upload-disabled):hover": {
|
|
12
|
-
background: e.calc(e.
|
|
13
|
-
borderColor: e.
|
|
12
|
+
background: e.calc(e.colorLink).colorMix(10),
|
|
13
|
+
borderColor: e.colorLink
|
|
14
14
|
},
|
|
15
15
|
".ant-upload-btn": {
|
|
16
16
|
padding: 0
|
|
@@ -46,10 +46,10 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
46
46
|
readonly value?: string | number | undefined;
|
|
47
47
|
readonly disabled?: boolean | undefined;
|
|
48
48
|
readonly placeholder?: string | number | undefined;
|
|
49
|
+
readonly id?: string | undefined;
|
|
49
50
|
readonly prefixCls?: string | undefined;
|
|
50
51
|
readonly name?: string | undefined;
|
|
51
52
|
readonly focused?: boolean | undefined;
|
|
52
|
-
readonly id?: string | undefined;
|
|
53
53
|
readonly readonly?: boolean | undefined;
|
|
54
54
|
readonly autofocus?: boolean | undefined;
|
|
55
55
|
readonly autocomplete?: string | undefined;
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.12.
|
|
1
|
+
declare const _default: "7.12.6";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),l=require("lodash-unified"),h=require("../../ap-form/index.js"),k=require("../../ap-form/context.js"),A=require("../../ap-form/hooks/use-watch.js"),H=require("../../ap-form/utils/get.js"),K=require("../../ap-form/utils/transform.js");require("../../config-provider/index.js");const P=require("../hooks/use-editable-columns.js"),z=require("../hooks/use-editable-form-item-api.js");require("../index.vue2.js");const G=require("../style/editable.js"),L=require("../utils.js"),p=require("./utils.js"),W=require("../../config-provider/hooks/use-namespace.js"),U=require("../../config-provider/hooks/use-global-config.js"),$=require("../index.vue.js"),J=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},defaultValue:{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{}},setup(w,{expose:y}){const b=o.useSlots(),t=w,{b:C}=W.useNamespace("editable-aggrid"),R=G.default("editable-aggrid"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),l=require("lodash-unified"),h=require("../../ap-form/index.js"),k=require("../../ap-form/context.js"),A=require("../../ap-form/hooks/use-watch.js"),H=require("../../ap-form/utils/get.js"),K=require("../../ap-form/utils/transform.js");require("../../config-provider/index.js");const P=require("../hooks/use-editable-columns.js"),z=require("../hooks/use-editable-form-item-api.js");require("../index.vue2.js");const G=require("../style/editable.js"),L=require("../utils.js"),p=require("./utils.js"),W=require("../../config-provider/hooks/use-namespace.js"),U=require("../../config-provider/hooks/use-global-config.js"),$=require("../index.vue.js"),J=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},defaultValue:{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{}},setup(w,{expose:y}){const b=o.useSlots(),t=w,{b:C}=W.useNamespace("editable-aggrid"),R=G.default("editable-aggrid"),r=o.ref(),{internalInstance:s}=k.useInjectForm();function v(e){const n=p.getColumnTransformOptions(t.columns||[]);if(!Object.keys(n).length||!e?.length)return e;let a=[];for(const d of e)a.push(K.transformValues(d,n));return a}const i=L.getShadowName(t.name);let m=[];o.onMounted(()=>{const e=t.formItem?.initialValue??H.getModelValue(s?.getInitialValues()??{},t.name);e&&(s?.updateInitialModel(i,p.arrayToObject(l.cloneDeep(e),t.rowKey)),m=l.cloneDeep(e),S(l.cloneDeep(e),"suffix",!0))});const u=o.ref([]),x=A.useWatch(t.name);o.watch(()=>x.value,e=>{l.isEqual(e,u.value)||f(e??l.cloneDeep(m))},{deep:!0,flush:"post"});const B=U.useGlobalConfig("valueTypeMap"),q=P.useGetEditableColumns(t,B,i),{add:_,addMultiple:I,__addMultiple:S,remove:T,removeByKey:E,getRowData:F,getRowsData:N,setRowData:V,clear:j,refreshRowIds:c}=z.useEditableFormItemApi(t,s,u,i);function D(){const e=r.value?._internalGridApi;if(!c.value?.length||!e)return;const n=c.value.map(a=>e.getRowNode(a)).filter(a=>!!a);e.refreshCells({rowNodes:n,force:!0}),c.value=[]}function f(e){u.value=[...e];const n=p.arrayToObject(e,t.rowKey);s?.setFieldValue(t.name,[...e]),s?.setFieldValue(i,n)}function g(e,n){const a=e==="end"?u.value.length-1:e;r.value?.scrollToRow(a,n)}function O(e,n){r.value?.scrollToColumn(e,n)}return y({add:_,addMultiple:I,remove:T,removeByKey:E,getRowData:F,getRowsData:N,setRowData:V,clear:j,setTableData:f,scrollTo:g,scrollToRow:g,scrollToColumn:O,table:r}),(e,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.unref(h.ApForm).FormItem,{hidden:"",name:e.name,"initial-value":e.formItem?.initialValue,transform:v},null,8,["name","initial-value"]),o.createVNode(o.unref(h.ApForm).FormItem,{label:e.label},{default:o.withCtx(()=>[o.createVNode($.default,o.mergeProps(o.unref(l.omit)(t,["name","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:r,class:[o.unref(C)(),o.unref(R)],size:"mini",columns:o.unref(q),"data-source":u.value,"search-form":!1,onUpdate:D}),o.createSlots({_:2},[o.renderList(b,(a,d)=>({name:d,fn:o.withCtx(M=>[o.renderSlot(e.$slots,d,o.normalizeProps(o.guardReactiveProps(M||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["label"])],64))}});exports.default=J;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),i=require("lodash-unified"),m=require("../../ap-form/index.js");require("../../config-provider/index.js");require("../../hooks/index.js");const G=require("../hooks/use-editable-api.js"),L=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const M=require("../style/editable.js"),d=require("./utils.js"),U=require("../../config-provider/hooks/use-namespace.js"),W=require("../../hooks/useControllableValue.js"),$=require("../../config-provider/hooks/use-global-config.js"),J=require("../index.vue.js"),Q=a.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(v,{expose:h,emit:C}){const R=a.useSlots(),t=v,{b:x}=U.useNamespace("editable-aggrid"),B=M.default("editable-aggrid"),_=C,u=a.ref(),{value:s,updateValue:y}=W.useControllableValue(t,_),l=a.ref(),T=m.ApForm.useWatch(t.name,l);a.watch(s,e=>{const o=d.arrayToObject(e,t.rowKey);i.isEqual(o,a.unref(T))||l.value?.setFieldValue(t.name,o)},{deep:!0});const S=$.useGlobalConfig("valueTypeMap"),F=L.useGetEditableColumns(t,S),{add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,refreshRowIds:c}=G.useEditableApi(t,l,s,y);function O(){const e=u.value?._internalGridApi;if(!c.value?.length||!e)return;const o=c.value.map(n=>e.getRowNode(n)).filter(n=>!!n);e.refreshCells({rowNodes:o,force:!0}),c.value=[]}function I(){l.value?.resetFields()}function w(e){return e?(i.isArray(e)?e:[e]).map(n=>i.isArray(n)?[t.name,...n]:[t.name,n]):void 0}function b(e){try{const o=Object.keys(e),n=s.value.map(r=>d.getRowKey(r,void 0,t.rowKey));return o.sort((r,p)=>n.findIndex(f=>String(f)===r)-n.findIndex(f=>String(f)===p)),o.map(r=>e[r])}catch{return e}}async function D(e,o){const r=(await l.value?.validateFields(w(e),o))?.[t.name];return b(r)}async function H(e,o){const r=(await l.value?.validateFieldsReturnTransformed(w(e),o))?.[t.name];return b(r)}function P(e){y(e);const o=d.arrayToObject(e,t.rowKey);l.value?.setFieldValue(t.name,o)}function g(e,o){const n=e==="end"?s.value.length-1:e;u.value?.scrollToRow(n,o)}function z(e,o){u.value?.scrollToColumn(e,o)}return h({resetFields:I,validateFields:D,validateFieldsReturnTransformed:H,add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,setTableData:P,scrollTo:g,scrollToRow:g,scrollToColumn:z}),(e,o)=>(a.openBlock(),a.createBlock(a.unref(m.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[t.name]:a.unref(d.arrayToObject)(a.unref(s),t.rowKey)},style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(a.unref(m.ApForm).FormItem,{name:e.name,"no-style":""},{default:a.withCtx(()=>[a.createVNode(J.default,a.mergeProps(a.unref(i.omit)(t,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:u,class:[a.unref(x)(),a.unref(B)],size:"mini",columns:a.unref(F),"data-source":a.unref(s),"search-form":!1,onUpdate:O}),a.createSlots({_:2},[a.renderList(R,(n,r)=>({name:r,fn:a.withCtx(p=>[a.renderSlot(e.$slots,r,a.normalizeProps(a.guardReactiveProps(p||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=Q;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),i=require("lodash-unified"),m=require("../../ap-form/index.js");require("../../config-provider/index.js");require("../../hooks/index.js");const G=require("../hooks/use-editable-api.js"),L=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const M=require("../style/editable.js"),d=require("./utils.js"),U=require("../../config-provider/hooks/use-namespace.js"),W=require("../../hooks/useControllableValue.js"),$=require("../../config-provider/hooks/use-global-config.js"),J=require("../index.vue.js"),Q=a.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(v,{expose:h,emit:C}){const R=a.useSlots(),t=v,{b:x}=U.useNamespace("editable-aggrid"),B=M.default("editable-aggrid"),_=C,u=a.ref(),{value:s,updateValue:y}=W.useControllableValue(t,_),l=a.ref(),T=m.ApForm.useWatch(t.name,l);a.watch(s,e=>{const o=d.arrayToObject(e,t.rowKey);i.isEqual(o,a.unref(T))||l.value?.setFieldValue(t.name,o)},{deep:!0});const S=$.useGlobalConfig("valueTypeMap"),F=L.useGetEditableColumns(t,S),{add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,refreshRowIds:c}=G.useEditableApi(t,l,s,y);function O(){const e=u.value?._internalGridApi;if(!c.value?.length||!e)return;const o=c.value.map(n=>e.getRowNode(n)).filter(n=>!!n);e.refreshCells({rowNodes:o,force:!0}),c.value=[]}function I(){l.value?.resetFields()}function w(e){return e?(i.isArray(e)?e:[e]).map(n=>i.isArray(n)?[t.name,...n]:[t.name,n]):void 0}function b(e){try{const o=Object.keys(e),n=s.value.map(r=>d.getRowKey(r,void 0,t.rowKey));return o.sort((r,p)=>n.findIndex(f=>String(f)===r)-n.findIndex(f=>String(f)===p)),o.map(r=>e[r])}catch{return e}}async function D(e,o){const r=(await l.value?.validateFields(w(e),o))?.[t.name];return b(r)}async function H(e,o){const r=(await l.value?.validateFieldsReturnTransformed(w(e),o))?.[t.name];return b(r)}function P(e){y(e);const o=d.arrayToObject(e,t.rowKey);l.value?.setFieldValue(t.name,o)}function g(e,o){const n=e==="end"?s.value.length-1:e;u.value?.scrollToRow(n,o)}function z(e,o){u.value?.scrollToColumn(e,o)}return h({resetFields:I,validateFields:D,validateFieldsReturnTransformed:H,add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,setTableData:P,scrollTo:g,scrollToRow:g,scrollToColumn:z,table:u}),(e,o)=>(a.openBlock(),a.createBlock(a.unref(m.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[t.name]:a.unref(d.arrayToObject)(a.unref(s),t.rowKey)},style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(a.unref(m.ApForm).FormItem,{name:e.name,"no-style":""},{default:a.withCtx(()=>[a.createVNode(J.default,a.mergeProps(a.unref(i.omit)(t,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:u,class:[a.unref(x)(),a.unref(B)],size:"mini",columns:a.unref(F),"data-source":a.unref(s),"search-form":!1,onUpdate:O}),a.createSlots({_:2},[a.renderList(R,(n,r)=>({name:r,fn:a.withCtx(p=>[a.renderSlot(e.$slots,r,a.normalizeProps(a.guardReactiveProps(p||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=Q;
|
|
@@ -5,7 +5,7 @@ import { ApFormItemProps } from '../../ap-form';
|
|
|
5
5
|
import { ApTableValueFields, ApTableValueTypes, CommonFieldReturnType, FieldPropsType } from '../../ap-table/interface';
|
|
6
6
|
import { EditableTableExpose } from '../../editable-table';
|
|
7
7
|
import { Recordable } from '../../type';
|
|
8
|
-
import { AgGridColumnType, AgGridProps } from '../interface';
|
|
8
|
+
import { AgGridColumnType, AgGridExpose, AgGridProps } from '../interface';
|
|
9
9
|
export type EditableAgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<AgGridColumnType<RecordType, ExtraValueType, ValueType>, 'children' | 'customRender' | 'hideInSearch' | 'customRenderFormItem' | 'fieldProps'> & {
|
|
10
10
|
children?: EditableAgGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
11
11
|
/**
|
|
@@ -85,6 +85,7 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
|
|
|
85
85
|
scrollToColumn: (key: string, position?: 'auto' | 'start' | 'middle' | 'end') => void;
|
|
86
86
|
remove: (data: RecordType | RecordType[]) => void;
|
|
87
87
|
validateFieldsReturnTransformed: EditableTableExpose<ModelType, RecordType>['validateFields'];
|
|
88
|
+
table: AgGridExpose;
|
|
88
89
|
};
|
|
89
90
|
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'>;
|
|
90
91
|
export type EditableAgGridFormItemProps<RecordType = any> = Omit<EditableAgGridProps<RecordType>, 'name' | 'value' | 'onUpdate:value'> & {
|
|
@@ -43,10 +43,10 @@ declare function __VLS_template(): {
|
|
|
43
43
|
readonly value?: ValueType | undefined;
|
|
44
44
|
readonly disabled?: boolean | undefined;
|
|
45
45
|
readonly placeholder?: string | undefined;
|
|
46
|
+
readonly id?: string | undefined;
|
|
46
47
|
readonly prefixCls?: string | undefined;
|
|
47
48
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
48
49
|
readonly name?: string | undefined;
|
|
49
|
-
readonly id?: string | undefined;
|
|
50
50
|
readonly readonly?: boolean | undefined;
|
|
51
51
|
readonly autofocus?: boolean | undefined;
|
|
52
52
|
readonly bordered?: boolean | undefined;
|
|
@@ -564,10 +564,10 @@ declare const __VLS_component: DefineComponent<ApFormItemNumberProps, {
|
|
|
564
564
|
readonly value?: ValueType | undefined;
|
|
565
565
|
readonly disabled?: boolean | undefined;
|
|
566
566
|
readonly placeholder?: string | undefined;
|
|
567
|
+
readonly id?: string | undefined;
|
|
567
568
|
readonly prefixCls?: string | undefined;
|
|
568
569
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
569
570
|
readonly name?: string | undefined;
|
|
570
|
-
readonly id?: string | undefined;
|
|
571
571
|
readonly readonly?: boolean | undefined;
|
|
572
572
|
readonly autofocus?: boolean | undefined;
|
|
573
573
|
readonly bordered?: boolean | undefined;
|
|
@@ -67,12 +67,12 @@ declare function __VLS_template(): {
|
|
|
67
67
|
readonly animation?: string | undefined;
|
|
68
68
|
readonly children?: VueNode[] | undefined;
|
|
69
69
|
readonly placeholder?: any;
|
|
70
|
+
readonly id?: string | undefined;
|
|
70
71
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
71
72
|
readonly prefixCls?: string | undefined;
|
|
72
73
|
readonly virtual?: boolean | undefined;
|
|
73
74
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
74
75
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
75
|
-
readonly id?: string | undefined;
|
|
76
76
|
readonly autofocus?: boolean | undefined;
|
|
77
77
|
readonly loading?: boolean | undefined;
|
|
78
78
|
readonly bordered?: boolean | undefined;
|
|
@@ -725,12 +725,12 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
725
725
|
readonly animation?: string | undefined;
|
|
726
726
|
readonly children?: VueNode[] | undefined;
|
|
727
727
|
readonly placeholder?: any;
|
|
728
|
+
readonly id?: string | undefined;
|
|
728
729
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
729
730
|
readonly prefixCls?: string | undefined;
|
|
730
731
|
readonly virtual?: boolean | undefined;
|
|
731
732
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
732
733
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
733
|
-
readonly id?: string | undefined;
|
|
734
734
|
readonly autofocus?: boolean | undefined;
|
|
735
735
|
readonly loading?: boolean | undefined;
|
|
736
736
|
readonly bordered?: boolean | undefined;
|
|
@@ -47,10 +47,10 @@ declare function __VLS_template(): {
|
|
|
47
47
|
readonly value?: string | number | undefined;
|
|
48
48
|
readonly disabled?: boolean | undefined;
|
|
49
49
|
readonly placeholder?: string | number | undefined;
|
|
50
|
+
readonly id?: string | undefined;
|
|
50
51
|
readonly prefixCls?: string | undefined;
|
|
51
52
|
readonly name?: string | undefined;
|
|
52
53
|
readonly focused?: boolean | undefined;
|
|
53
|
-
readonly id?: string | undefined;
|
|
54
54
|
readonly readonly?: boolean | undefined;
|
|
55
55
|
readonly autofocus?: boolean | undefined;
|
|
56
56
|
readonly autocomplete?: string | undefined;
|
|
@@ -204,10 +204,10 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
204
204
|
readonly value?: string | number | undefined;
|
|
205
205
|
readonly disabled?: boolean | undefined;
|
|
206
206
|
readonly placeholder?: string | number | undefined;
|
|
207
|
+
readonly id?: string | undefined;
|
|
207
208
|
readonly prefixCls?: string | undefined;
|
|
208
209
|
readonly name?: string | undefined;
|
|
209
210
|
readonly focused?: boolean | undefined;
|
|
210
|
-
readonly id?: string | undefined;
|
|
211
211
|
readonly readonly?: boolean | undefined;
|
|
212
212
|
readonly autofocus?: boolean | undefined;
|
|
213
213
|
readonly autocomplete?: string | undefined;
|
|
@@ -48,10 +48,10 @@ declare function __VLS_template(): {
|
|
|
48
48
|
readonly value?: string | number | undefined;
|
|
49
49
|
readonly disabled?: boolean | undefined;
|
|
50
50
|
readonly placeholder?: string | number | undefined;
|
|
51
|
+
readonly id?: string | undefined;
|
|
51
52
|
readonly prefixCls?: string | undefined;
|
|
52
53
|
readonly name?: string | undefined;
|
|
53
54
|
readonly focused?: boolean | undefined;
|
|
54
|
-
readonly id?: string | undefined;
|
|
55
55
|
readonly readonly?: boolean | undefined;
|
|
56
56
|
readonly autofocus?: boolean | undefined;
|
|
57
57
|
readonly autocomplete?: string | undefined;
|
|
@@ -211,10 +211,10 @@ declare const __VLS_component: DefineComponent<ApFormItemTextPasswordProps, {
|
|
|
211
211
|
readonly value?: string | number | undefined;
|
|
212
212
|
readonly disabled?: boolean | undefined;
|
|
213
213
|
readonly placeholder?: string | number | undefined;
|
|
214
|
+
readonly id?: string | undefined;
|
|
214
215
|
readonly prefixCls?: string | undefined;
|
|
215
216
|
readonly name?: string | undefined;
|
|
216
217
|
readonly focused?: boolean | undefined;
|
|
217
|
-
readonly id?: string | undefined;
|
|
218
218
|
readonly readonly?: boolean | undefined;
|
|
219
219
|
readonly autofocus?: boolean | undefined;
|
|
220
220
|
readonly autocomplete?: string | undefined;
|
|
@@ -71,12 +71,12 @@ declare function __VLS_template(): {
|
|
|
71
71
|
readonly animation?: string | undefined;
|
|
72
72
|
readonly children?: VueNode[] | undefined;
|
|
73
73
|
readonly placeholder?: any;
|
|
74
|
+
readonly id?: string | undefined;
|
|
74
75
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
75
76
|
readonly prefixCls?: string | undefined;
|
|
76
77
|
readonly virtual?: boolean | undefined;
|
|
77
78
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
78
79
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
79
|
-
readonly id?: string | undefined;
|
|
80
80
|
readonly autofocus?: boolean | undefined;
|
|
81
81
|
readonly loading?: boolean | undefined;
|
|
82
82
|
readonly bordered?: boolean | undefined;
|
|
@@ -875,12 +875,12 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
875
875
|
readonly animation?: string | undefined;
|
|
876
876
|
readonly children?: VueNode[] | undefined;
|
|
877
877
|
readonly placeholder?: any;
|
|
878
|
+
readonly id?: string | undefined;
|
|
878
879
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
879
880
|
readonly prefixCls?: string | undefined;
|
|
880
881
|
readonly virtual?: boolean | undefined;
|
|
881
882
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
882
883
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
883
|
-
readonly id?: string | undefined;
|
|
884
884
|
readonly autofocus?: boolean | undefined;
|
|
885
885
|
readonly loading?: boolean | undefined;
|
|
886
886
|
readonly bordered?: boolean | undefined;
|
|
@@ -186,10 +186,10 @@ export declare const apTableFormItemMap: {
|
|
|
186
186
|
readonly value?: ValueType | undefined;
|
|
187
187
|
readonly disabled?: boolean | undefined;
|
|
188
188
|
readonly placeholder?: string | undefined;
|
|
189
|
+
readonly id?: string | undefined;
|
|
189
190
|
readonly prefixCls?: string | undefined;
|
|
190
191
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
191
192
|
readonly name?: string | undefined;
|
|
192
|
-
readonly id?: string | undefined;
|
|
193
193
|
readonly readonly?: boolean | undefined;
|
|
194
194
|
readonly autofocus?: boolean | undefined;
|
|
195
195
|
readonly bordered?: boolean | undefined;
|
|
@@ -955,12 +955,12 @@ export declare const apTableFormItemMap: {
|
|
|
955
955
|
readonly animation?: string | undefined;
|
|
956
956
|
readonly children?: VueNode[] | undefined;
|
|
957
957
|
readonly placeholder?: any;
|
|
958
|
+
readonly id?: string | undefined;
|
|
958
959
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
959
960
|
readonly prefixCls?: string | undefined;
|
|
960
961
|
readonly virtual?: boolean | undefined;
|
|
961
962
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
962
963
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
963
|
-
readonly id?: string | undefined;
|
|
964
964
|
readonly autofocus?: boolean | undefined;
|
|
965
965
|
readonly loading?: boolean | undefined;
|
|
966
966
|
readonly bordered?: boolean | undefined;
|
|
@@ -1725,10 +1725,10 @@ export declare const apTableFormItemMap: {
|
|
|
1725
1725
|
readonly value?: string | number | undefined;
|
|
1726
1726
|
readonly disabled?: boolean | undefined;
|
|
1727
1727
|
readonly placeholder?: string | number | undefined;
|
|
1728
|
+
readonly id?: string | undefined;
|
|
1728
1729
|
readonly prefixCls?: string | undefined;
|
|
1729
1730
|
readonly name?: string | undefined;
|
|
1730
1731
|
readonly focused?: boolean | undefined;
|
|
1731
|
-
readonly id?: string | undefined;
|
|
1732
1732
|
readonly readonly?: boolean | undefined;
|
|
1733
1733
|
readonly autofocus?: boolean | undefined;
|
|
1734
1734
|
readonly autocomplete?: string | undefined;
|
|
@@ -2353,10 +2353,10 @@ export declare const apTableFormItemMap: {
|
|
|
2353
2353
|
readonly value?: string | number | undefined;
|
|
2354
2354
|
readonly disabled?: boolean | undefined;
|
|
2355
2355
|
readonly placeholder?: string | number | undefined;
|
|
2356
|
+
readonly id?: string | undefined;
|
|
2356
2357
|
readonly prefixCls?: string | undefined;
|
|
2357
2358
|
readonly name?: string | undefined;
|
|
2358
2359
|
readonly focused?: boolean | undefined;
|
|
2359
|
-
readonly id?: string | undefined;
|
|
2360
2360
|
readonly readonly?: boolean | undefined;
|
|
2361
2361
|
readonly autofocus?: boolean | undefined;
|
|
2362
2362
|
readonly autocomplete?: string | undefined;
|
|
@@ -2567,12 +2567,12 @@ export declare const apTableFormItemMap: {
|
|
|
2567
2567
|
readonly animation?: string | undefined;
|
|
2568
2568
|
readonly children?: VueNode[] | undefined;
|
|
2569
2569
|
readonly placeholder?: any;
|
|
2570
|
+
readonly id?: string | undefined;
|
|
2570
2571
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
2571
2572
|
readonly prefixCls?: string | undefined;
|
|
2572
2573
|
readonly virtual?: boolean | undefined;
|
|
2573
2574
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
2574
2575
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
2575
|
-
readonly id?: string | undefined;
|
|
2576
2576
|
readonly autofocus?: boolean | undefined;
|
|
2577
2577
|
readonly loading?: boolean | undefined;
|
|
2578
2578
|
readonly bordered?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),K=require("@ant-design/icons-vue"),i=require("@aplus-frontend/antdv"),Q=require("@aplus-frontend/icon"),X=require("../../ap-file-preview/index.js");require("../../../config-provider/index.js");const b=require("../hooks/useOss.js"),Y=require("../style/index.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),K=require("@ant-design/icons-vue"),i=require("@aplus-frontend/antdv"),Q=require("@aplus-frontend/icon"),X=require("../../ap-file-preview/index.js");require("../../../config-provider/index.js");const b=require("../hooks/useOss.js"),Y=require("../style/index.js"),I=require("../utils/accept.js"),x=require("../utils/returnData.js"),Z=require("../../../config-provider/hooks/use-global-config.js"),ee=require("../../../config-provider/hooks/use-locale.js"),te=require("../../../config-provider/hooks/use-namespace.js"),oe={class:"multiple-file-context"},ne={key:0},se={key:1},ae=e.defineComponent({__name:"MultipleFile",setup(re,{expose:P}){const C=Z.useGlobalConfig("downloadCenterTriggerConfig"),{t:r}=ee.useLocale(),{b:T}=te.useNamespace("ap-upload-multiple-file"),D=Y.default("ap-upload"),{put:M}=b.useOss(),R=e.inject("dirName"),S=e.inject("baseDirName"),k=e.inject("accept")||"*",j=e.inject("maxSize")??500,B=e.inject("title")||r("ap.apUpload.uploadFile"),m=e.inject("subTitle"),c=e.inject("maxCount")??10,p=e.inject("uploadingCount"),N=e.inject("beforeUpload"),E=e.inject("customRequest"),f=e.inject("getOssAccess"),L=e.inject("maxSizeErrorMsg"),O=e.inject("maxCountErrorMsg"),V=e.inject("acceptErrorMsg"),U=e.inject("onRemove"),y=e.inject("showUploadErrorMsg"),_=e.inject("bucket"),z=e.inject("showDownload")??!0,g=e.inject("showPreview")??!0,a=e.inject("value"),u=[],w=e.inject("needName"),d=e.ref(null);e.watch(()=>a?.value,function(t){!d?.value?.fileList?.length&&t&&q(t)},{immediate:!0});function q(t){if(!t){l=[],d.value.fileList=[],a.value=void 0,u.splice(0,u.length);return}e.nextTick(()=>{const o=t.map(n=>{const s=x.getPath(w,n),A=x.getName(w,n),v=new File([n],A,{});return v.response=s,v.uid=s,v.status="done",v});if(c&&o.length>c){i.message.warning(r("ap.apUpload.fileInitializationException",{maxCount:c}));return}o.forEach(n=>{l.push(n),u.push({uid:n.uid,path:n.response})}),d.value.fileList=o,a.value=t})}P({setValue:q});let l=[],F;function h(t){setTimeout(()=>{const o=d.value.fileList.findIndex(n=>n.uid===t.uid);o>=0&&d.value.fileList.splice(o,1)})}async function $(t){if(c&&c>1&&l.length>=c)return clearTimeout(F),F=setTimeout(()=>{i.message.warning(O||r("ap.apUpload.maxUploadFiles",{maxCount:c}))}),h(t),!1;if(t.size>j*1024*1024)return i.message.warning(L||r("ap.apUpload.maxUploadFileSize",{maxSize:j})),h(t),!1;if(!I.fileMatchesAccept(t,k))return i.message.warning(V||r("ap.apUpload.fileFormatNotSupported")),h(t),!1;if(typeof N=="function"&&await N(t)===!1)return h(t),!1;c&&c===1&&(l=[],a.value=void 0),l.push(t)}async function G(t){if(p.value++,typeof E=="function"){E({onProgress:o=>{setTimeout(()=>{t.onProgress({percent:o})})},onError:o=>{y&&i.message.warning(o||r("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:o,message:o})}),p.value--},onSuccess:o=>{setTimeout(()=>{t.onSuccess(o)}),a.value=[...a.value||[],x.getReturnData(w,o,t.file.name)],u.push({uid:t.file.uid,path:o}),p.value--},file:t.file});return}try{const o=await(_?f(_):f()),n=await b.getOssInstance(async()=>o);t.file.oss=n,M({file:t.file,dirName:R,oss:n,successCallBack(s){t.onSuccess(s),a.value=[...a.value||[],x.getReturnData(w,s,t.file.name)],u.push({uid:t.file.uid,path:s}),p.value--},errorCallBack(s){y&&i.message.warning(s||r("ap.apUpload.networkAnomaly")),t.onError({name:s,message:s}),p.value--},progressCallBack(s){t.onProgress({percent:s})},baseDirName:S,bucket:o?.bucket})}catch(o){y&&i.message.warning(typeof o?.message=="string"?o.message:r("ap.apUpload.networkAnomaly")),t.onError({name:o?.message||r("ap.apUpload.networkAnomaly"),message:o?.message||r("ap.apUpload.networkAnomaly")}),p.value--}}function W(t){if(U&&U?.(t),t.response){if(Array.isArray(a.value)){const n=u.findIndex(s=>s.uid===t.uid);n>=0&&(a?.value.splice(n,1),u.splice(n,1)),a.value.length===0&&(a.value=void 0)}}else t?.oss?.pauseUpload();const o=l.findIndex(n=>n.uid===t.uid);return l.splice(o,1),Promise.resolve(!0)}const H=async t=>{if(C.value?.trigger){let o=[t].map(n=>({objectName:n.response,fileName:n.name}));C.value?.trigger?.(o)}else{const o=t.response?.match(/^([^:]+):(.*)$/),n=o?.[1],s=o?.[2]??t.response;(await b.getOssInstance(()=>n?f?.(n):f?.())).downloadFile([{path:s,fileName:t.name}])}},J=t=>{(typeof g=="function"?g(t):g)&&X.ApFilePreview.createFilePreviewModal({src:t.response,fileName:t.name})};return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(T)()]:!0,[e.unref(D)??""]:!0})},[e.createVNode(e.unref(i.Upload),{ref_key:"uploadRef",ref:d,accept:e.unref(k),multiple:"","max-count":e.unref(c),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},"before-upload":$,"custom-request":G,"show-upload-list":{showDownloadIcon:e.unref(z),showRemoveIcon:!0,showPreviewIcon:e.unref(g)},onPreview:J,onRemove:W,onDownload:H},{downloadIcon:e.withCtx(()=>[e.createVNode(e.unref(Q.IconApAdLineDownload),{class:"anticon anticon-vertical-align-bottom"})]),default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(e.unref(i.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(K.UploadOutlined)),e.createTextVNode(" "+e.toDisplayString(e.unref(B)),1)]),_:1}),e.createElementVNode("div",{class:"sub-title",onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[typeof e.unref(m)=="string"?(e.openBlock(),e.createElementBlock("div",ne,e.toDisplayString(e.unref(m)||`${e.unref(r)("ap.apUpload.supportExtension")}:${e.unref(I.getAcceptText)(e.unref(k))}`),1)):e.unref(m)?(e.openBlock(),e.createElementBlock("div",se,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(m))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","max-count","show-upload-list"])],2))}});exports.default=ae;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=i=>{const{componentCls:r}=i,e=`${r}-single-file`;return{[e]:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:i.apUploadSingleFileContainerHeight,overflow:"hidden",transition:`all ${i.motionDurationSlow}`,border:`${i.lineWidth} dashed ${i.borderColorBase}`,borderRadius:i.borderRadius,background:i.colorBgLayout,userSelect:"none","& > div":{display:"flex",alignItems:"center",justifyContent:"center"},".state-un":{flexDirection:"column",".state-un-icon":{display:"block",width:i.apUploadSingleFileIconHeight},".state-un-title":{marginTop:i.spaceMD,color:i.textColor1,fontSize:i.fontSizeLG,lineHeight:i.lineHeightLG},".state-un-subtitle":{marginTop:i.spaceXS,color:i.textColor4,fontSize:i.fontSize,lineHeight:i.lineHeight}},".state-ing":{display:"flex",alignItems:"center",width:"min(516px, 77.24%)",height:"96px",paddingBlock:0,paddingInline:i.spaceXXL,borderRadius:i.borderRadius,background:"#fff",".left":{flexShrink:0,width:"48px",marginRight:i.spaceXL,img:{display:"block",width:"100%"}},".center":{flex:1,".center-title":{display:"-webkit-box",overflow:"hidden",fontSize:i.fontSizeLG,textAlign:"start",textOverflow:"ellipsis",wordWrap:"break-word",wordBreak:"break-all",WebkitBoxOrient:"vertical",WebkitLineClamp:i.lineClamp},".center-progress ":{".ant-progress-line":{marginRight:0,marginBottom:0}}},".right":{flexShrink:0,marginLeft:i.spaceXXL,color:i.colorError,fontSize:i.fontSizeXXL,cursor:"pointer !important"}}},[`${e}-un`]:{cursor:"pointer","&:hover":{border:`${i.lineWidth} dashed ${i.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=i=>{const{componentCls:r}=i,e=`${r}-single-file`;return{[e]:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:i.apUploadSingleFileContainerHeight,overflow:"hidden",transition:`all ${i.motionDurationSlow}`,border:`${i.lineWidth} dashed ${i.borderColorBase}`,borderRadius:i.borderRadius,background:i.colorBgLayout,userSelect:"none","& > div":{display:"flex",alignItems:"center",justifyContent:"center"},".state-un":{flexDirection:"column",".state-un-icon":{display:"block",width:i.apUploadSingleFileIconHeight},".state-un-title":{marginTop:i.spaceMD,color:i.textColor1,fontSize:i.fontSizeLG,lineHeight:i.lineHeightLG},".state-un-subtitle":{marginTop:i.spaceXS,color:i.textColor4,fontSize:i.fontSize,lineHeight:i.lineHeight}},".state-ing":{display:"flex",alignItems:"center",width:"min(516px, 77.24%)",height:"96px",paddingBlock:0,paddingInline:i.spaceXXL,borderRadius:i.borderRadius,background:"#fff",".left":{flexShrink:0,width:"48px",marginRight:i.spaceXL,img:{display:"block",width:"100%"}},".center":{flex:1,".center-title":{display:"-webkit-box",overflow:"hidden",fontSize:i.fontSizeLG,textAlign:"start",textOverflow:"ellipsis",wordWrap:"break-word",wordBreak:"break-all",WebkitBoxOrient:"vertical",WebkitLineClamp:i.lineClamp},".center-progress ":{".ant-progress-line":{marginRight:0,marginBottom:0}}},".right":{flexShrink:0,marginLeft:i.spaceXXL,color:i.colorError,fontSize:i.fontSizeXXL,cursor:"pointer !important"}}},[`${e}-un`]:{cursor:"pointer","&:hover":{border:`${i.lineWidth} dashed ${i.colorLink}`,background:i.calc(i.colorLink).colorMix(10)}}}};exports.singleFileStyle=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../../../utils/cssinjs/index.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../../../utils/cssinjs/index.js"),r=e=>{const{componentCls:o}=e;return{[o]:{userSelect:"none",".ant-upload-drag":{background:e.colorBgLayout,border:`${e.lineWidth} dashed var(--ap-border-color-base)`,height:e.apUploadSingleContainerHeight,"&:not(.ant-upload-disabled):hover":{background:e.calc(e.colorLink).colorMix(10),borderColor:e.colorLink},".ant-upload-btn":{padding:0},".ant-upload-disabled":{cursor:"default"}},[`${o}__content`]:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},[`${o}__content-file`]:{width:"min(516px, 77.24%)",height:e.apUploadSingleItemHeight,background:"#fff",borderRadius:e.borderRadius,display:"flex",alignItems:"center",paddingInline:e.spaceXXL,paddingBlock:0,"&-icon":{flexShrink:0,marginRight:e.spaceXL,svg:{width:e.apUploadSingleItemFileIconSize}},"&-name":{flex:1,textAlign:"start","&>.ant-typography":{color:"var(--name-color)",marginBottom:0,wordBreak:"break-all"}},"&-delete":{flexShrink:0,marginLeft:e.spaceXXL,svg:{width:e.apUploadSingleItemDeleteIconSize,color:e.colorError,fontSize:e.fontSizeXXL,cursor:"pointer"}}},[`${o}__content-ing`]:{"&-name":{"--name-color":"var(--ap-text-color-2)",".ant-progress-line":{marginInlineEnd:0,marginBottom:0}}},[`${o}__content-error`]:{"&-name":{"--name-color":e.colorError}},[`${o}__content-done`]:{"&-name":{"--name-color":e.colorPrimary}},[`${o}__content-empty`]:{cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center","&-icon":{svg:{width:e.apUploadSingleContainerFileIconSize}},"&-title":{marginTop:e.spaceMD,color:"var(--ap-text-color-2)",fontSize:e.fontSizeXL,lineHeight:e.lineHeightLG},"&-sub-title":{marginTop:e.spaceXS,color:"var(--ap-text-color-3)",fontSize:e.fontSize,lineHeight:e.lineHeight}}},[`${o}-affix-wrapper-status-error`]:{".ant-upload-drag:not(.ant-upload-disabled)":{borderColor:e.colorError,"&:hover":{borderColor:e.calc(e.colorPrimary).colorMix(80)}}}}},l=a.genComponentStyleHook("ApUploadSingle",e=>[r(e)],{apUploadSingleContainerHeight:200,apUploadSingleItemHeight:96,apUploadSingleItemFileIconSize:48,apUploadSingleItemDeleteIconSize:20,apUploadSingleContainerFileIconSize:56});exports.default=l;exports.genProCardStyle=r;
|
|
@@ -46,10 +46,10 @@ declare const _default: DefineComponent<BatchInputGroupProps, {}, {}, {}, {}, Co
|
|
|
46
46
|
readonly value?: string | number | undefined;
|
|
47
47
|
readonly disabled?: boolean | undefined;
|
|
48
48
|
readonly placeholder?: string | number | undefined;
|
|
49
|
+
readonly id?: string | undefined;
|
|
49
50
|
readonly prefixCls?: string | undefined;
|
|
50
51
|
readonly name?: string | undefined;
|
|
51
52
|
readonly focused?: boolean | undefined;
|
|
52
|
-
readonly id?: string | undefined;
|
|
53
53
|
readonly readonly?: boolean | undefined;
|
|
54
54
|
readonly autofocus?: boolean | undefined;
|
|
55
55
|
readonly autocomplete?: string | undefined;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.12.
|
|
1
|
+
declare const _default: "7.12.6";
|
|
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.12.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.12.6";exports.default=e;
|