@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
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
1
|
+
import { defineComponent as J, useSlots as X, ref as b, watch as R, unref as o, openBlock as p, createBlock as F, withCtx as m, createVNode as x, mergeProps as Y, createSlots as Z, createElementBlock as ee, normalizeClass as te, createCommentVNode as B, createElementVNode as ae, toDisplayString as ne, normalizeStyle as oe, renderList as le, renderSlot as re, normalizeProps as ue, guardReactiveProps as se } from "vue";
|
|
2
|
+
import { Table as ie, Tooltip as de } from "ant-design-vue";
|
|
3
3
|
import { ApForm as y } from "../ap-form/index.mjs";
|
|
4
|
-
import { isEqual as
|
|
4
|
+
import { isEqual as me, isArray as k, isNumber as g, cloneDeep as h, omit as fe } from "lodash-unified";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
6
|
import "../hooks/index.mjs";
|
|
7
7
|
import { isDef as C } from "../utils/index.mjs";
|
|
8
|
-
import { scrollToRowIndex as
|
|
9
|
-
import
|
|
8
|
+
import { scrollToRowIndex as ce, getColumnIsRequired as pe } from "./utils.mjs";
|
|
9
|
+
import xe from "./hooks/use-get-columns.mjs";
|
|
10
10
|
import "./style/index.css";
|
|
11
|
-
import { useToken as
|
|
12
|
-
import { QuestionCircleOutlined as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useControllableValue as
|
|
15
|
-
import { useGlobalConfig as
|
|
16
|
-
const
|
|
11
|
+
import { useToken as ye } from "ant-design-vue/es/theme/internal";
|
|
12
|
+
import { QuestionCircleOutlined as ge } from "@ant-design/icons-vue";
|
|
13
|
+
import { useNamespace as he } from "../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useControllableValue as Ce } from "../hooks/useControllableValue.mjs";
|
|
15
|
+
import { useGlobalConfig as ve } from "../config-provider/hooks/use-global-config.mjs";
|
|
16
|
+
const ze = /* @__PURE__ */ J({
|
|
17
17
|
name: "EditableTable",
|
|
18
18
|
__name: "index",
|
|
19
19
|
props: {
|
|
@@ -113,141 +113,146 @@ const Ae = /* @__PURE__ */ Q({
|
|
|
113
113
|
},
|
|
114
114
|
emits: ["update:value"],
|
|
115
115
|
setup(V, {
|
|
116
|
-
expose:
|
|
117
|
-
emit:
|
|
116
|
+
expose: T,
|
|
117
|
+
emit: D
|
|
118
118
|
}) {
|
|
119
119
|
const l = V, {
|
|
120
|
-
b:
|
|
121
|
-
em:
|
|
122
|
-
} =
|
|
123
|
-
value:
|
|
120
|
+
b: E,
|
|
121
|
+
em: L
|
|
122
|
+
} = he("editable-table"), N = X(), _ = D, v = b(), {
|
|
123
|
+
value: u,
|
|
124
124
|
updateValue: S
|
|
125
|
-
} =
|
|
125
|
+
} = Ce(l, _), s = b(), [, A] = ye(), z = ve("valueTypeMap"), c = y.useWatch(l.name, s);
|
|
126
126
|
R(() => c.value, (e) => {
|
|
127
127
|
var t;
|
|
128
128
|
S(e), (t = l.onChange) == null || t.call(l, e);
|
|
129
129
|
}, {
|
|
130
130
|
deep: !0
|
|
131
|
-
}), R(
|
|
131
|
+
}), R(u, (e) => {
|
|
132
132
|
var t;
|
|
133
|
-
e !==
|
|
133
|
+
e !== o(c) && (me(e, o(c)) || (t = s.value) == null || t.setFieldValue(l.name, e));
|
|
134
134
|
}, {
|
|
135
135
|
deep: !0
|
|
136
136
|
});
|
|
137
|
-
const P =
|
|
137
|
+
const P = xe(l, z);
|
|
138
138
|
function I() {
|
|
139
139
|
var e;
|
|
140
|
-
(e =
|
|
140
|
+
(e = s.value) == null || e.resetFields();
|
|
141
141
|
}
|
|
142
142
|
function O(e) {
|
|
143
|
-
return e ? (k(e) ? e : [e]).map((
|
|
143
|
+
return e ? (k(e) ? e : [e]).map((n) => k(n) ? [l.name, ...n] : [l.name, n]) : void 0;
|
|
144
144
|
}
|
|
145
145
|
async function j(e, t) {
|
|
146
|
-
var
|
|
147
|
-
const
|
|
148
|
-
return
|
|
146
|
+
var a;
|
|
147
|
+
const n = await ((a = s.value) == null ? void 0 : a.validateFields(O(e), t));
|
|
148
|
+
return n == null ? void 0 : n[l.name];
|
|
149
149
|
}
|
|
150
150
|
function q(e, t) {
|
|
151
151
|
var r, i, d;
|
|
152
|
-
const
|
|
153
|
-
if (C(l.maxLength) &&
|
|
152
|
+
const n = ((r = o(u)) == null ? void 0 : r.length) || 0;
|
|
153
|
+
if (C(l.maxLength) && n >= l.maxLength)
|
|
154
154
|
return;
|
|
155
|
-
const
|
|
156
|
-
C(t) ?
|
|
155
|
+
const a = [...o(u) || []];
|
|
156
|
+
C(t) ? a.splice(t, 0, {
|
|
157
157
|
...e || {}
|
|
158
|
-
}) :
|
|
158
|
+
}) : a.push({
|
|
159
159
|
...e || {}
|
|
160
|
-
}), (d = (i =
|
|
160
|
+
}), (d = (i = s.value) == null ? void 0 : i.setFieldValue) == null || d.call(i, l.name, a);
|
|
161
161
|
}
|
|
162
162
|
function K(e, t = "suffix") {
|
|
163
163
|
var d, f, w;
|
|
164
|
-
const
|
|
165
|
-
if (C(l.maxLength) &&
|
|
164
|
+
const n = ((d = o(u)) == null ? void 0 : d.length) || 0, a = g(e) ? e : e.length;
|
|
165
|
+
if (C(l.maxLength) && n + a > l.maxLength)
|
|
166
166
|
return;
|
|
167
|
-
const r = [...
|
|
168
|
-
t === "suffix" ? r.push(...i) : r.unshift(...i), (w = (f =
|
|
167
|
+
const r = [...o(u) || []], i = g(e) ? new Array(e).fill({}) : h(e);
|
|
168
|
+
t === "suffix" ? r.push(...i) : r.unshift(...i), (w = (f = s.value) == null ? void 0 : f.setFieldValue) == null || w.call(f, l.name, r);
|
|
169
169
|
}
|
|
170
170
|
function M(e) {
|
|
171
|
-
var
|
|
172
|
-
let t = h(
|
|
173
|
-
const
|
|
174
|
-
t = t.filter((i, d) => !
|
|
171
|
+
var a, r;
|
|
172
|
+
let t = h(o(u) || []);
|
|
173
|
+
const n = g(e) ? [e] : e;
|
|
174
|
+
t = t.filter((i, d) => !n.includes(d)), (r = (a = s.value) == null ? void 0 : a.setFieldValue) == null || r.call(a, l.name, t);
|
|
175
175
|
}
|
|
176
176
|
function G() {
|
|
177
|
-
return
|
|
177
|
+
return o(u);
|
|
178
178
|
}
|
|
179
179
|
function H(e) {
|
|
180
180
|
var t;
|
|
181
|
-
|
|
181
|
+
(t = s.value) == null || t.setFieldValue(l.name, e);
|
|
182
182
|
}
|
|
183
|
-
function U(e
|
|
184
|
-
var
|
|
185
|
-
|
|
183
|
+
function U(e) {
|
|
184
|
+
var t;
|
|
185
|
+
return (t = o(u)) == null ? void 0 : t[e];
|
|
186
|
+
}
|
|
187
|
+
function W(e, t, n = !0) {
|
|
188
|
+
var r, i;
|
|
189
|
+
const a = h(o(u));
|
|
186
190
|
a[e] && (a[e] = {
|
|
187
|
-
...a[e],
|
|
191
|
+
...n ? a[e] : {},
|
|
188
192
|
...t
|
|
189
|
-
}, (
|
|
193
|
+
}, (i = (r = s.value) == null ? void 0 : r.setFieldValue) == null || i.call(r, l.name, [...a]));
|
|
190
194
|
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
+
function $(e, t) {
|
|
196
|
+
var a;
|
|
197
|
+
const n = e === "end" ? u.value.length - 1 : e;
|
|
198
|
+
ce(n, (a = v.value) == null ? void 0 : a.$el, t);
|
|
195
199
|
}
|
|
196
|
-
function
|
|
200
|
+
function Q() {
|
|
197
201
|
var e, t;
|
|
198
|
-
(t = (e =
|
|
202
|
+
(t = (e = s.value) == null ? void 0 : e.setFieldValue) == null || t.call(e, l.name, []);
|
|
199
203
|
}
|
|
200
|
-
return
|
|
204
|
+
return T({
|
|
201
205
|
resetFields: I,
|
|
202
206
|
validateFields: j,
|
|
203
207
|
add: q,
|
|
204
208
|
remove: M,
|
|
205
|
-
getRowData:
|
|
209
|
+
getRowData: U,
|
|
206
210
|
getRowsData: G,
|
|
207
|
-
setRowData:
|
|
211
|
+
setRowData: W,
|
|
208
212
|
addMultiple: K,
|
|
209
|
-
scrollTo:
|
|
210
|
-
clear:
|
|
211
|
-
|
|
213
|
+
scrollTo: $,
|
|
214
|
+
clear: Q,
|
|
215
|
+
setTableData: H
|
|
216
|
+
}), (e, t) => (p(), F(o(y), {
|
|
212
217
|
"initial-values": {
|
|
213
|
-
[l.name]:
|
|
218
|
+
[l.name]: o(u)
|
|
214
219
|
},
|
|
215
220
|
ref_key: "formRef",
|
|
216
|
-
ref:
|
|
221
|
+
ref: s
|
|
217
222
|
}, {
|
|
218
|
-
default: m(() => [x(
|
|
223
|
+
default: m(() => [x(o(y).FormItem, {
|
|
219
224
|
name: e.name,
|
|
220
225
|
"no-style": ""
|
|
221
226
|
}, {
|
|
222
|
-
default: m(() => [x(
|
|
223
|
-
class:
|
|
224
|
-
columns:
|
|
225
|
-
"data-source":
|
|
227
|
+
default: m(() => [x(o(ie), Y(o(fe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
|
|
228
|
+
class: o(E)(),
|
|
229
|
+
columns: o(P),
|
|
230
|
+
"data-source": o(u),
|
|
226
231
|
ref_key: "tableRef",
|
|
227
232
|
ref: v
|
|
228
|
-
}),
|
|
233
|
+
}), Z({
|
|
229
234
|
headerCell: m(({
|
|
230
|
-
column:
|
|
231
|
-
}) => [
|
|
235
|
+
column: n
|
|
236
|
+
}) => [o(pe)(n) ? (p(), ee("span", {
|
|
232
237
|
key: 0,
|
|
233
|
-
class:
|
|
234
|
-
}, "*", 2)) :
|
|
238
|
+
class: te(o(L)("header-cell", "required"))
|
|
239
|
+
}, "*", 2)) : B("", !0), ae("span", null, ne(n.title), 1), n.tooltip ? (p(), F(o(de), {
|
|
235
240
|
key: 1,
|
|
236
|
-
title:
|
|
241
|
+
title: n.tooltip,
|
|
237
242
|
placement: "bottom"
|
|
238
243
|
}, {
|
|
239
|
-
default: m(() => [x(
|
|
244
|
+
default: m(() => [x(o(ge), {
|
|
240
245
|
style: oe({
|
|
241
246
|
paddingLeft: "4px",
|
|
242
|
-
color:
|
|
247
|
+
color: o(A).colorPrimary
|
|
243
248
|
})
|
|
244
249
|
}, null, 8, ["style"])]),
|
|
245
250
|
_: 2
|
|
246
|
-
}, 1032, ["title"])) :
|
|
251
|
+
}, 1032, ["title"])) : B("", !0)]),
|
|
247
252
|
_: 2
|
|
248
|
-
}, [
|
|
249
|
-
name:
|
|
250
|
-
fn: m((r) => [
|
|
253
|
+
}, [le(N, (n, a) => ({
|
|
254
|
+
name: a,
|
|
255
|
+
fn: m((r) => [re(e.$slots, a, ue(se(r || {})))])
|
|
251
256
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
252
257
|
_: 3
|
|
253
258
|
}, 8, ["name"])]),
|
|
@@ -256,5 +261,5 @@ const Ae = /* @__PURE__ */ Q({
|
|
|
256
261
|
}
|
|
257
262
|
});
|
|
258
263
|
export {
|
|
259
|
-
|
|
264
|
+
ze as default
|
|
260
265
|
};
|
|
@@ -163,6 +163,12 @@ export type EditableTableExpose<ModelType = any, RecordType = any> = {
|
|
|
163
163
|
* @returns
|
|
164
164
|
*/
|
|
165
165
|
scrollTo: (index: number | 'end', options?: StandardBehaviorOptions) => void;
|
|
166
|
+
/**
|
|
167
|
+
* 设置表格数据
|
|
168
|
+
* @param nextTableData
|
|
169
|
+
* @returns
|
|
170
|
+
*/
|
|
171
|
+
setTableData: (nextTableData: RecordType[]) => void;
|
|
166
172
|
};
|
|
167
173
|
/**
|
|
168
174
|
* 可编辑表格作为表单项暴露的实例
|