@aplus-frontend/ui 7.7.3 → 7.7.5

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 (131) hide show
  1. package/es/src/ap-action/group/index.vue.d.ts +1 -0
  2. package/es/src/ap-action/group/index.vue.mjs +28 -28
  3. package/es/src/ap-action/item-popconfirm/index.vue.d.ts +25 -1
  4. package/es/src/ap-button/ap-action-button.vue.d.ts +2 -1
  5. package/es/src/ap-button/ap-button.vue.d.ts +2 -1
  6. package/es/src/ap-field/checkbox/index.vue.mjs +18 -8
  7. package/es/src/ap-field/number/index.vue.d.ts +20 -0
  8. package/es/src/ap-field/number/index.vue.mjs +24 -23
  9. package/es/src/ap-field/number/read.vue2.mjs +3 -2
  10. package/es/src/ap-field/radio/index.vue.mjs +24 -24
  11. package/es/src/ap-field/rate/index.vue.mjs +10 -10
  12. package/es/src/ap-field/select/index.vue.d.ts +12 -4
  13. package/es/src/ap-field/select/index.vue.mjs +74 -71
  14. package/es/src/ap-field/slider/index.vue.d.ts +4 -2
  15. package/es/src/ap-field/slider/index.vue.mjs +12 -12
  16. package/es/src/ap-field/switch/index.vue.mjs +20 -20
  17. package/es/src/ap-field/text/index.vue2.mjs +23 -23
  18. package/es/src/ap-field/text/password.vue.mjs +9 -9
  19. package/es/src/ap-field/text-area/index.vue.mjs +24 -20
  20. package/es/src/ap-field/tree-select/index.vue.d.ts +2 -0
  21. package/es/src/ap-field/tree-select/index.vue.mjs +17 -17
  22. package/es/src/ap-form/ap-form.vue2.mjs +64 -64
  23. package/es/src/ap-form/drawer-form/index.vue.mjs +41 -41
  24. package/es/src/ap-form/item/index.vue.mjs +64 -64
  25. package/es/src/ap-form/items/number/index.vue.d.ts +22 -0
  26. package/es/src/ap-form/items/number/index.vue.mjs +10 -10
  27. package/es/src/ap-form/items/radio/index.vue.mjs +3 -3
  28. package/es/src/ap-form/items/select/index.vue.d.ts +18 -6
  29. package/es/src/ap-form/items/select/index.vue.mjs +5 -5
  30. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  31. package/es/src/ap-form/items/text/index.vue2.mjs +6 -6
  32. package/es/src/ap-form/items/text/password.vue.mjs +7 -7
  33. package/es/src/ap-form/items/text-area/index.vue.mjs +5 -5
  34. package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -0
  35. package/es/src/ap-form/items/tree-select/index.vue.mjs +7 -7
  36. package/es/src/ap-form/modal-form/index.vue.d.ts +25 -1
  37. package/es/src/ap-form/search-form/components/popover-filter.vue.d.ts +19 -1
  38. package/es/src/ap-form/search-form/index.vue.mjs +63 -63
  39. package/es/src/ap-form/style/item.mjs +8 -7
  40. package/es/src/ap-list/index.vue.mjs +6 -6
  41. package/es/src/ap-table/constants.d.ts +23 -4
  42. package/es/src/business/ap-batch-action-group/index.d.ts +34 -4
  43. package/es/src/business/ap-descriptions/ap-descriptions.vue.d.ts +3 -10
  44. package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +58 -79
  45. package/es/src/business/ap-descriptions/interface.d.ts +2 -3
  46. package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
  47. package/es/src/business/ap-upload/apUpload.vue.mjs +33 -29
  48. package/es/src/business/ap-upload/apUploadTypes.d.ts +4 -0
  49. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +50 -49
  50. package/es/src/business/ap-upload/components/Picture.vue2.mjs +66 -65
  51. package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +95 -94
  52. package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  53. package/es/src/business/ap-upload/hooks/useOss.mjs +26 -24
  54. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  55. package/es/src/editable-table/form-item.vue.mjs +64 -64
  56. package/es/src/editable-table/index.vue.mjs +66 -66
  57. package/es/src/scroll-bar/index.vue.d.ts +7 -7
  58. package/es/src/scroll-bar/index.vue.mjs +21 -21
  59. package/es/src/scroll-bar/internal.vue.d.ts +4 -4
  60. package/es/src/scroll-bar/internal.vue.mjs +20 -20
  61. package/es/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
  62. package/es/src/scroll-view/hooks/use-scroll-wrapper.mjs +13 -13
  63. package/es/src/scroll-view/index.vue.d.ts +25 -25
  64. package/es/src/version.d.ts +1 -1
  65. package/es/src/version.mjs +1 -1
  66. package/lib/src/ap-action/group/index.vue.d.ts +1 -0
  67. package/lib/src/ap-action/group/index.vue.js +1 -1
  68. package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +25 -1
  69. package/lib/src/ap-button/ap-action-button.vue.d.ts +2 -1
  70. package/lib/src/ap-button/ap-button.vue.d.ts +2 -1
  71. package/lib/src/ap-field/checkbox/index.vue.js +1 -1
  72. package/lib/src/ap-field/number/index.vue.d.ts +20 -0
  73. package/lib/src/ap-field/number/index.vue.js +1 -1
  74. package/lib/src/ap-field/number/read.vue2.js +1 -1
  75. package/lib/src/ap-field/radio/index.vue.js +1 -1
  76. package/lib/src/ap-field/rate/index.vue.js +1 -1
  77. package/lib/src/ap-field/select/index.vue.d.ts +12 -4
  78. package/lib/src/ap-field/select/index.vue.js +1 -1
  79. package/lib/src/ap-field/slider/index.vue.d.ts +4 -2
  80. package/lib/src/ap-field/slider/index.vue.js +1 -1
  81. package/lib/src/ap-field/switch/index.vue.js +1 -1
  82. package/lib/src/ap-field/text/index.vue2.js +1 -1
  83. package/lib/src/ap-field/text/password.vue.js +1 -1
  84. package/lib/src/ap-field/text-area/index.vue.js +1 -1
  85. package/lib/src/ap-field/tree-select/index.vue.d.ts +2 -0
  86. package/lib/src/ap-field/tree-select/index.vue.js +1 -1
  87. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  88. package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
  89. package/lib/src/ap-form/item/index.vue.js +1 -1
  90. package/lib/src/ap-form/items/number/index.vue.d.ts +22 -0
  91. package/lib/src/ap-form/items/number/index.vue.js +1 -1
  92. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  93. package/lib/src/ap-form/items/select/index.vue.d.ts +18 -6
  94. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  95. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  96. package/lib/src/ap-form/items/text/index.vue2.js +1 -1
  97. package/lib/src/ap-form/items/text/password.vue.js +1 -1
  98. package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
  99. package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -0
  100. package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
  101. package/lib/src/ap-form/modal-form/index.vue.d.ts +25 -1
  102. package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +19 -1
  103. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  104. package/lib/src/ap-form/style/item.js +1 -1
  105. package/lib/src/ap-list/index.vue.js +1 -1
  106. package/lib/src/ap-table/constants.d.ts +23 -4
  107. package/lib/src/business/ap-batch-action-group/index.d.ts +34 -4
  108. package/lib/src/business/ap-descriptions/ap-descriptions.vue.d.ts +3 -10
  109. package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
  110. package/lib/src/business/ap-descriptions/interface.d.ts +2 -3
  111. package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
  112. package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
  113. package/lib/src/business/ap-upload/apUploadTypes.d.ts +4 -0
  114. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  115. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  116. package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
  117. package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  118. package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
  119. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  120. package/lib/src/editable-table/form-item.vue.js +1 -1
  121. package/lib/src/editable-table/index.vue.js +1 -1
  122. package/lib/src/scroll-bar/index.vue.d.ts +7 -7
  123. package/lib/src/scroll-bar/index.vue.js +1 -1
  124. package/lib/src/scroll-bar/internal.vue.d.ts +4 -4
  125. package/lib/src/scroll-bar/internal.vue.js +1 -1
  126. package/lib/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
  127. package/lib/src/scroll-view/hooks/use-scroll-wrapper.js +1 -1
  128. package/lib/src/scroll-view/index.vue.d.ts +25 -25
  129. package/lib/src/version.d.ts +1 -1
  130. package/lib/src/version.js +1 -1
  131. package/package.json +5 -5
@@ -1,19 +1,19 @@
1
- import { defineComponent as H, useSlots as $, ref as b, watch as v, unref as s, createBlock as q, openBlock as J, withCtx as p, createVNode as w, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
2
- import { Table as te } from "@aplus-frontend/antdv";
1
+ import { defineComponent as W, useSlots as H, shallowRef as $, ref as q, watch as b, unref as s, createBlock as J, openBlock as Q, withCtx as p, createVNode as w, mergeProps as X, createSlots as Y, renderList as Z, renderSlot as M, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
+ import { Table as ae } from "@aplus-frontend/antdv";
3
3
  import { ApForm as m } from "../ap-form/index.mjs";
4
- import { isEqual as ae, isArray as c, isUndefined as ne, isNumber as h, cloneDeep as oe, omit as x } from "lodash-unified";
4
+ import { isEqual as ne, isArray as c, isUndefined as oe, isNumber as h, cloneDeep as le, omit as v } from "lodash-unified";
5
5
  import "../config-provider/index.mjs";
6
6
  import "../hooks/index.mjs";
7
7
  import "../utils/index.mjs";
8
- import { scrollToRowIndex as le } from "./utils.mjs";
9
- import se from "./hooks/use-get-columns.mjs";
10
- import { useDevWarning as re } from "../utils/warning.mjs";
11
- import ue from "./style/index.mjs";
12
- import { useNamespace as ie } from "../config-provider/hooks/use-namespace.mjs";
13
- import { useControllableValue as de } from "../hooks/useControllableValue.mjs";
14
- import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.mjs";
15
- import { isDef as y } from "../utils/is.mjs";
16
- const Ve = /* @__PURE__ */ H({
8
+ import { scrollToRowIndex as se } from "./utils.mjs";
9
+ import re from "./hooks/use-get-columns.mjs";
10
+ import { useDevWarning as ue } from "../utils/warning.mjs";
11
+ import ie from "./style/index.mjs";
12
+ import { useNamespace as de } from "../config-provider/hooks/use-namespace.mjs";
13
+ import { useControllableValue as fe } from "../hooks/useControllableValue.mjs";
14
+ import { useGlobalConfig as pe } from "../config-provider/hooks/use-global-config.mjs";
15
+ import { isDef as x } from "../utils/is.mjs";
16
+ const Se = /* @__PURE__ */ W({
17
17
  name: "EditableTable",
18
18
  __name: "index",
19
19
  props: {
@@ -113,41 +113,41 @@ const Ve = /* @__PURE__ */ H({
113
113
  onFieldChange: {}
114
114
  },
115
115
  emits: ["update:value"],
116
- setup(C, {
117
- expose: R,
118
- emit: F
116
+ setup(y, {
117
+ expose: C,
118
+ emit: R
119
119
  }) {
120
- const t = C;
121
- re("EditableTable")(!1, "breaking", "EditableTable has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
120
+ const t = y;
121
+ ue("EditableTable")(!1, "breaking", "EditableTable has been EOL, Please use EditableAgGrid(https://aplus.aplnk.com/aplus-ui/components/ag-grid/editable/) instead.");
122
122
  const {
123
- b: B
124
- } = ie("editable-table"), T = ue("editable-table"), E = $(), V = F, g = b(), {
123
+ b: F
124
+ } = de("editable-table"), B = ie("editable-table"), T = H(), E = R, g = $(), {
125
125
  value: i,
126
- updateValue: S
127
- } = de(t, V), r = b(), D = fe("valueTypeMap"), f = m.useWatch(t.name, r);
128
- v(() => f.value, (e) => {
129
- S(e), t.onChange?.(e);
126
+ updateValue: V
127
+ } = fe(t, E), r = q(), S = pe("valueTypeMap"), f = m.useWatch(t.name, r);
128
+ b(() => f.value, (e) => {
129
+ V(e), t.onChange?.(e);
130
130
  }, {
131
131
  deep: !0,
132
132
  flush: "post"
133
- }), v(i, (e) => {
134
- e !== s(f) && (ae(e, s(f)) || r.value?.setFieldValue(t.name, e));
133
+ }), b(i, (e) => {
134
+ e !== s(f) && (ne(e, s(f)) || r.value?.setFieldValue(t.name, e));
135
135
  }, {
136
136
  deep: !0
137
137
  });
138
- const L = se(t, D);
139
- function _() {
138
+ const D = re(t, S);
139
+ function L() {
140
140
  r.value?.resetFields();
141
141
  }
142
- function k(e) {
142
+ function _(e) {
143
143
  return e ? (c(e) ? e : [e]).map((n) => c(n) ? [t.name, ...n] : [t.name, n]) : void 0;
144
144
  }
145
- async function N(e, l) {
146
- return (await r.value?.validateFields(k(e), l))?.[t.name];
145
+ async function k(e, l) {
146
+ return (await r.value?.validateFields(_(e), l))?.[t.name];
147
147
  }
148
- function A(e, l) {
148
+ function N(e, l) {
149
149
  const n = s(i)?.length || 0;
150
- if (y(t.maxLength) && n >= t.maxLength)
150
+ if (x(t.maxLength) && n >= t.maxLength)
151
151
  return;
152
152
  const a = {
153
153
  ...e || {}
@@ -157,14 +157,14 @@ const Ve = /* @__PURE__ */ H({
157
157
  o[u] = [a];
158
158
  return;
159
159
  }
160
- ne(l) ? o[u].push(a) : o[u].splice(l, 0, a);
160
+ oe(l) ? o[u].push(a) : o[u].splice(l, 0, a);
161
161
  });
162
162
  }
163
- function I(e, l = "suffix") {
163
+ function A(e, l = "suffix") {
164
164
  const n = s(i)?.length || 0, a = h(e) ? e : e.length;
165
- if (y(t.maxLength) && n + a > t.maxLength)
165
+ if (x(t.maxLength) && n + a > t.maxLength)
166
166
  return;
167
- const o = h(e) ? new Array(e).fill(0).map(() => ({})) : oe(e);
167
+ const o = h(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
168
168
  r.value?.setFieldValue?.(t.name, o, !0, (u, d) => {
169
169
  if (!u[d]) {
170
170
  u[d] = [...o];
@@ -173,28 +173,28 @@ const Ve = /* @__PURE__ */ H({
173
173
  l === "suffix" ? u[d].push(...o) : u[d].unshift(...o);
174
174
  });
175
175
  }
176
- function P(e) {
176
+ function I(e) {
177
177
  const l = new Set(h(e) ? [e] : e);
178
178
  r.value?.setFieldValue?.(t.name, void 0, !0, (n, a) => {
179
179
  n[a] = n[a].filter((o, u) => !l.has(u));
180
180
  });
181
181
  }
182
- function z(e) {
182
+ function P(e) {
183
183
  const l = new Set(c(e) ? e : [e]);
184
184
  l.size !== 0 && r.value?.setFieldValue?.(t.name, void 0, !0, (n, a) => {
185
185
  n[a] = n[a].filter((o) => !l.has(o[t.rowKey]));
186
186
  });
187
187
  }
188
- function K() {
188
+ function z() {
189
189
  return s(i);
190
190
  }
191
- function O(e) {
191
+ function K(e) {
192
192
  r.value?.setFieldValue(t.name, e);
193
193
  }
194
- function j(e) {
194
+ function O(e) {
195
195
  return s(i)?.[e];
196
196
  }
197
- function G(e, l, n = !0) {
197
+ function j(e, l, n = !0) {
198
198
  r.value?.setFieldValue?.(t.name, void 0, !0, (a, o) => {
199
199
  !a[o] || !a[o][e] || (a[o][e] = {
200
200
  ...n ? a[o][e] : {},
@@ -202,27 +202,27 @@ const Ve = /* @__PURE__ */ H({
202
202
  });
203
203
  });
204
204
  }
205
- function U(e, l) {
205
+ function G(e, l) {
206
206
  const n = e === "end" ? i.value.length - 1 : e;
207
- le(n, g.value?.$el, l);
207
+ se(n, g.value?.$el, l);
208
208
  }
209
- function W() {
209
+ function U() {
210
210
  r.value?.setFieldValue?.(t.name, []);
211
211
  }
212
- return R({
213
- resetFields: _,
214
- validateFields: N,
215
- add: A,
216
- remove: P,
217
- getRowData: j,
218
- getRowsData: K,
219
- setRowData: G,
220
- addMultiple: I,
221
- scrollTo: U,
222
- clear: W,
223
- setTableData: O,
224
- removeByKey: z
225
- }), (e, l) => (J(), q(s(m), {
212
+ return C({
213
+ resetFields: L,
214
+ validateFields: k,
215
+ add: N,
216
+ remove: I,
217
+ getRowData: O,
218
+ getRowsData: z,
219
+ setRowData: j,
220
+ addMultiple: A,
221
+ scrollTo: G,
222
+ clear: U,
223
+ setTableData: K,
224
+ removeByKey: P
225
+ }), (e, l) => (Q(), J(s(m), {
226
226
  ref_key: "formRef",
227
227
  ref: r,
228
228
  "initial-values": {
@@ -233,17 +233,17 @@ const Ve = /* @__PURE__ */ H({
233
233
  name: e.name,
234
234
  "no-style": ""
235
235
  }, {
236
- default: p(() => [w(s(te), Q(s(x)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
236
+ default: p(() => [w(s(ae), X(s(v)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange"]), {
237
237
  ref_key: "tableRef",
238
238
  ref: g,
239
- class: [s(B)(), s(T)],
240
- columns: s(L),
239
+ class: [s(F)(), s(B)],
240
+ columns: s(D),
241
241
  "data-source": s(i)
242
- }), X({
242
+ }), Y({
243
243
  _: 2
244
- }, [Y(s(x)(E, ["headerCell"]), (n, a) => ({
244
+ }, [Z(s(v)(T, ["headerCell"]), (n, a) => ({
245
245
  name: a,
246
- fn: p((o) => [Z(e.$slots, a, M(ee(o || {})))])
246
+ fn: p((o) => [M(e.$slots, a, ee(te(o || {})))])
247
247
  }))]), 1040, ["class", "columns", "data-source"])]),
248
248
  _: 3
249
249
  }, 8, ["name"])]),
@@ -252,5 +252,5 @@ const Ve = /* @__PURE__ */ H({
252
252
  }
253
253
  });
254
254
  export {
255
- Ve as default
255
+ Se as default
256
256
  };
@@ -1,5 +1,5 @@
1
1
  import { ScrollBarProps, ScrollBarDirection, InternalScrollBarProps } from './interface';
2
- import { DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, Ref, GlobalComponents, GlobalDirectives } from 'vue';
2
+ import { DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, Ref, ShallowRef, GlobalComponents, GlobalDirectives } from 'vue';
3
3
  declare function handleBarScroll(percent: number): void;
4
4
  declare const _default: DefineComponent<ScrollBarProps, {
5
5
  currentScroll: ComputedRef<number | undefined>;
@@ -16,9 +16,9 @@ declare const _default: DefineComponent<ScrollBarProps, {
16
16
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
17
17
  barRef: CreateComponentPublicInstanceWithMixins<Readonly< InternalScrollBarProps> & Readonly<{}>, {
18
18
  currentScroll: Ref<number, number>;
19
- container: Ref<HTMLElement | undefined, HTMLElement | undefined>;
20
- bar: Ref<HTMLElement | undefined, HTMLElement | undefined>;
21
- track: Ref<HTMLElement | undefined, HTMLElement | undefined>;
19
+ container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
20
+ bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
21
+ track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
22
22
  scroll: (percent: number) => void;
23
23
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
24
24
  scroll: number;
@@ -40,9 +40,9 @@ declare const _default: DefineComponent<ScrollBarProps, {
40
40
  Defaults: {};
41
41
  }, Readonly< InternalScrollBarProps> & Readonly<{}>, {
42
42
  currentScroll: Ref<number, number>;
43
- container: Ref<HTMLElement | undefined, HTMLElement | undefined>;
44
- bar: Ref<HTMLElement | undefined, HTMLElement | undefined>;
45
- track: Ref<HTMLElement | undefined, HTMLElement | undefined>;
43
+ container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
44
+ bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
45
+ track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
46
46
  scroll: (percent: number) => void;
47
47
  }, {}, {}, {}, {
48
48
  scroll: number;
@@ -1,10 +1,10 @@
1
- import { defineComponent as z, toRef as g, ref as p, watchEffect as x, unref as a, watch as _, computed as s, createBlock as k, createCommentVNode as C, openBlock as B, mergeProps as L } from "vue";
1
+ import { defineComponent as b, toRef as z, shallowRef as g, ref as x, watchEffect as _, unref as a, watch as k, computed as s, createBlock as C, createCommentVNode as R, openBlock as B, mergeProps as L } from "vue";
2
2
  import "./internal.vue2.mjs";
3
- import { omit as R } from "lodash-unified";
4
- import { getScrollable as u, ensureRangeValue as w } from "./utils/index.mjs";
5
- import { useResizeObserver as y } from "@vueuse/core";
6
- import E from "./internal.vue.mjs";
7
- const W = /* @__PURE__ */ z({
3
+ import { omit as w } from "lodash-unified";
4
+ import { getScrollable as u, ensureRangeValue as y } from "./utils/index.mjs";
5
+ import { useResizeObserver as E } from "@vueuse/core";
6
+ import N from "./internal.vue.mjs";
7
+ const j = /* @__PURE__ */ b({
8
8
  name: "ScrollBar",
9
9
  __name: "index",
10
10
  props: {
@@ -24,9 +24,9 @@ const W = /* @__PURE__ */ z({
24
24
  onScroll: {},
25
25
  onScrollEnd: {}
26
26
  },
27
- setup(S, { expose: m }) {
28
- const r = S, o = g(r, "scrollContainer"), l = p(), n = p(r.barLength);
29
- function v() {
27
+ setup(p, { expose: S }) {
28
+ const r = p, o = z(r, "scrollContainer"), l = g(), n = x(r.barLength);
29
+ function m() {
30
30
  if (!o.value || !l.value) return;
31
31
  const { totalSize: e, visibleSize: t, distance: c } = u(
32
32
  o.value,
@@ -39,19 +39,19 @@ const W = /* @__PURE__ */ z({
39
39
  o.value,
40
40
  r.direction
41
41
  );
42
- n.value = w(
42
+ n.value = y(
43
43
  e / (t + r.extraSize || 1) * 100
44
44
  );
45
45
  }
46
- y(o, () => {
46
+ E(o, () => {
47
47
  f();
48
- }), x(
48
+ }), _(
49
49
  () => {
50
50
  const e = a(o.value);
51
- e && (f(), e.addEventListener("scroll", v));
51
+ e && (f(), e.addEventListener("scroll", m));
52
52
  },
53
53
  { flush: "post" }
54
- ), _(
54
+ ), k(
55
55
  () => r.barLength,
56
56
  (e) => {
57
57
  n.value = e;
@@ -60,29 +60,29 @@ const W = /* @__PURE__ */ z({
60
60
  function d(e) {
61
61
  const t = a(o);
62
62
  if (!t) return;
63
- const { totalSize: c, visibleSize: i, topOrLeft: b } = u(
63
+ const { totalSize: c, visibleSize: i, topOrLeft: v } = u(
64
64
  t,
65
65
  r.direction
66
66
  );
67
67
  if (c <= i) return;
68
- const h = `scroll${b}`;
68
+ const h = `scroll${v}`;
69
69
  t[h] = e * (c + r.extraSize - i) / 100;
70
70
  }
71
- return m({
71
+ return S({
72
72
  currentScroll: s(() => a(l.value?.currentScroll)),
73
73
  scroll: d,
74
74
  visible: s(() => n.value < 100),
75
75
  rootElement: s(() => a(l.value?.container))
76
- }), (e, t) => n.value !== 100 ? (B(), k(E, L({
76
+ }), (e, t) => n.value !== 100 ? (B(), C(N, L({
77
77
  key: 0,
78
78
  ref_key: "barRef",
79
79
  ref: l
80
- }, a(R)(r, ["onScroll", "extraSize", "scrollContainer"]), {
80
+ }, a(w)(r, ["onScroll", "extraSize", "scrollContainer"]), {
81
81
  "bar-length": n.value,
82
82
  onScroll: d
83
- }), null, 16, ["bar-length"])) : C("", !0);
83
+ }), null, 16, ["bar-length"])) : R("", !0);
84
84
  }
85
85
  });
86
86
  export {
87
- W as default
87
+ j as default
88
88
  };
@@ -1,11 +1,11 @@
1
1
  import { InternalScrollBarProps, ScrollBarDirection } from './interface';
2
- import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { DefineComponent, Ref, ShallowRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  declare function scroll(percent: number): void;
4
4
  declare const _default: DefineComponent<InternalScrollBarProps, {
5
5
  currentScroll: Ref<number, number>;
6
- container: Ref<HTMLElement | undefined, HTMLElement | undefined>;
7
- bar: Ref<HTMLElement | undefined, HTMLElement | undefined>;
8
- track: Ref<HTMLElement | undefined, HTMLElement | undefined>;
6
+ container: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
7
+ bar: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
8
+ track: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
9
9
  scroll: typeof scroll;
10
10
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<InternalScrollBarProps> & Readonly<{}>, {
11
11
  scroll: number;
@@ -1,10 +1,10 @@
1
- import { defineComponent as V, ref as f, toRef as p, watch as W, watchEffect as z, unref as o, createElementBlock as A, openBlock as N, normalizeStyle as U, normalizeClass as b, createElementVNode as E } from "vue";
1
+ import { defineComponent as V, shallowRef as h, ref as W, toRef as f, watch as z, watchEffect as A, unref as o, createElementBlock as N, openBlock as U, normalizeStyle as X, normalizeClass as b, createElementVNode as E } from "vue";
2
2
  import "../config-provider/index.mjs";
3
- import { useTrack as X } from "./hooks/use-track.mjs";
3
+ import { useTrack as Y } from "./hooks/use-track.mjs";
4
4
  import { ensureRangeValue as L } from "./utils/index.mjs";
5
- import Y from "./style/index.mjs";
6
- import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
7
- const K = /* @__PURE__ */ V({
5
+ import I from "./style/index.mjs";
6
+ import { useNamespace as j } from "../config-provider/hooks/use-namespace.mjs";
7
+ const O = /* @__PURE__ */ V({
8
8
  __name: "internal",
9
9
  props: {
10
10
  direction: { default: "vertical" },
@@ -22,14 +22,14 @@ const K = /* @__PURE__ */ V({
22
22
  onScrollEnd: {}
23
23
  },
24
24
  setup(C, { expose: D }) {
25
- const t = C, m = f(), i = f(), l = f(), { b: M, e: k, m: B, em: c, cssVar: P } = I("scroll-bar"), R = Y("scroll-bar"), n = f(t.scroll), { handleMouseDown: v } = X({
25
+ const t = C, m = h(), i = h(), l = h(), { b: M, e: k, m: R, em: c, cssVar: B } = j("scroll-bar"), P = I("scroll-bar"), n = W(t.scroll), { handleMouseDown: v } = Y({
26
26
  currentScroll: n,
27
27
  track: i,
28
28
  bar: l,
29
- type: p(t, "direction"),
30
- trackSpeed: p(t, "trackSpeed"),
31
- barLength: p(t, "barLength"),
32
- disabled: p(t, "disabled"),
29
+ type: f(t, "direction"),
30
+ trackSpeed: f(t, "trackSpeed"),
31
+ barLength: f(t, "barLength"),
32
+ disabled: f(t, "disabled"),
33
33
  onDown: (e) => {
34
34
  t.onScrollStart?.(e);
35
35
  },
@@ -40,17 +40,17 @@ const K = /* @__PURE__ */ V({
40
40
  t.onScroll?.(e);
41
41
  }
42
42
  });
43
- W(
43
+ z(
44
44
  () => t.scroll,
45
45
  (e) => {
46
46
  n.value = e;
47
47
  }
48
- ), z(() => {
48
+ ), A(() => {
49
49
  if (!o(l)) return;
50
50
  const e = `${(100 - t.barLength) * n.value / t.barLength}%`, r = `${t.barLength}%`;
51
51
  t.direction === "vertical" ? (l.value.style.height = r, l.value.style.transform = `translate3d(0, ${e}, 0)`) : (l.value.style.width = r, l.value.style.transform = `translate3d(${e}, 0, 0)`);
52
52
  });
53
- let h, s, d;
53
+ let p, s, d;
54
54
  function T(e) {
55
55
  if (t.disabled || e.button !== 0) return;
56
56
  e.preventDefault(), e.stopPropagation();
@@ -59,13 +59,13 @@ const K = /* @__PURE__ */ V({
59
59
  return;
60
60
  document.addEventListener("pointermove", g), document.addEventListener("pointerup", S);
61
61
  const u = r.getBoundingClientRect(), y = a.getBoundingClientRect();
62
- t.direction === "vertical" ? (h = u.height, s = y.top - u.top, d = e.clientY) : (h = u.width, s = y.left - u.left, d = e.clientX), t.onScrollStart?.(o(n));
62
+ t.direction === "vertical" ? (p = u.height, s = y.top - u.top, d = e.clientY) : (p = u.width, s = y.left - u.left, d = e.clientX), t.onScrollStart?.(o(n));
63
63
  }
64
64
  function g(e) {
65
65
  e.stopPropagation(), e.preventDefault();
66
66
  let r;
67
67
  t.direction === "vertical" ? r = s + e.clientY - d : r = s + e.clientX - d;
68
- const a = r / h / (100 - t.barLength) * 1e4;
68
+ const a = r / p / (100 - t.barLength) * 1e4;
69
69
  n.value = L(a), t.onScroll?.(o(n));
70
70
  }
71
71
  function S(e) {
@@ -83,12 +83,12 @@ const K = /* @__PURE__ */ V({
83
83
  bar: l,
84
84
  track: i,
85
85
  scroll: $
86
- }), (e, r) => (N(), A("div", {
86
+ }), (e, r) => (U(), N("div", {
87
87
  ref_key: "container",
88
88
  ref: m,
89
- class: b([o(M)(), o(B)(e.direction), o(R)]),
90
- style: U(
91
- o(P)(
89
+ class: b([o(M)(), o(R)(e.direction), o(P)]),
90
+ style: X(
91
+ o(B)(
92
92
  {
93
93
  "bar-color": e.barColor,
94
94
  "track-color": e.trackColor,
@@ -126,5 +126,5 @@ const K = /* @__PURE__ */ V({
126
126
  }
127
127
  });
128
128
  export {
129
- K as default
129
+ O as default
130
130
  };
@@ -1,5 +1,5 @@
1
1
  import { InternalScrollBarExpose } from '../../scroll-bar';
2
- import { Ref } from 'vue';
2
+ import { ShallowRef } from 'vue';
3
3
  declare const useScrollWrapper: () => {
4
4
  maxScrollDistance: {
5
5
  x: number;
@@ -9,11 +9,11 @@ declare const useScrollWrapper: () => {
9
9
  x: number;
10
10
  y: number;
11
11
  };
12
- xBarRef: Ref<InternalScrollBarExpose | undefined, InternalScrollBarExpose | undefined>;
13
- yBarRef: Ref<InternalScrollBarExpose | undefined, InternalScrollBarExpose | undefined>;
12
+ xBarRef: ShallowRef<InternalScrollBarExpose | undefined, InternalScrollBarExpose | undefined>;
13
+ yBarRef: ShallowRef<InternalScrollBarExpose | undefined, InternalScrollBarExpose | undefined>;
14
14
  scrollYBar: () => void;
15
15
  scrollXBar: () => void;
16
- containerRef: Ref<HTMLElement | undefined, HTMLElement | undefined>;
16
+ containerRef: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
17
17
  updateMaxScrollDistance: () => void;
18
18
  };
19
19
  export default useScrollWrapper;
@@ -1,7 +1,7 @@
1
1
  import { getScrollable as r } from "../../scroll-bar/utils/index.mjs";
2
- import { ref as a, reactive as f, watch as p, unref as b } from "vue";
3
- const B = () => {
4
- const t = a(), c = f({ x: 0, y: 0 }), n = f({ x: 0, y: 0 }), i = a(), s = a();
2
+ import { shallowRef as n, reactive as f, watch as p, unref as b } from "vue";
3
+ const h = () => {
4
+ const t = n(), c = f({ x: 0, y: 0 }), a = f({ x: 0, y: 0 }), i = n(), s = n();
5
5
  p(
6
6
  () => t.value,
7
7
  () => {
@@ -12,33 +12,33 @@ const B = () => {
12
12
  const e = b(t);
13
13
  if (!e)
14
14
  return;
15
- const { visibleSize: o, totalSize: l } = r(
15
+ const { visibleSize: l, totalSize: o } = r(
16
16
  e,
17
17
  "horizontal"
18
18
  ), { visibleSize: z, totalSize: x } = r(e, "vertical");
19
- c.x = l - o, c.y = x - z;
19
+ c.x = o - l, c.y = x - z;
20
20
  }
21
21
  function v() {
22
22
  if (!t.value)
23
23
  return;
24
- const { totalSize: e, visibleSize: o } = r(
24
+ const { totalSize: e, visibleSize: l } = r(
25
25
  t.value,
26
26
  "vertical"
27
- ), l = n.y / (e - o || 1) * 100;
28
- s.value?.scroll(l);
27
+ ), o = a.y / (e - l || 1) * 100;
28
+ s.value?.scroll(o);
29
29
  }
30
30
  function S() {
31
31
  if (!t.value)
32
32
  return;
33
- const { totalSize: e, visibleSize: o } = r(
33
+ const { totalSize: e, visibleSize: l } = r(
34
34
  t.value,
35
35
  "horizontal"
36
- ), l = n.x / (e - o || 1) * 100;
37
- i.value?.scroll(l);
36
+ ), o = a.x / (e - l || 1) * 100;
37
+ i.value?.scroll(o);
38
38
  }
39
39
  return {
40
40
  maxScrollDistance: c,
41
- scrollOffset: n,
41
+ scrollOffset: a,
42
42
  xBarRef: i,
43
43
  yBarRef: s,
44
44
  scrollYBar: v,
@@ -48,5 +48,5 @@ const B = () => {
48
48
  };
49
49
  };
50
50
  export {
51
- B as default
51
+ h as default
52
52
  };