x-next 1.6.0 → 1.7.0
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/AI_USAGE.md +57 -4
- package/CHANGELOG.md +36 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/draggable/Draggable.d.ts +1 -1
- package/dist/components/draggable/index.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +6 -6
- package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
- package/dist/components/dropdown/Dropdown.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +5 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +29 -29
- package/dist/components/form/FormItem.vue.d.ts +12 -12
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +24 -24
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/grid/Row.vue.d.ts +3 -3
- package/dist/components/grid/index.d.ts +9 -9
- package/dist/components/image/Image.vue.d.ts +125 -17
- package/dist/components/image/ImagePreview.vue.d.ts +97 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
- package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
- package/dist/components/image/index.d.ts +712 -124
- package/dist/components/image/interface.d.ts +9 -1
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/space/Space.d.ts +1 -1
- package/dist/components/space/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +372 -0
- package/dist/components/upload/context.d.ts +28 -0
- package/dist/components/upload/index.d.ts +656 -0
- package/dist/components/upload/interface.d.ts +110 -0
- package/dist/components/upload/props.d.ts +321 -0
- package/dist/components/upload/upload-list-item.d.ts +15 -0
- package/dist/components/upload/upload-list.d.ts +11 -0
- package/dist/components/upload/upload-picture-item.d.ts +20 -0
- package/dist/components/upload/upload-trigger.d.ts +8 -0
- package/dist/components/upload/utils.d.ts +48 -0
- package/dist/es/_styles/palette-aliases.js +2 -4
- package/dist/es/components/image/Image.vue.js +55 -45
- package/dist/es/components/image/Image.vue2.js +113 -92
- package/dist/es/components/image/ImagePreview.vue.js +66 -53
- package/dist/es/components/image/ImagePreview.vue2.js +219 -171
- package/dist/es/components/image/ImagePreviewAction.js +12 -15
- package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
- package/dist/es/components/image/hooks/use-image-drag.js +16 -14
- package/dist/es/components/index.js +33 -31
- package/dist/es/components/upload/Upload.js +420 -0
- package/dist/es/components/upload/context.js +4 -0
- package/dist/es/components/upload/index.js +8 -0
- package/dist/es/components/upload/props.js +321 -0
- package/dist/es/components/upload/upload-list-item.js +138 -0
- package/dist/es/components/upload/upload-list.js +48 -0
- package/dist/es/components/upload/upload-picture-item.js +109 -0
- package/dist/es/components/upload/upload-trigger.js +89 -0
- package/dist/es/components/upload/utils.js +195 -0
- package/dist/es/icons/_self/upload-icons.js +103 -0
- package/dist/es/index.js +40 -38
- package/dist/es/locale/en-US.js +22 -0
- package/dist/es/locale/zh-CN.js +22 -0
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/upload-icons.d.ts +523 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +32 -0
- package/dist/style/base.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/upload.css +1 -0
- package/dist/style/upload.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/volar.d.ts +1 -0
- package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, toRefs as D, reactive as b, computed as r, ref as E, watch as F, provide as H } from "vue";
|
|
2
2
|
import C from "../../_hooks/use-merge-state.js";
|
|
3
|
-
import
|
|
4
|
-
import { PreviewGroupInjectionKey as
|
|
3
|
+
import J from "./ImagePreview.vue.js";
|
|
4
|
+
import { PreviewGroupInjectionKey as Q } from "./context.js";
|
|
5
5
|
import { isArray as A, isUndefined as s } from "../../_utils/is.js";
|
|
6
|
-
|
|
6
|
+
import { useLocale as W } from "../../locale/index.js";
|
|
7
|
+
const re = /* @__PURE__ */ q({
|
|
7
8
|
name: "ImagePreviewGroup",
|
|
8
9
|
components: {
|
|
9
|
-
ImagePreview:
|
|
10
|
+
ImagePreview: J
|
|
10
11
|
},
|
|
11
12
|
inheritAttrs: !1,
|
|
12
13
|
props: {
|
|
@@ -120,21 +121,23 @@ const $ = /* @__PURE__ */ T({
|
|
|
120
121
|
emit: m
|
|
121
122
|
}) {
|
|
122
123
|
const {
|
|
124
|
+
t: U
|
|
125
|
+
} = W(), {
|
|
123
126
|
srcList: n,
|
|
124
|
-
visible:
|
|
125
|
-
defaultVisible:
|
|
126
|
-
current:
|
|
127
|
+
visible: M,
|
|
128
|
+
defaultVisible: S,
|
|
129
|
+
current: L,
|
|
127
130
|
defaultCurrent: N,
|
|
128
131
|
infinite: w
|
|
129
|
-
} =
|
|
130
|
-
value:
|
|
132
|
+
} = D(B), [h, O] = C(S.value, b({
|
|
133
|
+
value: M
|
|
131
134
|
})), g = (e) => {
|
|
132
135
|
e !== h.value && (m("visible-change", e), m("update:visible", e), O(e));
|
|
133
136
|
}, k = r(() => new Map(A(n == null ? void 0 : n.value) ? n == null ? void 0 : n.value.map((e, t) => [t, {
|
|
134
137
|
url: e,
|
|
135
138
|
canPreview: !0
|
|
136
|
-
}]) : [])), x = r(() => A(n == null ? void 0 : n.value)), c =
|
|
137
|
-
function
|
|
139
|
+
}]) : [])), x = r(() => A(n == null ? void 0 : n.value)), c = E(/* @__PURE__ */ new Map()), f = r(() => x.value ? k.value : c.value), z = r(() => Array.from(c.value.keys())), d = r(() => Array.from(f.value.keys())), o = r(() => d.value.length);
|
|
140
|
+
function R(e, t, u) {
|
|
138
141
|
return c.value.set(e, {
|
|
139
142
|
url: t,
|
|
140
143
|
canPreview: u
|
|
@@ -142,21 +145,21 @@ const $ = /* @__PURE__ */ T({
|
|
|
142
145
|
c.value.delete(e);
|
|
143
146
|
};
|
|
144
147
|
}
|
|
145
|
-
const [a,
|
|
146
|
-
value:
|
|
148
|
+
const [a, _] = C(N.value, b({
|
|
149
|
+
value: L
|
|
147
150
|
})), v = (e) => {
|
|
148
|
-
e !== a.value && (m("change", e), m("update:current", e),
|
|
149
|
-
},
|
|
151
|
+
e !== a.value && (m("change", e), m("update:current", e), _(e));
|
|
152
|
+
}, j = r(() => d.value[a.value]), G = (e) => {
|
|
150
153
|
const t = d.value.indexOf(e);
|
|
151
154
|
t >= 0 && t !== a.value && v(t);
|
|
152
|
-
},
|
|
155
|
+
}, V = r(() => {
|
|
153
156
|
var e;
|
|
154
|
-
return (e = f.value.get(
|
|
157
|
+
return (e = f.value.get(j.value)) == null ? void 0 : e.url;
|
|
155
158
|
});
|
|
156
|
-
|
|
157
|
-
[
|
|
159
|
+
F(
|
|
160
|
+
[o, a],
|
|
158
161
|
() => {
|
|
159
|
-
if (
|
|
162
|
+
if (o.value === 0) {
|
|
160
163
|
g(!1);
|
|
161
164
|
return;
|
|
162
165
|
}
|
|
@@ -164,64 +167,67 @@ const $ = /* @__PURE__ */ T({
|
|
|
164
167
|
v(0);
|
|
165
168
|
return;
|
|
166
169
|
}
|
|
167
|
-
a.value >=
|
|
170
|
+
a.value >= o.value && v(o.value - 1);
|
|
168
171
|
},
|
|
169
172
|
// 自动收集模式须等子图片注册;显式列表在 setup 时即可检查边界。
|
|
170
173
|
{
|
|
171
174
|
immediate: x.value
|
|
172
175
|
}
|
|
173
|
-
),
|
|
174
|
-
registerImageUrl:
|
|
176
|
+
), H(Q, b({
|
|
177
|
+
registerImageUrl: R,
|
|
175
178
|
preview: (e) => {
|
|
176
179
|
if (x.value) {
|
|
177
|
-
const u = c.value.get(e),
|
|
178
|
-
|
|
180
|
+
const u = c.value.get(e), i = u != null && u.canPreview ? z.value.indexOf(e) : -1;
|
|
181
|
+
i >= 0 && i < o.value && (v(i), g(!0));
|
|
179
182
|
return;
|
|
180
183
|
}
|
|
181
184
|
const t = f.value.get(e);
|
|
182
|
-
t != null && t.canPreview && (
|
|
185
|
+
t != null && t.canPreview && (G(e), g(!0));
|
|
183
186
|
}
|
|
184
187
|
}));
|
|
185
188
|
const y = r(() => {
|
|
186
|
-
const e = (u,
|
|
189
|
+
const e = (u, i) => {
|
|
187
190
|
var p;
|
|
188
|
-
for (let l = u; l <=
|
|
191
|
+
for (let l = u; l <= i; l++) {
|
|
189
192
|
const P = d.value[l];
|
|
190
193
|
if ((p = f.value.get(P)) != null && p.canPreview)
|
|
191
194
|
return l;
|
|
192
195
|
}
|
|
193
|
-
}, t = e(a.value + 1,
|
|
196
|
+
}, t = e(a.value + 1, o.value - 1);
|
|
194
197
|
return s(t) && w.value ? e(0, a.value - 1) : t;
|
|
195
198
|
}), I = r(() => {
|
|
196
|
-
const e = (u,
|
|
199
|
+
const e = (u, i) => {
|
|
197
200
|
var p;
|
|
198
|
-
for (let l = u; l >=
|
|
201
|
+
for (let l = u; l >= i; l--) {
|
|
199
202
|
const P = d.value[l];
|
|
200
203
|
if ((p = f.value.get(P)) != null && p.canPreview)
|
|
201
204
|
return l;
|
|
202
205
|
}
|
|
203
206
|
}, t = e(a.value - 1, 0);
|
|
204
|
-
return s(t) && w.value ? e(
|
|
205
|
-
}),
|
|
207
|
+
return s(t) && w.value ? e(o.value - 1, a.value + 1) : t;
|
|
208
|
+
}), K = r(() => s(I.value) ? void 0 : () => {
|
|
206
209
|
!s(I.value) && v(I.value);
|
|
207
|
-
}),
|
|
210
|
+
}), T = r(() => s(y.value) ? void 0 : () => {
|
|
208
211
|
!s(y.value) && v(y.value);
|
|
209
212
|
});
|
|
210
213
|
return {
|
|
214
|
+
t: U,
|
|
215
|
+
currentIndex: a,
|
|
216
|
+
imageCount: o,
|
|
211
217
|
mergedVisible: h,
|
|
212
|
-
currentUrl:
|
|
218
|
+
currentUrl: V,
|
|
213
219
|
prevIndex: I,
|
|
214
220
|
nextIndex: y,
|
|
215
221
|
onClose() {
|
|
216
222
|
g(!1);
|
|
217
223
|
},
|
|
218
224
|
groupArrowProps: b({
|
|
219
|
-
onPrev:
|
|
220
|
-
onNext:
|
|
225
|
+
onPrev: K,
|
|
226
|
+
onNext: T
|
|
221
227
|
})
|
|
222
228
|
};
|
|
223
229
|
}
|
|
224
230
|
});
|
|
225
231
|
export {
|
|
226
|
-
|
|
232
|
+
re as default
|
|
227
233
|
};
|
|
@@ -2,39 +2,41 @@ import { toRefs as E, ref as x, watchEffect as R, watch as X, nextTick as Y } fr
|
|
|
2
2
|
import { on as s, off as f } from "../../../_utils/dom.js";
|
|
3
3
|
import h from "../utils/get-fix-translate.js";
|
|
4
4
|
function B(D) {
|
|
5
|
-
const { wrapperEl: v, imageEl:
|
|
6
|
-
let i = 0, c = 0,
|
|
5
|
+
const { wrapperEl: v, imageEl: l, scale: n } = E(D), t = x([0, 0]), o = x(!1);
|
|
6
|
+
let i = 0, c = 0, r = [0, 0];
|
|
7
7
|
const T = () => {
|
|
8
|
-
if (!v.value || !
|
|
9
|
-
const e = v.value.getBoundingClientRect(),
|
|
8
|
+
if (!v.value || !l.value) return;
|
|
9
|
+
const e = v.value.getBoundingClientRect(), a = l.value.getBoundingClientRect(), [u, d] = h(
|
|
10
10
|
e,
|
|
11
|
-
|
|
11
|
+
a,
|
|
12
12
|
t.value[0],
|
|
13
13
|
t.value[1],
|
|
14
14
|
n.value
|
|
15
15
|
);
|
|
16
|
-
(
|
|
16
|
+
(u !== t.value[0] || d !== t.value[1]) && (t.value = [u, d]);
|
|
17
17
|
}, p = (e) => {
|
|
18
18
|
e.preventDefault && e.preventDefault();
|
|
19
|
-
const
|
|
20
|
-
t.value = [
|
|
19
|
+
const a = r[0] + (e.pageX - i) / n.value, u = r[1] + (e.pageY - c) / n.value;
|
|
20
|
+
t.value = [a, u];
|
|
21
21
|
}, g = (e) => {
|
|
22
|
-
e.preventDefault && e.preventDefault(),
|
|
22
|
+
e.preventDefault && e.preventDefault(), o.value = !1, w();
|
|
23
23
|
}, m = (e) => {
|
|
24
|
-
e.target === e.currentTarget && (e.preventDefault && e.preventDefault(),
|
|
24
|
+
e.target === e.currentTarget && (e.preventDefault && e.preventDefault(), o.value = !0, i = e.pageX, c = e.pageY, r = [...t.value], s(window, "mousemove", p, !1), s(window, "mouseup", g, !1));
|
|
25
25
|
};
|
|
26
26
|
function w() {
|
|
27
27
|
typeof window > "u" || (f(window, "mousemove", p, !1), f(window, "mouseup", g, !1));
|
|
28
28
|
}
|
|
29
29
|
return R((e) => {
|
|
30
|
-
typeof window > "u"
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
if (typeof window > "u") return;
|
|
31
|
+
const a = l.value;
|
|
32
|
+
a && s(a, "mousedown", m), e(() => {
|
|
33
|
+
a && f(a, "mousedown", m), o.value = !1, w();
|
|
34
|
+
});
|
|
33
35
|
}), X([n], () => {
|
|
34
36
|
Y(() => T());
|
|
35
37
|
}), {
|
|
36
38
|
translate: t,
|
|
37
|
-
moving:
|
|
39
|
+
moving: o,
|
|
38
40
|
resetTranslate() {
|
|
39
41
|
t.value = [0, 0];
|
|
40
42
|
}
|
|
@@ -11,8 +11,8 @@ import { Checkbox as M, CheckboxGroup as R } from "./form-checkbox/index.js";
|
|
|
11
11
|
import { Input as B, InputGroup as E, InputPassword as _, InputSearch as N } from "./form-input/index.js";
|
|
12
12
|
import { InputNumber as j } from "./form-input-number/index.js";
|
|
13
13
|
import { InputTag as H } from "./form-input-tag/index.js";
|
|
14
|
-
import { Radio as W, RadioGroup as
|
|
15
|
-
import { Select as
|
|
14
|
+
import { Radio as W, RadioGroup as U } from "./form-radio/index.js";
|
|
15
|
+
import { Select as Q, SelectDropdown as Y, SelectOption as Z, SelectOptionGroup as q } from "./form-select/index.js";
|
|
16
16
|
import { Slider as V } from "./form-slider/index.js";
|
|
17
17
|
import { Switch as $ } from "./form-switch/index.js";
|
|
18
18
|
import { Textarea as ro } from "./form-textarea/index.js";
|
|
@@ -30,7 +30,7 @@ import { Notification as No } from "./notification/index.js";
|
|
|
30
30
|
import { Pagination as jo } from "./pagination/index.js";
|
|
31
31
|
import { Popconfirm as Ho } from "./popconfirm/index.js";
|
|
32
32
|
import { Popover as Wo } from "./popover/index.js";
|
|
33
|
-
import { Popup as
|
|
33
|
+
import { Popup as zo } from "./popup/index.js";
|
|
34
34
|
import { Progress as Yo } from "./progress/index.js";
|
|
35
35
|
import { Rate as qo } from "./rate/index.js";
|
|
36
36
|
import { ResizeBox as Vo } from "./resize-box/index.js";
|
|
@@ -49,17 +49,18 @@ import { TimelineItem as Dr } from "./timeline-item/index.js";
|
|
|
49
49
|
import { Tooltip as Gr } from "./tooltip/index.js";
|
|
50
50
|
import { TrendChart as vr } from "./trend-chart/index.js";
|
|
51
51
|
import { Trigger as Rr } from "./trigger/index.js";
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import { default as Kr } from "./table/table-
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as Zr } from "./table/table-
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
52
|
+
import { Upload as Br } from "./upload/index.js";
|
|
53
|
+
import { Watermark as _r } from "./watermark/index.js";
|
|
54
|
+
import { TABLE_LOCALE_EN_US as Or, TABLE_LOCALE_ZH_CN as jr, formatLocaleText as Fr } from "./table/locale.js";
|
|
55
|
+
import { default as Kr } from "./table/table-tbody.js";
|
|
56
|
+
import { default as Ur } from "./table/table-td.js";
|
|
57
|
+
import { default as Qr } from "./table/table-th.js";
|
|
58
|
+
import { default as Zr } from "./table/table-thead.js";
|
|
59
|
+
import { default as Jr } from "./table/table-tr.js";
|
|
60
|
+
import { configProviderInjectionKey as Xr } from "./config-provider/context.js";
|
|
61
|
+
import { formInjectionKey as oe, formItemInjectionKey as re } from "./form/context.js";
|
|
62
|
+
import { vDraggable as te } from "./draggable/directive.js";
|
|
63
|
+
import { vWatermark as me } from "./watermark/directive.js";
|
|
63
64
|
export {
|
|
64
65
|
e as Alert,
|
|
65
66
|
p as Button,
|
|
@@ -111,17 +112,17 @@ export {
|
|
|
111
112
|
jo as Pagination,
|
|
112
113
|
Ho as Popconfirm,
|
|
113
114
|
Wo as Popover,
|
|
114
|
-
|
|
115
|
+
zo as Popup,
|
|
115
116
|
Yo as Progress,
|
|
116
117
|
w as QuarterPicker,
|
|
117
118
|
W as Radio,
|
|
118
|
-
|
|
119
|
+
U as RadioGroup,
|
|
119
120
|
L as RangePicker,
|
|
120
121
|
qo as Rate,
|
|
121
122
|
Vo as ResizeBox,
|
|
122
123
|
io as Row,
|
|
123
124
|
$o as Scrollbar,
|
|
124
|
-
|
|
125
|
+
Q as Select,
|
|
125
126
|
Y as SelectDropdown,
|
|
126
127
|
Z as SelectOption,
|
|
127
128
|
q as SelectOptionGroup,
|
|
@@ -134,33 +135,34 @@ export {
|
|
|
134
135
|
nr as Step,
|
|
135
136
|
ir as Steps,
|
|
136
137
|
$ as Switch,
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
Or as TABLE_LOCALE_EN_US,
|
|
139
|
+
jr as TABLE_LOCALE_ZH_CN,
|
|
139
140
|
Tr as TabPane,
|
|
140
141
|
lr as Table,
|
|
141
142
|
cr as TableColumn,
|
|
142
143
|
Sr as Tabs,
|
|
143
144
|
Pr as Tag,
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
Kr as Tbody,
|
|
146
|
+
Ur as Td,
|
|
146
147
|
ro as Textarea,
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
Qr as Th,
|
|
149
|
+
Zr as Thead,
|
|
149
150
|
kr as TimePicker,
|
|
150
151
|
sr as TimeRangeSelector,
|
|
151
152
|
Lr as Timeline,
|
|
152
153
|
Dr as TimelineItem,
|
|
153
154
|
Gr as Tooltip,
|
|
154
|
-
|
|
155
|
+
Jr as Tr,
|
|
155
156
|
vr as TrendChart,
|
|
156
157
|
Rr as Trigger,
|
|
157
|
-
Br as
|
|
158
|
+
Br as Upload,
|
|
159
|
+
_r as Watermark,
|
|
158
160
|
C as WeekPicker,
|
|
159
161
|
D as YearPicker,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
Xr as configProviderInjectionKey,
|
|
163
|
+
oe as formInjectionKey,
|
|
164
|
+
re as formItemInjectionKey,
|
|
165
|
+
Fr as formatLocaleText,
|
|
166
|
+
te as vDraggable,
|
|
167
|
+
me as vWatermark
|
|
166
168
|
};
|