@sepveneto/free-dom 0.11.6 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- /* ../../../../../../../tmp/tmp-1918-SHZS2aFjA1XL/core/src/style/index.css */
1
+ /* ../../../../../../../tmp/tmp-1992-csHJqiVDHJRr/core/src/style/index.css */
2
2
  :root {
3
3
  --vv-free-dom--theme: rgb(64, 137, 239);
4
4
  --vv-free-dom--line: var(--vv-free-dom--theme);
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) => void;
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) => {
@@ -1623,7 +1624,9 @@ var resizeDomCore = (0, import_vue_demi16.defineComponent)({
1623
1624
  deltaY = -deltaY;
1624
1625
  let width = props.width + (canDragX ? deltaX : 0);
1625
1626
  let height = props.height + (canDragY ? deltaY : 0);
1626
- [width, height] = runConstraints(width, height);
1627
+ if (!evt.shiftKey) {
1628
+ [width, height] = runConstraints(width, height);
1629
+ }
1627
1630
  const sizeChanged = width !== props.width || height !== props.height;
1628
1631
  const fnName = `${handleName}Fn`;
1629
1632
  const cb = typeof props[fnName] === "function" ? props[fnName] : null;
@@ -2443,7 +2446,8 @@ var GridLayout = (0, import_vue_demi20.defineComponent)({
2443
2446
  },
2444
2447
  resizeStopFn: (evt, data) => {
2445
2448
  const { w, h: h7 } = data;
2446
- layout.resizeTo(config, w, h7);
2449
+ const _layout = layout.resizeTo(config, w, h7);
2450
+ emit("update:modelValue", _layout);
2447
2451
  activeDrag.value = null;
2448
2452
  }
2449
2453
  };
@@ -2475,16 +2479,38 @@ var GridLayout = (0, import_vue_demi20.defineComponent)({
2475
2479
  ...this.$attrs.style || {},
2476
2480
  height: this.layout.calContainerHeight()
2477
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
+ ];
2478
2487
  const defaultSlot = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default || [];
2488
+ const slotList = flattenSlots(defaultSlot);
2479
2489
  return (0, import_vue_demi20.h)("div", {
2480
- class: "vv-grid-layout",
2490
+ class: mergedClass,
2481
2491
  style: mergedStyle
2482
2492
  }, [
2483
- defaultSlot.map(this.processItem),
2493
+ slotList.map((slot) => {
2494
+ if (slot.type === import_vue_demi20.Fragment) {
2495
+ this.processItem(slot);
2496
+ }
2497
+ return this.processItem(slot);
2498
+ }),
2484
2499
  this.placeholder()
2485
2500
  ]);
2486
2501
  }
2487
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
+ }
2488
2514
  var gridLayout_default = GridLayout;
2489
2515
 
2490
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) => {
@@ -1602,7 +1603,9 @@ var resizeDomCore = defineComponent4({
1602
1603
  deltaY = -deltaY;
1603
1604
  let width = props.width + (canDragX ? deltaX : 0);
1604
1605
  let height = props.height + (canDragY ? deltaY : 0);
1605
- [width, height] = runConstraints(width, height);
1606
+ if (!evt.shiftKey) {
1607
+ [width, height] = runConstraints(width, height);
1608
+ }
1606
1609
  const sizeChanged = width !== props.width || height !== props.height;
1607
1610
  const fnName = `${handleName}Fn`;
1608
1611
  const cb = typeof props[fnName] === "function" ? props[fnName] : null;
@@ -2174,7 +2177,7 @@ var FreeDomWrap = defineComponent6({
2174
2177
  });
2175
2178
 
2176
2179
  // src/components/gridLayout.ts
2177
- 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";
2178
2181
 
2179
2182
  // src/components/gridItem.ts
2180
2183
  import { defineComponent as defineComponent7, inject as inject5 } from "vue-demi";
@@ -2422,7 +2425,8 @@ var GridLayout = defineComponent8({
2422
2425
  },
2423
2426
  resizeStopFn: (evt, data) => {
2424
2427
  const { w, h: h7 } = data;
2425
- layout.resizeTo(config, w, h7);
2428
+ const _layout = layout.resizeTo(config, w, h7);
2429
+ emit("update:modelValue", _layout);
2426
2430
  activeDrag.value = null;
2427
2431
  }
2428
2432
  };
@@ -2454,16 +2458,38 @@ var GridLayout = defineComponent8({
2454
2458
  ...this.$attrs.style || {},
2455
2459
  height: this.layout.calContainerHeight()
2456
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
+ ];
2457
2466
  const defaultSlot = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default || [];
2467
+ const slotList = flattenSlots(defaultSlot);
2458
2468
  return h6("div", {
2459
- class: "vv-grid-layout",
2469
+ class: mergedClass,
2460
2470
  style: mergedStyle
2461
2471
  }, [
2462
- defaultSlot.map(this.processItem),
2472
+ slotList.map((slot) => {
2473
+ if (slot.type === Fragment2) {
2474
+ this.processItem(slot);
2475
+ }
2476
+ return this.processItem(slot);
2477
+ }),
2463
2478
  this.placeholder()
2464
2479
  ]);
2465
2480
  }
2466
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
+ }
2467
2493
  var gridLayout_default = GridLayout;
2468
2494
 
2469
2495
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sepveneto/free-dom",
3
- "version": "0.11.6",
3
+ "version": "0.11.8",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",