@vc-shell/framework 1.1.0-alpha.4 → 1.1.0-alpha.6

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 (119) hide show
  1. package/core/composables/useMenuService/index.ts +20 -110
  2. package/core/composables/useWidgets/index.ts +2 -1
  3. package/core/plugins/modularity/index.ts +3 -3
  4. package/core/services/menu-service.ts +195 -0
  5. package/core/services/widget-service.ts +20 -0
  6. package/core/types/index.ts +1 -1
  7. package/dist/core/composables/useMenuService/index.d.ts +4 -10
  8. package/dist/core/composables/useMenuService/index.d.ts.map +1 -1
  9. package/dist/core/composables/useWidgets/index.d.ts +2 -1
  10. package/dist/core/composables/useWidgets/index.d.ts.map +1 -1
  11. package/dist/core/plugins/modularity/index.d.ts.map +1 -1
  12. package/dist/core/services/menu-service.d.ts +17 -0
  13. package/dist/core/services/menu-service.d.ts.map +1 -0
  14. package/dist/core/services/widget-service.d.ts +4 -0
  15. package/dist/core/services/widget-service.d.ts.map +1 -1
  16. package/dist/core/types/index.d.ts +1 -1
  17. package/dist/core/types/index.d.ts.map +1 -1
  18. package/dist/framework.js +220 -210
  19. package/dist/{index-CrxFDC2b.js → index-3ySdd-mG.js} +1 -1
  20. package/dist/{index-B1YR_MYV.js → index-B-nvqNbp.js} +1 -1
  21. package/dist/{index-xLYzNPa7.js → index-BQF2-UMe.js} +1 -1
  22. package/dist/{index-BBYyHeYA.js → index-BXlxP2d2.js} +1 -1
  23. package/dist/{index-Cf9Tz1ql.js → index-C7P-aBjd.js} +1 -1
  24. package/dist/{index-8LELHzw9.js → index-CO_2IshF.js} +1 -1
  25. package/dist/{index-BA98L1jI.js → index-CfyFpaKq.js} +1 -1
  26. package/dist/{index-DVljTjbf.js → index-Ci23AX3j.js} +1 -1
  27. package/dist/{index-D1JchciU.js → index-CyuFXG83.js} +1 -1
  28. package/dist/{index-CWKrD2Cd.js → index-D1rpRTKf.js} +1 -1
  29. package/dist/{index-BAeTsi-X.js → index-DLxTAT7x.js} +1 -1
  30. package/dist/{index-BuO5ByG9.js → index-DOVhosAY.js} +1 -1
  31. package/dist/{index-DLtsQ_PJ.js → index-DZAq0B3U.js} +23780 -23339
  32. package/dist/{index-BrUitdDo.js → index-DtkJ7xTB.js} +1 -1
  33. package/dist/{index-9lJxZE5w.js → index-DvGVm1rK.js} +1 -1
  34. package/dist/{index-RwX3kiZh.js → index-EDF1MDtU.js} +1 -1
  35. package/dist/{index-CJ5I7vTn.js → index-LjqdX6jw.js} +1 -1
  36. package/dist/index.css +1 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/injection-keys.d.ts +2 -0
  39. package/dist/injection-keys.d.ts.map +1 -1
  40. package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts +2 -0
  41. package/dist/shared/components/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -1
  42. package/dist/shared/components/draggable-dashboard/composables/useCellSizeCalculator.d.ts +25 -0
  43. package/dist/shared/components/draggable-dashboard/composables/useCellSizeCalculator.d.ts.map +1 -0
  44. package/dist/shared/components/draggable-dashboard/composables/useCollisionDetection.d.ts +27 -0
  45. package/dist/shared/components/draggable-dashboard/composables/useCollisionDetection.d.ts.map +1 -0
  46. package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts +22 -0
  47. package/dist/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.d.ts.map +1 -1
  48. package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts +12 -4
  49. package/dist/shared/components/draggable-dashboard/composables/useDashboardGrid.d.ts.map +1 -1
  50. package/dist/shared/components/draggable-dashboard/composables/useDragClone.d.ts +15 -0
  51. package/dist/shared/components/draggable-dashboard/composables/useDragClone.d.ts.map +1 -0
  52. package/dist/shared/components/draggable-dashboard/composables/useEventCoordinates.d.ts +33 -0
  53. package/dist/shared/components/draggable-dashboard/composables/useEventCoordinates.d.ts.map +1 -0
  54. package/dist/shared/components/draggable-dashboard/composables/useGridPosition.d.ts +57 -0
  55. package/dist/shared/components/draggable-dashboard/composables/useGridPosition.d.ts.map +1 -0
  56. package/dist/shared/components/draggable-dashboard/composables/useGridSystem.d.ts +22 -0
  57. package/dist/shared/components/draggable-dashboard/composables/useGridSystem.d.ts.map +1 -0
  58. package/dist/shared/components/draggable-dashboard/composables/useLayoutPersistence.d.ts +19 -0
  59. package/dist/shared/components/draggable-dashboard/composables/useLayoutPersistence.d.ts.map +1 -0
  60. package/dist/shared/components/draggable-dashboard/composables/useResizeObserver.d.ts +18 -0
  61. package/dist/shared/components/draggable-dashboard/composables/useResizeObserver.d.ts.map +1 -0
  62. package/dist/shared/components/draggable-dashboard/composables/useWidgetLayout.d.ts +14 -0
  63. package/dist/shared/components/draggable-dashboard/composables/useWidgetLayout.d.ts.map +1 -0
  64. package/dist/shared/components/draggable-dashboard/composables/useWidgetStyles.d.ts +21 -0
  65. package/dist/shared/components/draggable-dashboard/composables/useWidgetStyles.d.ts.map +1 -0
  66. package/dist/shared/components/draggable-dashboard/types.d.ts +5 -1
  67. package/dist/shared/components/draggable-dashboard/types.d.ts.map +1 -1
  68. package/dist/tsconfig.tsbuildinfo +1 -1
  69. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +18 -0
  70. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +1 -0
  71. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +18 -0
  72. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +1 -0
  73. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +18 -0
  74. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +1 -0
  75. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +18 -0
  76. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +1 -0
  77. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +18 -0
  78. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +1 -0
  79. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +18 -0
  80. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +1 -0
  81. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +6 -0
  82. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
  83. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  84. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/components/app-bar-button/app-bar-button.vue.d.ts +1 -0
  85. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/components/app-bar-button/app-bar-button.vue.d.ts.map +1 -1
  86. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts +2 -1
  87. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue.d.ts.map +1 -1
  88. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  89. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  90. package/package.json +4 -4
  91. package/shared/components/draggable-dashboard/DraggableDashboard.vue +114 -148
  92. package/shared/components/draggable-dashboard/composables/useCellSizeCalculator.ts +121 -0
  93. package/shared/components/draggable-dashboard/composables/useCollisionDetection.ts +219 -0
  94. package/shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts +126 -331
  95. package/shared/components/draggable-dashboard/composables/useDashboardGrid.ts +74 -220
  96. package/shared/components/draggable-dashboard/composables/useDragClone.ts +97 -0
  97. package/shared/components/draggable-dashboard/composables/useEventCoordinates.ts +91 -0
  98. package/shared/components/draggable-dashboard/composables/useGridPosition.ts +150 -0
  99. package/shared/components/draggable-dashboard/composables/useGridSystem.ts +169 -0
  100. package/shared/components/draggable-dashboard/composables/useLayoutPersistence.ts +89 -0
  101. package/shared/components/draggable-dashboard/composables/useResizeObserver.ts +105 -0
  102. package/shared/components/draggable-dashboard/composables/useWidgetLayout.ts +264 -0
  103. package/shared/components/draggable-dashboard/composables/useWidgetStyles.ts +120 -0
  104. package/shared/components/draggable-dashboard/types.ts +6 -1
  105. package/shared/components/notification-dropdown/notification-dropdown.vue +1 -0
  106. package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +27 -0
  107. package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +23 -0
  108. package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +19 -0
  109. package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +21 -0
  110. package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +23 -0
  111. package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +18 -0
  112. package/ui/components/atoms/vc-icon/icons/index.ts +6 -0
  113. package/ui/components/atoms/vc-icon/vc-icon.vue +101 -82
  114. package/ui/components/organisms/vc-app/_internal/vc-app-bar/components/app-bar-button/app-bar-button.vue +10 -3
  115. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +3 -4
  116. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +2 -2
  117. package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +1 -0
  118. package/ui/components/organisms/vc-app/vc-app.vue +2 -3
  119. package/ui/components/organisms/vc-table/vc-table.vue +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,MAAM,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AA0BrC,OAAO,eAAe,CAAC;AACvB,OAAO,+BAA+B,CAAC;AACvC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,4BAA4B,CAAC;AAMpC,MAAM,WAAW,sBAAsB;IACrC,OAAO,CACL,GAAG,EAAE,GAAG,EACR,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE;YACL,MAAM,EAAE,MAAM,CAAC;YACf,cAAc,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,mBAAmB,CAAC,EAAE;YACpB,kBAAkB,EAAE,MAAM,CAAC;YAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;SAC5B,CAAC;KACH,GACA,IAAI,CAAC;CACT;;AAwBD,wBA0N4B;AAE5B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,YAAY,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,MAAM,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AA0BrC,OAAO,eAAe,CAAC;AACvB,OAAO,+BAA+B,CAAC;AACvC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,4BAA4B,CAAC;AAOpC,MAAM,WAAW,sBAAsB;IACrC,OAAO,CACL,GAAG,EAAE,GAAG,EACR,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE;YACL,MAAM,EAAE,MAAM,CAAC;YACf,cAAc,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,mBAAmB,CAAC,EAAE;YACpB,kBAAkB,EAAE,MAAM,CAAC;YAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;SAC5B,CAAC;KACH,GACA,IAAI,CAAC;CACT;;AAwBD,wBA0N4B;AAE5B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,YAAY,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,UAAU,CAAC"}
@@ -4,6 +4,7 @@ import { NotificationTemplateConstructor } from "./core/types";
4
4
  import { IWidgetService } from "./core/services/widget-service";
5
5
  import { IDashboardService } from "./core/services/dashboard-service";
6
6
  import { GlobalSearchState } from "./core/composables/useGlobalSearch";
7
+ import { MenuService } from "./core/services/menu-service";
7
8
  export declare const navigationViewLocation: InjectionKey<BladeVNode>;
8
9
  export declare const BladeInstance: InjectionKey<ComputedRef<IBladeInstance>>;
9
10
  export declare const NotificationTemplatesSymbol: InjectionKey<NotificationTemplateConstructor[]>;
@@ -35,4 +36,5 @@ export declare const DynamicModulesKey: InjectionKey<{
35
36
  };
36
37
  } | undefined>;
37
38
  export declare const GlobalSearchKey: InjectionKey<GlobalSearchState>;
39
+ export declare const MenuServiceKey: InjectionKey<MenuService>;
38
40
  //# sourceMappingURL=injection-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"injection-keys.d.ts","sourceRoot":"","sources":["../injection-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,UAAU,CAA4C,CAAC;AACzG,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,CAA2B,CAAC;AAChG,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,+BAA+B,EAAE,CACvD,CAAC;AAClC,eAAO,MAAM,gBAAgB,8BAA0D,CAAC;AACxF,eAAO,MAAM,iBAAiB,qCAAqE,CAAC;AACpG,eAAO,MAAM,mBAAmB,iCAAgE,CAAC;AACjG,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;cAE7B,CAAC;AACF,eAAO,MAAM,eAAe,iCAA4D,CAAC"}
1
+ {"version":3,"file":"injection-keys.d.ts","sourceRoot":"","sources":["../injection-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,UAAU,CAA4C,CAAC;AACzG,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,CAA2B,CAAC;AAChG,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,+BAA+B,EAAE,CACvD,CAAC;AAClC,eAAO,MAAM,gBAAgB,8BAA0D,CAAC;AACxF,eAAO,MAAM,iBAAiB,qCAAqE,CAAC;AACpG,eAAO,MAAM,mBAAmB,iCAAgE,CAAC;AACjG,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;cAE7B,CAAC;AACF,eAAO,MAAM,eAAe,iCAA4D,CAAC;AACzF,eAAO,MAAM,cAAc,2BAAqD,CAAC"}
@@ -1,6 +1,8 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  rearrangeWidgets: () => void;
3
3
  recalculateLayout: () => void;
4
+ saveLayout: () => void;
5
+ useBuiltInPositions: () => boolean;
4
6
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
7
  export default _default;
6
8
  //# sourceMappingURL=DraggableDashboard.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableDashboard.vue.d.ts","sourceRoot":"","sources":["../../../../shared/components/draggable-dashboard/DraggableDashboard.vue.ts"],"names":[],"mappings":";;;;AAqVA,wBAMG"}
1
+ {"version":3,"file":"DraggableDashboard.vue.d.ts","sourceRoot":"","sources":["../../../../shared/components/draggable-dashboard/DraggableDashboard.vue.ts"],"names":[],"mappings":";;;;;;AAqTA,wBAMG"}
@@ -0,0 +1,25 @@
1
+ import { type Ref } from "vue";
2
+ /**
3
+ * Size of the cell
4
+ */
5
+ export interface CellSize {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ /**
10
+ * Hook for calculating the sizes of dashboard cells
11
+ *
12
+ * Provides functions for calculating the sizes of cells with respect to the container size
13
+ * and caching for performance optimization
14
+ *
15
+ * @param gridColumns The number of columns in the grid
16
+ * @returns An object with functions for working with cell sizes
17
+ */
18
+ export declare function useCellSizeCalculator(gridColumns: number): {
19
+ calculateCellSize: (container: HTMLElement | null, useCache?: boolean) => CellSize;
20
+ clearCache: () => void;
21
+ shouldRecalculate: (newWidth: number) => boolean;
22
+ handleContainerResize: (container: HTMLElement) => void;
23
+ previousContainerWidth: Ref<number, number>;
24
+ };
25
+ //# sourceMappingURL=useCellSizeCalculator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCellSizeCalculator.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useCellSizeCalculator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAQD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM;mCAcjB,WAAW,GAAG,IAAI,aAAY,OAAO,KAAU,QAAQ;sBAgCtE,IAAI;kCAUU,MAAM,KAAG,OAAO;uCAeX,WAAW,KAAG,IAAI;;EAwB7D"}
@@ -0,0 +1,27 @@
1
+ import type { IDashboardWidget, DashboardWidgetPosition } from "../types";
2
+ /**
3
+ * Composables for detecting and handling collisions between widgets
4
+ *
5
+ * Provides functions for checking widget intersections and calculating
6
+ * new positions for displaced widgets
7
+ *
8
+ * @returns An object with functions for working with collisions
9
+ */
10
+ export declare function useCollisionDetection(): {
11
+ displacedWidgets: import("vue").Ref<Map<string, {
12
+ x: number;
13
+ y: number;
14
+ }> & Omit<Map<string, DashboardWidgetPosition>, keyof Map<any, any>>, Map<string, DashboardWidgetPosition> | (Map<string, {
15
+ x: number;
16
+ y: number;
17
+ }> & Omit<Map<string, DashboardWidgetPosition>, keyof Map<any, any>>)>;
18
+ intersect: (widgetA: IDashboardWidget, posA: DashboardWidgetPosition, widgetB: IDashboardWidget, posB: DashboardWidgetPosition) => boolean;
19
+ updateDisplacedWidgets: (draggedWidget: IDashboardWidget | null, previewPosition: DashboardWidgetPosition | null, widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>) => void;
20
+ clearDisplacedWidgets: () => void;
21
+ isWidgetDisplaced: (widgetId: string) => boolean;
22
+ getDisplacedPosition: (widgetId: string) => {
23
+ x: number;
24
+ y: number;
25
+ } | undefined;
26
+ };
27
+ //# sourceMappingURL=useCollisionDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCollisionDetection.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useCollisionDetection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;GAOG;AACH,wBAAgB,qBAAqB;;;;;;;;yBAcxB,gBAAgB,QACnB,uBAAuB,WACpB,gBAAgB,QACnB,uBAAuB,KAC5B,OAAO;4CAoCO,gBAAgB,GAAG,IAAI,mBACrB,uBAAuB,GAAG,IAAI,WACtC,gBAAgB,EAAE,UACnB,IAAI,MAAM,EAAE,uBAAuB,CAAC;;kCAgIT,MAAM;qCAUH,MAAM;;;;EAY/C"}
@@ -1,4 +1,13 @@
1
1
  import type { IDashboardWidget, DashboardWidgetPosition } from "../types";
2
+ /**
3
+ * Composables for managing the dragging of widgets on the dashboard
4
+ *
5
+ * Provides functions for handling drag events, updating widget positions, and handling collisions
6
+ *
7
+ * @param updateWidgetPosition Function to update the position of a widget in the store
8
+ * @param getGridRows Function to get the number of rows in the grid
9
+ * @returns An object with functions and state for managing the dragging
10
+ */
2
11
  export declare function useDashboardDragAndDrop(updateWidgetPosition: (widgetId: string, position: DashboardWidgetPosition) => void, getGridRows?: () => number): {
3
12
  draggedWidget: import("vue").Ref<{
4
13
  id: string;
@@ -166,6 +175,10 @@ export declare function useDashboardDragAndDrop(updateWidgetPosition: (widgetId:
166
175
  width: number;
167
176
  height: number;
168
177
  };
178
+ position?: {
179
+ x: number;
180
+ y: number;
181
+ } | undefined;
169
182
  } | null, IDashboardWidget | {
170
183
  id: string;
171
184
  name?: string | undefined;
@@ -332,6 +345,10 @@ export declare function useDashboardDragAndDrop(updateWidgetPosition: (widgetId:
332
345
  width: number;
333
346
  height: number;
334
347
  };
348
+ position?: {
349
+ x: number;
350
+ y: number;
351
+ } | undefined;
335
352
  } | null>;
336
353
  previewPosition: import("vue").Ref<{
337
354
  x: number;
@@ -350,5 +367,10 @@ export declare function useDashboardDragAndDrop(updateWidgetPosition: (widgetId:
350
367
  isDragging: import("vue").Ref<boolean, boolean>;
351
368
  handleMouseDown: (event: MouseEvent | TouchEvent, widget: IDashboardWidget, element: HTMLElement) => void;
352
369
  setGridContainer: (container: HTMLElement) => void;
370
+ isWidgetDisplaced: (widgetId: string) => boolean;
371
+ getDisplacedPosition: (widgetId: string) => {
372
+ x: number;
373
+ y: number;
374
+ } | undefined;
353
375
  };
354
376
  //# sourceMappingURL=useDashboardDragAndDrop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDashboardDragAndDrop.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAQ1E,wBAAgB,uBAAuB,CACrC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB,KAAK,IAAI,EACnF,WAAW,CAAC,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA8aM,UAAU,GAAG,UAAU,UAAU,gBAAgB,WAAW,WAAW;kCAwFlE,WAAW;EAiBjD"}
1
+ {"version":3,"file":"useDashboardDragAndDrop.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useDashboardDragAndDrop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAY1E;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB,KAAK,IAAI,EACnF,WAAW,CAAC,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0NM,UAAU,GAAG,UAAU,UAAU,gBAAgB,WAAW,WAAW;kCAgFlE,WAAW;;;;;;EAmBjD"}
@@ -1,12 +1,20 @@
1
1
  import type { IDashboardWidget } from "../types";
2
- export declare const GRID_COLUMNS = 12;
3
- export declare const MIN_GRID_ROWS = 12;
2
+ /**
3
+ * Main composable for managing the dashboard
4
+ *
5
+ * Combines functionality for working with the grid, widget placement, and layout persistence
6
+ *
7
+ * @returns An object with functions for working with the dashboard
8
+ */
4
9
  export declare function useDashboardGrid(): {
5
10
  widgets: import("vue").ComputedRef<import("../../../../core/services/dashboard-service").DashboardWidget[]>;
6
11
  layout: import("vue").ComputedRef<Map<string, import("../../../../core/services/dashboard-service").DashboardWidgetPosition>>;
7
- arrangeWidgetsInRows: (widgetsToArrange: IDashboardWidget[]) => void;
8
- initializeLayout: () => void;
9
12
  GRID_COLUMNS: number;
10
13
  getGridRows: () => number;
14
+ saveLayoutToLocalStorage: () => void;
15
+ loadLayoutFromLocalStorage: () => boolean;
16
+ arrangeWidgetsInRows: (widgetsToArrange: IDashboardWidget[]) => void;
17
+ initializeWithBuiltInPositions: () => boolean;
18
+ initializeLayout: () => void;
11
19
  };
12
20
  //# sourceMappingURL=useDashboardGrid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDashboardGrid.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useDashboardGrid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAgD,MAAM,UAAU,CAAC;AAI/F,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,eAAO,MAAM,aAAa,KAAK,CAAC;AAmBhC,wBAAgB,gBAAgB;;;6CA6GkB,gBAAgB,EAAE,KAAG,IAAI;;;;EAkH1E"}
1
+ {"version":3,"file":"useDashboardGrid.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useDashboardGrid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,UAAU,CAAC;AAS1E;;;;;;GAMG;AACH,wBAAgB,gBAAgB;;;;uBAmBN,MAAM;oCAOO,IAAI;sCASF,OAAO;6CASE,gBAAgB,EAAE,KAAG,IAAI;0CAS9B,OAAO;4BAOrB,IAAI;EA0BlC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Composible for managing a widget clone during dragging
3
+ *
4
+ * Provides functions for creating, updating, and deleting a widget clone
5
+ * during dragging, as well as for animating the transition
6
+ *
7
+ * @returns An object with functions for working with the widget clone
8
+ */
9
+ export declare function useDragClone(): {
10
+ dragClone: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
11
+ createDragClone: (element: HTMLElement) => HTMLElement | null;
12
+ updateDragClonePosition: (deltaX: number, deltaY: number) => void;
13
+ removeDragClone: () => void;
14
+ };
15
+ //# sourceMappingURL=useDragClone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDragClone.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useDragClone.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,YAAY;;+BAUQ,WAAW;sCAoDJ,MAAM,UAAU,MAAM;;EAwBhE"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Interface for event coordinates
3
+ */
4
+ export interface EventCoordinates {
5
+ clientX: number;
6
+ clientY: number;
7
+ }
8
+ /**
9
+ * Composible for processing event coordinates
10
+ *
11
+ * Provides functions for getting coordinates from different types of events,
12
+ * tracking the initial position, and calculating the offset
13
+ *
14
+ * @returns An object with functions for working with event coordinates
15
+ */
16
+ export declare function useEventCoordinates(): {
17
+ initialPosition: import("vue").Ref<{
18
+ clientX: number;
19
+ clientY: number;
20
+ }, EventCoordinates | {
21
+ clientX: number;
22
+ clientY: number;
23
+ }>;
24
+ isTouchDevice: import("vue").Ref<boolean, boolean>;
25
+ getEventCoordinates: (event: MouseEvent | TouchEvent) => EventCoordinates;
26
+ saveInitialPosition: (event: MouseEvent | TouchEvent) => void;
27
+ calculateDelta: (currentCoordinates: EventCoordinates) => {
28
+ deltaX: number;
29
+ deltaY: number;
30
+ };
31
+ hasMovedBeyondThreshold: (currentCoordinates: EventCoordinates, threshold?: number) => boolean;
32
+ };
33
+ //# sourceMappingURL=useEventCoordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEventCoordinates.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useEventCoordinates.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB;;;;;;;;;iCAaG,UAAU,GAAG,UAAU,KAAG,gBAAgB;iCAsB1C,UAAU,GAAG,UAAU;yCAUf,gBAAgB;;;;kDAcP,gBAAgB;EAatE"}
@@ -0,0 +1,57 @@
1
+ import type { DashboardWidgetPosition } from "../types";
2
+ import type { EventCoordinates } from "./useEventCoordinates";
3
+ /**
4
+ * Interface for the cell size
5
+ */
6
+ export interface CellSize {
7
+ cellWidth: number;
8
+ cellHeight: number;
9
+ }
10
+ /**
11
+ * Interface for the drag offset
12
+ */
13
+ export interface DragOffset {
14
+ x: number;
15
+ y: number;
16
+ }
17
+ /**
18
+ * Composible for calculating the position of a widget in the grid
19
+ *
20
+ * Provides functions for converting mouse coordinates to grid coordinates,
21
+ * considering the cell sizes, drag offset, and grid boundaries
22
+ *
23
+ * @param gridColumns The number of columns in the grid
24
+ * @param getGridRows The function for getting the number of rows in the grid
25
+ * @returns An object with functions for working with the grid position
26
+ */
27
+ export declare function useGridPosition(gridColumns: number, getGridRows?: () => number): {
28
+ previewPosition: import("vue").Ref<{
29
+ x: number;
30
+ y: number;
31
+ } | null, DashboardWidgetPosition | {
32
+ x: number;
33
+ y: number;
34
+ } | null>;
35
+ dragOffset: import("vue").Ref<{
36
+ x: number;
37
+ y: number;
38
+ }, DragOffset | {
39
+ x: number;
40
+ y: number;
41
+ }>;
42
+ calculateDragOffset: (event: MouseEvent | TouchEvent, element: HTMLElement, cellSize: CellSize) => void;
43
+ mouseToGridCoordinates: (coords: EventCoordinates, containerRect: DOMRect, cellSize: CellSize, scrollOffset: {
44
+ left: number;
45
+ top: number;
46
+ }) => {
47
+ gridX: number;
48
+ gridY: number;
49
+ };
50
+ constrainToGrid: (gridX: number, gridY: number, widgetWidth: number, widgetHeight: number) => {
51
+ gridX: number;
52
+ gridY: number;
53
+ };
54
+ updatePreviewPosition: (position: DashboardWidgetPosition) => DashboardWidgetPosition;
55
+ resetPosition: () => void;
56
+ };
57
+ //# sourceMappingURL=useGridPosition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGridPosition.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useGridPosition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;iCAczC,UAAU,GAAG,UAAU,WAAW,WAAW,YAAY,QAAQ;qCA+B3F,gBAAgB,iBACT,OAAO,YACZ,QAAQ,gBACJ;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,MAAM,CAAA;KAAE;eACjC,MAAM;eAAS,MAAM;;6BAsBxB,MAAM,SACN,MAAM,eACA,MAAM,gBACL,MAAM;eACV,MAAM;eAAS,MAAM;;sCAsBQ,uBAAuB,KAAG,uBAAuB;;EAsB3F"}
@@ -0,0 +1,22 @@
1
+ import type { IDashboardWidget, DashboardWidgetPosition } from "../types";
2
+ export declare const GRID_COLUMNS = 12;
3
+ export declare const MIN_GRID_ROWS = 12;
4
+ export declare const ROWS_BUFFER = 10;
5
+ /**
6
+ * Hook for working with the dashboard grid
7
+ *
8
+ * Provides basic functions and constants for working with the grid
9
+ *
10
+ * @returns An object with functions and constants for working with the grid
11
+ */
12
+ export declare function useGridSystem(): {
13
+ GRID_COLUMNS: number;
14
+ MIN_GRID_ROWS: number;
15
+ ROWS_BUFFER: number;
16
+ dynamicRows: import("vue").Ref<number, number>;
17
+ updateGridRows: (widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>) => number;
18
+ hasCollision: (widget: IDashboardWidget, position: DashboardWidgetPosition, widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>, excludeWidgetId?: string) => boolean;
19
+ isAreaFree: (x: number, y: number, width: number, height: number, occupiedCells: Set<string>) => boolean;
20
+ createOccupiedCellsMap: (widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>, excludeWidgetId?: string) => Set<string>;
21
+ };
22
+ //# sourceMappingURL=useGridSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGridSystem.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useGridSystem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG1E,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B;;;;;;GAMG;AACH,wBAAgB,aAAa;;;;;8BAWM,gBAAgB,EAAE,UAAU,IAAI,MAAM,EAAE,uBAAuB,CAAC,KAAG,MAAM;2BA+BhG,gBAAgB,YACd,uBAAuB,WACxB,gBAAgB,EAAE,UACnB,IAAI,MAAM,EAAE,uBAAuB,CAAC,oBAC1B,MAAM,KACvB,OAAO;oBA+Ca,MAAM,KAAK,MAAM,SAAS,MAAM,UAAU,MAAM,iBAAiB,IAAI,MAAM,CAAC,KAAG,OAAO;sCAyBlG,gBAAgB,EAAE,UACnB,IAAI,MAAM,EAAE,uBAAuB,CAAC,oBAC1B,MAAM,KACvB,IAAI,MAAM,CAAC;EA+Bf"}
@@ -0,0 +1,19 @@
1
+ import type { DashboardWidgetPosition } from "../types";
2
+ /**
3
+ * Hook for managing the saving and loading of the dashboard layout
4
+ *
5
+ * Provides functions for saving and loading the dashboard layout from localStorage
6
+ *
7
+ * @param storageKey The key for local storage
8
+ * @param updateCallback The function for updating the position of the widget
9
+ * @returns An object with functions for working with the saved layout
10
+ */
11
+ export declare function useLayoutPersistence(storageKey: string, updateCallback: (widgetId: string, position: DashboardWidgetPosition) => void): {
12
+ saveLayout: (layout: Map<string, DashboardWidgetPosition>) => void;
13
+ loadLayout: <T extends {
14
+ id: string;
15
+ }>(widgets: T[]) => boolean;
16
+ clearSavedLayout: () => void;
17
+ hasSavedLayout: () => boolean;
18
+ };
19
+ //# sourceMappingURL=useLayoutPersistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLayoutPersistence.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useLayoutPersistence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB,KAAK,IAAI;yBAUjD,IAAI,MAAM,EAAE,uBAAuB,CAAC,KAAG,IAAI;;YAsBnC,MAAM;wBAAmB,OAAO;4BAyBvC,IAAI;0BAON,OAAO;EAUnC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Hook for managing ResizeObserver
3
+ *
4
+ * Provides functionality for tracking changes in the sizes of elements
5
+ *
6
+ * @param callback The function called when the sizes change
7
+ * @param options Options
8
+ * @returns An object with methods for working with ResizeObserver
9
+ */
10
+ export declare function useResizeObserver(callback: (entries: ResizeObserverEntry[]) => void, options?: {
11
+ debounceMs?: number;
12
+ }): {
13
+ observe: (element: Element) => void;
14
+ unobserve: (element: Element) => void;
15
+ disconnect: () => void;
16
+ isSupported: boolean;
17
+ };
18
+ //# sourceMappingURL=useResizeObserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useResizeObserver.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,IAAI,EAClD,OAAO,CAAC,EAAE;IACR,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;uBAuCyB,OAAO;yBAiBL,OAAO;;;EAiCpC"}
@@ -0,0 +1,14 @@
1
+ import type { IDashboardWidget, DashboardWidgetPosition } from "../types";
2
+ /**
3
+ * Hook for managing the placement of widgets on the dashboard
4
+ *
5
+ * @param updatePositionCallback The function for updating the position of the widget
6
+ * @returns An object with functions for working with the placement of widgets
7
+ */
8
+ export declare function useWidgetLayout(updatePositionCallback: (widgetId: string, position: DashboardWidgetPosition) => void): {
9
+ findFreePosition: (widget: IDashboardWidget, widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>) => DashboardWidgetPosition;
10
+ findOptimalPosition: (widget: IDashboardWidget, occupiedCells: Set<string>, maxRows: number) => DashboardWidgetPosition;
11
+ arrangeWidgetsInRows: (widgetsToArrange: IDashboardWidget[], allWidgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>) => void;
12
+ initializeWithBuiltInPositions: (widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPosition>) => boolean;
13
+ };
14
+ //# sourceMappingURL=useWidgetLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWidgetLayout.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useWidgetLayout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAgB1E;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB,KAAK,IAAI;+BAYzG,gBAAgB,WACf,gBAAgB,EAAE,UACnB,IAAI,MAAM,EAAE,uBAAuB,CAAC,KAC3C,uBAAuB;kCAiDhB,gBAAgB,iBACT,IAAI,MAAM,CAAC,WACjB,MAAM,KACd,uBAAuB;6CA+CN,gBAAgB,EAAE,cACxB,gBAAgB,EAAE,UACtB,IAAI,MAAM,EAAE,uBAAuB,CAAC,KAC3C,IAAI;8CA4CI,gBAAgB,EAAE,UACnB,IAAI,MAAM,EAAE,uBAAuB,CAAC,KAC3C,OAAO;EA6EX"}
@@ -0,0 +1,21 @@
1
+ import type { IDashboardWidget, DashboardWidgetPosition } from "../types";
2
+ import type { CellSize } from "./useCellSizeCalculator";
3
+ /**
4
+ * Type for returned styles
5
+ */
6
+ export type WidgetStyle = Record<string, string>;
7
+ /**
8
+ * Hook for managing widget styles
9
+ *
10
+ * Provides functions for calculating CSS styles for widgets based on their position,
11
+ * dragging state, and other parameters
12
+ *
13
+ * @param getCellSize The function for getting the cell sizes
14
+ * @returns An object with functions for working with widget styles
15
+ */
16
+ export declare function useWidgetStyles(getCellSize: () => CellSize): {
17
+ getPreviewStyles: (widget: IDashboardWidget, position: DashboardWidgetPosition) => WidgetStyle;
18
+ getWidgetStyles: (widget: IDashboardWidget, position: DashboardWidgetPosition | undefined, isDragged?: boolean, displacedPosition?: DashboardWidgetPosition) => WidgetStyle;
19
+ WIDGET_GAP: number;
20
+ };
21
+ //# sourceMappingURL=useWidgetStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWidgetStyles.d.ts","sourceRoot":"","sources":["../../../../../shared/components/draggable-dashboard/composables/useWidgetStyles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAOxD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,QAAQ;+BAQvB,gBAAgB,YAAY,uBAAuB,KAAG,WAAW;8BA2BzF,gBAAgB,YACd,uBAAuB,GAAG,SAAS,cAClC,OAAO,sBACE,uBAAuB,KAC1C,WAAW;;EAyDf"}
@@ -1,4 +1,4 @@
1
- import type { Component } from 'vue';
1
+ import type { Component } from "vue";
2
2
  /**
3
3
  * Position type for a widget on the dashboard grid
4
4
  */
@@ -54,6 +54,10 @@ export interface IDashboardWidget {
54
54
  * Widget size
55
55
  */
56
56
  size: DashboardWidgetSize;
57
+ /**
58
+ * Built-in widget position (optional)
59
+ */
60
+ position?: DashboardWidgetPosition;
57
61
  }
58
62
  /**
59
63
  * Drag event type
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../shared/components/draggable-dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;;OAGG;IACH,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,uBAAuB,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../shared/components/draggable-dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,CAAC,EAAE,MAAM,CAAC;IAEV;;;OAGG;IACH,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,uBAAuB,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,uBAAuB,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB"}