-
-
-
-
-
-
-
{{ title }}
-
-
-
{{ subHeading }}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ title }}
+
+
+
{{ subHeading }}
+
-
-
-
+
+
+
+
+
+
+
-
-
-
\ No newline at end of file
+function done() {
+ if (props.done) {
+ props.done()
+ }
+}
+
+/* SlideOver */
+const show = ref(false)
+const transition1 = ref('')
+const rule1 = {
+ entering: { cls: 'transform transition ease-in-out duration-500 sm:duration-700', from: 'translate-x-full', to: 'translate-x-0' },
+ leaving: { cls: 'transform transition ease-in-out duration-500 sm:duration-700', from: 'translate-x-0', to: 'translate-x-full' }
+}
+watch(show, () => {
+ transition(rule1, transition1, show.value)
+ if (!show.value) setTimeout(done, 700)
+})
+show.value = true
+function close() {
+ if (props.formStyle == 'slideOver') {
+ show.value = false
+ } else {
+ done()
+ }
+}
+
+const globalKeyHandler = (e:KeyboardEvent) => { if (e.key === 'Escape') close() }
+onMounted(() => window.addEventListener('keydown', globalKeyHandler))
+onUnmounted(() => window.removeEventListener('keydown', globalKeyHandler))
+
\ No newline at end of file