@aplus-frontend/ui 0.0.21 → 0.0.22
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 +34 -32
- package/es/src/ap-form/hooks/use-watch.d.ts +1 -1
- package/es/src/ap-form/modal-form/index.vue.mjs +41 -39
- package/es/src/ap-list/hooks/use-offline-list.d.ts +21 -0
- package/es/src/ap-list/hooks/use-offline-list.mjs +32 -0
- package/es/src/ap-list/index.d.ts +4 -0
- package/es/src/ap-list/index.mjs +2 -0
- package/es/src/ap-list/index.vue.d.ts +153 -0
- package/es/src/ap-list/index.vue.mjs +137 -0
- package/es/src/ap-list/index.vue2.mjs +4 -0
- package/es/src/ap-list/interface.d.ts +35 -2
- package/es/src/ap-list/interface.mjs +1 -0
- package/es/src/ap-list/style/index.css +5 -0
- package/es/src/ap-table/interface.d.ts +2 -2
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +230 -227
- package/es/src/theme/ap-list/index.css +5 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-form/hooks/use-watch.d.ts +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-list/hooks/use-offline-list.d.ts +21 -0
- package/lib/src/ap-list/hooks/use-offline-list.js +1 -0
- package/lib/src/ap-list/index.d.ts +4 -0
- package/lib/src/ap-list/index.js +1 -0
- package/lib/src/ap-list/index.vue.d.ts +153 -0
- package/lib/src/ap-list/index.vue.js +1 -0
- package/lib/src/ap-list/index.vue2.js +1 -0
- package/lib/src/ap-list/interface.d.ts +35 -2
- package/lib/src/ap-list/interface.js +1 -0
- package/lib/src/ap-list/style/index.css +5 -0
- package/lib/src/ap-table/interface.d.ts +2 -2
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-list/index.css +5 -0
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -8,8 +8,8 @@ import { buildLocaleContext as S, buildTranslator as I, localeContextKey as b, t
|
|
|
8
8
|
import { defaultNamespace as R, namespaceContextKey as h, useGetDerivedNamespace as v, useNamespace as M } from "./src/config-provider/hooks/use-namespace.mjs";
|
|
9
9
|
import { ConfigProvider as w } from "./src/config-provider/config-provider.mjs";
|
|
10
10
|
import { APConfigProvider as G } from "./src/config-provider/index.mjs";
|
|
11
|
-
import { Scrollbar as
|
|
12
|
-
import { CollapseContainer as
|
|
11
|
+
import { Scrollbar as N } from "./src/scroll-bar/index.mjs";
|
|
12
|
+
import { CollapseContainer as E, ScrollContainer as X } from "./src/container/index.mjs";
|
|
13
13
|
import { IconPicker as Y } from "./src/icon-picker/index.mjs";
|
|
14
14
|
import { default as H } from "./src/locale/lang/zh-cn.mjs";
|
|
15
15
|
import { default as z } from "./src/locale/lang/en.mjs";
|
|
@@ -27,8 +27,8 @@ import { default as he } from "./src/pro-form/components/api-radio-group.vue.mjs
|
|
|
27
27
|
import { default as Me } from "./src/pro-form/components/api-select.vue.mjs";
|
|
28
28
|
import { default as we } from "./src/pro-form/components/api-transfer.vue.mjs";
|
|
29
29
|
import { default as Ge } from "./src/pro-form/components/api-tree.vue.mjs";
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
30
|
+
import { default as Ne } from "./src/pro-form/components/radio-button-group.vue.mjs";
|
|
31
|
+
import { default as Ee } from "./src/pro-form/pro-form.vue.mjs";
|
|
32
32
|
import { default as Ke } from "./src/pro-form/components/api-tree-select.vue.mjs";
|
|
33
33
|
import { default as Oe } from "./src/pro-form/table-form.vue.mjs";
|
|
34
34
|
import { default as We } from "./src/pro-form/table-form-inner.vue.mjs";
|
|
@@ -52,8 +52,8 @@ import { ApFormItemText as ho } from "./src/ap-form/items/text/index.mjs";
|
|
|
52
52
|
import { default as Mo } from "./src/ap-form/items/text-area/index.vue.mjs";
|
|
53
53
|
import { default as wo } from "./src/ap-form/items/number/index.vue.mjs";
|
|
54
54
|
import { default as Go } from "./src/ap-form/items/date/index.vue.mjs";
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
55
|
+
import { default as No } from "./src/ap-form/items/date-range/index.vue.mjs";
|
|
56
|
+
import { default as Eo } from "./src/ap-form/items/radio/index.vue.mjs";
|
|
57
57
|
import { default as Ko } from "./src/ap-form/items/select/index.vue.mjs";
|
|
58
58
|
import { default as Oo } from "./src/ap-form/items/switch/index.vue.mjs";
|
|
59
59
|
import { default as Wo } from "./src/ap-form/items/checkbox/index.vue.mjs";
|
|
@@ -78,8 +78,8 @@ import { default as Dr } from "./src/ap-field/text/password.vue.mjs";
|
|
|
78
78
|
import { default as hr } from "./src/ap-field/slider/index.vue.mjs";
|
|
79
79
|
import { default as Mr } from "./src/ap-field/segmented/index.vue.mjs";
|
|
80
80
|
import { default as wr } from "./src/ap-field/rate/index.vue.mjs";
|
|
81
|
-
import { adminToken as Gr, aplusToken as
|
|
82
|
-
import { ApActionItem as
|
|
81
|
+
import { adminToken as Gr, aplusToken as Lr } from "./src/design-token/index.mjs";
|
|
82
|
+
import { ApActionItem as yr } from "./src/ap-action/index.mjs";
|
|
83
83
|
import { default as Xr } from "./src/ap-action/item-modal/index.vue.mjs";
|
|
84
84
|
import { default as Yr } from "./src/ap-action/item-popconfirm/index.vue.mjs";
|
|
85
85
|
import { default as Hr } from "./src/ap-action/item-dropdown/index.vue.mjs";
|
|
@@ -100,13 +100,14 @@ import { default as ct } from "./src/ap-download/ap-download.vue.mjs";
|
|
|
100
100
|
import { CheckCard as Tt } from "./src/check-card/index.mjs";
|
|
101
101
|
import { default as St } from "./src/check-card/group.vue.mjs";
|
|
102
102
|
import { ApModal as bt } from "./src/ap-modal/index.mjs";
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import { default as Bt } from "./src/
|
|
107
|
-
import { default as
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
103
|
+
import { default as Pt } from "./src/ap-list/index.vue.mjs";
|
|
104
|
+
import { ApExpandAlert as Rt, ApLabel as ht, ApTitle as vt } from "./src/business/index.mjs";
|
|
105
|
+
import { useTablePaging as kt } from "./src/ap-table/hooks/use-table-paging.mjs";
|
|
106
|
+
import { default as Bt } from "./src/ap-table/ap-table.vue.mjs";
|
|
107
|
+
import { default as Lt } from "./src/editable-table/index.vue.mjs";
|
|
108
|
+
import { default as yt } from "./src/editable-table/form-item.vue.mjs";
|
|
109
|
+
import { useMessage as Xt } from "./src/hooks/useMessage.mjs";
|
|
110
|
+
import { useControllableValue as Yt } from "./src/hooks/useControllableValue.mjs";
|
|
110
111
|
const p = {
|
|
111
112
|
install: (r) => {
|
|
112
113
|
for (const t in o) {
|
|
@@ -118,14 +119,14 @@ const p = {
|
|
|
118
119
|
export {
|
|
119
120
|
G as APConfigProvider,
|
|
120
121
|
zr as ApActionGroup,
|
|
121
|
-
|
|
122
|
+
yr as ApActionItem,
|
|
122
123
|
Hr as ApActionItemDropdown,
|
|
123
124
|
Xr as ApActionItemModal,
|
|
124
125
|
Yr as ApActionItemPopconfirm,
|
|
125
126
|
Jr as ApCustomColumn,
|
|
126
127
|
Zr as ApCustomSelect,
|
|
127
128
|
ct as ApDownload,
|
|
128
|
-
|
|
129
|
+
Rt as ApExpandAlert,
|
|
129
130
|
pr as ApField,
|
|
130
131
|
sr as ApFieldCheckbox,
|
|
131
132
|
xr as ApFieldDate,
|
|
@@ -144,10 +145,10 @@ export {
|
|
|
144
145
|
qo as ApFormItem,
|
|
145
146
|
Wo as ApFormItemCheckbox,
|
|
146
147
|
Go as ApFormItemDate,
|
|
147
|
-
|
|
148
|
+
No as ApFormItemDateRange,
|
|
148
149
|
Qo as ApFormItemGroup,
|
|
149
150
|
wo as ApFormItemNumber,
|
|
150
|
-
|
|
151
|
+
Eo as ApFormItemRadio,
|
|
151
152
|
Ko as ApFormItemSelect,
|
|
152
153
|
Oo as ApFormItemSwitch,
|
|
153
154
|
ho as ApFormItemText,
|
|
@@ -157,12 +158,13 @@ export {
|
|
|
157
158
|
tr as ApFormModalForm,
|
|
158
159
|
or as ApFormSearchForm,
|
|
159
160
|
dt as ApInfoLayout,
|
|
160
|
-
|
|
161
|
+
ht as ApLabel,
|
|
162
|
+
Pt as ApList,
|
|
161
163
|
bt as ApModal,
|
|
162
|
-
|
|
164
|
+
Bt as ApTable,
|
|
163
165
|
ft as ApTag,
|
|
164
166
|
lt as ApTagGroup,
|
|
165
|
-
|
|
167
|
+
vt as ApTitle,
|
|
166
168
|
ut as ApUpload,
|
|
167
169
|
De as ApiCascader,
|
|
168
170
|
he as ApiRadioGroup,
|
|
@@ -177,7 +179,7 @@ export {
|
|
|
177
179
|
j as BasicTitle,
|
|
178
180
|
Tt as CheckCard,
|
|
179
181
|
St as CheckCardGroup,
|
|
180
|
-
|
|
182
|
+
E as CollapseContainer,
|
|
181
183
|
J as CollapseTransition,
|
|
182
184
|
w as ConfigProvider,
|
|
183
185
|
so as CountdownButton,
|
|
@@ -188,8 +190,8 @@ export {
|
|
|
188
190
|
et as DictCode,
|
|
189
191
|
Ao as Dropdown,
|
|
190
192
|
Io as EditTableHeaderIcon,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
Lt as EditableTable,
|
|
194
|
+
yt as EditableTableFormItem,
|
|
193
195
|
Z as ExpandTransition,
|
|
194
196
|
_ as ExpandXTransition,
|
|
195
197
|
ee as FadeTransition,
|
|
@@ -199,11 +201,11 @@ export {
|
|
|
199
201
|
Ue as ModalButton,
|
|
200
202
|
it as NeedNameKeyDefault,
|
|
201
203
|
$e as PopConfirmButton,
|
|
202
|
-
|
|
204
|
+
Ee as ProForm,
|
|
203
205
|
Fo as ProTable,
|
|
204
206
|
Oe as ProTableForm,
|
|
205
207
|
We as ProTableFormInner,
|
|
206
|
-
|
|
208
|
+
Ne as RadioButtonGroup,
|
|
207
209
|
oe as ScaleRotateTransition,
|
|
208
210
|
re as ScaleTransition,
|
|
209
211
|
X as ScrollContainer,
|
|
@@ -211,7 +213,7 @@ export {
|
|
|
211
213
|
ae as ScrollXTransition,
|
|
212
214
|
pe as ScrollYReverseTransition,
|
|
213
215
|
fe as ScrollYTransition,
|
|
214
|
-
|
|
216
|
+
N as Scrollbar,
|
|
215
217
|
me as SlideXReverseTransition,
|
|
216
218
|
le as SlideXTransition,
|
|
217
219
|
se as SlideYReverseTransition,
|
|
@@ -222,7 +224,7 @@ export {
|
|
|
222
224
|
go as TableImg,
|
|
223
225
|
at as WorkOrderModal,
|
|
224
226
|
Gr as adminToken,
|
|
225
|
-
|
|
227
|
+
Lr as aplusToken,
|
|
226
228
|
S as buildLocaleContext,
|
|
227
229
|
I as buildTranslator,
|
|
228
230
|
n as configProviderContextKey,
|
|
@@ -243,18 +245,18 @@ export {
|
|
|
243
245
|
g as translate,
|
|
244
246
|
jr as useCacheColumnSetting,
|
|
245
247
|
ce as useComponentRegister,
|
|
246
|
-
|
|
248
|
+
Yt as useControllableValue,
|
|
247
249
|
ie as useDescription,
|
|
248
250
|
Te as useForm,
|
|
249
251
|
v as useGetDerivedNamespace,
|
|
250
252
|
T as useGlobalConfig,
|
|
251
253
|
P as useLocale,
|
|
252
|
-
|
|
254
|
+
Xt as useMessage,
|
|
253
255
|
oo as useModal,
|
|
254
256
|
_e as useModalContext,
|
|
255
257
|
ro as useModalInner,
|
|
256
258
|
M as useNamespace,
|
|
257
259
|
Do as useTable,
|
|
258
|
-
|
|
260
|
+
kt as useTablePaging,
|
|
259
261
|
H as zhCn
|
|
260
262
|
};
|
|
@@ -3,5 +3,5 @@ import { ApFormExpose } from '../interface';
|
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
|
|
5
5
|
type ApFormIns<T> = ApFormExpose<T>;
|
|
6
|
-
declare const useWatch: <ValueType = any>(name: NamePath, form?: Ref<ApFormIns<
|
|
6
|
+
declare const useWatch: <ValueType = any, StoreType = any>(name: NamePath, form?: Ref<ApFormIns<StoreType> | undefined> | undefined) => Ref<ValueType | undefined>;
|
|
7
7
|
export default useWatch;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { isVNode as $, defineComponent as q, useSlots as D, ref as F, watch as L, cloneVNode as A, computed as G, createVNode as u, mergeProps as p, unref as i, openBlock as g, createElementBlock as W, Fragment as H, withCtx as y, renderSlot as
|
|
2
|
-
import { Button as V, Flex as
|
|
1
|
+
import { isVNode as $, defineComponent as q, useSlots as D, ref as F, watch as L, cloneVNode as A, computed as G, createVNode as u, mergeProps as p, unref as i, openBlock as g, createElementBlock as W, Fragment as H, withCtx as y, renderSlot as x, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as T, resolveDynamicComponent as N, createCommentVNode as Y } from "vue";
|
|
2
|
+
import { Button as V, Flex as Z, Space as I, Modal as ee } from "ant-design-vue";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { getSingleVNode as
|
|
5
|
+
import { getSingleVNode as te } from "../../utils/slot.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { omit as
|
|
7
|
+
import { omit as le } from "lodash-unified";
|
|
8
8
|
import "../style/modal-form.css";
|
|
9
|
-
import { convertReactiveToRaw as
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import
|
|
15
|
-
function
|
|
9
|
+
import { convertReactiveToRaw as ae } from "../../utils/index.mjs";
|
|
10
|
+
import { useControllableValue as oe } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useLocale as ie } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import re from "../ap-form.vue2.mjs";
|
|
15
|
+
function P(d) {
|
|
16
16
|
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !$(d);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const _e = /* @__PURE__ */ q({
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
21
21
|
layout: {
|
|
@@ -86,26 +86,26 @@ const Se = /* @__PURE__ */ q({
|
|
|
86
86
|
},
|
|
87
87
|
emits: ["update:open"],
|
|
88
88
|
setup(d, {
|
|
89
|
-
expose:
|
|
90
|
-
emit:
|
|
89
|
+
expose: S,
|
|
90
|
+
emit: _
|
|
91
91
|
}) {
|
|
92
|
-
const a = d, b = D(),
|
|
93
|
-
value:
|
|
92
|
+
const a = d, b = D(), R = _, o = F(), c = F(), r = F(!1), {
|
|
93
|
+
value: M,
|
|
94
94
|
updateValue: m
|
|
95
|
-
} =
|
|
95
|
+
} = oe(a, R, {
|
|
96
96
|
valuePropName: "open",
|
|
97
97
|
defaultValue: !1
|
|
98
98
|
}), {
|
|
99
99
|
t: v
|
|
100
|
-
} =
|
|
101
|
-
b:
|
|
100
|
+
} = ie(), h = se("uiMode", "aplus"), {
|
|
101
|
+
b: j,
|
|
102
102
|
e: C
|
|
103
|
-
} =
|
|
103
|
+
} = ne("ap-form-modal-form");
|
|
104
104
|
L(() => o.value, (e) => {
|
|
105
105
|
var t;
|
|
106
106
|
e && c.value && ((t = e.setFieldsValue) == null || t.call(e, c.value), c.value = void 0);
|
|
107
107
|
});
|
|
108
|
-
const B =
|
|
108
|
+
const B = te(b.trigger), k = B ? A(B, {
|
|
109
109
|
onClick: () => {
|
|
110
110
|
m(!0);
|
|
111
111
|
}
|
|
@@ -117,9 +117,9 @@ const Se = /* @__PURE__ */ q({
|
|
|
117
117
|
if (a.showCancel) {
|
|
118
118
|
let s;
|
|
119
119
|
e.push(u(V, {
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: w,
|
|
121
121
|
disabled: r.value
|
|
122
|
-
},
|
|
122
|
+
}, P(s = v("ap.common.cancelText")) ? s : {
|
|
123
123
|
default: () => [s]
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
@@ -143,11 +143,11 @@ const Se = /* @__PURE__ */ q({
|
|
|
143
143
|
var s;
|
|
144
144
|
return [((s = a.submitter) == null ? void 0 : s.submitText) || v("ap.common.okText")];
|
|
145
145
|
}
|
|
146
|
-
})), u(
|
|
146
|
+
})), u(Z, {
|
|
147
147
|
justify: "flex-end",
|
|
148
148
|
class: C(i(h) === "admin" ? "footer-admin" : "footer")
|
|
149
149
|
}, {
|
|
150
|
-
default: () => [b.submitter ? b.submitter(e) : u(
|
|
150
|
+
default: () => [b.submitter ? b.submitter(e) : u(I, null, P(e) ? e : {
|
|
151
151
|
default: () => [e]
|
|
152
152
|
})]
|
|
153
153
|
});
|
|
@@ -161,18 +161,18 @@ const Se = /* @__PURE__ */ q({
|
|
|
161
161
|
if (a.submitter !== !1)
|
|
162
162
|
try {
|
|
163
163
|
const f = await ((e = o.value) == null ? void 0 : e.validateFields());
|
|
164
|
-
(l = (t = a.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), r.value = !0, await ((n = a.onFinish) == null ? void 0 : n.call(a,
|
|
164
|
+
(l = (t = a.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), r.value = !0, await ((n = a.onFinish) == null ? void 0 : n.call(a, ae(f))) && m(!1);
|
|
165
165
|
} finally {
|
|
166
166
|
r.value = !1;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function w() {
|
|
170
170
|
i(r) || m(!1);
|
|
171
171
|
}
|
|
172
172
|
function U(e) {
|
|
173
173
|
!e && i(r) || m(e);
|
|
174
174
|
}
|
|
175
|
-
return
|
|
175
|
+
return S({
|
|
176
176
|
resetFields: (e) => {
|
|
177
177
|
var t;
|
|
178
178
|
(t = o.value) == null || t.resetFields(e);
|
|
@@ -209,33 +209,35 @@ const Se = /* @__PURE__ */ q({
|
|
|
209
209
|
}
|
|
210
210
|
(l = (t = o.value) == null ? void 0 : t.setFieldsValue) == null || l.call(t, e);
|
|
211
211
|
}
|
|
212
|
-
}), (e, t) => (g(), W(H, null, [u(i(
|
|
213
|
-
open: i(
|
|
212
|
+
}), (e, t) => (g(), W(H, null, [u(i(ee), p(e.modalProps, {
|
|
213
|
+
open: i(M),
|
|
214
214
|
"onUpdate:open": U,
|
|
215
|
-
onCancel:
|
|
215
|
+
onCancel: w,
|
|
216
216
|
footer: null,
|
|
217
217
|
width: e.width,
|
|
218
|
-
class: i(
|
|
218
|
+
class: i(j)(),
|
|
219
219
|
"body-style": {
|
|
220
220
|
padding: i(h) === "admin" ? "0px !important" : "20px !important"
|
|
221
221
|
// 这里使用内联样式目的是为了使用最高优先级覆盖设置的全局样式
|
|
222
222
|
// 使用ModalForm你可能无法再自定义body的样式
|
|
223
223
|
}
|
|
224
224
|
}), {
|
|
225
|
-
title: y(() => [
|
|
225
|
+
title: y(() => [x(e.$slots, "title", {}, () => [J(K(a.title), 1)])]),
|
|
226
226
|
default: y(() => [Q("div", {
|
|
227
227
|
class: X(i(C)(i(h) === "admin" ? "content-admin" : "content"))
|
|
228
|
-
}, [u(
|
|
228
|
+
}, [u(re, p({
|
|
229
229
|
ref_key: "formRef",
|
|
230
230
|
ref: o
|
|
231
|
-
}, i(
|
|
232
|
-
default: y(() => [
|
|
231
|
+
}, i(le)(a, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
232
|
+
default: y(() => [x(e.$slots, "default")]),
|
|
233
233
|
_: 3
|
|
234
|
-
}, 16)], 2), (g(),
|
|
234
|
+
}, 16)], 2), (g(), T(N(O.value)))]),
|
|
235
235
|
_: 3
|
|
236
|
-
}, 16, ["open", "width", "class", "body-style"]), (g(),
|
|
236
|
+
}, 16, ["open", "width", "class", "body-style"]), i(k) ? (g(), T(N(i(k)), {
|
|
237
|
+
key: 0
|
|
238
|
+
})) : Y("", !0)], 64));
|
|
237
239
|
}
|
|
238
240
|
});
|
|
239
241
|
export {
|
|
240
|
-
|
|
242
|
+
_e as default
|
|
241
243
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Recordable } from '../../type';
|
|
2
|
+
import { ApListProps } from '../interface';
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 处理离线数据分页的情况
|
|
7
|
+
* @param dataSource
|
|
8
|
+
* @param pagination
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const useOfflineList: <DataType = Recordable<any>>(params: ApListProps<DataType, Recordable<any>>) => {
|
|
12
|
+
pagination: ComputedRef<{
|
|
13
|
+
current: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
total: number;
|
|
16
|
+
showSizeChanger: boolean;
|
|
17
|
+
showQuickJumper: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
dataSource: ComputedRef<DataType[]>;
|
|
20
|
+
onChange: (page: number, size: number) => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ref as o, computed as r, unref as t } from "vue";
|
|
2
|
+
const l = (e) => {
|
|
3
|
+
const n = o(
|
|
4
|
+
e.pagination && e.pagination.defaultCurrent || 1
|
|
5
|
+
), u = o(
|
|
6
|
+
e.pagination && e.pagination.defaultPageSize || 10
|
|
7
|
+
);
|
|
8
|
+
function a(i, g) {
|
|
9
|
+
n.value = i, u.value = g;
|
|
10
|
+
}
|
|
11
|
+
const c = r(() => e.dataSource ? e.pagination === !1 ? [...e.dataSource] : e.dataSource.slice(
|
|
12
|
+
(t(n) - 1) * t(u),
|
|
13
|
+
t(n) * t(u)
|
|
14
|
+
) : []);
|
|
15
|
+
return {
|
|
16
|
+
pagination: r(() => {
|
|
17
|
+
var i;
|
|
18
|
+
return {
|
|
19
|
+
current: t(n),
|
|
20
|
+
pageSize: t(u),
|
|
21
|
+
total: ((i = e.dataSource) == null ? void 0 : i.length) || 0,
|
|
22
|
+
showSizeChanger: !0,
|
|
23
|
+
showQuickJumper: !0
|
|
24
|
+
};
|
|
25
|
+
}),
|
|
26
|
+
dataSource: c,
|
|
27
|
+
onChange: a
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
l as useOfflineList
|
|
32
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Recordable } from '../type';
|
|
2
|
+
import { RequestData } from '../ap-table';
|
|
3
|
+
import { CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, Ref, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
4
|
+
import { ApFormSearchFormExpose } from '..';
|
|
5
|
+
|
|
6
|
+
declare const _default: <RecordType extends Recordable<any>>(__VLS_props: {
|
|
7
|
+
loading?: boolean | undefined;
|
|
8
|
+
pagination?: false | {
|
|
9
|
+
defaultCurrent?: number | undefined;
|
|
10
|
+
defaultPageSize?: number | undefined;
|
|
11
|
+
hideOnSinglePage?: boolean | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
params?: Recordable<any> | undefined;
|
|
14
|
+
manual?: boolean | undefined;
|
|
15
|
+
dataSource?: RecordType[] | undefined;
|
|
16
|
+
request?: ((params: Partial<Recordable<any>> & {
|
|
17
|
+
pageSize: number;
|
|
18
|
+
current: number;
|
|
19
|
+
}) => Promise<Partial< RequestData<RecordType>>>) | undefined;
|
|
20
|
+
defaultData?: RecordType[] | undefined;
|
|
21
|
+
onLoadingChange?: ((loading: boolean) => void) | undefined;
|
|
22
|
+
beforeSearchSubmit?: ((params: Partial<Recordable<any>>) => any) | undefined;
|
|
23
|
+
onItem?: ((record: RecordType, index: number) => void) | undefined;
|
|
24
|
+
containerStyle?: CSSProperties | undefined;
|
|
25
|
+
footerWarpperStyle?: CSSProperties | undefined;
|
|
26
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: {
|
|
27
|
+
attrs: any;
|
|
28
|
+
slots: {
|
|
29
|
+
header?(_: {
|
|
30
|
+
formIns: {
|
|
31
|
+
form: Ref< ApFormSearchFormExpose | undefined>;
|
|
32
|
+
};
|
|
33
|
+
submit: () => void;
|
|
34
|
+
reset: () => void;
|
|
35
|
+
}): any;
|
|
36
|
+
renderContent?(_: {
|
|
37
|
+
dataSource: RecordType[];
|
|
38
|
+
}): any;
|
|
39
|
+
renderItem?(_: {
|
|
40
|
+
item: RecordType;
|
|
41
|
+
index: number;
|
|
42
|
+
}): any;
|
|
43
|
+
};
|
|
44
|
+
emit: any;
|
|
45
|
+
} | undefined, __VLS_expose?: ((exposed: ShallowUnwrapRef<{
|
|
46
|
+
submit: () => void;
|
|
47
|
+
reset: () => void;
|
|
48
|
+
refresh: () => void;
|
|
49
|
+
refreshByDelete: (n: number) => void;
|
|
50
|
+
scrollToFirstRow: (selector?: string) => void;
|
|
51
|
+
}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
52
|
+
props: {
|
|
53
|
+
loading?: boolean | undefined;
|
|
54
|
+
pagination?: false | {
|
|
55
|
+
defaultCurrent?: number | undefined;
|
|
56
|
+
defaultPageSize?: number | undefined;
|
|
57
|
+
hideOnSinglePage?: boolean | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
params?: Recordable<any> | undefined;
|
|
60
|
+
manual?: boolean | undefined;
|
|
61
|
+
dataSource?: RecordType[] | undefined;
|
|
62
|
+
request?: ((params: Partial<Recordable<any>> & {
|
|
63
|
+
pageSize: number;
|
|
64
|
+
current: number;
|
|
65
|
+
}) => Promise<Partial< RequestData<RecordType>>>) | undefined;
|
|
66
|
+
defaultData?: RecordType[] | undefined;
|
|
67
|
+
onLoadingChange?: ((loading: boolean) => void) | undefined;
|
|
68
|
+
beforeSearchSubmit?: ((params: Partial<Recordable<any>>) => any) | undefined;
|
|
69
|
+
onItem?: ((record: RecordType, index: number) => void) | undefined;
|
|
70
|
+
containerStyle?: CSSProperties | undefined;
|
|
71
|
+
footerWarpperStyle?: CSSProperties | undefined;
|
|
72
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
73
|
+
expose(exposed: ShallowUnwrapRef<{
|
|
74
|
+
submit: () => void;
|
|
75
|
+
reset: () => void;
|
|
76
|
+
refresh: () => void;
|
|
77
|
+
refreshByDelete: (n: number) => void;
|
|
78
|
+
scrollToFirstRow: (selector?: string) => void;
|
|
79
|
+
}>): void;
|
|
80
|
+
attrs: any;
|
|
81
|
+
slots: {
|
|
82
|
+
header?(_: {
|
|
83
|
+
formIns: {
|
|
84
|
+
form: Ref< ApFormSearchFormExpose | undefined>;
|
|
85
|
+
};
|
|
86
|
+
submit: () => void;
|
|
87
|
+
reset: () => void;
|
|
88
|
+
}): any;
|
|
89
|
+
renderContent?(_: {
|
|
90
|
+
dataSource: RecordType[];
|
|
91
|
+
}): any;
|
|
92
|
+
renderItem?(_: {
|
|
93
|
+
item: RecordType;
|
|
94
|
+
index: number;
|
|
95
|
+
}): any;
|
|
96
|
+
};
|
|
97
|
+
emit: any;
|
|
98
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}> & {
|
|
101
|
+
__ctx?: {
|
|
102
|
+
props: {
|
|
103
|
+
loading?: boolean | undefined;
|
|
104
|
+
pagination?: false | {
|
|
105
|
+
defaultCurrent?: number | undefined;
|
|
106
|
+
defaultPageSize?: number | undefined;
|
|
107
|
+
hideOnSinglePage?: boolean | undefined;
|
|
108
|
+
} | undefined;
|
|
109
|
+
params?: Recordable<any> | undefined;
|
|
110
|
+
manual?: boolean | undefined;
|
|
111
|
+
dataSource?: RecordType[] | undefined;
|
|
112
|
+
request?: ((params: Partial<Recordable<any>> & {
|
|
113
|
+
pageSize: number;
|
|
114
|
+
current: number;
|
|
115
|
+
}) => Promise<Partial< RequestData<RecordType>>>) | undefined;
|
|
116
|
+
defaultData?: RecordType[] | undefined;
|
|
117
|
+
onLoadingChange?: ((loading: boolean) => void) | undefined;
|
|
118
|
+
beforeSearchSubmit?: ((params: Partial<Recordable<any>>) => any) | undefined;
|
|
119
|
+
onItem?: ((record: RecordType, index: number) => void) | undefined;
|
|
120
|
+
containerStyle?: CSSProperties | undefined;
|
|
121
|
+
footerWarpperStyle?: CSSProperties | undefined;
|
|
122
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
123
|
+
expose(exposed: ShallowUnwrapRef<{
|
|
124
|
+
submit: () => void;
|
|
125
|
+
reset: () => void;
|
|
126
|
+
refresh: () => void;
|
|
127
|
+
refreshByDelete: (n: number) => void;
|
|
128
|
+
scrollToFirstRow: (selector?: string) => void;
|
|
129
|
+
}>): void;
|
|
130
|
+
attrs: any;
|
|
131
|
+
slots: {
|
|
132
|
+
header?(_: {
|
|
133
|
+
formIns: {
|
|
134
|
+
form: Ref< ApFormSearchFormExpose | undefined>;
|
|
135
|
+
};
|
|
136
|
+
submit: () => void;
|
|
137
|
+
reset: () => void;
|
|
138
|
+
}): any;
|
|
139
|
+
renderContent?(_: {
|
|
140
|
+
dataSource: RecordType[];
|
|
141
|
+
}): any;
|
|
142
|
+
renderItem?(_: {
|
|
143
|
+
item: RecordType;
|
|
144
|
+
index: number;
|
|
145
|
+
}): any;
|
|
146
|
+
};
|
|
147
|
+
emit: any;
|
|
148
|
+
} | undefined;
|
|
149
|
+
};
|
|
150
|
+
export default _default;
|
|
151
|
+
type __VLS_Prettify<T> = {
|
|
152
|
+
[K in keyof T]: T[K];
|
|
153
|
+
} & {};
|