@sepveneto/free-dom 0.11.7 → 0.11.8
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/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -3
- package/dist/index.mjs +28 -4
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -272,7 +272,7 @@ declare const GridLayout: vue_demi.DefineComponent<{
|
|
|
272
272
|
minH: vue_demi.ComputedRef<number>;
|
|
273
273
|
calContainerHeight: () => string | undefined;
|
|
274
274
|
moveTo: (item: GridLayoutItem, x?: number | undefined, y?: number | undefined) => GridLayoutConfig;
|
|
275
|
-
resizeTo: (item: GridLayoutItem, w: number, h: number) =>
|
|
275
|
+
resizeTo: (item: GridLayoutItem, w: number, h: number) => GridLayoutConfig;
|
|
276
276
|
getItem: (key: string) => GridLayoutItem | undefined;
|
|
277
277
|
getFull: () => GridLayoutConfig;
|
|
278
278
|
};
|
package/dist/index.js
CHANGED
|
@@ -685,6 +685,7 @@ function useLayout(props) {
|
|
|
685
685
|
item.h = h7;
|
|
686
686
|
}
|
|
687
687
|
layout.value = _normalize([...layout.value]);
|
|
688
|
+
return layout.value;
|
|
688
689
|
}
|
|
689
690
|
function _sortLayoutItems(layout2) {
|
|
690
691
|
return layout2.slice(0).sort((a, b) => {
|
|
@@ -2445,7 +2446,8 @@ var GridLayout = (0, import_vue_demi20.defineComponent)({
|
|
|
2445
2446
|
},
|
|
2446
2447
|
resizeStopFn: (evt, data) => {
|
|
2447
2448
|
const { w, h: h7 } = data;
|
|
2448
|
-
layout.resizeTo(config, w, h7);
|
|
2449
|
+
const _layout = layout.resizeTo(config, w, h7);
|
|
2450
|
+
emit("update:modelValue", _layout);
|
|
2449
2451
|
activeDrag.value = null;
|
|
2450
2452
|
}
|
|
2451
2453
|
};
|
|
@@ -2477,16 +2479,38 @@ var GridLayout = (0, import_vue_demi20.defineComponent)({
|
|
|
2477
2479
|
...this.$attrs.style || {},
|
|
2478
2480
|
height: this.layout.calContainerHeight()
|
|
2479
2481
|
};
|
|
2482
|
+
const classes = Array.isArray(this.$attrs.class) ? this.$attrs.class : [this.$attrs.class];
|
|
2483
|
+
const mergedClass = [
|
|
2484
|
+
...classes || [],
|
|
2485
|
+
"vv-grid-layout"
|
|
2486
|
+
];
|
|
2480
2487
|
const defaultSlot = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default || [];
|
|
2488
|
+
const slotList = flattenSlots(defaultSlot);
|
|
2481
2489
|
return (0, import_vue_demi20.h)("div", {
|
|
2482
|
-
class:
|
|
2490
|
+
class: mergedClass,
|
|
2483
2491
|
style: mergedStyle
|
|
2484
2492
|
}, [
|
|
2485
|
-
|
|
2493
|
+
slotList.map((slot) => {
|
|
2494
|
+
if (slot.type === import_vue_demi20.Fragment) {
|
|
2495
|
+
this.processItem(slot);
|
|
2496
|
+
}
|
|
2497
|
+
return this.processItem(slot);
|
|
2498
|
+
}),
|
|
2486
2499
|
this.placeholder()
|
|
2487
2500
|
]);
|
|
2488
2501
|
}
|
|
2489
2502
|
});
|
|
2503
|
+
function flattenSlots(slots) {
|
|
2504
|
+
const slotList = [];
|
|
2505
|
+
slots.forEach((slot) => {
|
|
2506
|
+
if (slot.type === import_vue_demi20.Fragment && Array.isArray(slot.children)) {
|
|
2507
|
+
slotList.push(...flattenSlots(slot.children));
|
|
2508
|
+
} else {
|
|
2509
|
+
slotList.push(slot);
|
|
2510
|
+
}
|
|
2511
|
+
});
|
|
2512
|
+
return slotList;
|
|
2513
|
+
}
|
|
2490
2514
|
var gridLayout_default = GridLayout;
|
|
2491
2515
|
|
|
2492
2516
|
// src/index.ts
|
package/dist/index.mjs
CHANGED
|
@@ -664,6 +664,7 @@ function useLayout(props) {
|
|
|
664
664
|
item.h = h7;
|
|
665
665
|
}
|
|
666
666
|
layout.value = _normalize([...layout.value]);
|
|
667
|
+
return layout.value;
|
|
667
668
|
}
|
|
668
669
|
function _sortLayoutItems(layout2) {
|
|
669
670
|
return layout2.slice(0).sort((a, b) => {
|
|
@@ -2176,7 +2177,7 @@ var FreeDomWrap = defineComponent6({
|
|
|
2176
2177
|
});
|
|
2177
2178
|
|
|
2178
2179
|
// src/components/gridLayout.ts
|
|
2179
|
-
import { defineComponent as defineComponent8, h as h6, provide as provide3, ref as ref14 } from "vue-demi";
|
|
2180
|
+
import { Fragment as Fragment2, defineComponent as defineComponent8, h as h6, provide as provide3, ref as ref14 } from "vue-demi";
|
|
2180
2181
|
|
|
2181
2182
|
// src/components/gridItem.ts
|
|
2182
2183
|
import { defineComponent as defineComponent7, inject as inject5 } from "vue-demi";
|
|
@@ -2424,7 +2425,8 @@ var GridLayout = defineComponent8({
|
|
|
2424
2425
|
},
|
|
2425
2426
|
resizeStopFn: (evt, data) => {
|
|
2426
2427
|
const { w, h: h7 } = data;
|
|
2427
|
-
layout.resizeTo(config, w, h7);
|
|
2428
|
+
const _layout = layout.resizeTo(config, w, h7);
|
|
2429
|
+
emit("update:modelValue", _layout);
|
|
2428
2430
|
activeDrag.value = null;
|
|
2429
2431
|
}
|
|
2430
2432
|
};
|
|
@@ -2456,16 +2458,38 @@ var GridLayout = defineComponent8({
|
|
|
2456
2458
|
...this.$attrs.style || {},
|
|
2457
2459
|
height: this.layout.calContainerHeight()
|
|
2458
2460
|
};
|
|
2461
|
+
const classes = Array.isArray(this.$attrs.class) ? this.$attrs.class : [this.$attrs.class];
|
|
2462
|
+
const mergedClass = [
|
|
2463
|
+
...classes || [],
|
|
2464
|
+
"vv-grid-layout"
|
|
2465
|
+
];
|
|
2459
2466
|
const defaultSlot = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default || [];
|
|
2467
|
+
const slotList = flattenSlots(defaultSlot);
|
|
2460
2468
|
return h6("div", {
|
|
2461
|
-
class:
|
|
2469
|
+
class: mergedClass,
|
|
2462
2470
|
style: mergedStyle
|
|
2463
2471
|
}, [
|
|
2464
|
-
|
|
2472
|
+
slotList.map((slot) => {
|
|
2473
|
+
if (slot.type === Fragment2) {
|
|
2474
|
+
this.processItem(slot);
|
|
2475
|
+
}
|
|
2476
|
+
return this.processItem(slot);
|
|
2477
|
+
}),
|
|
2465
2478
|
this.placeholder()
|
|
2466
2479
|
]);
|
|
2467
2480
|
}
|
|
2468
2481
|
});
|
|
2482
|
+
function flattenSlots(slots) {
|
|
2483
|
+
const slotList = [];
|
|
2484
|
+
slots.forEach((slot) => {
|
|
2485
|
+
if (slot.type === Fragment2 && Array.isArray(slot.children)) {
|
|
2486
|
+
slotList.push(...flattenSlots(slot.children));
|
|
2487
|
+
} else {
|
|
2488
|
+
slotList.push(slot);
|
|
2489
|
+
}
|
|
2490
|
+
});
|
|
2491
|
+
return slotList;
|
|
2492
|
+
}
|
|
2469
2493
|
var gridLayout_default = GridLayout;
|
|
2470
2494
|
|
|
2471
2495
|
// src/index.ts
|