ngx-kit 9.2.3 → 9.3.0

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.
@@ -208,7 +208,7 @@ class DragPreviewRef {
208
208
  this.isCustom = false;
209
209
  const preview = dragEl.cloneNode(true);
210
210
  this.element = preview;
211
- // Avoid duplicated ids in the document.
211
+ // Avoid duplicated ids in the document
212
212
  this.element.removeAttribute('id');
213
213
  this.element.querySelectorAll('[id]').forEach((n) => n.removeAttribute('id'));
214
214
  copyVisualStyles(dragEl, this.element);
@@ -359,7 +359,7 @@ function multiplyLinear(left, right) {
359
359
  }
360
360
  /**
361
361
  * Converts a client-space point from one same-origin Document viewport to another.
362
- * The conversion walks both frameElement chains through their common top-level document.
362
+ * The conversion walks both frameElement chains through their common top-level document
363
363
  * Cross-origin frame boundaries cannot be inspected and return null.
364
364
  */
365
365
  function convertPointBetweenDocuments(point, fromDocument, toDocument) {
@@ -943,7 +943,6 @@ class DragRef {
943
943
  const targetDocument = list.el?.ownerDocument;
944
944
  if (!targetDocument)
945
945
  continue;
946
- // Pointer coordinates originate in the draggable's document. A same-origin iframe has
947
946
  // its own viewport coordinate space, so convert before testing its DropList geometry.
948
947
  const targetPoint = convertPointBetweenDocuments(pointer, this.el.ownerDocument, targetDocument);
949
948
  if (!targetPoint || !list._containsPoint(targetPoint.x, targetPoint.y))
@@ -2279,7 +2278,6 @@ class DropListRef {
2279
2278
  if (ph.custom)
2280
2279
  return;
2281
2280
  placeholder.style.display = drag.originalDisplay;
2282
- // `rect` is in the VIEWPORT pixels of the dragged item's document. CSS sizes are local to the
2283
2281
  // list: convert across an (optionally scaled) iframe boundary first, then through the
2284
2282
  // list's own scaled/zoomed ancestors. Without this a placeholder inside a `scale(.5)` canvas
2285
2283
  // would be drawn at half the size it reserves.
@@ -2804,6 +2802,7 @@ class NgxDraggable {
2804
2802
  * When `true`, presses on native interactive controls (`button, a, input, textarea, select`,
2805
2803
  * `[contenteditable]`) do not start a drag either. Off by default so that a page-builder canvas
2806
2804
  * block can be grabbed by its own button/link, which is exactly what you want while editing.
2805
+ * @default false
2807
2806
  */
2808
2807
  ignoreInteractive = input(false, /* @ts-ignore */
2809
2808
  ...(ngDevMode ? [{ debugName: "ignoreInteractive" }] : /* istanbul ignore next */ []));
@@ -2889,17 +2888,15 @@ class NgxDraggable {
2889
2888
  this._ref.dropList?.removeItem(this._ref);
2890
2889
  }
2891
2890
  pointerDown(e) {
2892
- if (this.disabled() ||
2893
- e.button !== 0 ||
2894
- this.isExcluded(e.target) ||
2895
- !this.isOnHandle(e.target))
2891
+ if (this.disabled() || e.button !== 0 || !this.isOnHandle(e.target))
2896
2892
  return;
2897
2893
  // Nested draggables: pointerdown bubbles, so without this an ancestor draggable would start
2898
2894
  // its own drag from the very same gesture. The innermost enabled draggable claims it.
2899
2895
  if (claimedPointerEvents.has(e))
2900
2896
  return;
2901
2897
  claimedPointerEvents.add(e);
2902
- e.preventDefault();
2898
+ if (this.ignoreInteractive())
2899
+ e.preventDefault();
2903
2900
  this.down = true;
2904
2901
  this.keyboardDrag = false;
2905
2902
  this.pointerId = e.pointerId;
@@ -3171,15 +3168,6 @@ class NgxDraggable {
3171
3168
  // TODO notsafe instanseof: node.nodeType === Node.ELEMENT_NODE
3172
3169
  return isElementTarget$1(target) && !!target.closest(this.dragHandle());
3173
3170
  }
3174
- /** Should a press on `target` be left alone (no drag)? */
3175
- isExcluded(target) {
3176
- if (!isElementTarget$1(target))
3177
- return false;
3178
- const selector = this.noDragSelector();
3179
- if (selector && target.closest(selector))
3180
- return true;
3181
- return this.ignoreInteractive() && isEditableOrInteractive(target);
3182
- }
3183
3171
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: NgxDraggable, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
3184
3172
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.4", type: NgxDraggable, isStandalone: true, selector: "[NgxDraggable],[ngxDraggable]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, boundary: { classPropertyName: "boundary", publicName: "boundary", isSignal: true, isRequired: false, transformFunction: null }, dragRootElement: { classPropertyName: "dragRootElement", publicName: "dragRootElement", isSignal: true, isRequired: false, transformFunction: null }, dragHandle: { classPropertyName: "dragHandle", publicName: "dragHandle", isSignal: true, isRequired: false, transformFunction: null }, lockAxis: { classPropertyName: "lockAxis", publicName: "lockAxis", isSignal: true, isRequired: false, transformFunction: null }, dragThreshold: { classPropertyName: "dragThreshold", publicName: "dragThreshold", isSignal: true, isRequired: false, transformFunction: null }, keyboardStep: { classPropertyName: "keyboardStep", publicName: "keyboardStep", isSignal: true, isRequired: false, transformFunction: null }, autoScroll: { classPropertyName: "autoScroll", publicName: "autoScroll", isSignal: true, isRequired: false, transformFunction: null }, noDragSelector: { classPropertyName: "noDragSelector", publicName: "noDragSelector", isSignal: true, isRequired: false, transformFunction: null }, ignoreInteractive: { classPropertyName: "ignoreInteractive", publicName: "ignoreInteractive", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", dragRootElement: "dragRootElementChange", dragHandle: "dragHandleChange", dragStart: "dragStart", dragMove: "dragMove", dragEnd: "dragEnd" }, host: { properties: { "style.touch-action": "\"none\"", "attr.tabindex": "disabled() ? null : 0", "attr.aria-grabbed": "dragging()", "class.disable-drag": "disabled()" }, classAttribute: "ngx-draggable" }, providers: [{ provide: NGX_DRAGGABLE, useExisting: NgxDraggable }], queries: [{ propertyName: "customPreview", first: true, predicate: NgxDragPreview, descendants: true }], ngImport: i0 });
3185
3173
  }
@@ -3203,9 +3191,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
3203
3191
  type: ContentChild,
3204
3192
  args: [NgxDragPreview]
3205
3193
  }], dragStart: [{ type: i0.Output, args: ["dragStart"] }], dragMove: [{ type: i0.Output, args: ["dragMove"] }], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }] } });
3206
- function isEditableOrInteractive(el) {
3207
- return !!el.closest('button,a[href],input,textarea,select,[contenteditable]:not([contenteditable="false"])');
3208
- }
3209
3194
  function isEditableTarget(target) {
3210
3195
  if (!isElementTarget$1(target))
3211
3196
  return false;