v-nuxt-ui 0.2.0 → 0.2.2

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/module.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "dependencies": [
8
8
  "@nuxt/ui"
9
9
  ],
10
- "version": "0.2.0",
10
+ "version": "0.2.2",
11
11
  "builder": {
12
12
  "@nuxt/module-builder": "1.0.2",
13
13
  "unbuild": "3.6.1"
@@ -131,8 +131,15 @@ watchEffect(() => {
131
131
  const isDeleteKey = (event) => {
132
132
  return event.key === "Delete" || event.key === "Backspace" || event.code === "Backspace";
133
133
  };
134
+ const isEditableTarget = (target) => {
135
+ const element = target instanceof HTMLElement ? target : null;
136
+ if (!element) return false;
137
+ const tagName = element.tagName;
138
+ return element.isContentEditable || tagName === "INPUT" || tagName === "TEXTAREA" || tagName === "SELECT";
139
+ };
134
140
  const handleKeyDown = async (event) => {
135
141
  if (!isDeleteKey(event)) return;
142
+ if (isEditableTarget(event.target)) return;
136
143
  event.preventDefault();
137
144
  event.stopPropagation();
138
145
  event.stopImmediatePropagation();
@@ -199,6 +206,7 @@ const isValidConnection = () => true;
199
206
  :default-edge-options="defaultEdgeOptions"
200
207
  :is-valid-connection="isValidConnection"
201
208
  :edges-updatable="true"
209
+ fit-view-on-init
202
210
  >
203
211
  <Background
204
212
  v-if="showBackground"
@@ -59,20 +59,15 @@ function updateNodeInFlow(row, updatedNode) {
59
59
  updateExpandedFlow(row, updatedFlow);
60
60
  }
61
61
  async function handleEditNode(row, node) {
62
- const updatedNode = await new Promise((resolve, reject) => {
63
- editNodeModal.open({ model: node }).result.then((result) => {
64
- if (!result || typeof result === "boolean") {
65
- resolve(null);
66
- return;
62
+ await editNodeModal.open({
63
+ model: node,
64
+ onSave: async (newNode) => {
65
+ const { data } = await flowNodeApi.update(newNode);
66
+ if (data.value.data) {
67
+ updateNodeInFlow(row, data.value.data);
67
68
  }
68
- resolve(result);
69
- }).catch(reject);
70
- });
71
- if (!updatedNode) return;
72
- const { data } = await flowNodeApi.update(updatedNode);
73
- if (data.value.data) {
74
- updateNodeInFlow(row, data.value.data);
75
- }
69
+ }
70
+ }).result;
76
71
  }
77
72
  function getExpandVNode(row) {
78
73
  return h("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-nuxt-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
5
5
  "type": "module",
6
6
  "style": "./dist/runtime/index.css",