asiaint-lowcode 3.1.98 → 3.1.100

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 (43) hide show
  1. package/README.md +31 -31
  2. package/dist/asiaint-lowcode.js +5 -5
  3. package/dist/asiaint-lowcode.umd.cjs +197 -197
  4. package/dist/index.d.ts +6 -4
  5. package/dist/lazy/{Card-Dyp8FQTp.js → Card-BZDjHu_m.js} +23 -23
  6. package/dist/lazy/{Cascader-DuWSx-__.js → Cascader-Dn1pjB5T.js} +1 -1
  7. package/dist/lazy/{Checkbox-BzqmvYX4.js → Checkbox-DI-6MNQ1.js} +2 -2
  8. package/dist/lazy/{Collapse-eIEqgaVy.js → Collapse-C3_QWAIH.js} +1 -1
  9. package/dist/lazy/{Component-r3DCzDzZ.js → Component-B8xM0qor.js} +2 -2
  10. package/dist/lazy/{Component-D0YArJ9Z.js → Component-B_Jap6qQ.js} +1 -1
  11. package/dist/lazy/{Component-DKk2Djmi.js → Component-CFkVhgsW.js} +2 -2
  12. package/dist/lazy/{Component-CRa7cELh.js → Component-DJTFvMsn.js} +1 -1
  13. package/dist/lazy/{Component-QolkfjWc.js → Component-DZi53-pE.js} +2 -2
  14. package/dist/lazy/{CurdCard-DWx31uFo.js → CurdCard-CPXW5f-S.js} +2 -2
  15. package/dist/lazy/Custom-PgN_xXcY.js +26 -0
  16. package/dist/lazy/{DatePicker-ulDSN83q.js → DatePicker-CTJjGRk8.js} +1 -1
  17. package/dist/lazy/DragList-Dg5HxV3x.js +914 -0
  18. package/dist/lazy/{FilterSearch-BcHjHbVW.js → FilterSearch-BOUE45nF.js} +2 -2
  19. package/dist/lazy/{FloatCurd-SWZ6i5OE.js → FloatCurd-B2uaBqsQ.js} +9 -9
  20. package/dist/lazy/{FormList-B1_Pfb_1.js → FormList-DzesZMda.js} +1 -1
  21. package/dist/lazy/{Grid-CnRmOyDl.js → Grid-CAQvKht-.js} +1 -1
  22. package/dist/lazy/{InfiniteScroll-5i4KeyAW.js → InfiniteScroll-bgYxwbqK.js} +4 -4
  23. package/dist/lazy/{Inline-CCNQ_4BH.js → Inline-Pv3N9pow.js} +3 -3
  24. package/dist/lazy/{JsonEdit-NnFr-Cqn.js → JsonEdit-imz7C04M.js} +3 -3
  25. package/dist/lazy/{LogList-BSqSCZ0m.js → LogList-rLWZkKEQ.js} +7 -7
  26. package/dist/lazy/{ObjGroup-BzgoWAnO.js → ObjGroup-DQNR3Ie9.js} +1 -1
  27. package/dist/lazy/{OfferDetails-abmV3AI6.js → OfferDetails-4MJ5Cn68.js} +11 -11
  28. package/dist/lazy/{Pagination-Dcq_Cfmq.js → Pagination-B2LP1WNd.js} +4 -4
  29. package/dist/lazy/{Progress-3JVja4cs.js → Progress-Q79oISPT.js} +15 -15
  30. package/dist/lazy/{Radio-C4RpRsUu.js → Radio-ONGuXLrG.js} +3 -3
  31. package/dist/lazy/{SearchSelect-DryoVIAP.js → SearchSelect-CVZ8-AOk.js} +6 -6
  32. package/dist/lazy/{Select-Des_9BEX.js → Select-D9N9vDzF.js} +2 -2
  33. package/dist/lazy/{Table-AYMi4kNI.js → Table-Bd2LkjC3.js} +39 -39
  34. package/dist/lazy/{Tabs-BiBrav4A.js → Tabs-tsNnUa-B.js} +2 -2
  35. package/dist/lazy/{TextArea-DpiCN9FH.js → TextArea-DNhsV3At.js} +3 -3
  36. package/dist/lazy/{Wrapper-tmP-CbqH.js → Wrapper-BBJ_Oilm.js} +2 -2
  37. package/dist/lazy/{index-ClavMxt3.js → index-7i6sjAor.js} +7788 -7359
  38. package/dist/lazy/{useSelect-BKxUX8p7.js → useSelect-CJ87tEaw.js} +1 -1
  39. package/dist/style.css +2 -2
  40. package/global.d.ts +10 -10
  41. package/package.json +36 -36
  42. package/dist/lazy/Custom-DhXKvs15.js +0 -26
  43. package/dist/lazy/DragList-DS48P6U5.js +0 -332
@@ -0,0 +1,914 @@
1
+ import { defineComponent as ze, inject as He, ref as ge, reactive as ce, toRef as gt, onBeforeMount as Ge, onMounted as Pe, watchEffect as ct, onBeforeUnmount as Ue, computed as ie, watch as z, openBlock as Q, createElementBlock as fe, normalizeClass as Le, normalizeStyle as je, renderSlot as we, createCommentVNode as ft, nextTick as G, provide as Ne, toRefs as Ee, Fragment as mt, renderList as ht, createBlock as Ke, mergeProps as pt, withCtx as qe, withDirectives as yt, createVNode as Je, vShow as vt, mergeModels as wt, useModel as bt, onUnmounted as xt, unref as Te, readonly as We } from "vue";
2
+ import { o as E, r as D, S as Ie, t as _e, w as zt, m as Mt, V as Rt, c as St, j as Bt, b as Ct, _ as Dt } from "./index-7i6sjAor.js";
3
+ import "element-plus";
4
+ const Qe = Symbol("LAYOUT_KEY"), Ze = Symbol("EMITTER_KEY");
5
+ function kt(o) {
6
+ let i = 0, n;
7
+ for (let e = 0, s = o.length; e < s; e++)
8
+ n = o[e].y + o[e].h, n > i && (i = n);
9
+ return i;
10
+ }
11
+ function be(o) {
12
+ const i = Array(o.length);
13
+ for (let n = 0, e = o.length; n < e; n++)
14
+ i[n] = $t(o[n]);
15
+ return i;
16
+ }
17
+ function $t(o) {
18
+ return { ...o };
19
+ }
20
+ function et(o, i) {
21
+ return !(o === i || o.x + o.w <= i.x || o.x >= i.x + i.w || o.y + o.h <= i.y || o.y >= i.y + i.h);
22
+ }
23
+ function J(o, i, n) {
24
+ const e = at(o), s = ot(o), a = Array(o.length);
25
+ for (let d = 0, u = s.length; d < u; d++) {
26
+ let t = s[d];
27
+ t.static || (t = Ht(e, t, i, n), e.push(t)), a[o.findIndex((S) => S.i === t.i)] = t, t.moved = !1;
28
+ }
29
+ return a;
30
+ }
31
+ function Ht(o, i, n, e) {
32
+ if (n)
33
+ for (; i.y > 0 && !re(o, i); )
34
+ i.y--;
35
+ else if (e) {
36
+ const a = e[i.i].y;
37
+ for (; i.y > a && !re(o, i); )
38
+ i.y--;
39
+ }
40
+ let s;
41
+ for (; s = re(o, i); )
42
+ i.y = s.y + s.h;
43
+ return i;
44
+ }
45
+ function Lt(o, i) {
46
+ const n = at(o);
47
+ for (let e = 0, s = o.length; e < s; e++) {
48
+ const a = o[e];
49
+ if (a.x + a.w > i.cols && (a.x = i.cols - a.w), a.x < 0 && (a.x = 0, a.w = i.cols), !a.static) n.push(a);
50
+ else
51
+ for (; re(n, a); )
52
+ a.y++;
53
+ }
54
+ return o;
55
+ }
56
+ function Ae(o, i) {
57
+ for (let n = 0, e = o.length; n < e; n++)
58
+ if (o[n].i === i) return o[n];
59
+ }
60
+ function re(o, i) {
61
+ for (let n = 0, e = o.length; n < e; n++)
62
+ if (et(o[n], i)) return o[n];
63
+ }
64
+ function tt(o, i) {
65
+ return o.filter((n) => et(n, i));
66
+ }
67
+ function at(o) {
68
+ return o.filter((i) => i.static);
69
+ }
70
+ function xe(o, i, n, e, s = !1, a = !1) {
71
+ if (i.static) return o;
72
+ const d = i.x, u = i.y, t = e && i.y > e;
73
+ typeof n == "number" && (i.x = n), typeof e == "number" && (i.y = e), i.moved = !0;
74
+ let S = ot(o);
75
+ t && (S = S.reverse());
76
+ const k = tt(S, i);
77
+ if (a && k.length)
78
+ return i.x = d, i.y = u, i.moved = !1, o;
79
+ for (let h = 0, y = k.length; h < y; h++) {
80
+ const b = k[h];
81
+ b.moved || i.y > b.y && i.y - b.y > b.h / 4 || (b.static ? o = Oe(o, b, i, s) : o = Oe(o, i, b, s));
82
+ }
83
+ return o;
84
+ }
85
+ function Oe(o, i, n, e) {
86
+ if (e) {
87
+ const s = {
88
+ x: n.x,
89
+ y: n.y,
90
+ w: n.w,
91
+ h: n.h
92
+ };
93
+ if (s.y = Math.max(i.y - n.h, 0), !re(o, s))
94
+ return xe(o, n, void 0, s.y, !1);
95
+ }
96
+ return xe(o, n, void 0, n.y + 1, !1);
97
+ }
98
+ function Nt(o, i, n, e) {
99
+ const s = "translate3d(" + i + "px," + o + "px, 0)";
100
+ return {
101
+ transform: s,
102
+ WebkitTransform: s,
103
+ MozTransform: s,
104
+ msTransform: s,
105
+ OTransform: s,
106
+ width: n + "px",
107
+ height: e + "px",
108
+ position: "absolute"
109
+ };
110
+ }
111
+ function Et(o, i, n, e) {
112
+ const s = "translate3d(" + i * -1 + "px," + o + "px, 0)";
113
+ return {
114
+ transform: s,
115
+ WebkitTransform: s,
116
+ MozTransform: s,
117
+ msTransform: s,
118
+ OTransform: s,
119
+ width: n + "px",
120
+ height: e + "px",
121
+ position: "absolute"
122
+ };
123
+ }
124
+ function Tt(o, i, n, e) {
125
+ return {
126
+ top: o + "px",
127
+ left: i + "px",
128
+ width: n + "px",
129
+ height: e + "px",
130
+ position: "absolute"
131
+ };
132
+ }
133
+ function Wt(o, i, n, e) {
134
+ return {
135
+ top: o + "px",
136
+ right: i + "px",
137
+ width: n + "px",
138
+ height: e + "px",
139
+ position: "absolute"
140
+ };
141
+ }
142
+ function ot(o) {
143
+ return Array.from(o).sort(function(i, n) {
144
+ return i.y === n.y && i.x === n.x ? 0 : i.y > n.y || i.y === n.y && i.x > n.x ? 1 : -1;
145
+ });
146
+ }
147
+ function It(o, i) {
148
+ i = i || "Layout";
149
+ const n = ["x", "y", "w", "h"], e = [];
150
+ if (!Array.isArray(o)) throw new Error(i + " must be an array!");
151
+ for (let s = 0, a = o.length; s < a; s++) {
152
+ const d = o[s];
153
+ for (let u = 0; u < n.length; u++)
154
+ if (typeof d[n[u]] != "number")
155
+ throw new Error(
156
+ "VueGridLayout: " + i + "[" + s + "]." + n[u] + " must be a number!"
157
+ );
158
+ if (d.i === void 0 || d.i === null)
159
+ throw new Error("VueGridLayout: " + i + "[" + s + "].i cannot be null!");
160
+ if (typeof d.i != "number" && typeof d.i != "string")
161
+ throw new Error("VueGridLayout: " + i + "[" + s + "].i must be a string or number!");
162
+ if (e.indexOf(d.i) >= 0)
163
+ throw new Error("VueGridLayout: " + i + "[" + s + "].i must be unique!");
164
+ if (e.push(d.i), d.static !== void 0 && typeof d.static != "boolean")
165
+ throw new Error("VueGridLayout: " + i + "[" + s + "].static must be a boolean!");
166
+ }
167
+ }
168
+ function _t(o, i = "vgl") {
169
+ const n = () => `${i}-${o}`;
170
+ return {
171
+ b: n,
172
+ be: (e) => `${n()}__${e}`,
173
+ bm: (e) => `${n()}--${e}`,
174
+ bem: (e, s) => `${n()}__${e}--${s}`
175
+ };
176
+ }
177
+ function Ye(o) {
178
+ return At(o);
179
+ }
180
+ function At(o) {
181
+ var i;
182
+ const n = ((i = o.target) == null ? void 0 : i.offsetParent) || document.body, e = o.offsetParent === document.body ? { left: 0, top: 0 } : n.getBoundingClientRect(), s = o.clientX + n.scrollLeft - e.left, a = o.clientY + n.scrollTop - e.top;
183
+ return { x: s, y: a };
184
+ }
185
+ function Fe(o, i, n, e) {
186
+ return Ot(o) ? {
187
+ deltaX: n - o,
188
+ deltaY: e - i,
189
+ lastX: o,
190
+ lastY: i,
191
+ x: n,
192
+ y: e
193
+ } : {
194
+ deltaX: 0,
195
+ deltaY: 0,
196
+ lastX: n,
197
+ lastY: e,
198
+ x: n,
199
+ y: e
200
+ };
201
+ }
202
+ function Ot(o) {
203
+ return typeof o == "number" && !Number.isNaN(o);
204
+ }
205
+ function Yt(o, i) {
206
+ const n = rt(o);
207
+ let e = n[0];
208
+ for (let s = 1, a = n.length; s < a; s++) {
209
+ const d = n[s];
210
+ i > o[d] && (e = d);
211
+ }
212
+ return e;
213
+ }
214
+ function it(o, i) {
215
+ if (!i[o])
216
+ throw new Error(
217
+ "ResponsiveGridLayout: `cols` entry for breakpoint " + o + " is missing!"
218
+ );
219
+ return i[o];
220
+ }
221
+ function Ft(o, i, n, e, s, a, d) {
222
+ if (i[e]) return be(i[e]);
223
+ let u = o;
224
+ const t = rt(n), S = t.slice(t.indexOf(e));
225
+ for (let k = 0, h = S.length; k < h; k++) {
226
+ const y = S[k];
227
+ if (i[y]) {
228
+ u = i[y];
229
+ break;
230
+ }
231
+ }
232
+ return u = be(u || []), J(Lt(u, { cols: a }), d);
233
+ }
234
+ function rt(o) {
235
+ return Object.keys(o).sort((i, n) => o[i] - o[n]);
236
+ }
237
+ let Vt = "auto";
238
+ function Xt() {
239
+ return typeof document < "u";
240
+ }
241
+ function Ve() {
242
+ return Xt() ? typeof document.dir < "u" ? document.dir : document.getElementsByTagName("html")[0].getAttribute("dir") : Vt;
243
+ }
244
+ const Xe = /* @__PURE__ */ ze({
245
+ __name: "grid-item",
246
+ props: {
247
+ isDraggable: { type: Boolean, default: void 0 },
248
+ isResizable: { type: Boolean, default: void 0 },
249
+ isBounded: { type: Boolean, default: void 0 },
250
+ static: { type: Boolean, default: !1 },
251
+ minH: { default: 1 },
252
+ minW: { default: 1 },
253
+ maxH: { default: 1 / 0 },
254
+ maxW: { default: 1 / 0 },
255
+ x: {},
256
+ y: {},
257
+ w: {},
258
+ h: {},
259
+ i: {},
260
+ dragIgnoreFrom: { default: "a, button" },
261
+ dragAllowFrom: { default: void 0 },
262
+ resizeIgnoreFrom: { default: "a, button" },
263
+ preserveAspectRatio: { type: Boolean, default: !1 },
264
+ dragOption: { default: () => ({}) },
265
+ resizeOption: { default: () => ({}) }
266
+ },
267
+ emits: ["container-resized", "resize", "resized", "move", "moved"],
268
+ setup(o, { expose: i, emit: n }) {
269
+ const e = o, s = n, a = He(Qe), d = He(Ze);
270
+ if (!a)
271
+ throw new Error("[grid-layout-plus]: missing layout store, GridItem must under a GridLayout.");
272
+ const u = ge(null), t = ce({
273
+ cols: 1,
274
+ containerWidth: 100,
275
+ rowHeight: 30,
276
+ margin: [10, 10],
277
+ maxRows: 1 / 0,
278
+ draggable: void 0,
279
+ resizable: void 0,
280
+ bounded: void 0,
281
+ transformScale: 1,
282
+ useCssTransforms: !0,
283
+ useStyleCursor: !0,
284
+ isDragging: !1,
285
+ dragging: {
286
+ top: -1,
287
+ left: -1
288
+ },
289
+ isResizing: !1,
290
+ resizing: {
291
+ width: -1,
292
+ height: -1
293
+ },
294
+ style: {},
295
+ rtl: !1
296
+ });
297
+ let S = !1, k = !1, h = NaN, y = NaN, b = NaN, $ = NaN, P = -1, ne = -1, Z = -1, Y = -1, B = e.x, I = e.y, C = e.w, T = e.h;
298
+ const V = ge(), se = ce({
299
+ i: gt(e, "i"),
300
+ state: t,
301
+ wrapper: V,
302
+ calcXY: Se
303
+ });
304
+ function ee(r) {
305
+ lt(r);
306
+ }
307
+ function le() {
308
+ De();
309
+ }
310
+ function l(r) {
311
+ E(e.isDraggable) && (t.draggable = r);
312
+ }
313
+ function x(r) {
314
+ E(e.isResizable) && (t.resizable = r);
315
+ }
316
+ function v(r) {
317
+ E(e.isBounded) && (t.bounded = r);
318
+ }
319
+ function W(r) {
320
+ t.transformScale = r;
321
+ }
322
+ function H(r) {
323
+ t.rowHeight = r;
324
+ }
325
+ function L(r) {
326
+ t.maxRows = r;
327
+ }
328
+ function f() {
329
+ t.rtl = Ve() === "rtl", De();
330
+ }
331
+ function X(r) {
332
+ t.cols = Math.floor(r);
333
+ }
334
+ a.increaseItem(se), Ge(() => {
335
+ t.rtl = Ve() === "rtl";
336
+ }), Pe(() => {
337
+ a.responsive && a.lastBreakpoint ? t.cols = it(a.lastBreakpoint, a.cols) : t.cols = a.colNum, t.rowHeight = a.rowHeight, t.containerWidth = a.width !== null ? a.width : 100, t.margin = a.margin !== void 0 ? a.margin.map(Number) : [10, 10], t.maxRows = a.maxRows, E(e.isDraggable) ? t.draggable = a.isDraggable : t.draggable = e.isDraggable, E(e.isResizable) ? t.resizable = a.isResizable : t.resizable = e.isResizable, E(e.isBounded) ? t.bounded = a.isBounded : t.bounded = e.isBounded, t.transformScale = a.transformScale, t.useCssTransforms = a.useCssTransforms, t.useStyleCursor = a.useStyleCursor, ct(() => {
338
+ B = e.x, I = e.y, T = e.h, C = e.w, D(K);
339
+ }), d.on("updateWidth", ee), d.on("compact", le), d.on("setDraggable", l), d.on("setResizable", x), d.on("setBounded", v), d.on("setTransformScale", W), d.on("setRowHeight", H), d.on("setMaxRows", L), d.on("directionchange", f), d.on("setColNum", X);
340
+ }), Ue(() => {
341
+ d.off("updateWidth", ee), d.off("compact", le), d.off("setDraggable", l), d.off("setResizable", x), d.off("setBounded", v), d.off("setTransformScale", W), d.off("setRowHeight", H), d.off("setMaxRows", L), d.off("directionchange", f), d.off("setColNum", X), u.value && (u.value.unset(), u.value = null), a.decreaseItem(se);
342
+ }), i({ state: t, wrapper: V });
343
+ const U = typeof navigator < "u" ? navigator.userAgent.toLowerCase().includes("android") : !1, _ = ie(() => t.resizable && !e.static), M = ie(() => a.isMirrored ? !t.rtl : t.rtl), j = ie(() => (t.draggable || t.resizable) && !e.static), O = _t("item"), nt = ie(() => ({
344
+ [O.b()]: !0,
345
+ [O.bm("resizable")]: _.value,
346
+ [O.bm("static")]: e.static,
347
+ [O.bm("resizing")]: t.isResizing,
348
+ [O.bm("dragging")]: t.isDragging,
349
+ [O.bm("transform")]: t.useCssTransforms,
350
+ [O.bm("rtl")]: M.value,
351
+ [O.bm("no-touch")]: U && j.value
352
+ })), ue = ie(() => [O.be("resizer"), M.value && O.bem("resizer", "rtl")].filter(Boolean));
353
+ z(
354
+ () => e.isDraggable,
355
+ (r) => {
356
+ t.draggable = r;
357
+ }
358
+ ), z(
359
+ () => e.static,
360
+ () => {
361
+ D($e), D(q);
362
+ }
363
+ ), z(
364
+ () => t.draggable,
365
+ () => {
366
+ D($e);
367
+ }
368
+ ), z(
369
+ () => e.isResizable,
370
+ (r) => {
371
+ t.resizable = r;
372
+ }
373
+ ), z(
374
+ () => e.isBounded,
375
+ (r) => {
376
+ t.bounded = r;
377
+ }
378
+ ), z(
379
+ () => t.resizable,
380
+ () => {
381
+ D(q);
382
+ }
383
+ ), z(
384
+ () => t.rowHeight,
385
+ () => {
386
+ D(K), D(me);
387
+ }
388
+ ), z([() => t.cols, () => t.containerWidth], () => {
389
+ D(q), D(K), D(me);
390
+ }), z([() => e.minH, () => e.maxH, () => e.minW, () => e.maxW], () => {
391
+ D(q);
392
+ }), z(M, () => {
393
+ D(q), D(K);
394
+ }), z([() => a.margin, () => a.margin[0], () => a.margin[1]], () => {
395
+ const r = a.margin;
396
+ !r || r[0] === t.margin[0] && r[1] === t.margin[1] || (t.margin = r.map(Number), D(K), D(me));
397
+ });
398
+ function K() {
399
+ e.x + e.w > t.cols ? (B = 0, C = e.w > t.cols ? t.cols : e.w) : (B = e.x, C = e.w);
400
+ const r = te(B, I, C, T);
401
+ t.isDragging && (r.top = t.dragging.top, M.value ? r.right = t.dragging.left : r.left = t.dragging.left), t.isResizing && (r.width = t.resizing.width, r.height = t.resizing.height);
402
+ let c;
403
+ t.useCssTransforms ? M.value ? c = Et(r.top, r.right, r.width, r.height) : c = Nt(r.top, r.left, r.width, r.height) : M.value ? c = Wt(r.top, r.right, r.width, r.height) : c = Tt(r.top, r.left, r.width, r.height), t.style = c;
404
+ }
405
+ function me() {
406
+ const r = {};
407
+ for (const c of ["width", "height"]) {
408
+ const p = t.style[c].match(/^(\d+)px$/);
409
+ if (!p)
410
+ return;
411
+ r[c] = p[1];
412
+ }
413
+ s("container-resized", e.i, e.h, e.w, r.height, r.width);
414
+ }
415
+ function Me(r) {
416
+ if (e.static) return;
417
+ const c = r.type;
418
+ if (c === "resizestart" && t.isResizing || c !== "resizestart" && !t.isResizing)
419
+ return;
420
+ const p = Ye(r);
421
+ if (E(p)) return;
422
+ const { x: w, y: R } = p, m = { width: 0, height: 0 };
423
+ let g;
424
+ switch (c) {
425
+ case "resizestart": {
426
+ q(), P = C, ne = T, g = te(B, I, C, T), m.width = g.width, m.height = g.height, t.resizing = m, t.isResizing = !0;
427
+ break;
428
+ }
429
+ case "resizemove": {
430
+ !r.edges.right && !r.edges.left && (b = w), !r.edges.top && !r.edges.bottom && ($ = R);
431
+ const N = Fe(b, $, w, R);
432
+ M.value ? m.width = t.resizing.width - N.deltaX / t.transformScale : m.width = t.resizing.width + N.deltaX / t.transformScale, m.height = t.resizing.height + N.deltaY / t.transformScale, t.resizing = m;
433
+ break;
434
+ }
435
+ case "resizeend": {
436
+ g = te(B, I, C, T), m.width = g.width, m.height = g.height, t.resizing = { width: -1, height: -1 }, t.isResizing = !1;
437
+ break;
438
+ }
439
+ }
440
+ g = st(m.height, m.width), g.w < e.minW && (g.w = e.minW), g.w > e.maxW && (g.w = e.maxW), g.h < e.minH && (g.h = e.minH), g.h > e.maxH && (g.h = e.maxH), g.h < 1 && (g.h = 1), g.w < 1 && (g.w = 1), b = w, $ = R, (C !== g.w || T !== g.h) && s("resize", e.i, g.h, g.w, m.height, m.width), r.type === "resizeend" && (P !== C || ne !== T) && s("resized", e.i, g.h, g.w, m.height, m.width), d.emit("resizeEvent", r.type, e.i, B, I, g.h, g.w);
441
+ }
442
+ function Re(r) {
443
+ if (e.static || t.isResizing) return;
444
+ const c = r.type;
445
+ if (c === "dragstart" && t.isDragging || c !== "dragstart" && !t.isDragging)
446
+ return;
447
+ const p = Ye(r);
448
+ if (E(p)) return;
449
+ const { x: w, y: R } = p, m = r.target;
450
+ if (!m.offsetParent) return;
451
+ const g = { top: 0, left: 0 };
452
+ switch (c) {
453
+ case "dragstart": {
454
+ Z = B, Y = I;
455
+ const A = m.offsetParent.getBoundingClientRect(), F = m.getBoundingClientRect(), ae = F.left / t.transformScale, oe = A.left / t.transformScale, he = F.right / t.transformScale, pe = A.right / t.transformScale, ye = F.top / t.transformScale, ve = A.top / t.transformScale;
456
+ M.value ? g.left = (he - pe) * -1 : g.left = ae - oe, g.top = ye - ve, t.dragging = g, t.isDragging = !0;
457
+ break;
458
+ }
459
+ case "dragmove": {
460
+ const A = Fe(h, y, w, R);
461
+ if (M.value ? g.left = t.dragging.left - A.deltaX / t.transformScale : g.left = t.dragging.left + A.deltaX / t.transformScale, g.top = t.dragging.top + A.deltaY / t.transformScale, t.bounded) {
462
+ const F = m.offsetParent.clientHeight - Be(e.h, t.rowHeight, t.margin[1]);
463
+ g.top = Ce(g.top, 0, F);
464
+ const ae = de(), oe = t.containerWidth - Be(e.w, ae, t.margin[0]);
465
+ g.left = Ce(g.left, 0, oe);
466
+ }
467
+ t.dragging = g;
468
+ break;
469
+ }
470
+ case "dragend": {
471
+ const A = m.offsetParent.getBoundingClientRect(), F = m.getBoundingClientRect(), ae = F.left / t.transformScale, oe = A.left / t.transformScale, he = F.right / t.transformScale, pe = A.right / t.transformScale, ye = F.top / t.transformScale, ve = A.top / t.transformScale;
472
+ M.value ? g.left = (he - pe) * -1 : g.left = ae - oe, g.top = ye - ve, t.dragging = { top: -1, left: -1 }, t.isDragging = !1;
473
+ break;
474
+ }
475
+ }
476
+ let N;
477
+ M.value, N = Se(g.top, g.left), h = w, y = R, (B !== N.x || I !== N.y) && s("move", e.i, N.x, N.y), r.type === "dragend" && (Z !== B || Y !== I) && s("moved", e.i, N.x, N.y), d.emit("dragEvent", r.type, e.i, N.x, N.y, T, C);
478
+ }
479
+ function te(r, c, p, w) {
480
+ const R = de();
481
+ let m;
482
+ return M.value ? m = {
483
+ right: Math.round(R * r + (r + 1) * t.margin[0]),
484
+ top: Math.round(t.rowHeight * c + (c + 1) * t.margin[1]),
485
+ // 0 * Infinity === NaN, which causes problems with resize constraints;
486
+ // Fix this if it occurs.
487
+ // Note we do it here rather than later because Math.round(Infinity) causes depot
488
+ width: p === 1 / 0 ? p : Math.round(R * p + Math.max(0, p - 1) * t.margin[0]),
489
+ height: w === 1 / 0 ? w : Math.round(t.rowHeight * w + Math.max(0, w - 1) * t.margin[1])
490
+ } : m = {
491
+ left: Math.round(R * r + (r + 1) * t.margin[0]),
492
+ top: Math.round(t.rowHeight * c + (c + 1) * t.margin[1]),
493
+ // 0 * Infinity === NaN, which causes problems with resize constraints;
494
+ // Fix this if it occurs.
495
+ // Note we do it here rather than later because Math.round(Infinity) causes depot
496
+ width: p === 1 / 0 ? p : Math.round(R * p + Math.max(0, p - 1) * t.margin[0]),
497
+ height: w === 1 / 0 ? w : Math.round(t.rowHeight * w + Math.max(0, w - 1) * t.margin[1])
498
+ }, m;
499
+ }
500
+ function Se(r, c) {
501
+ const p = de();
502
+ let w = Math.round((c - t.margin[0]) / (p + t.margin[0])), R = Math.round((r - t.margin[1]) / (t.rowHeight + t.margin[1]));
503
+ return w = Math.max(Math.min(w, t.cols - C), 0), R = Math.max(Math.min(R, t.maxRows - T), 0), { x: w, y: R };
504
+ }
505
+ function de() {
506
+ return (t.containerWidth - t.margin[0] * (t.cols + 1)) / t.cols;
507
+ }
508
+ function Be(r, c, p) {
509
+ return Number.isFinite(r) ? Math.round(c * r + Math.max(0, r - 1) * p) : r;
510
+ }
511
+ function Ce(r, c, p) {
512
+ return Math.max(Math.min(r, p), c);
513
+ }
514
+ function st(r, c, p = !1) {
515
+ const w = de();
516
+ let R = Math.round((c + t.margin[0]) / (w + t.margin[0])), m = 0;
517
+ return p ? m = Math.ceil((r + t.margin[1]) / (t.rowHeight + t.margin[1])) : m = Math.round((r + t.margin[1]) / (t.rowHeight + t.margin[1])), R = Math.max(Math.min(R, t.cols - B), 0), m = Math.max(Math.min(m, t.maxRows - I), 0), { w: R, h: m };
518
+ }
519
+ function lt(r, c) {
520
+ t.containerWidth = r;
521
+ }
522
+ function De() {
523
+ K();
524
+ }
525
+ function ke() {
526
+ !u.value && V.value && (u.value = Ie(V.value), t.useStyleCursor || u.value.styleCursor(!1));
527
+ }
528
+ const ut = _e(Re);
529
+ function $e() {
530
+ if (ke(), !!u.value)
531
+ if (t.draggable && !e.static) {
532
+ const r = {
533
+ ignoreFrom: e.dragIgnoreFrom,
534
+ allowFrom: e.dragAllowFrom,
535
+ ...e.dragOption
536
+ };
537
+ u.value.draggable(r), S || (S = !0, u.value.on("dragstart dragmove dragend", (c) => {
538
+ c.type === "dragmove" ? ut(c) : Re(c);
539
+ }));
540
+ } else
541
+ u.value.draggable({ enabled: !1 });
542
+ }
543
+ const dt = _e(Me);
544
+ function q() {
545
+ if (ke(), !!u.value)
546
+ if (t.resizable && !e.static) {
547
+ const r = te(0, 0, e.maxW, e.maxH), c = te(0, 0, e.minW, e.minH), p = {
548
+ edges: {
549
+ left: M.value ? `.${ue.value[0]}` : !1,
550
+ right: M.value ? !1 : `.${ue.value[0]}`,
551
+ bottom: `.${ue.value[0]}`,
552
+ top: !1
553
+ },
554
+ ignoreFrom: e.resizeIgnoreFrom,
555
+ restrictSize: {
556
+ min: {
557
+ height: c.height * t.transformScale,
558
+ width: c.width * t.transformScale
559
+ },
560
+ max: {
561
+ height: r.height * t.transformScale,
562
+ width: r.width * t.transformScale
563
+ }
564
+ },
565
+ ...e.resizeOption
566
+ };
567
+ e.preserveAspectRatio && (p.modifiers = [Ie.modifiers.aspectRatio({ ratio: "preserve" })]), u.value.resizable(p), k || (k = !0, u.value.on("resizestart resizemove resizeend", (w) => {
568
+ w.type === "resizemove" ? dt(w) : Me(w);
569
+ }));
570
+ } else
571
+ u.value.resizable({ enabled: !1 });
572
+ }
573
+ return (r, c) => (Q(), fe("section", {
574
+ ref_key: "wrapper",
575
+ ref: V,
576
+ class: Le(nt.value),
577
+ style: je(t.style)
578
+ }, [
579
+ we(r.$slots, "default"),
580
+ _.value ? (Q(), fe("span", {
581
+ key: 0,
582
+ class: Le(ue.value)
583
+ }, null, 2)) : ft("", !0)
584
+ ], 6));
585
+ }
586
+ }), Gt = /* @__PURE__ */ ze({
587
+ __name: "grid-layout",
588
+ props: {
589
+ autoSize: { type: Boolean, default: !0 },
590
+ colNum: { default: 12 },
591
+ rowHeight: { default: 150 },
592
+ maxRows: { default: 1 / 0 },
593
+ margin: { default: () => [10, 10] },
594
+ isDraggable: { type: Boolean, default: !0 },
595
+ isResizable: { type: Boolean, default: !0 },
596
+ isMirrored: { type: Boolean, default: !1 },
597
+ isBounded: { type: Boolean, default: !1 },
598
+ useCssTransforms: { type: Boolean, default: !0 },
599
+ verticalCompact: { type: Boolean, default: !0 },
600
+ restoreOnDrag: { type: Boolean, default: !1 },
601
+ layout: {},
602
+ responsive: { type: Boolean, default: !1 },
603
+ responsiveLayouts: { default: () => ({}) },
604
+ transformScale: { default: 1 },
605
+ breakpoints: { default: () => ({ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 }) },
606
+ cols: { default: () => ({ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 }) },
607
+ preventCollision: { type: Boolean, default: !1 },
608
+ useStyleCursor: { type: Boolean, default: !0 }
609
+ },
610
+ emits: [
611
+ "layout-before-mount",
612
+ "layout-mounted",
613
+ "layout-updated",
614
+ "breakpoint-changed",
615
+ "update:layout",
616
+ "layout-ready"
617
+ ],
618
+ setup(o, { expose: i, emit: n }) {
619
+ const e = o, s = n, a = ce({
620
+ width: -1,
621
+ mergedStyle: {},
622
+ lastLayoutLength: 0,
623
+ isDragging: !1,
624
+ placeholder: {
625
+ x: 0,
626
+ y: 0,
627
+ w: 0,
628
+ h: 0,
629
+ i: ""
630
+ },
631
+ layouts: {},
632
+ // array to store all layouts from different breakpoints
633
+ lastBreakpoint: null,
634
+ // store last active breakpoint
635
+ originalLayout: null
636
+ // store original Layout
637
+ }), d = /* @__PURE__ */ new Map(), u = ge(e.layout), t = ge(), { observeResize: S, unobserveResize: k } = zt(), h = Rt();
638
+ h.on("resizeEvent", y), h.on("dragEvent", b), Ge(() => {
639
+ s("layout-before-mount", u.value);
640
+ }), Pe(() => {
641
+ s("layout-mounted", u.value), G(() => {
642
+ It(u.value), a.originalLayout = u.value, G(() => {
643
+ ee(), t.value && S(t.value, Mt(B, 16)), J(u.value, e.verticalCompact), s("layout-updated", u.value), Y(), B();
644
+ });
645
+ });
646
+ }), Ue(() => {
647
+ h.clearAll(), t.value && k(t.value);
648
+ });
649
+ function y(l, x, v, W, H, L) {
650
+ V(l, x, v, W, H, L);
651
+ }
652
+ function b(l, x, v, W, H, L) {
653
+ T(l, x, v, W, H, L);
654
+ }
655
+ z(
656
+ () => a.width,
657
+ (l, x) => {
658
+ G(() => {
659
+ h.emit("updateWidth", l), x === -1 && G(() => {
660
+ s("layout-ready", u.value);
661
+ }), Y();
662
+ });
663
+ }
664
+ ), z(
665
+ () => [e.layout, e.layout.length],
666
+ () => {
667
+ u.value = e.layout, Z();
668
+ }
669
+ ), z(
670
+ () => e.colNum,
671
+ (l) => {
672
+ h.emit("setColNum", l);
673
+ }
674
+ ), z(
675
+ () => e.rowHeight,
676
+ (l) => {
677
+ h.emit("setRowHeight", l);
678
+ }
679
+ ), z(
680
+ () => e.isDraggable,
681
+ (l) => {
682
+ h.emit("setDraggable", l);
683
+ }
684
+ ), z(
685
+ () => e.isResizable,
686
+ (l) => {
687
+ h.emit("setResizable", l);
688
+ }
689
+ ), z(
690
+ () => e.isBounded,
691
+ (l) => {
692
+ h.emit("setBounded", l);
693
+ }
694
+ ), z(
695
+ () => e.transformScale,
696
+ (l) => {
697
+ h.emit("setTransformScale", l);
698
+ }
699
+ ), z(
700
+ () => e.responsive,
701
+ (l) => {
702
+ l || (s("update:layout", a.originalLayout), h.emit("setColNum", e.colNum)), B();
703
+ }
704
+ ), z(
705
+ () => e.maxRows,
706
+ (l) => {
707
+ h.emit("setMaxRows", l);
708
+ }
709
+ ), z([() => e.margin, () => e.margin[1]], Y), Ne(
710
+ Qe,
711
+ ce({
712
+ ...Ee(e),
713
+ ...Ee(a),
714
+ increaseItem: $,
715
+ decreaseItem: P
716
+ })
717
+ ), Ne(Ze, h), i({ state: a, getItem: ne, resizeEvent: V, dragEvent: T, layoutUpdate: Z });
718
+ function $(l) {
719
+ d.set(l.i, l);
720
+ }
721
+ function P(l) {
722
+ d.delete(l.i);
723
+ }
724
+ function ne(l) {
725
+ return d.get(l);
726
+ }
727
+ function Z() {
728
+ if (!E(u.value) && !E(a.originalLayout)) {
729
+ if (u.value.length !== a.originalLayout.length) {
730
+ const l = le(u.value, a.originalLayout);
731
+ if (l.length > 0)
732
+ if (u.value.length > a.originalLayout.length)
733
+ a.originalLayout = a.originalLayout.concat(l);
734
+ else {
735
+ const x = new Set(l.map((v) => v.i));
736
+ a.originalLayout = a.originalLayout.filter((v) => !x.has(v.i));
737
+ }
738
+ a.lastLayoutLength = u.value.length, ee();
739
+ }
740
+ J(u.value, e.verticalCompact), h.emit("updateWidth", a.width), Y(), s("layout-updated", u.value);
741
+ }
742
+ }
743
+ function Y() {
744
+ a.mergedStyle = {
745
+ height: I()
746
+ };
747
+ }
748
+ function B() {
749
+ t.value && (a.width = t.value.offsetWidth), h.emit("resizeEvent");
750
+ }
751
+ function I() {
752
+ if (!e.autoSize) return;
753
+ const l = parseFloat(e.margin[1]);
754
+ return kt(u.value) * (e.rowHeight + l) + l + "px";
755
+ }
756
+ let C;
757
+ function T(l, x, v, W, H, L) {
758
+ let f = Ae(u.value, x);
759
+ E(f) && (f = { h: 0, w: 0, x: 0, y: 0, i: "" }), l === "dragstart" && !e.verticalCompact && (C = u.value.reduce(
760
+ (X, { i: U, x: _, y: M }) => ({
761
+ ...X,
762
+ [U]: { x: _, y: M }
763
+ }),
764
+ {}
765
+ )), l === "dragmove" || l === "dragstart" ? (a.placeholder.i = x, a.placeholder.x = f.x, a.placeholder.y = f.y, a.placeholder.w = L, a.placeholder.h = H, G(() => {
766
+ a.isDragging = !0;
767
+ }), h.emit("updateWidth", a.width)) : G(() => {
768
+ a.isDragging = !1;
769
+ }), u.value = xe(u.value, f, v, W, !0, e.preventCollision), e.restoreOnDrag ? (f.static = !0, J(u.value, e.verticalCompact, C), f.static = !1) : J(u.value, e.verticalCompact), h.emit("compact"), Y(), l === "dragend" && (C = void 0, s("layout-updated", u.value));
770
+ }
771
+ function V(l, x, v, W, H, L) {
772
+ let f = Ae(u.value, x);
773
+ E(f) && (f = { h: 0, w: 0, x: 0, y: 0, i: "" });
774
+ let X;
775
+ if (e.preventCollision) {
776
+ const U = tt(u.value, { ...f, w: L, h: H }).filter(
777
+ (_) => _.i !== f.i
778
+ );
779
+ if (X = U.length > 0, X) {
780
+ let _ = 1 / 0, M = 1 / 0;
781
+ U.forEach((j) => {
782
+ j.x > f.x && (_ = Math.min(_, j.x)), j.y > f.y && (M = Math.min(M, j.y));
783
+ }), Number.isFinite(_) && (f.w = _ - f.x), Number.isFinite(M) && (f.h = M - f.y);
784
+ }
785
+ }
786
+ X || (f.w = L, f.h = H), l === "resizestart" || l === "resizemove" ? (a.placeholder.i = x, a.placeholder.x = v, a.placeholder.y = W, a.placeholder.w = f.w, a.placeholder.h = f.h, G(() => {
787
+ a.isDragging = !0;
788
+ }), h.emit("updateWidth", a.width)) : l && G(() => {
789
+ a.isDragging = !1;
790
+ }), e.responsive && se(), J(u.value, e.verticalCompact), h.emit("compact"), Y(), l === "resizeend" && s("layout-updated", u.value);
791
+ }
792
+ function se() {
793
+ const l = Yt(e.breakpoints, a.width);
794
+ if (l === a.lastBreakpoint)
795
+ return;
796
+ const x = it(l, e.cols);
797
+ !E(a.lastBreakpoint) && !a.layouts[a.lastBreakpoint] && (a.layouts[a.lastBreakpoint] = be(u.value));
798
+ const v = Ft(
799
+ a.originalLayout,
800
+ a.layouts,
801
+ e.breakpoints,
802
+ l,
803
+ a.lastBreakpoint,
804
+ x,
805
+ e.verticalCompact
806
+ );
807
+ a.layouts[l] = v, a.lastBreakpoint !== l && s("breakpoint-changed", l, v), u.value = v, s("update:layout", v), a.lastBreakpoint = l, h.emit("setColNum", x);
808
+ }
809
+ function ee() {
810
+ a.layouts = Object.assign({}, e.responsiveLayouts);
811
+ }
812
+ function le(l, x) {
813
+ const v = new Set(x.map((f) => f.i)), W = new Set(l.map((f) => f.i)), H = l.filter((f) => !v.has(f.i)), L = x.filter((f) => !W.has(f.i));
814
+ return H.concat(L);
815
+ }
816
+ return (l, x) => (Q(), fe("div", {
817
+ ref_key: "wrapper",
818
+ ref: t,
819
+ class: "vgl-layout",
820
+ style: je(a.mergedStyle)
821
+ }, [
822
+ l.$slots.default ? we(l.$slots, "default", { key: 0 }) : (Q(!0), fe(mt, { key: 1 }, ht(u.value, (v) => (Q(), Ke(Xe, pt({
823
+ key: v.i,
824
+ ref_for: !0
825
+ }, v), {
826
+ default: qe(() => [
827
+ we(l.$slots, "item", { item: v })
828
+ ]),
829
+ _: 2
830
+ }, 1040))), 128)),
831
+ yt(Je(Xe, {
832
+ class: "vgl-item--placeholder",
833
+ x: a.placeholder.x,
834
+ y: a.placeholder.y,
835
+ w: a.placeholder.w,
836
+ h: a.placeholder.h,
837
+ i: a.placeholder.i
838
+ }, null, 8, ["x", "y", "w", "h", "i"]), [
839
+ [vt, a.isDragging]
840
+ ])
841
+ ], 4));
842
+ }
843
+ }), Pt = /* @__PURE__ */ ze({
844
+ __name: "DragList",
845
+ props: /* @__PURE__ */ wt({
846
+ children: {},
847
+ rowHeight: {},
848
+ colNum: {},
849
+ maxRows: {},
850
+ isDraggable: { type: Boolean },
851
+ name: {},
852
+ onMoved: {}
853
+ }, {
854
+ gridlayout: { required: !0 },
855
+ gridlayoutModifiers: {}
856
+ }),
857
+ emits: ["update:gridlayout"],
858
+ setup(o, { expose: i }) {
859
+ const n = o, e = bt(o, "gridlayout"), t = {
860
+ getLayout: () => We(e),
861
+ setItemX: (y, b) => {
862
+ e.value[y].x = b;
863
+ },
864
+ setItemY: (y, b) => {
865
+ e.value[y].y = b;
866
+ },
867
+ setItemVisible: (y, b) => {
868
+ const $ = e.value.find((P) => P.i === y);
869
+ $ && ($.h = b ? $.contentHeight || 1 : 0);
870
+ },
871
+ type: "draglist"
872
+ }, { ruleModule: S, pageMethodMap: k } = St(), h = () => {
873
+ if (n.onMoved && S)
874
+ try {
875
+ S[n.onMoved](k, We(e.value));
876
+ } catch (y) {
877
+ console.error(y + `
878
+ onMoved: ${n.onMoved}`);
879
+ }
880
+ };
881
+ if (i(t), n.name) {
882
+ const y = Bt(n.name, t);
883
+ xt(() => {
884
+ y();
885
+ });
886
+ }
887
+ return (y, b) => (Q(), Ke(Te(Gt), {
888
+ layout: e.value,
889
+ "onUpdate:layout": b[1] || (b[1] = ($) => e.value = $),
890
+ "col-num": y.colNum || 12,
891
+ "row-height": y.rowHeight || 30,
892
+ "max-rows": y.maxRows,
893
+ margin: [8, 8],
894
+ "is-draggable": y.isDraggable,
895
+ "is-bounded": "",
896
+ "is-resizable": !1,
897
+ "vertical-compact": "",
898
+ "use-css-transforms": ""
899
+ }, {
900
+ default: qe(() => [
901
+ Je(Te(Ct), {
902
+ list: y.children,
903
+ gridData: e.value,
904
+ "onUpdate:gridData": b[0] || (b[0] = ($) => e.value = $),
905
+ onGridItemMoved: h
906
+ }, null, 8, ["list", "gridData"])
907
+ ]),
908
+ _: 1
909
+ }, 8, ["layout", "col-num", "row-height", "max-rows", "is-draggable"]));
910
+ }
911
+ }), qt = /* @__PURE__ */ Dt(Pt, [["__scopeId", "data-v-869881f7"]]);
912
+ export {
913
+ qt as default
914
+ };