@aplus-frontend/ui 0.0.20 → 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.
Files changed (53) hide show
  1. package/es/index.mjs +34 -32
  2. package/es/src/ap-form/hooks/use-watch.d.ts +2 -2
  3. package/es/src/ap-form/modal-form/index.vue.mjs +41 -39
  4. package/es/src/ap-list/hooks/use-offline-list.d.ts +21 -0
  5. package/es/src/ap-list/hooks/use-offline-list.mjs +32 -0
  6. package/es/src/ap-list/index.d.ts +4 -0
  7. package/es/src/ap-list/index.mjs +2 -0
  8. package/es/src/ap-list/index.vue.d.ts +153 -0
  9. package/es/src/ap-list/index.vue.mjs +137 -0
  10. package/es/src/ap-list/index.vue2.mjs +4 -0
  11. package/es/src/ap-list/interface.d.ts +100 -0
  12. package/es/src/ap-list/interface.mjs +1 -0
  13. package/es/src/ap-list/style/index.css +11 -0
  14. package/es/src/ap-table/ap-table.vue.mjs +123 -113
  15. package/es/src/ap-table/interface.d.ts +8 -6
  16. package/es/src/ap-table/style/ap-table.css +19 -0
  17. package/es/src/ap-table/utils.d.ts +826 -670
  18. package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -25
  19. package/es/src/editable-table/hooks/use-get-columns.mjs +47 -45
  20. package/es/src/editable-table/interface.d.ts +6 -1
  21. package/es/src/editable-table/style/index.css +3 -0
  22. package/es/src/index.d.ts +1 -0
  23. package/es/src/index.mjs +230 -227
  24. package/es/src/theme/ap-list/index.css +11 -0
  25. package/es/src/theme/ap-table/ap-table.css +19 -0
  26. package/es/src/theme/editable-table/index.css +3 -0
  27. package/lib/index.js +1 -1
  28. package/lib/src/ap-form/hooks/use-watch.d.ts +2 -2
  29. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  30. package/lib/src/ap-list/hooks/use-offline-list.d.ts +21 -0
  31. package/lib/src/ap-list/hooks/use-offline-list.js +1 -0
  32. package/lib/src/ap-list/index.d.ts +4 -0
  33. package/lib/src/ap-list/index.js +1 -0
  34. package/lib/src/ap-list/index.vue.d.ts +153 -0
  35. package/lib/src/ap-list/index.vue.js +1 -0
  36. package/lib/src/ap-list/index.vue2.js +1 -0
  37. package/lib/src/ap-list/interface.d.ts +100 -0
  38. package/lib/src/ap-list/interface.js +1 -0
  39. package/lib/src/ap-list/style/index.css +11 -0
  40. package/lib/src/ap-table/ap-table.vue.js +1 -1
  41. package/lib/src/ap-table/interface.d.ts +8 -6
  42. package/lib/src/ap-table/style/ap-table.css +19 -0
  43. package/lib/src/ap-table/utils.d.ts +826 -670
  44. package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -25
  45. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  46. package/lib/src/editable-table/interface.d.ts +6 -1
  47. package/lib/src/editable-table/style/index.css +3 -0
  48. package/lib/src/index.d.ts +1 -0
  49. package/lib/src/index.js +1 -1
  50. package/lib/src/theme/ap-list/index.css +11 -0
  51. package/lib/src/theme/ap-table/ap-table.css +19 -0
  52. package/lib/src/theme/editable-table/index.css +3 -0
  53. 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 y } from "./src/scroll-bar/index.mjs";
12
- import { CollapseContainer as L, ScrollContainer as X } from "./src/container/index.mjs";
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 ye } from "./src/pro-form/components/radio-button-group.vue.mjs";
31
- import { default as Le } from "./src/pro-form/pro-form.vue.mjs";
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 yo } from "./src/ap-form/items/date-range/index.vue.mjs";
56
- import { default as Lo } from "./src/ap-form/items/radio/index.vue.mjs";
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 Nr } from "./src/design-token/index.mjs";
82
- import { ApActionItem as Er } from "./src/ap-action/index.mjs";
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 { ApExpandAlert as Pt, ApLabel as Dt, ApTitle as Rt } from "./src/business/index.mjs";
104
- import { useTablePaging as vt } from "./src/ap-table/hooks/use-table-paging.mjs";
105
- import { default as kt } from "./src/ap-table/ap-table.vue.mjs";
106
- import { default as Bt } from "./src/editable-table/index.vue.mjs";
107
- import { default as Nt } from "./src/editable-table/form-item.vue.mjs";
108
- import { useMessage as Et } from "./src/hooks/useMessage.mjs";
109
- import { useControllableValue as Xt } from "./src/hooks/useControllableValue.mjs";
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
- Er as ApActionItem,
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
- Pt as ApExpandAlert,
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
- yo as ApFormItemDateRange,
148
+ No as ApFormItemDateRange,
148
149
  Qo as ApFormItemGroup,
149
150
  wo as ApFormItemNumber,
150
- Lo as ApFormItemRadio,
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
- Dt as ApLabel,
161
+ ht as ApLabel,
162
+ Pt as ApList,
161
163
  bt as ApModal,
162
- kt as ApTable,
164
+ Bt as ApTable,
163
165
  ft as ApTag,
164
166
  lt as ApTagGroup,
165
- Rt as ApTitle,
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
- L as CollapseContainer,
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
- Bt as EditableTable,
192
- Nt as EditableTableFormItem,
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
- Le as ProForm,
204
+ Ee as ProForm,
203
205
  Fo as ProTable,
204
206
  Oe as ProTableForm,
205
207
  We as ProTableFormInner,
206
- ye as RadioButtonGroup,
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
- y as Scrollbar,
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
- Nr as aplusToken,
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
- Xt as useControllableValue,
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
- Et as useMessage,
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
- vt as useTablePaging,
260
+ kt as useTablePaging,
259
261
  H as zhCn
260
262
  };
@@ -2,6 +2,6 @@ import { NamePath } from 'ant-design-vue/es/form/interface';
2
2
  import { ApFormExpose } from '../interface';
3
3
  import { Ref } from 'vue';
4
4
 
5
- type ApFormIns = ApFormExpose;
6
- declare const useWatch: <ValueType = any>(name: NamePath, form?: Ref<ApFormIns | undefined>) => Ref<ValueType | undefined>;
5
+ type ApFormIns<T> = ApFormExpose<T>;
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 w, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as x, resolveDynamicComponent as T } from "vue";
2
- import { Button as V, Flex as Y, Space as Z, Modal as I } from "ant-design-vue";
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 ee } from "../../utils/slot.mjs";
5
+ import { getSingleVNode as te } from "../../utils/slot.mjs";
6
6
  import "../../config-provider/index.mjs";
7
- import { omit as te } from "lodash-unified";
7
+ import { omit as le } from "lodash-unified";
8
8
  import "../style/modal-form.css";
9
- import { convertReactiveToRaw as le } from "../../utils/index.mjs";
10
- import { useControllableValue as ae } from "../../hooks/useControllableValue.mjs";
11
- import { useLocale as oe } from "../../config-provider/hooks/use-locale.mjs";
12
- import { useGlobalConfig as ie } from "../../config-provider/hooks/use-global-config.mjs";
13
- import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
14
- import ne from "../ap-form.vue2.mjs";
15
- function N(d) {
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 Se = /* @__PURE__ */ q({
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: P,
90
- emit: S
89
+ expose: S,
90
+ emit: _
91
91
  }) {
92
- const a = d, b = D(), _ = S, o = F(), c = F(), r = F(!1), {
93
- value: R,
92
+ const a = d, b = D(), R = _, o = F(), c = F(), r = F(!1), {
93
+ value: M,
94
94
  updateValue: m
95
- } = ae(a, _, {
95
+ } = oe(a, R, {
96
96
  valuePropName: "open",
97
97
  defaultValue: !1
98
98
  }), {
99
99
  t: v
100
- } = oe(), h = ie("uiMode", "aplus"), {
101
- b: M,
100
+ } = ie(), h = se("uiMode", "aplus"), {
101
+ b: j,
102
102
  e: C
103
- } = se("ap-form-modal-form");
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 = ee(b.trigger), j = B ? A(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: k,
120
+ onClick: w,
121
121
  disabled: r.value
122
- }, N(s = v("ap.common.cancelText")) ? s : {
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(Y, {
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(Z, null, N(e) ? e : {
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, le(f))) && m(!1);
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 k() {
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 P({
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(I), p(e.modalProps, {
213
- open: i(R),
212
+ }), (e, t) => (g(), W(H, null, [u(i(ee), p(e.modalProps, {
213
+ open: i(M),
214
214
  "onUpdate:open": U,
215
- onCancel: k,
215
+ onCancel: w,
216
216
  footer: null,
217
217
  width: e.width,
218
- class: i(M)(),
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(() => [w(e.$slots, "title", {}, () => [J(K(a.title), 1)])]),
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(ne, p({
228
+ }, [u(re, p({
229
229
  ref_key: "formRef",
230
230
  ref: o
231
- }, i(te)(a, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
232
- default: y(() => [w(e.$slots, "default")]),
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(), x(T(O.value)))]),
234
+ }, 16)], 2), (g(), T(N(O.value)))]),
235
235
  _: 3
236
- }, 16, ["open", "width", "class", "body-style"]), (g(), x(T(i(j))))], 64));
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
- Se as default
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,4 @@
1
+ import { default as ApList } from './index.vue';
2
+
3
+ export { ApList };
4
+ export * from './interface';
@@ -0,0 +1,2 @@
1
+ import "./index.vue2.mjs";
2
+ import "./interface.mjs";
@@ -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
+ } & {};