@featherk/composables 0.13.5 → 0.13.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.
@@ -1,4 +1,4 @@
1
- import { type ComponentPublicInstance, type ComputedRef, type Ref } from "vue";
1
+ import { type ComponentPublicInstance, type ComputedRef, type MaybeRefOrGetter, type Ref } from "vue";
2
2
  /** Kendo Window's stage values. Distinct from browser fullscreen APIs. */
3
3
  export type WindowStage = "DEFAULT" | "MINIMIZED" | "FULLSCREEN";
4
4
  export interface WindowMoveEventPayload {
@@ -40,6 +40,8 @@ export interface UseWindowOptions {
40
40
  */
41
41
  settings?: Partial<WindowSettings> | Ref<Partial<WindowSettings>>;
42
42
  initialStage?: WindowStage;
43
+ /** Enables the native titlebar double-click stage toggle. Defaults to true. */
44
+ titlebarDoubleClick?: MaybeRefOrGetter<boolean>;
43
45
  onMove?: (payload: WindowMoveEventPayload) => void;
44
46
  onResize?: (payload: WindowResizeEventPayload) => void;
45
47
  onStageChange?: (stage: WindowStage) => void;
@@ -63,6 +63,51 @@ A partially-populated ref is fine - any field `myLoadedSettings` doesn't have fa
63
63
 
64
64
  `open()` respects this: by default it reopens at whatever `left`/`top`/`width`/`height` are already on `settings` (a prior drag/resize, or a value you restored from persistence), rather than recomputing the initial inset position. Pass `open({ resetPosition: true })` to force the Window back to its computed initial position/size instead - see `UseWindowReturn.open` in the API table below.
65
65
 
66
+ ## Extending Window Behavior
67
+
68
+ Use the `UseWindowOptions` callbacks when application code needs to react to Window behavior. These callbacks are extension hooks: they run after `useWindow` completes its internal handling, and they do not replace Kendo's event handlers.
69
+
70
+ This applies to every callback option:
71
+
72
+ - `onMove` runs after viewport clamping and position updates.
73
+ - `onResize` runs after size/position updates and resize-state tracking.
74
+ - `onStageChange` runs after a valid controlled stage transition.
75
+ - `onOpen` runs after `open()` has shown and sized the Window.
76
+ - `onClose` runs after `close()` has reset the stage and hidden the Window.
77
+
78
+ For example, use `onMove` and `onResize` when application code needs to observe movement or resizing:
79
+
80
+ ```ts
81
+ const win = useWindow({
82
+ onMove: (payload) => {
83
+ console.log("Moved", payload.left, payload.top);
84
+ },
85
+ onResize: (payload) => {
86
+ console.log("Resized", payload.width, payload.height);
87
+ },
88
+ });
89
+ ```
90
+
91
+ ## Titlebar Double-Click
92
+
93
+ Titlebar double-click stage changes follow normal Windows behavior by default: double-clicking
94
+ the titlebar toggles between `DEFAULT` and `FULLSCREEN`. Set `titlebarDoubleClick: false` to
95
+ disable both transitions. This option is independent of `settings.maximizeButton`; disabling the
96
+ maximize button does not automatically disable titlebar double-click behavior.
97
+
98
+ Keep binding `v-on="events"` on `<Window>` so viewport clamping, resize tracking, stage handling, and Kendo workarounds remain active:
99
+
100
+ ```vue
101
+ <Window
102
+ v-if="win.visible.value"
103
+ ref="windowRef"
104
+ v-bind="win.props.value"
105
+ v-on="win.events"
106
+ />
107
+ ```
108
+
109
+ Do not replace entries on `events` unless you intentionally opt out of the corresponding `useWindow` protections. For most consumers, compose application behavior through the callback options and leave `v-on="events"` intact.
110
+
66
111
  ## API
67
112
 
68
113
  ### `UseWindowOptions`
@@ -71,6 +116,7 @@ A partially-populated ref is fine - any field `myLoadedSettings` doesn't have fa
71
116
  | --------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
72
117
  | `settings` | `Partial<WindowSettings> \| Ref<Partial<WindowSettings>>` | Overrides merged over `WINDOW_SETTINGS_DEFAULTS` internally. Pass a `Ref` for externally-owned/persisted settings. |
73
118
  | `initialStage` | `WindowStage` | Initial `stage` value. Defaults to `"DEFAULT"`. |
119
+ | `titlebarDoubleClick` | `MaybeRefOrGetter<boolean>` | Enables titlebar double-click stage changes. Defaults to `true`; pass `false` or a reactive ref/getter returning `false` to disable both maximize and restore transitions. |
74
120
  | `onMove` | `(payload) => void` | Called after internal move handling. |
75
121
  | `onResize` | `(payload) => void` | Called after internal resize handling. |
76
122
  | `onStageChange` | `(stage) => void` | Called after a valid stage transition. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@featherk/composables",
3
- "version": "0.13.5",
3
+ "version": "0.13.6",
4
4
  "main": "dist/featherk-composables.umd.js",
5
5
  "module": "dist/featherk-composables.es.js",
6
6
  "types": "dist/index.d.ts",