@quirekit/ui 0.3.1 → 0.3.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/vue.mjs CHANGED
@@ -11234,7 +11234,7 @@ const _sfc_main$229 = /*@__PURE__*/ defineComponent({
11234
11234
  },
11235
11235
  expandOnClick: {
11236
11236
  type: Boolean,
11237
- default: true
11237
+ default: false
11238
11238
  },
11239
11239
  typeahead: {
11240
11240
  type: Boolean,
@@ -11260,6 +11260,7 @@ const _sfc_main$229 = /*@__PURE__*/ defineComponent({
11260
11260
  emits: /*@__PURE__*/ mergeModels([
11261
11261
  "expandedChange",
11262
11262
  "selectionChange",
11263
+ "nodeActivate",
11263
11264
  "loadChildrenComplete",
11264
11265
  "loadChildrenError"
11265
11266
  ], [
@@ -11314,6 +11315,25 @@ const _sfc_main$229 = /*@__PURE__*/ defineComponent({
11314
11315
  });
11315
11316
  }
11316
11317
  /**
11318
+ * Publishes title activation independently of changes to the selection.
11319
+ * @param event - A captured row click or a keyboard confirmation handled by Ark.
11320
+ */
11321
+ function activateNode(event) {
11322
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
11323
+ if (event instanceof KeyboardEvent) {
11324
+ if (!(event.key === "Enter" || event.key === " " && !props.checkable) || !event.defaultPrevented || event.repeat || event.isComposing) return;
11325
+ } else if (event.button !== 0 || event.defaultPrevented) return;
11326
+ const target = event.target;
11327
+ if (!(target instanceof Element) || target.closest("[data-scope=\"tree-view\"][data-part=\"root\"]") !== event.currentTarget) return;
11328
+ const row = target.closest("[data-part=\"branch-control\"], [data-part=\"item\"]");
11329
+ if (!row || row.matches("[data-disabled], [data-loading], [data-renaming]")) return;
11330
+ const control = target.closest("button, a, input, select, textarea, [role=\"button\"], [role=\"checkbox\"], [contenteditable]:not([contenteditable=\"false\"])");
11331
+ if (control && control !== row) return;
11332
+ const id = row.dataset.value;
11333
+ const node = id === void 0 ? void 0 : collection.value.findNode(id);
11334
+ if (node) emit("nodeActivate", node);
11335
+ }
11336
+ /**
11317
11337
  * 接管 Ark 返回的新 collection,使异步节点立即进入递归渲染。
11318
11338
  *
11319
11339
  * @param details - 包含已替换子节点的新 collection。
@@ -11358,7 +11378,9 @@ const _sfc_main$229 = /*@__PURE__*/ defineComponent({
11358
11378
  !__props.showIndentGuides && "qk-tree-view--hide-guides"
11359
11379
  ],
11360
11380
  onCheckedChange: _cache[0] || (_cache[0] = ($event) => checkedValue.value = $event.checkedValue),
11381
+ onClickCapture: activateNode,
11361
11382
  onKeydownCapture: checkWithKeyboard,
11383
+ onKeydown: activateNode,
11362
11384
  onExpandedChange: handleExpandedChange,
11363
11385
  onSelectionChange: handleSelectionChange,
11364
11386
  onLoadChildrenComplete: handleLoadComplete,