@ixfx/components 0.11.2 → 0.11.3

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.
Files changed (72) hide show
  1. package/bundle/index.d.ts +60 -4
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +161 -8
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.d.ts +1 -1
  6. package/dist/{ac-token--_vCHXWw.d.ts → ac-token-TCLAZeVg.d.ts} +2 -2
  7. package/dist/{ac-token--_vCHXWw.d.ts.map → ac-token-TCLAZeVg.d.ts.map} +1 -1
  8. package/dist/ac-token.d.ts +1 -1
  9. package/dist/{button-BYuf72aR.d.ts → button-CTL45aBl.d.ts} +2 -2
  10. package/dist/{button-BYuf72aR.d.ts.map → button-CTL45aBl.d.ts.map} +1 -1
  11. package/dist/button.d.ts +1 -1
  12. package/dist/colour-picker.d.ts +1 -1
  13. package/dist/crumbs.d.ts +1 -1
  14. package/dist/{data-grid-3yIylIH-.d.ts → data-grid-BWrtE8H9.d.ts} +4 -4
  15. package/dist/{data-grid-3yIylIH-.d.ts.map → data-grid-BWrtE8H9.d.ts.map} +1 -1
  16. package/dist/data-grid.d.ts +1 -1
  17. package/dist/{detail-list-ccWFyhEc.d.ts → detail-list-DxQZkK-C.d.ts} +4 -4
  18. package/dist/{detail-list-ccWFyhEc.d.ts.map → detail-list-DxQZkK-C.d.ts.map} +1 -1
  19. package/dist/detail-list.d.ts +2 -2
  20. package/dist/{grid-list-BnOVgtLI.d.ts → grid-list-ChgYpUUq.d.ts} +2 -2
  21. package/dist/{grid-list-BnOVgtLI.d.ts.map → grid-list-ChgYpUUq.d.ts.map} +1 -1
  22. package/dist/grid-list.d.ts +1 -1
  23. package/dist/{grouped-item-lister-DETte0Dh.d.ts → grouped-item-lister-Bhyo-dkH.d.ts} +2 -2
  24. package/dist/{grouped-item-lister-DETte0Dh.d.ts.map → grouped-item-lister-Bhyo-dkH.d.ts.map} +1 -1
  25. package/dist/grouped-item-lister.d.ts +1 -1
  26. package/dist/{icon-CDGprSdE.d.ts → icon-DR_3rSyZ.d.ts} +2 -2
  27. package/dist/icon-DR_3rSyZ.d.ts.map +1 -0
  28. package/dist/icons.d.ts +2 -2
  29. package/dist/incr-search.d.ts +1 -1
  30. package/dist/{index-tq6f8007.d.ts → index-BOUaDIW-.d.ts} +2 -2
  31. package/dist/{index-tq6f8007.d.ts.map → index-BOUaDIW-.d.ts.map} +1 -1
  32. package/dist/{index-CoqtMSd9.d.ts → index-BUB5SICW.d.ts} +2 -2
  33. package/dist/{index-CoqtMSd9.d.ts.map → index-BUB5SICW.d.ts.map} +1 -1
  34. package/dist/{index-5-cwYpmx.d.ts → index-CHbuPyLL.d.ts} +2 -2
  35. package/dist/{index-5-cwYpmx.d.ts.map → index-CHbuPyLL.d.ts.map} +1 -1
  36. package/dist/{index-UvnoZUAo.d.ts → index-CJ5fshD3.d.ts} +2 -2
  37. package/dist/{index-UvnoZUAo.d.ts.map → index-CJ5fshD3.d.ts.map} +1 -1
  38. package/dist/{index-RImMNo0r.d.ts → index-PjiaGpA5.d.ts} +3 -3
  39. package/dist/{index-RImMNo0r.d.ts.map → index-PjiaGpA5.d.ts.map} +1 -1
  40. package/dist/{index-CYndvTWH.d.ts → index-garxxqgV.d.ts} +2 -2
  41. package/dist/{index-CYndvTWH.d.ts.map → index-garxxqgV.d.ts.map} +1 -1
  42. package/dist/index.d.ts +78 -22
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +161 -8
  45. package/dist/index.js.map +1 -1
  46. package/dist/{labelled-input-base-DiTme1JO.d.ts → labelled-input-base-Dp_9KP0G.d.ts} +2 -2
  47. package/dist/{labelled-input-base-DiTme1JO.d.ts.map → labelled-input-base-Dp_9KP0G.d.ts.map} +1 -1
  48. package/dist/labelled-radial-input.d.ts +2 -2
  49. package/dist/labelled-radial-input.d.ts.map +1 -1
  50. package/dist/labelled-range-input.d.ts +1 -1
  51. package/dist/labelled-slider-input.d.ts +1 -1
  52. package/dist/{menu-item-CZi9vy5O.d.ts → menu-item-ZmkXNjek.d.ts} +2 -2
  53. package/dist/{menu-item-CZi9vy5O.d.ts.map → menu-item-ZmkXNjek.d.ts.map} +1 -1
  54. package/dist/menu.d.ts +2 -2
  55. package/dist/miller.d.ts +1 -1
  56. package/dist/panel.d.ts +1 -1
  57. package/dist/{split-layout-JK3xWVX2.d.ts → split-layout-C5SYbDrq.d.ts} +2 -2
  58. package/dist/{split-layout-JK3xWVX2.d.ts.map → split-layout-C5SYbDrq.d.ts.map} +1 -1
  59. package/dist/split-layout.d.ts +1 -1
  60. package/dist/{tab-list-pqfKaVAE.d.ts → tab-list-v8mKX7Fu.d.ts} +2 -2
  61. package/dist/{tab-list-pqfKaVAE.d.ts.map → tab-list-v8mKX7Fu.d.ts.map} +1 -1
  62. package/dist/tabs.d.ts +1 -1
  63. package/dist/{titlebar-Tqu-VvMU.d.ts → titlebar-B5zSTZnF.d.ts} +2 -2
  64. package/dist/{titlebar-Tqu-VvMU.d.ts.map → titlebar-B5zSTZnF.d.ts.map} +1 -1
  65. package/dist/titlebar.d.ts +1 -1
  66. package/dist/tree.d.ts +1 -1
  67. package/dist/{vertical-list-9dJ1R1hU.d.ts → vertical-list-R25WqAVO.d.ts} +2 -2
  68. package/dist/{vertical-list-9dJ1R1hU.d.ts.map → vertical-list-R25WqAVO.d.ts.map} +1 -1
  69. package/dist/vertical-list.d.ts +1 -1
  70. package/docs-user/index.json +2 -2
  71. package/package.json +1 -1
  72. package/dist/icon-CDGprSdE.d.ts.map +0 -1
package/bundle/index.js CHANGED
@@ -11995,7 +11995,10 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
11995
11995
  this._editingCancelled = false;
11996
11996
  this._editStartIndex = null;
11997
11997
  this._openCumPath = null;
11998
+ this._dragCumPath = null;
11999
+ this._dropCumPath = null;
11998
12000
  this.#uid = Math.random().toString(36).slice(2, 8);
12001
+ this.#clickSuppressUntil = 0;
11999
12002
  this.#onPopoverToggle = (e) => {
12000
12003
  if (e.newState === `closed` && this._openIdx !== null) {
12001
12004
  this._openIdx = null;
@@ -12049,6 +12052,8 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12049
12052
  #pendingController;
12050
12053
  #pendingIndex;
12051
12054
  #uid;
12055
+ /** Clicks within this window after a drag are ignored (post-drag click-through guard). */
12056
+ #clickSuppressUntil;
12052
12057
  #anchorName(cumPath) {
12053
12058
  return `--cp-${this.#uid}-${cumPath.replaceAll(this.separator, `-`).replaceAll(` `, `-`).replace(INVALID_ANCHOR_CHARS_RE, `-`)}`;
12054
12059
  }
@@ -12110,6 +12115,23 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12110
12115
  if (isRoot) return rootSegments.slice(0, index + 1).join(this.separator);
12111
12116
  return [...rootSegments, ...segments.slice(0, index + 1)].join(this.separator);
12112
12117
  }
12118
+ #resolveFullPathSegments(index, isRoot) {
12119
+ const rootSegments = this.#getRootSegments();
12120
+ if (isRoot) return rootSegments.slice(0, index + 1);
12121
+ return [...rootSegments, ...this.#getSegments().slice(0, index + 1)];
12122
+ }
12123
+ #segmentDragPayloads(fullPathSegments) {
12124
+ try {
12125
+ const result = this.segmentDragLookup?.(fullPathSegments, fullPathSegments.length - 1);
12126
+ if (result === void 0 || result === null) return [];
12127
+ return Array.isArray(result) ? [...result] : [result];
12128
+ } catch {
12129
+ return [];
12130
+ }
12131
+ }
12132
+ #clicksSuppressed() {
12133
+ return Date.now() < this.#clickSuppressUntil || this._dragCumPath !== null;
12134
+ }
12113
12135
  #resolveSegmentIcon(fullPathSegments, index) {
12114
12136
  const direct = this.segmentIconLookup?.(fullPathSegments, index);
12115
12137
  if (typeof direct === `string` && direct.length > 0) return direct;
@@ -12176,7 +12198,87 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12176
12198
  }
12177
12199
  this.requestUpdate();
12178
12200
  }
12201
+ #onLabelDragStart(fullPathSegments, cumPath, event) {
12202
+ this.#closeDropdown();
12203
+ const index = fullPathSegments.length - 1;
12204
+ const dt = event.dataTransfer;
12205
+ const detail = {
12206
+ index,
12207
+ label: fullPathSegments[index] ?? ``,
12208
+ pathSegments: fullPathSegments,
12209
+ parentPath: fullPathSegments.slice(0, -1).join(this.separator),
12210
+ fullPath: fullPathSegments.join(this.separator),
12211
+ dataTransfer: dt
12212
+ };
12213
+ const evt = new CustomEvent(`crumb-drag-start`, {
12214
+ detail,
12215
+ bubbles: true,
12216
+ composed: true,
12217
+ cancelable: true
12218
+ });
12219
+ if (!this.dispatchEvent(evt)) {
12220
+ event.preventDefault();
12221
+ return;
12222
+ }
12223
+ this._dragCumPath = cumPath;
12224
+ this.toggleAttribute(`data-native-dragging`, true);
12225
+ if (!dt) return;
12226
+ try {
12227
+ if (dt.effectAllowed === `none` || dt.effectAllowed === `uninitialized`) dt.effectAllowed = `copyMove`;
12228
+ } catch {}
12229
+ try {
12230
+ for (const payload of this.#segmentDragPayloads(fullPathSegments)) dt.setData(payload.type, payload.data);
12231
+ if (!dt.types.includes(`text/plain`)) dt.setData(`text/plain`, detail.fullPath);
12232
+ } catch {}
12233
+ }
12234
+ #onLabelDragEnd() {
12235
+ this._dragCumPath = null;
12236
+ this._dropCumPath = null;
12237
+ this.toggleAttribute(`data-native-dragging`, false);
12238
+ this.#clickSuppressUntil = Date.now() + 150;
12239
+ }
12240
+ #onSegDragOver(cumPath, event) {
12241
+ if (!this.parseExternalDrop) return;
12242
+ if (!event.dataTransfer) return;
12243
+ event.preventDefault();
12244
+ if (this._dropCumPath !== cumPath) this._dropCumPath = cumPath;
12245
+ }
12246
+ #onSegDragLeave(cumPath, _event) {
12247
+ if (!this.parseExternalDrop) return;
12248
+ if (this._dropCumPath === cumPath) this._dropCumPath = null;
12249
+ }
12250
+ #onSegDrop(fullPathSegments, event) {
12251
+ if (!this.parseExternalDrop) return;
12252
+ event.preventDefault();
12253
+ event.stopPropagation();
12254
+ this._dropCumPath = null;
12255
+ const dt = event.dataTransfer;
12256
+ if (!dt) return;
12257
+ let data;
12258
+ try {
12259
+ data = this.parseExternalDrop(dt);
12260
+ } catch (err) {
12261
+ console.error(`parseExternalDrop failed:`, err);
12262
+ return;
12263
+ }
12264
+ if (data === void 0) return;
12265
+ const index = fullPathSegments.length - 1;
12266
+ this.dispatchEvent(new CustomEvent(`crumb-drop`, {
12267
+ detail: {
12268
+ index,
12269
+ label: fullPathSegments[index] ?? ``,
12270
+ pathSegments: fullPathSegments,
12271
+ parentPath: fullPathSegments.slice(0, -1).join(this.separator),
12272
+ fullPath: fullPathSegments.join(this.separator),
12273
+ data,
12274
+ dataTransfer: dt
12275
+ },
12276
+ bubbles: true,
12277
+ composed: true
12278
+ }));
12279
+ }
12179
12280
  #onLabelClick(index, event) {
12281
+ if (this.#clicksSuppressed()) return;
12180
12282
  event.preventDefault();
12181
12283
  event.stopPropagation();
12182
12284
  this.#closeDropdown();
@@ -12258,16 +12360,31 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12258
12360
  #renderSegment(label, index, isLast) {
12259
12361
  const isOpen = this._openIdx === index;
12260
12362
  const cumPath = this.#getCumulativePath(index, false);
12261
- const fullPathSegments = [...this.#getRootSegments(), ...this.#getSegments().slice(0, index + 1)];
12363
+ const fullPathSegments = this.#resolveFullPathSegments(index, false);
12262
12364
  const icon = this.#resolveSegmentIcon(fullPathSegments, fullPathSegments.length - 1);
12365
+ const draggable = this.#segmentDragPayloads(fullPathSegments).length > 0;
12366
+ const dragging = this._dragCumPath === cumPath;
12367
+ const dropInto = this._dropCumPath === cumPath;
12263
12368
  return html`
12264
- <div class="seg" data-cumulative=${cumPath} @click=${(e) => this.#onSegmentClick(index, e)}>
12265
- <label title=${label} @click=${(e) => this.#onLabelClick(index, e)}>
12369
+ <div class="seg ${dragging ? `dragging` : ``} ${dropInto ? `drop-into` : ``}"
12370
+ part=${dropInto ? `segment drop-target` : `segment`}
12371
+ data-cumulative=${cumPath}
12372
+ @click=${(e) => this.#onSegmentClick(index, e)}
12373
+ @dragover=${(e) => this.#onSegDragOver(cumPath, e)}
12374
+ @dragleave=${(e) => this.#onSegDragLeave(cumPath, e)}
12375
+ @drop=${(e) => this.#onSegDrop(fullPathSegments, e)}>
12376
+ <label title=${label}
12377
+ part="label"
12378
+ ?draggable=${draggable}
12379
+ @click=${(e) => this.#onLabelClick(index, e)}
12380
+ @dragstart=${(e) => this.#onLabelDragStart(fullPathSegments, cumPath, e)}
12381
+ @dragend=${() => this.#onLabelDragEnd()}>
12266
12382
  ${icon ? html`<ixfx-icon class="crumb-icon segment-icon" name=${icon}></ixfx-icon>` : nothing}
12267
12383
  ${label}
12268
12384
  </label>
12269
12385
  ${(!isLast || this.siblingLookup) && this._leafSegmentIndex !== index ? html`
12270
12386
  <div class="caret ${isOpen ? `open` : ``} ${this._confirmedLeafIndices.has(cumPath) ? `disabled` : ``}"
12387
+ part="caret"
12271
12388
  style="anchor-name: ${this.#anchorName(cumPath)}"
12272
12389
  data-cumulative=${cumPath}
12273
12390
  @click=${(e) => this.#onCaretClick(index, e)}>
@@ -12278,17 +12395,31 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12278
12395
  `;
12279
12396
  }
12280
12397
  #renderRootSegment(label, index) {
12281
- const rootSegments = this.#getRootSegments();
12282
- const isLast = index === rootSegments.length - 1;
12398
+ const isLast = index === this.#getRootSegments().length - 1;
12283
12399
  const isOpen = this._openIdx === index;
12284
12400
  const cumPath = this.#getCumulativePath(index, true);
12285
- const fullPathSegments = rootSegments.slice(0, index + 1);
12401
+ const fullPathSegments = this.#resolveFullPathSegments(index, true);
12286
12402
  const icon = this.#resolveSegmentIcon(fullPathSegments, index);
12403
+ const draggable = this.#segmentDragPayloads(fullPathSegments).length > 0;
12404
+ const dragging = this._dragCumPath === cumPath;
12405
+ const dropInto = this._dropCumPath === cumPath;
12287
12406
  return html`
12288
- <div class="seg seg-root" data-cumulative=${cumPath} @click=${(e) => this.#onRootSegmentClick(index, e)}>
12289
- <label title=${label}>${icon ? html`<ixfx-icon class="crumb-icon segment-icon" name=${icon}></ixfx-icon>` : nothing}${label}</label>
12407
+ <div class="seg seg-root ${dragging ? `dragging` : ``} ${dropInto ? `drop-into` : ``}"
12408
+ part=${dropInto ? `segment drop-target` : `segment`}
12409
+ data-cumulative=${cumPath}
12410
+ @click=${(e) => this.#onRootSegmentClick(index, e)}
12411
+ @dragover=${(e) => this.#onSegDragOver(cumPath, e)}
12412
+ @dragleave=${(e) => this.#onSegDragLeave(cumPath, e)}
12413
+ @drop=${(e) => this.#onSegDrop(fullPathSegments, e)}>
12414
+ <label title=${label}
12415
+ part="label"
12416
+ ?draggable=${draggable}
12417
+ @click=${(e) => this.#onLabelClick(index, e)}
12418
+ @dragstart=${(e) => this.#onLabelDragStart(fullPathSegments, cumPath, e)}
12419
+ @dragend=${() => this.#onLabelDragEnd()}>${icon ? html`<ixfx-icon class="crumb-icon segment-icon" name=${icon}></ixfx-icon>` : nothing}${label}</label>
12290
12420
  ${isLast && this.siblingLookup ? html`
12291
12421
  <div class="caret ${isOpen ? `open` : ``} ${this._confirmedLeafIndices.has(cumPath) ? `disabled` : ``}"
12422
+ part="caret"
12292
12423
  style="anchor-name: ${this.#anchorName(cumPath)}"
12293
12424
  data-cumulative=${cumPath}
12294
12425
  @click=${(e) => this.#onCaretClick(index, e)}>
@@ -12299,12 +12430,14 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12299
12430
  `;
12300
12431
  }
12301
12432
  #onRootSegmentClick(index, event) {
12433
+ if (this.#clicksSuppressed()) return;
12302
12434
  event.preventDefault();
12303
12435
  event.stopPropagation();
12304
12436
  const newPath = this.#getRootSegments().slice(0, index + 1).join(this.separator);
12305
12437
  this.setPath(newPath);
12306
12438
  }
12307
12439
  #onSegmentClick(index, event) {
12440
+ if (this.#clicksSuppressed()) return;
12308
12441
  event.preventDefault();
12309
12442
  event.stopPropagation();
12310
12443
  this.#closeDropdown();
@@ -12312,6 +12445,7 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12312
12445
  this._editStartIndex = index;
12313
12446
  }
12314
12447
  #onTrailingClick() {
12448
+ if (this.#clicksSuppressed()) return;
12315
12449
  this.#closeDropdown();
12316
12450
  this._editing = true;
12317
12451
  this._editStartIndex = null;
@@ -12533,6 +12667,21 @@ let CrumbPathElement = class CrumbPathElement extends LitElement {
12533
12667
  cursor: not-allowed;
12534
12668
  }
12535
12669
 
12670
+ /* Drag and drop styles */
12671
+ label[draggable] {
12672
+ cursor: grab;
12673
+ }
12674
+
12675
+ .seg.dragging {
12676
+ opacity: 0.4;
12677
+ }
12678
+
12679
+ .seg.drop-into {
12680
+ outline: var(--crumb-drop-into-outline, 2px solid var(--accent));
12681
+ outline-offset: -2px;
12682
+ background: var(--crumb-drop-into-bg, color-mix(in srgb, var(--accent) 14%, transparent));
12683
+ }
12684
+
12536
12685
  .crumb-icon {
12537
12686
  width: 1em;
12538
12687
  height: 1em;
@@ -12615,6 +12764,8 @@ __decorate([property({
12615
12764
  })], CrumbPathElement.prototype, "pathRoot", void 0);
12616
12765
  __decorate([property({ type: Object })], CrumbPathElement.prototype, "siblingLookup", void 0);
12617
12766
  __decorate([property({ type: Object })], CrumbPathElement.prototype, "segmentIconLookup", void 0);
12767
+ __decorate([property({ type: Object })], CrumbPathElement.prototype, "segmentDragLookup", void 0);
12768
+ __decorate([property({ type: Object })], CrumbPathElement.prototype, "parseExternalDrop", void 0);
12618
12769
  __decorate([state()], CrumbPathElement.prototype, "_openIdx", void 0);
12619
12770
  __decorate([state()], CrumbPathElement.prototype, "_editing", void 0);
12620
12771
  __decorate([state()], CrumbPathElement.prototype, "_cachedSiblings", void 0);
@@ -12624,6 +12775,8 @@ __decorate([state()], CrumbPathElement.prototype, "_dropdownActiveIndex", void 0
12624
12775
  __decorate([state()], CrumbPathElement.prototype, "_editingCancelled", void 0);
12625
12776
  __decorate([state()], CrumbPathElement.prototype, "_editStartIndex", void 0);
12626
12777
  __decorate([state()], CrumbPathElement.prototype, "_openCumPath", void 0);
12778
+ __decorate([state()], CrumbPathElement.prototype, "_dragCumPath", void 0);
12779
+ __decorate([state()], CrumbPathElement.prototype, "_dropCumPath", void 0);
12627
12780
  CrumbPathElement = __decorate([safeCustomElement(`ixfx-crumb-path`)], CrumbPathElement);
12628
12781
  //#endregion
12629
12782
  //#region src/data-display/data-display.ts