@ixfx/components 0.16.1 → 0.16.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.
- package/bundle/index.d.ts +272 -58
- package/bundle/index.js +400 -337
- package/dist/ac-token.js +1 -1
- package/dist/{crumb-navigation-YnFVFqrx.js → crumb-navigation-D3ndPgFg.js} +2 -2
- package/dist/crumbs.js +1 -1
- package/dist/{data-grid-Cqxuwgbb.js → data-grid-8TsiF2ES.js} +142 -60
- package/dist/{data-grid-Csh5EJW9.d.ts → data-grid-CslzF16R.d.ts} +21 -3
- package/dist/data-grid.d.ts +2 -2
- package/dist/data-grid.js +1 -1
- package/dist/{detail-list-DSZ1DDor.d.ts → detail-list-n1MbNbhF.d.ts} +11 -3
- package/dist/{detail-list-Bo5ze3SN.js → detail-list-w3GXKO2k.js} +71 -19
- package/dist/detail-list.d.ts +2 -2
- package/dist/detail-list.js +1 -1
- package/dist/{flat-list-CT9kX3TQ.d.ts → flat-list-D_4y3wgn.d.ts} +7 -2
- package/dist/flat-list.d.ts +1 -1
- package/dist/flat-list.js +5 -2
- package/dist/{grid-list-DDLrWRxm.d.ts → grid-list-CqYS28NY.d.ts} +60 -14
- package/dist/{grid-list-D0dJNVEF.js → grid-list-Cz2tKcNZ.js} +55 -17
- package/dist/grid-list.d.ts +2 -2
- package/dist/grid-list.js +1 -1
- package/dist/{grouped-item-lister-DETte0Dh.d.ts → grouped-item-lister-CS4yInuw.d.ts} +1 -1
- package/dist/grouped-item-lister.d.ts +1 -1
- package/dist/{incr-search-CgbL-OlS.js → incr-search-Dc6gYpJG.js} +34 -5
- package/dist/incr-search.d.ts +1 -1
- package/dist/incr-search.js +1 -1
- package/dist/{index-CUErGhCg.d.ts → index-Bm9a9S3_.d.ts} +2 -1
- package/dist/{index-Bnm-kKGC.d.ts → index-DyaHA9Kk.d.ts} +20 -1
- package/dist/{index-D-lZNlHa.d.ts → index-VAs9akt4.d.ts} +18 -2
- package/dist/{index-DxyyVqzA.d.ts → index-ZaA90u09.d.ts} +1 -0
- package/dist/index.d.ts +45 -14
- package/dist/index.js +93 -17
- package/dist/{list-selection-controller-5L0Nj9tR.js → list-selection-controller-D4iIrvJH.js} +199 -57
- package/dist/list-selection-types-Dnamh2Lu.d.ts +109 -0
- package/dist/{menu-CU9KAm8s.js → menu-BX1FHxY8.js} +16 -1
- package/dist/{menu-item-BUv8An2k.js → menu-item-oxU1VKiJ.js} +34 -9
- package/dist/menu.d.ts +1 -1
- package/dist/menu.js +2 -2
- package/dist/{miller-DUqiUAWQ.js → miller-Be7x4ufN.js} +142 -10
- package/dist/miller.d.ts +1 -1
- package/dist/miller.js +1 -1
- package/dist/narrowed-text.js +1 -1
- package/dist/partial-keys-Ck6CiprB.js +32 -0
- package/dist/sunburst-tree.d.ts +1 -1
- package/dist/sunburst-tree.js +1 -1
- package/dist/{sunbursttree-list-DePuFYlU.d.ts → sunbursttree-list-Bk20giTF.d.ts} +1 -1
- package/dist/{sunbursttree-list-B_M0YTEA.js → sunbursttree-list-DQF6DcsS.js} +1 -1
- package/dist/timeline.d.ts +1 -1
- package/dist/{tree-DAlgvaHB.js → tree-BaXYyt5U.js} +185 -69
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-SAx56U-l.d.ts → vertical-list-DtHX26JO.d.ts} +11 -2
- package/dist/{vertical-list-DyKPKGxK.js → vertical-list-o5hfqH87.js} +54 -19
- package/dist/vertical-list.d.ts +2 -2
- package/dist/vertical-list.js +1 -1
- package/docs-user/README.md +1 -0
- package/docs-user/data-grid.md +10 -3
- package/docs-user/detail-list.md +1 -1
- package/docs-user/grid-list.md +4 -1
- package/docs-user/index.json +6 -2
- package/docs-user/llms.txt +1 -0
- package/docs-user/menu.md +11 -1
- package/docs-user/miller.md +4 -0
- package/docs-user/multicol-list.md +6 -0
- package/docs-user/select-horiz.md +1 -1
- package/docs-user/tree.md +6 -0
- package/docs-user/user-selection-intents.md +86 -0
- package/docs-user/vertical-list.md +9 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
- package/dist/list-selection-types-PjKdhF-a.d.ts +0 -45
- /package/dist/{index-DV3iaUBW.d.ts → index-DV3iaUBW2.d.ts} +0 -0
|
@@ -3,13 +3,14 @@ import { t as themeFallbacks } from "./fallbacks-DQ_5OsmR.js";
|
|
|
3
3
|
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
4
4
|
import "./icon-1gpwtPx8.js";
|
|
5
5
|
import { t as DataController } from "./data-controller-DOlmqNKb.js";
|
|
6
|
-
import { c as createElementListSearchAdapter, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-
|
|
6
|
+
import { c as createElementListSearchAdapter, d as keysOfElements, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-Dc6gYpJG.js";
|
|
7
7
|
import { a as toGroupKey, r as partitionByGroup } from "./grouping-RYPnHkrS.js";
|
|
8
8
|
import { i as animateListItemOut, r as animateListItemIn, t as ListNativeDragController } from "./list-native-drag-controller-CcXoS0YX.js";
|
|
9
|
-
import {
|
|
9
|
+
import { i as ListDragSelectController, n as gestureOf, t as ListSelectionController } from "./list-selection-controller-D4iIrvJH.js";
|
|
10
10
|
import { a as capKeys, d as partitionKeys, l as keysToArray, o as flagsFromRecord } from "./pending-BGidHppL.js";
|
|
11
|
-
import {
|
|
11
|
+
import { i as sameKeySet, n as applyPartialAttributes, r as isPartialKey } from "./partial-keys-Ck6CiprB.js";
|
|
12
12
|
import { t as scrollFadeStyles } from "./scroll-fade-Xx28D7mH.js";
|
|
13
|
+
import { a as restoreElementScroll, o as scrollToOffset, r as captureElementScroll, t as ViewStateController } from "./view-state-controller-BdyXWUUM.js";
|
|
13
14
|
import { n as appearanceColor, t as appearanceAbsent } from "./item-appearance-BjcMyauw.js";
|
|
14
15
|
import "./list-group-header.js";
|
|
15
16
|
import { LitElement, css, html, nothing, render } from "lit";
|
|
@@ -332,6 +333,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
332
333
|
interactionMode: this.interactionMode
|
|
333
334
|
}),
|
|
334
335
|
getKey: keyForElement,
|
|
336
|
+
onIntent: (intent) => this._dispatchCancelable(`list-select-intent`, intent) === false,
|
|
335
337
|
getGroupKey: (el) => this.#groupIndex.get(el) ?? null,
|
|
336
338
|
crossGroupSelection: () => this.crossGroupSelection,
|
|
337
339
|
getFallbackGroupKey: () => {
|
|
@@ -343,7 +345,8 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
343
345
|
this._dispatch(`list-select`, {
|
|
344
346
|
selected,
|
|
345
347
|
previous,
|
|
346
|
-
selectedKeys: this.selection.selectedKeys
|
|
348
|
+
selectedKeys: this.selection.selectedKeys,
|
|
349
|
+
previousKeys: keysOfElements(previous)
|
|
347
350
|
});
|
|
348
351
|
this.#viewState.notify();
|
|
349
352
|
}
|
|
@@ -436,6 +439,8 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
436
439
|
getLabel: (el) => el.getAttribute(`data-search-label`) ?? el.textContent?.trim() ?? ``,
|
|
437
440
|
highlightKey: SEARCH_HIGHLIGHT_KEY
|
|
438
441
|
}) });
|
|
442
|
+
this.#partialKeys = /* @__PURE__ */ new Set();
|
|
443
|
+
this.#markedPartial = /* @__PURE__ */ new Set();
|
|
439
444
|
this.#onListScroll = () => {
|
|
440
445
|
if (!this.#viewState.pendingScroll) this.#viewState.notify();
|
|
441
446
|
if (this.#viewportScrollRaf !== 0) return;
|
|
@@ -459,7 +464,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
459
464
|
if ((e.ctrlKey || e.metaKey) && e.key === `a`) {
|
|
460
465
|
if (this.selection.canSelectAll()) {
|
|
461
466
|
e.preventDefault();
|
|
462
|
-
this.selection.selectAll();
|
|
467
|
+
this.selection.selectAll(`keyboard`);
|
|
463
468
|
}
|
|
464
469
|
return;
|
|
465
470
|
}
|
|
@@ -468,17 +473,17 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
468
473
|
case `ArrowDown`:
|
|
469
474
|
e.preventDefault();
|
|
470
475
|
this.#navigateDown();
|
|
471
|
-
if (e.shiftKey && this.interactionMode === `vscode`) {
|
|
476
|
+
if (e.shiftKey && (this.interactionMode === `vscode` || this.interactionMode === `manual`)) {
|
|
472
477
|
const cur = this.tickled.tickledId;
|
|
473
|
-
if (cur) this.selection.
|
|
478
|
+
if (cur) this.selection.handleExtend(cur);
|
|
474
479
|
}
|
|
475
480
|
break;
|
|
476
481
|
case `ArrowUp`:
|
|
477
482
|
e.preventDefault();
|
|
478
483
|
this.#navigateUp();
|
|
479
|
-
if (e.shiftKey && this.interactionMode === `vscode`) {
|
|
484
|
+
if (e.shiftKey && (this.interactionMode === `vscode` || this.interactionMode === `manual`)) {
|
|
480
485
|
const cur = this.tickled.tickledId;
|
|
481
|
-
if (cur) this.selection.
|
|
486
|
+
if (cur) this.selection.handleExtend(cur);
|
|
482
487
|
}
|
|
483
488
|
break;
|
|
484
489
|
case `ArrowRight`:
|
|
@@ -502,7 +507,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
502
507
|
if (id) {
|
|
503
508
|
e.preventDefault();
|
|
504
509
|
this._dispatch(`list-item-click`, { item: id });
|
|
505
|
-
this._activateItem(id);
|
|
510
|
+
this._activateItem(id, `keyboard`);
|
|
506
511
|
}
|
|
507
512
|
break;
|
|
508
513
|
}
|
|
@@ -514,7 +519,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
514
519
|
}
|
|
515
520
|
break;
|
|
516
521
|
}
|
|
517
|
-
case `Escape`: this.selection.
|
|
522
|
+
case `Escape`: this.selection.handleClear(`keyboard`);
|
|
518
523
|
}
|
|
519
524
|
};
|
|
520
525
|
this._onClick = (e) => {
|
|
@@ -529,7 +534,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
529
534
|
if (!item) return;
|
|
530
535
|
this.focus();
|
|
531
536
|
this._dispatch(`list-item-click`, { item });
|
|
532
|
-
this.selection.handleClick(item, e);
|
|
537
|
+
this.selection.handleClick(item, gestureOf(e));
|
|
533
538
|
};
|
|
534
539
|
this._onDblClick = (e) => {
|
|
535
540
|
const item = this._findListItem(e.composedPath());
|
|
@@ -1807,7 +1812,41 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1807
1812
|
this.#appliedSelected = new Set(selected);
|
|
1808
1813
|
this.#appliedChecked = checked;
|
|
1809
1814
|
if (this.dataset.inputMode !== this.tickled.inputMode) this.dataset.inputMode = this.tickled.inputMode;
|
|
1810
|
-
if (selectionChanged)
|
|
1815
|
+
if (selectionChanged) {
|
|
1816
|
+
this.#syncPartial();
|
|
1817
|
+
this._syncCheckboxes();
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
#partialKeys;
|
|
1821
|
+
/** Rows currently carrying `data-partial`. */
|
|
1822
|
+
#markedPartial;
|
|
1823
|
+
/**
|
|
1824
|
+
* Rows shown as *partially* selected (a part of the resource is selected):
|
|
1825
|
+
* `data-partial`, an indeterminate checkbox in `checked` mode, and an
|
|
1826
|
+
* accessible description. Independent of `selectedKeys` — a key in both
|
|
1827
|
+
* counts as selected. Replace-on-set.
|
|
1828
|
+
*/
|
|
1829
|
+
get partialKeys() {
|
|
1830
|
+
return this.#partialKeys;
|
|
1831
|
+
}
|
|
1832
|
+
set partialKeys(keys) {
|
|
1833
|
+
const next = new Set(keys);
|
|
1834
|
+
if (sameKeySet(next, this.#partialKeys)) return;
|
|
1835
|
+
this.#partialKeys = next;
|
|
1836
|
+
this.#itemStatesFullSync = true;
|
|
1837
|
+
this._syncItemStates();
|
|
1838
|
+
}
|
|
1839
|
+
/** Touch only the rows whose partial state changed: O(partial keys), not O(rows). */
|
|
1840
|
+
#syncPartial() {
|
|
1841
|
+
const selected = this.selection.selected;
|
|
1842
|
+
const next = /* @__PURE__ */ new Set();
|
|
1843
|
+
for (const key of this.#partialKeys) {
|
|
1844
|
+
const el = this.#itemForKey(key);
|
|
1845
|
+
if (el && isPartialKey(key, this.#partialKeys, selected.has(el))) next.add(el);
|
|
1846
|
+
}
|
|
1847
|
+
for (const el of this.#markedPartial) if (!next.has(el)) applyPartialAttributes(el, false);
|
|
1848
|
+
for (const el of next) if (!this.#markedPartial.has(el)) applyPartialAttributes(el, true);
|
|
1849
|
+
this.#markedPartial = next;
|
|
1811
1850
|
}
|
|
1812
1851
|
_syncCheckboxes() {
|
|
1813
1852
|
const inCheckedMode = this.interactionMode === `checked`;
|
|
@@ -1837,16 +1876,22 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1837
1876
|
el.prepend(cb);
|
|
1838
1877
|
}
|
|
1839
1878
|
const checked = this.selection.selected.has(el);
|
|
1879
|
+
const partial = isPartialKey(keyForElement(el), this.#partialKeys, checked);
|
|
1840
1880
|
if (wantsCustom) {
|
|
1841
|
-
cb.setAttribute(`aria-checked`, String(checked));
|
|
1881
|
+
cb.setAttribute(`aria-checked`, partial ? `mixed` : String(checked));
|
|
1842
1882
|
cb.toggleAttribute(`data-checked`, checked);
|
|
1883
|
+
cb.toggleAttribute(`data-partial`, partial);
|
|
1843
1884
|
if (this.checkboxRenderer) {
|
|
1844
1885
|
const renderer = typeof this.checkboxRenderer === `function` ? this.checkboxRenderer : this.checkboxRenderer.renderer;
|
|
1845
1886
|
render(renderer(checked), cb);
|
|
1846
1887
|
}
|
|
1847
1888
|
} else {
|
|
1848
1889
|
const input = cb.querySelector(`input.ixfx-list-checkbox`);
|
|
1849
|
-
if (input)
|
|
1890
|
+
if (input) {
|
|
1891
|
+
input.checked = checked;
|
|
1892
|
+
input.indeterminate = partial;
|
|
1893
|
+
}
|
|
1894
|
+
cb.setAttribute(`aria-checked`, partial ? `mixed` : String(checked));
|
|
1850
1895
|
}
|
|
1851
1896
|
}
|
|
1852
1897
|
}
|
|
@@ -1865,7 +1910,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1865
1910
|
cell.setAttribute(`part`, `checkbox`);
|
|
1866
1911
|
cell.addEventListener(`click`, (e) => {
|
|
1867
1912
|
e.stopPropagation();
|
|
1868
|
-
this.selection.
|
|
1913
|
+
this.selection.handleCheckbox(el);
|
|
1869
1914
|
});
|
|
1870
1915
|
const input = document.createElement(`input`);
|
|
1871
1916
|
input.type = `checkbox`;
|
|
@@ -1884,7 +1929,7 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1884
1929
|
span.setAttribute(`part`, `checkbox`);
|
|
1885
1930
|
span.addEventListener(`click`, (e) => {
|
|
1886
1931
|
e.stopPropagation();
|
|
1887
|
-
this.selection.
|
|
1932
|
+
this.selection.handleCheckbox(el);
|
|
1888
1933
|
});
|
|
1889
1934
|
return span;
|
|
1890
1935
|
}
|
|
@@ -1949,8 +1994,8 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1949
1994
|
visibleKeys
|
|
1950
1995
|
});
|
|
1951
1996
|
}
|
|
1952
|
-
_activateItem(item) {
|
|
1953
|
-
|
|
1997
|
+
_activateItem(item, source = `pointer`) {
|
|
1998
|
+
this.selection.handleReplace(item, source);
|
|
1954
1999
|
this._dispatch(`list-activate`, { item });
|
|
1955
2000
|
}
|
|
1956
2001
|
static {
|
|
@@ -2070,6 +2115,13 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
2070
2115
|
outline: 1px solid transparent;
|
|
2071
2116
|
}
|
|
2072
2117
|
|
|
2118
|
+
/* Partially selected: a dashed edge, lighter than a full selection. Hook: --item-bg-partial. */
|
|
2119
|
+
::slotted([data-partial]) {
|
|
2120
|
+
background: var(--item-bg-partial, color-mix(in srgb, var(--item-bg-selected) 35%, transparent));
|
|
2121
|
+
outline: 1px dashed var(--item-border-partial, var(--border));
|
|
2122
|
+
outline-offset: -1px;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2073
2125
|
::slotted([data-selected][data-tickled]) {
|
|
2074
2126
|
background: var(--item-bg-selected-tickled);
|
|
2075
2127
|
outline: 2px dashed var(--surface-3);
|
package/dist/detail-list.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as ListNativeDragStartDetail, F as ListDragPreview, I as ListDragPreviewContext, L as ListDragPreviewRenderer, P as ListDragEntry, V as ListNativeDragStartEvent, z as ListDragSource } from "./tree-component-DgfkxmVY.js";
|
|
2
2
|
import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
|
|
3
3
|
import { i as ListGroupChangeEvent, l as ListGroupToggleDetail, n as ListGroupBy, o as ListGroupInfo, r as ListGroupChangeDetail, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
|
|
4
|
-
import { a as DetailSortComparator, c as DetailListViewState, i as DetailGroupBy, n as DetailListElementEventMap, o as DetailSortItem, r as DetailFormatter, s as DetailSortMode, t as DetailListElement } from "./detail-list-
|
|
5
|
-
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-
|
|
4
|
+
import { a as DetailSortComparator, c as DetailListViewState, i as DetailGroupBy, n as DetailListElementEventMap, o as DetailSortItem, r as DetailFormatter, s as DetailSortMode, t as DetailListElement } from "./detail-list-n1MbNbhF.js";
|
|
5
|
+
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-DtHX26JO.js";
|
|
6
6
|
export { type AddItemOptions, type CustomCheckboxOptions, type DetailFormatter, type DetailGroupBy, DetailListElement, DetailListElementEventMap, type DetailListViewState, type DetailSortComparator, type DetailSortItem, type DetailSortMode, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListGroupBy, type ListGroupChangeDetail, type ListGroupChangeEvent, type ListGroupInfo, type ListGroupLabel, type ListGroupToggleDetail, type ListGroupToggleEvent, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListViewportChangeDetail, type ListViewportChangeEvent };
|
package/dist/detail-list.js
CHANGED
|
@@ -4,8 +4,8 @@ import { o as TreeNode, r as TreeFilterPredicate, t as LoadChildrenCallback } fr
|
|
|
4
4
|
import { a as ViewStateBase, t as GetViewStateOptions } from "./types-LU1u0CB8.js";
|
|
5
5
|
import "./index-9ttcdwlL.js";
|
|
6
6
|
import "./crumb-navigation-BbqfmkYs.js";
|
|
7
|
-
import {
|
|
8
|
-
import { r as VerticalListElement } from "./vertical-list-
|
|
7
|
+
import { h as ListSelectionMode, i as ListInteractionMode } from "./list-selection-types-Dnamh2Lu.js";
|
|
8
|
+
import { r as VerticalListElement } from "./vertical-list-DtHX26JO.js";
|
|
9
9
|
import { LitElement, PropertyValues } from "lit";
|
|
10
10
|
//#region src/flat-list/types.d.ts
|
|
11
11
|
/** How branches and leaves are ordered within one level. */
|
|
@@ -121,6 +121,11 @@ declare class FlatListElement extends LitElement {
|
|
|
121
121
|
branchOrder: FlatListBranchOrder;
|
|
122
122
|
selectionMode: ListSelectionMode;
|
|
123
123
|
interactionMode: ListInteractionMode;
|
|
124
|
+
/**
|
|
125
|
+
* Row keys shown as *partially* selected (see `ixfx-vertical-list`'s
|
|
126
|
+
* `partialKeys`). Independent of the selection; a key in both counts as selected.
|
|
127
|
+
*/
|
|
128
|
+
partialKeys: ReadonlySet<string>;
|
|
124
129
|
itemWrap: `stop` | `wrap`;
|
|
125
130
|
searchModes: string | undefined;
|
|
126
131
|
itemsDraggable: boolean;
|
package/dist/flat-list.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as FlatListSelectEvent, a as FlatListContextMenuDetail, c as FlatListDropEvent, d as FlatListEditCommitDetail, f as FlatListEditCommitEvent, g as FlatListSelectDetail, h as FlatListNavigateEvent, i as FlatListBranchOrder, l as FlatListEditCancelDetail, m as FlatListNavigateDetail, n as FlatListActivateDetail, o as FlatListContextMenuEvent, p as FlatListElementEventMap, r as FlatListActivateEvent, s as FlatListDropDetail, t as FlatListElement, u as FlatListEditCancelEvent, v as FlatListViewState } from "./flat-list-
|
|
1
|
+
import { _ as FlatListSelectEvent, a as FlatListContextMenuDetail, c as FlatListDropEvent, d as FlatListEditCommitDetail, f as FlatListEditCommitEvent, g as FlatListSelectDetail, h as FlatListNavigateEvent, i as FlatListBranchOrder, l as FlatListEditCancelDetail, m as FlatListNavigateDetail, n as FlatListActivateDetail, o as FlatListContextMenuEvent, p as FlatListElementEventMap, r as FlatListActivateEvent, s as FlatListDropDetail, t as FlatListElement, u as FlatListEditCancelEvent, v as FlatListViewState } from "./flat-list-D_4y3wgn.js";
|
|
2
2
|
export { type FlatListActivateDetail, type FlatListActivateEvent, type FlatListBranchOrder, type FlatListContextMenuDetail, type FlatListContextMenuEvent, type FlatListDropDetail, type FlatListDropEvent, type FlatListEditCancelDetail, type FlatListEditCancelEvent, type FlatListEditCommitDetail, type FlatListEditCommitEvent, FlatListElement, type FlatListElementEventMap, type FlatListNavigateDetail, type FlatListNavigateEvent, type FlatListSelectDetail, type FlatListSelectEvent, type FlatListViewState };
|
package/dist/flat-list.js
CHANGED
|
@@ -4,9 +4,9 @@ import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js"
|
|
|
4
4
|
import "./icon-1gpwtPx8.js";
|
|
5
5
|
import { t as collectDataResult } from "./data-provider-35TyWclX.js";
|
|
6
6
|
import { t as ViewStateController } from "./view-state-controller-BdyXWUUM.js";
|
|
7
|
-
import { n as resolveKeyPath } from "./crumb-navigation-
|
|
7
|
+
import { n as resolveKeyPath } from "./crumb-navigation-D3ndPgFg.js";
|
|
8
8
|
import { n as appearanceColor, t as appearanceAbsent } from "./item-appearance-BjcMyauw.js";
|
|
9
|
-
import "./vertical-list-
|
|
9
|
+
import "./vertical-list-o5hfqH87.js";
|
|
10
10
|
import { LitElement, css, html, nothing } from "lit";
|
|
11
11
|
import { property, state } from "lit/decorators.js";
|
|
12
12
|
//#region src/flat-list/flat-list.ts
|
|
@@ -73,6 +73,7 @@ let FlatListElement = class FlatListElement extends LitElement {
|
|
|
73
73
|
this.branchOrder = `first`;
|
|
74
74
|
this.selectionMode = `single`;
|
|
75
75
|
this.interactionMode = `standard`;
|
|
76
|
+
this.partialKeys = /* @__PURE__ */ new Set();
|
|
76
77
|
this.itemWrap = `stop`;
|
|
77
78
|
this.itemsDraggable = false;
|
|
78
79
|
this.itemsDroppable = false;
|
|
@@ -597,6 +598,7 @@ let FlatListElement = class FlatListElement extends LitElement {
|
|
|
597
598
|
key-property="key"
|
|
598
599
|
.selectionMode=${this.selectionMode}
|
|
599
600
|
.interactionMode=${this.interactionMode}
|
|
601
|
+
.partialKeys=${this.partialKeys}
|
|
600
602
|
.itemWrap=${this.itemWrap}
|
|
601
603
|
.searchModes=${this.searchModes}
|
|
602
604
|
?items-draggable=${this.itemsDraggable}
|
|
@@ -742,6 +744,7 @@ __decorate([property({
|
|
|
742
744
|
type: String,
|
|
743
745
|
attribute: `interaction-mode`
|
|
744
746
|
})], FlatListElement.prototype, "interactionMode", void 0);
|
|
747
|
+
__decorate([property({ attribute: false })], FlatListElement.prototype, "partialKeys", void 0);
|
|
745
748
|
__decorate([property({
|
|
746
749
|
type: String,
|
|
747
750
|
attribute: `item-wrap`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { L as ListDragPreviewRenderer, R as ListDragPreviewSourceResolver, V as ListNativeDragStartEvent } from "./tree-component-DgfkxmVY.js";
|
|
2
2
|
import { a as ViewStateBase, t as GetViewStateOptions } from "./types-LU1u0CB8.js";
|
|
3
3
|
import "./index-9ttcdwlL.js";
|
|
4
|
-
import {
|
|
4
|
+
import { h as ListSelectionMode, i as ListInteractionMode, p as ListSelectIntentSource, s as ListMarqueeMode, u as ListSelectIntentDetail } from "./list-selection-types-Dnamh2Lu.js";
|
|
5
|
+
import { S as ListSearchController } from "./index-Bm9a9S3_.js";
|
|
5
6
|
import "./pan-text-CoYmt2qd.js";
|
|
6
7
|
import { i as ListGroupChangeEvent, n as ListGroupBy, o as ListGroupInfo, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
|
|
7
|
-
import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
|
|
8
8
|
import "./list-group-header.js";
|
|
9
9
|
import "./list-native-drag-controller-D_UrXipS.js";
|
|
10
10
|
import { i as TickledItem, n as TickledController } from "./tickled-controller-DodxD3eQ.js";
|
|
@@ -86,10 +86,13 @@ type ListDragSelectControllerConfig<T> = {
|
|
|
86
86
|
/**
|
|
87
87
|
* Fired once on release with the final set. Host applies it to its
|
|
88
88
|
* selection. `additive` is `true` when the drag ran with Shift (add) or
|
|
89
|
-
* Cmd / Ctrl (invert) held.
|
|
89
|
+
* Cmd / Ctrl (invert) held. `covered` is the set the marquee itself hit,
|
|
90
|
+
* before combining with the base selection.
|
|
90
91
|
*/
|
|
91
92
|
onCommit: (finalSet: ReadonlySet<T>, info: {
|
|
92
93
|
additive: boolean;
|
|
94
|
+
covered: ReadonlySet<T>;
|
|
95
|
+
mode: ListMarqueeMode;
|
|
93
96
|
}) => void;
|
|
94
97
|
/** Optional: scroll the surface when the pointer nears an edge during a drag. */
|
|
95
98
|
autoScroll?: (dx: number, dy: number) => void;
|
|
@@ -133,7 +136,11 @@ type ListSelectionGesture = {
|
|
|
133
136
|
readonly ctrlKey: boolean;
|
|
134
137
|
readonly metaKey: boolean;
|
|
135
138
|
readonly shiftKey: boolean;
|
|
139
|
+
/** `PointerEvent.pointerType`, when known; a `touch` tap reports source `touch`. */
|
|
140
|
+
readonly pointerType?: string;
|
|
136
141
|
};
|
|
142
|
+
/** Capture the modifier / pointer-type state of a click for `handleClick`. */
|
|
143
|
+
declare function gestureOf(e: MouseEvent): ListSelectionGesture;
|
|
137
144
|
type ListSelectionModes = {
|
|
138
145
|
readonly selectionMode: ListSelectionMode;
|
|
139
146
|
readonly interactionMode: ListInteractionMode;
|
|
@@ -157,6 +164,13 @@ type ListSelectionControllerConfig<T> = {
|
|
|
157
164
|
* requests an update.
|
|
158
165
|
*/
|
|
159
166
|
readonly onChange: (selected: ReadonlySet<T>, previous: ReadonlySet<T>) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Optional: called with the intent behind a gesture (or `selectAll()`)
|
|
169
|
+
* before the selection changes. Return `true` when the caller took over
|
|
170
|
+
* (`preventDefault()`); the controller then leaves the selection alone but
|
|
171
|
+
* still moves the range anchor.
|
|
172
|
+
*/
|
|
173
|
+
readonly onIntent?: (intent: ListSelectIntentDetail) => boolean;
|
|
160
174
|
/**
|
|
161
175
|
* Optional: derive a stable string key for an item. Enables `selectedKeys`
|
|
162
176
|
* and `selectKeys()`. When omitted, `selectedKeys` is always empty.
|
|
@@ -225,8 +239,11 @@ declare class ListSelectionController<T> {
|
|
|
225
239
|
rangeTo(item: T): void;
|
|
226
240
|
/** Clear the selection. No change event when the selection is already empty. */
|
|
227
241
|
clear(): void;
|
|
228
|
-
/**
|
|
229
|
-
|
|
242
|
+
/**
|
|
243
|
+
* Select every ordered item that passes `isSelectable`. Fires an `all`
|
|
244
|
+
* intent first; the caller may take over.
|
|
245
|
+
*/
|
|
246
|
+
selectAll(source?: ListSelectIntentSource): void;
|
|
230
247
|
/**
|
|
231
248
|
* Replace the selection with many items at once. Requires
|
|
232
249
|
* `selectionMode="multiple"`, throws otherwise. Updates the anchor.
|
|
@@ -248,24 +265,30 @@ declare class ListSelectionController<T> {
|
|
|
248
265
|
* non-empty selection (e.g. a Cmd-drag that toggles everything off) but is
|
|
249
266
|
* a no-op when nothing is selected.
|
|
250
267
|
*/
|
|
251
|
-
applyDragSelection(items: Iterable<T
|
|
268
|
+
applyDragSelection(items: Iterable<T>, info?: {
|
|
269
|
+
additive: boolean;
|
|
270
|
+
covered: Iterable<T>;
|
|
271
|
+
mode?: ListMarqueeMode;
|
|
272
|
+
}): void;
|
|
252
273
|
/** Remove a single item from the selection. */
|
|
253
274
|
deselect(item: T): void;
|
|
254
275
|
/**
|
|
255
276
|
* Replace the selection with the items resolved from `keys`. Keys that
|
|
256
|
-
* `resolve` cannot map
|
|
257
|
-
*
|
|
258
|
-
*
|
|
277
|
+
* `resolve` cannot map yet are kept pending and selected when their items
|
|
278
|
+
* appear (see `resolvePending()`); keys that resolve to a non-selectable
|
|
279
|
+
* item are ignored. `selectionMode="none"` is a no-op. When multi-select is
|
|
280
|
+
* not available, only the last key is kept. `onChange` fires once.
|
|
259
281
|
*/
|
|
260
282
|
selectKeys(keys: Iterable<string>, resolve: (key: string) => T | undefined): void;
|
|
261
283
|
/**
|
|
262
284
|
* Add the items resolved from `keys` to the selection (multi-select only;
|
|
263
|
-
* a no-op otherwise).
|
|
285
|
+
* a no-op otherwise). Keys not present yet are kept pending. `onChange`
|
|
286
|
+
* fires once if anything changed.
|
|
264
287
|
*/
|
|
265
288
|
addKeys(keys: Iterable<string>, resolve: (key: string) => T | undefined): void;
|
|
266
289
|
/**
|
|
267
|
-
* Remove the items resolved from `keys` from the selection
|
|
268
|
-
* fires once if anything changed.
|
|
290
|
+
* Remove the items resolved from `keys` from the selection, and drop them
|
|
291
|
+
* from the pending keys. `onChange` fires once if anything changed.
|
|
269
292
|
*/
|
|
270
293
|
removeKeys(keys: Iterable<string>, resolve: (key: string) => T | undefined): void;
|
|
271
294
|
/** Selected keys waiting for their items to appear. */
|
|
@@ -291,10 +314,25 @@ declare class ListSelectionController<T> {
|
|
|
291
314
|
demote(items: Iterable<T>): boolean;
|
|
292
315
|
/** Drop pending keys without touching the live selection. */
|
|
293
316
|
clearPending(): void;
|
|
294
|
-
/**
|
|
317
|
+
/**
|
|
318
|
+
* Route a click on `item` according to the current interaction mode. In
|
|
319
|
+
* `manual` mode nothing is selected, but the intent is still reported so
|
|
320
|
+
* the caller can apply it.
|
|
321
|
+
*/
|
|
295
322
|
handleClick(item: T, gesture: ListSelectionGesture): void;
|
|
296
323
|
/** Route a Space keypress on `item` according to the current interaction mode. */
|
|
297
324
|
handleSpace(item: T): void;
|
|
325
|
+
/** Route a checkbox (checked-mode) toggle on `item`. */
|
|
326
|
+
handleCheckbox(item: T, source?: ListSelectIntentSource): void;
|
|
327
|
+
/** Route a plain "select only this" gesture (Enter, double-click) on `item`. */
|
|
328
|
+
handleReplace(item: T, source?: ListSelectIntentSource): void;
|
|
329
|
+
/** Route Shift+Arrow: extend the range from the anchor to the cursor `item`. */
|
|
330
|
+
handleExtend(item: T): void;
|
|
331
|
+
/**
|
|
332
|
+
* Route Escape / empty-space click: clear the selection. `reportOnly`
|
|
333
|
+
* suppresses the default action in `manual` mode (the caller owns it).
|
|
334
|
+
*/
|
|
335
|
+
handleClear(source?: ListSelectIntentSource, reportOnly?: boolean): void;
|
|
298
336
|
/** Drop the range-selection anchor (e.g. when the interaction mode changes). */
|
|
299
337
|
clearAnchor(): void;
|
|
300
338
|
/**
|
|
@@ -773,6 +811,14 @@ declare class GridListElement<T = unknown> extends LitElement {
|
|
|
773
811
|
* Auto-assigned keyless-item keys are omitted.
|
|
774
812
|
*/
|
|
775
813
|
visibleKeys(): string[];
|
|
814
|
+
/**
|
|
815
|
+
* Cells shown as *partially* selected (a part of the resource is selected):
|
|
816
|
+
* `data-partial` / `part="item partial"` and an accessible description.
|
|
817
|
+
* Independent of `selectedKeys` — a key in both counts as selected.
|
|
818
|
+
* Replace-on-set; keys without a cell are kept for when it appears.
|
|
819
|
+
*/
|
|
820
|
+
get partialKeys(): ReadonlySet<string>;
|
|
821
|
+
set partialKeys(keys: Iterable<string>);
|
|
776
822
|
/**
|
|
777
823
|
* Mirror cursor / selection onto the light-DOM items as `data-tickled` /
|
|
778
824
|
* `data-selected`. Only the items whose state changed are touched, so a
|
|
@@ -795,4 +841,4 @@ interface GridListElement {
|
|
|
795
841
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
796
842
|
}
|
|
797
843
|
//#endregion
|
|
798
|
-
export {
|
|
844
|
+
export { gestureOf as A, capFlags as B, TreeKeyboardNavController as C, ListSelectionControllerConfig as D, ListSelectionController as E, EMPTY_FLAGS as F, keysToArray as G, flagsFromRecord as H, EMPTY_KEYS as I, withoutFlag as J, partitionFlags as K, MAX_PENDING_KEYS as L, DragSelectRect as M, ListDragSelectController as N, ListSelectionGesture as O, ListDragSelectControllerConfig as P, PendingFlags as R, TreeKeyboardNavCallbacks as S, TreeKeyboardNavItemId as T, flagsToRecord as U, capKeys as V, keysAsFlags as W, GridListSelectEvent as _, GridListCaptionAlign as a, GridListViewportChangeDetail as b, GridListCaptionStyle as c, GridListFullElementEventMap as d, GridListItemClickDetail as f, GridListSelectDetail as g, GridListOrientation as h, GridListActivateEvent as i, isMultiMode as j, ListSelectionModes as k, GridListDataAdapter as l, GridListItemEventDetail as m, GridListViewState as n, GridListCaptionBackdrop as o, GridListItemClickEvent as p, partitionKeys as q, GridListActivateDetail as r, GridListCaptionPosition as s, GridListElement as t, GridListElementEventMap as u, GridListTickleDetail as v, TreeKeyboardNavControllerConfig as w, GridListViewportChangeEvent as x, GridListTickleEvent as y, PendingKeys as z };
|