• v0.22.0 1036703584

    v0.22.0 Stable

    pienter-release-bot released this 2026-09-16 01:19:41 +00:00 | 95 commits to main since this release

    Added

    • RecordForm tracks whether the record has unsaved edits. baseline is
      the last saved state; without one the first modelValue the form sees
      stands in, so a create form is clean until the first edit. dirty is a
      structural comparison of modelValue against that baseline
      (isEqualRecord in utils/cms, so key order does not matter), always
      false in readonly mode, emitted as update:dirty for v-model:dirty
      and exposed on the component instance. Consumers set baseline to a clone
      of the model after load and after a successful save, before navigating.
    • useUnsavedChanges(dirty) (@[secure]/ui/composables/useUnsavedChanges)
      turns that flag into a leave guard: while dirty, beforeunload has the
      browser confirm a reload or tab close, and a vue-router onBeforeRouteLeave
      guard asks through confirmLeave(), which resolves true at once when
      clean and otherwise raises pending until resolve(leave) answers it. The
      consumer binds pending to an AlertDialog and answers with
      resolve(true) on confirm, resolve(false) on cancel; a second question
      while one is pending shares its promise. Requires the optional vue-router
      peer dependency, like useUrlTab.
    Downloads