@ixfx/components 0.16.0 → 0.16.1
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 +74 -10
- package/bundle/index.js +258 -228
- package/dist/ac-token.js +1 -1
- package/dist/{data-grid-rMkLX2qo.js → data-grid-Cqxuwgbb.js} +22 -4
- package/dist/{data-grid-CIG2DVip.d.ts → data-grid-Csh5EJW9.d.ts} +11 -2
- package/dist/data-grid.d.ts +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{detail-list-C4pDSoI8.js → detail-list-Bo5ze3SN.js} +16 -2
- package/dist/{detail-list-6iMTNP4N.d.ts → detail-list-DSZ1DDor.d.ts} +16 -2
- package/dist/detail-list.d.ts +2 -2
- package/dist/detail-list.js +1 -1
- package/dist/{flat-list-JPgQSmLW.d.ts → flat-list-CT9kX3TQ.d.ts} +1 -1
- package/dist/flat-list.d.ts +1 -1
- package/dist/flat-list.js +1 -1
- package/dist/{grid-list-CdEkScn-.js → grid-list-D0dJNVEF.js} +2 -1
- package/dist/{grid-list-D6n7WH8l.d.ts → grid-list-DDLrWRxm.d.ts} +1 -1
- package/dist/grid-list.d.ts +1 -1
- package/dist/grid-list.js +1 -1
- package/dist/{incr-search-JIhwB49y.js → incr-search-CgbL-OlS.js} +140 -10
- package/dist/incr-search.d.ts +1 -1
- package/dist/incr-search.js +1 -1
- package/dist/{index-CYRc6Dah.d.ts → index-Bnm-kKGC.d.ts} +1 -1
- package/dist/{index-Dr80Zdl6.d.ts → index-CUErGhCg.d.ts} +30 -3
- package/dist/{index-Bx0BXPxI.d.ts → index-D-lZNlHa.d.ts} +1 -1
- package/dist/index.d.ts +21 -12
- package/dist/index.js +51 -29
- package/dist/{miller-BFRfn0ve.js → miller-DUqiUAWQ.js} +1 -8
- package/dist/miller.d.ts +1 -1
- package/dist/miller.js +1 -1
- package/dist/narrowed-text.js +1 -1
- package/dist/sunburst-tree.d.ts +1 -1
- package/dist/sunburst-tree.js +1 -1
- package/dist/{sunbursttree-list-B_VxOHlo.js → sunbursttree-list-B_M0YTEA.js} +1 -1
- package/dist/{sunbursttree-list-D6j5BxVQ.d.ts → sunbursttree-list-DePuFYlU.d.ts} +1 -1
- package/dist/{tree-Crdpl4nc.js → tree-DAlgvaHB.js} +1 -1
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-1V1Vg2O5.js → vertical-list-DyKPKGxK.js} +1 -1
- package/dist/{vertical-list-BPDmZx6T.d.ts → vertical-list-SAx56U-l.d.ts} +1 -1
- package/dist/vertical-list.d.ts +1 -1
- package/dist/vertical-list.js +1 -1
- package/docs-user/data-grid.md +13 -4
- package/docs-user/detail-list.md +15 -0
- package/docs-user/dock.md +12 -3
- package/docs-user/grid-list.md +5 -2
- package/docs-user/index.json +2 -2
- package/package.json +2 -2
package/dist/ac-token.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as themeFallbacks } from "./fallbacks-DQ_5OsmR.js";
|
|
|
4
4
|
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
5
5
|
import "./icon-1gpwtPx8.js";
|
|
6
6
|
import { t as DataController } from "./data-controller-DOlmqNKb.js";
|
|
7
|
-
import { m as createAcCompletionProvider } from "./incr-search-
|
|
7
|
+
import { m as createAcCompletionProvider } from "./incr-search-CgbL-OlS.js";
|
|
8
8
|
import { LitElement, css, html, nothing } from "lit";
|
|
9
9
|
import { property, state } from "lit/decorators.js";
|
|
10
10
|
import { styleMap } from "lit/directives/style-map.js";
|
|
@@ -3,7 +3,7 @@ import { n as tickledStyles, t as tickledItemStyles } from "./tickled-styles-BrA
|
|
|
3
3
|
import { t as themeFallbacks } from "./fallbacks-DQ_5OsmR.js";
|
|
4
4
|
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
5
5
|
import "./icon-1gpwtPx8.js";
|
|
6
|
-
import { i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES } from "./incr-search-
|
|
6
|
+
import { i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES } from "./incr-search-CgbL-OlS.js";
|
|
7
7
|
import { t as handleStyles } from "./handle-DAXs7kbJ.js";
|
|
8
8
|
import { a as listItemFadeKeyframes, t as ListNativeDragController } from "./list-native-drag-controller-CcXoS0YX.js";
|
|
9
9
|
import { a as capKeys, l as keysToArray, n as EMPTY_KEYS, o as flagsFromRecord, r as MAX_PENDING_KEYS } from "./pending-BGidHppL.js";
|
|
@@ -253,6 +253,8 @@ function attachShiftWheel(getScroller) {
|
|
|
253
253
|
}
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region src/data-grid/data-grid.ts
|
|
256
|
+
/** `CSS.highlights` key for incremental-search matches, styled in `listSearchStyles`. */
|
|
257
|
+
const SEARCH_HIGHLIGHT_KEY = `data-grid-search`;
|
|
256
258
|
const EMPTY_CELL_LOOK = {
|
|
257
259
|
textColor: void 0,
|
|
258
260
|
icon: void 0,
|
|
@@ -298,6 +300,7 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
298
300
|
this.textColorColumn = ``;
|
|
299
301
|
this.iconColumn = ``;
|
|
300
302
|
this.badgeColumn = ``;
|
|
303
|
+
this.searchColumn = ``;
|
|
301
304
|
this.itemsDraggable = false;
|
|
302
305
|
this.columnButtonIcon = `ellipsis`;
|
|
303
306
|
this._columnFormatters = /* @__PURE__ */ new Map();
|
|
@@ -702,8 +705,13 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
702
705
|
}
|
|
703
706
|
#rowSearchText(row) {
|
|
704
707
|
if (this.rowSearchText) return this.rowSearchText(row);
|
|
705
|
-
const
|
|
706
|
-
|
|
708
|
+
const col = this.#searchColumn();
|
|
709
|
+
if (col === void 0) return ``;
|
|
710
|
+
const value = this._formatValue(row[col.key], col, row);
|
|
711
|
+
return typeof value === `string` || typeof value === `number` ? String(value) : ``;
|
|
712
|
+
}
|
|
713
|
+
#searchColumn() {
|
|
714
|
+
return (this.searchColumn === `` ? void 0 : this._visibleColumns.find((c) => c.key === this.searchColumn)) ?? this._visibleColumns[0];
|
|
707
715
|
}
|
|
708
716
|
#createSearchAdapter() {
|
|
709
717
|
return {
|
|
@@ -727,7 +735,12 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
727
735
|
const k = this.#searchKeyByRow.get(row);
|
|
728
736
|
return k === void 0 || matched.has(k);
|
|
729
737
|
};
|
|
730
|
-
}
|
|
738
|
+
},
|
|
739
|
+
highlightRoot: () => this.rowSearchText ? void 0 : this.renderRoot,
|
|
740
|
+
highlightSelector: `.row .cell`,
|
|
741
|
+
highlightKeyOf: (el) => el.getAttribute(`data-col`) === this.#searchColumn()?.key ? el.closest(`.row`)?.getAttribute(`data-key`) ?? void 0 : void 0,
|
|
742
|
+
highlightText: (el) => Array.from(el.childNodes, (n) => n.nodeType === Node.TEXT_NODE ? n.textContent : ``).join(``),
|
|
743
|
+
highlightKey: SEARCH_HIGHLIGHT_KEY
|
|
731
744
|
};
|
|
732
745
|
}
|
|
733
746
|
#effectiveSearchModes() {
|
|
@@ -847,6 +860,7 @@ let DataGridElement = class DataGridElement extends LitElement {
|
|
|
847
860
|
updated(changed) {
|
|
848
861
|
super.updated(changed);
|
|
849
862
|
this.#viewState.applyPendingScroll((s) => this.#applyScroll(s));
|
|
863
|
+
if (this.search.isOpen) this.search.repaintHighlights();
|
|
850
864
|
if (changed.has(`rows`) || changed.has(`sortState`) || changed.has(`columns`) || changed.has(`groupBy`) || changed.has(`groupLabel`) || changed.has(`filterPredicate`) || changed.has(`rowHeight`)) this.#scheduleViewportChangeEmit();
|
|
851
865
|
if (changed.has(`_editing`) || changed.has(`_editingRow`)) this.updateComplete.then(() => {
|
|
852
866
|
let sel = null;
|
|
@@ -2488,6 +2502,10 @@ __decorate([property({
|
|
|
2488
2502
|
})], DataGridElement.prototype, "badgeColumn", void 0);
|
|
2489
2503
|
__decorate([property({ attribute: false })], DataGridElement.prototype, "filterPredicate", void 0);
|
|
2490
2504
|
__decorate([property({ attribute: false })], DataGridElement.prototype, "rowSearchText", void 0);
|
|
2505
|
+
__decorate([property({
|
|
2506
|
+
type: String,
|
|
2507
|
+
attribute: `search-column`
|
|
2508
|
+
})], DataGridElement.prototype, "searchColumn", void 0);
|
|
2491
2509
|
__decorate([property({
|
|
2492
2510
|
type: String,
|
|
2493
2511
|
attribute: `search-modes`,
|
|
@@ -3,7 +3,7 @@ import { L as ListDragPreviewRenderer, R as ListDragPreviewSourceResolver, V as
|
|
|
3
3
|
import { a as ViewStateBase, t as GetViewStateOptions } from "./types-LU1u0CB8.js";
|
|
4
4
|
import "./index-9ttcdwlL.js";
|
|
5
5
|
import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
|
|
6
|
-
import { S as ListSearchController } from "./index-
|
|
6
|
+
import { S as ListSearchController } from "./index-CUErGhCg.js";
|
|
7
7
|
import "./index-DxyyVqzA.js";
|
|
8
8
|
import "./pan-text-CoYmt2qd.js";
|
|
9
9
|
import { LitElement } from "lit";
|
|
@@ -241,8 +241,17 @@ declare class DataGridElement extends LitElement {
|
|
|
241
241
|
* view and navigation.
|
|
242
242
|
*/
|
|
243
243
|
filterPredicate?: (row: unknown) => boolean;
|
|
244
|
-
/**
|
|
244
|
+
/**
|
|
245
|
+
* Text a row is matched against by incremental search. Overrides
|
|
246
|
+
* `searchColumn`; matches against it aren't highlighted, since they can't be
|
|
247
|
+
* mapped onto a cell.
|
|
248
|
+
*/
|
|
245
249
|
rowSearchText?: (row: unknown) => string;
|
|
250
|
+
/**
|
|
251
|
+
* Key of the column incremental search matches against, using the cell's
|
|
252
|
+
* displayed (formatted) text. Default: the first visible column.
|
|
253
|
+
*/
|
|
254
|
+
searchColumn: string;
|
|
246
255
|
/**
|
|
247
256
|
* Space-separated subset of `navigate select filter` — limits which
|
|
248
257
|
* incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search
|
package/dist/data-grid.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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
|
-
import { A as DataGridEditability, B as DataGridSortDirection, C as DataGridColumnViewState, D as DataGridColumn, E as BuiltInFormatterOptions, F as DataGridGroupBy, H as GlobalFormatter, I as DataGridGroupLabel, L as DataGridInteractionMode, M as DataGridEditorFactory, N as DataGridEditorType, O as DataGridColumnMenu, P as DataGridGetRowKey, R as DataGridRowLook, S as DataGridViewportChangeEvent, T as BuiltInFormatterName, V as DataGridSortState, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridEditorContext, k as DataGridDataType, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as DataGridViewState, x as DataGridViewportChangeDetail, y as DataGridSortDetail, z as DataGridSelectionMode } from "./data-grid-
|
|
2
|
+
import { A as DataGridEditability, B as DataGridSortDirection, C as DataGridColumnViewState, D as DataGridColumn, E as BuiltInFormatterOptions, F as DataGridGroupBy, H as GlobalFormatter, I as DataGridGroupLabel, L as DataGridInteractionMode, M as DataGridEditorFactory, N as DataGridEditorType, O as DataGridColumnMenu, P as DataGridGetRowKey, R as DataGridRowLook, S as DataGridViewportChangeEvent, T as BuiltInFormatterName, V as DataGridSortState, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridEditorContext, k as DataGridDataType, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as DataGridViewState, x as DataGridViewportChangeDetail, y as DataGridSortDetail, z as DataGridSelectionMode } from "./data-grid-Csh5EJW9.js";
|
|
3
3
|
export { type BuiltInFormatterName, type BuiltInFormatterOptions, DataGridCellClickDetail, DataGridCellClickEvent, DataGridCellEditDetail, DataGridCellEditEvent, type DataGridColumn, type DataGridColumnMenu, DataGridColumnReorderDetail, DataGridColumnReorderEvent, DataGridColumnResizeDetail, DataGridColumnResizeEvent, type DataGridColumnViewState, DataGridColumnVisibilityDetail, DataGridColumnVisibilityEvent, type DataGridDataType, type DataGridEditability, type DataGridEditorContext, type DataGridEditorFactory, type DataGridEditorType, DataGridElement, DataGridElementEventMap, type DataGridGetRowKey, type DataGridGroupBy, DataGridGroupChangeDetail, DataGridGroupChangeEvent, type DataGridGroupLabel, type DataGridInteractionMode, DataGridRowActivateDetail, DataGridRowActivateEvent, type DataGridRowLook, DataGridSelectDetail, DataGridSelectEvent, type DataGridSelectionMode, DataGridSortDetail, type DataGridSortDirection, DataGridSortEvent, type DataGridSortState, type DataGridViewState, DataGridViewportChangeDetail, DataGridViewportChangeEvent, type GlobalFormatter, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListNativeDragStartDetail, type ListNativeDragStartEvent };
|
package/dist/data-grid.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DataGridElement } from "./data-grid-
|
|
1
|
+
import { t as DataGridElement } from "./data-grid-Cqxuwgbb.js";
|
|
2
2
|
export { DataGridElement };
|
|
@@ -3,7 +3,7 @@ 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, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-CgbL-OlS.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
9
|
import { r as ListDragSelectController, t as ListSelectionController } from "./list-selection-controller-5L0Nj9tR.js";
|
|
@@ -823,8 +823,9 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
823
823
|
});
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
|
-
const shapeChanged = changed.has(`displayProperty`) || changed.has(`formatter`) || changed.has(`iconProperty`) || changed.has(`iconColorProperty`) || changed.has(`textColorProperty`) || changed.has(`badgeProperty`) || changed.has(`keyProperty`);
|
|
826
|
+
const shapeChanged = changed.has(`displayProperty`) || changed.has(`formatter`) || changed.has(`searchText`) || changed.has(`iconProperty`) || changed.has(`iconColorProperty`) || changed.has(`textColorProperty`) || changed.has(`badgeProperty`) || changed.has(`keyProperty`);
|
|
827
827
|
if ((changed.has(`items`) || shapeChanged) && this.provider === void 0 && this.items.length > 0) this.#rebuildFromObjects(this.items, !shapeChanged);
|
|
828
|
+
else if (shapeChanged && this.provider !== void 0 && this.#builtFromProvider.length > 0) this.#rebuildFromObjects(this.#builtFromProvider);
|
|
828
829
|
this.#syncFromProvider();
|
|
829
830
|
if (changed.has(`sort`) || changed.has(`sortBy`) || changed.has(`sortComparator`)) this.#applySort();
|
|
830
831
|
if (changed.has(`filterPredicate`)) {
|
|
@@ -860,6 +861,16 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
860
861
|
this.#recomputeGeometry();
|
|
861
862
|
this.#scheduleViewportChangeEmit();
|
|
862
863
|
}
|
|
864
|
+
/**
|
|
865
|
+
* Rebuild every object-item row, for when something the `formatter` (or
|
|
866
|
+
* `searchText`) reads has changed but the items themselves haven't —
|
|
867
|
+
* reassigning the same objects keeps their rows as they are. Assigning a new
|
|
868
|
+
* `formatter` function has the same effect.
|
|
869
|
+
*/
|
|
870
|
+
reformat() {
|
|
871
|
+
const items = this.provider === void 0 ? this.items : this.#builtFromProvider;
|
|
872
|
+
if (items.length > 0) this.#rebuildFromObjects(items);
|
|
873
|
+
}
|
|
863
874
|
addItem(item, options) {
|
|
864
875
|
let el;
|
|
865
876
|
if (typeof item === `string`) {
|
|
@@ -1223,6 +1234,8 @@ let DetailListElement = class DetailListElement extends LitElement {
|
|
|
1223
1234
|
li.appendChild(content);
|
|
1224
1235
|
if (textColor !== void 0) li.style.color = textColor;
|
|
1225
1236
|
}
|
|
1237
|
+
const searchText = this.searchText?.(item, index);
|
|
1238
|
+
if (searchText !== void 0) li.setAttribute(`data-search-label`, searchText);
|
|
1226
1239
|
if (this.keyProperty) {
|
|
1227
1240
|
const key = this.#propertyValue(item, this.keyProperty);
|
|
1228
1241
|
if (key !== void 0 && key !== null) li.setAttribute(`data-key`, String(key));
|
|
@@ -2157,6 +2170,7 @@ __decorate([property({
|
|
|
2157
2170
|
attribute: `display-property`
|
|
2158
2171
|
})], DetailListElement.prototype, "displayProperty", void 0);
|
|
2159
2172
|
__decorate([property({ attribute: false })], DetailListElement.prototype, "formatter", void 0);
|
|
2173
|
+
__decorate([property({ attribute: false })], DetailListElement.prototype, "searchText", void 0);
|
|
2160
2174
|
__decorate([property({
|
|
2161
2175
|
type: String,
|
|
2162
2176
|
attribute: `icon-property`
|
|
@@ -4,10 +4,10 @@ import { L as ListDragPreviewRenderer, R as ListDragPreviewSourceResolver, V as
|
|
|
4
4
|
import { a as ViewStateBase, s as ViewStateChangeEvent, t as GetViewStateOptions } from "./types-LU1u0CB8.js";
|
|
5
5
|
import "./index-9ttcdwlL.js";
|
|
6
6
|
import { n as ListViewportChangeEvent } from "./list-viewport-types-BRZsLcvp.js";
|
|
7
|
-
import { S as ListSearchController } from "./index-
|
|
7
|
+
import { S as ListSearchController } from "./index-CUErGhCg.js";
|
|
8
8
|
import { a as ListGroupEventMap, o as ListGroupInfo, s as ListGroupLabel } from "./grouping-CUKgmkMm.js";
|
|
9
9
|
import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-PjKdhF-a.js";
|
|
10
|
-
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-
|
|
10
|
+
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-SAx56U-l.js";
|
|
11
11
|
import "./list-group-header.js";
|
|
12
12
|
import { LitElement, PropertyValues } from "lit";
|
|
13
13
|
import { CommandId, CommandRegistry } from "@clinth/ui-commands";
|
|
@@ -75,6 +75,13 @@ declare class DetailListElement extends LitElement {
|
|
|
75
75
|
provider: IDataProvider<void, unknown> | undefined;
|
|
76
76
|
displayProperty: string;
|
|
77
77
|
formatter: DetailFormatter | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Text incremental search matches for an object item. Defaults to the
|
|
80
|
+
* caption when it is a string (`displayProperty` or a string `formatter`),
|
|
81
|
+
* else the row's whole text — set this when `formatter` returns a `Node`
|
|
82
|
+
* carrying more than the name (sublines, sizes, dates).
|
|
83
|
+
*/
|
|
84
|
+
searchText: ((item: unknown, index: number) => string) | undefined;
|
|
78
85
|
iconProperty: string;
|
|
79
86
|
/**
|
|
80
87
|
* Property on each `items` entry holding a CSS colour for the item's
|
|
@@ -158,6 +165,13 @@ declare class DetailListElement extends LitElement {
|
|
|
158
165
|
* changed by outside forces (e.g. an external font load).
|
|
159
166
|
*/
|
|
160
167
|
refreshLayout(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Rebuild every object-item row, for when something the `formatter` (or
|
|
170
|
+
* `searchText`) reads has changed but the items themselves haven't —
|
|
171
|
+
* reassigning the same objects keeps their rows as they are. Assigning a new
|
|
172
|
+
* `formatter` function has the same effect.
|
|
173
|
+
*/
|
|
174
|
+
reformat(): void;
|
|
161
175
|
addItem(item: Element | string, options?: AddItemOptions): void;
|
|
162
176
|
/**
|
|
163
177
|
* Collapse + fade `item` out, then detach it; the rows after it slide up to
|
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-DSZ1DDor.js";
|
|
5
|
+
import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-SAx56U-l.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
|
@@ -5,7 +5,7 @@ import { a as ViewStateBase, t as GetViewStateOptions } from "./types-LU1u0CB8.j
|
|
|
5
5
|
import "./index-9ttcdwlL.js";
|
|
6
6
|
import "./crumb-navigation-BbqfmkYs.js";
|
|
7
7
|
import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
|
|
8
|
-
import { r as VerticalListElement } from "./vertical-list-
|
|
8
|
+
import { r as VerticalListElement } from "./vertical-list-SAx56U-l.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. */
|
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-CT9kX3TQ.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
|
@@ -6,7 +6,7 @@ import { t as collectDataResult } from "./data-provider-35TyWclX.js";
|
|
|
6
6
|
import { t as ViewStateController } from "./view-state-controller-BdyXWUUM.js";
|
|
7
7
|
import { n as resolveKeyPath } from "./crumb-navigation-YnFVFqrx.js";
|
|
8
8
|
import { n as appearanceColor, t as appearanceAbsent } from "./item-appearance-BjcMyauw.js";
|
|
9
|
-
import "./vertical-list-
|
|
9
|
+
import "./vertical-list-DyKPKGxK.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
|
|
@@ -2,7 +2,7 @@ import { t as TickledController } from "./tickled-controller-D-HZymaZ.js";
|
|
|
2
2
|
import { n as tickledStyles, t as tickledItemStyles } from "./tickled-styles-BrAHEj1q.js";
|
|
3
3
|
import { t as themeFallbacks } from "./fallbacks-DQ_5OsmR.js";
|
|
4
4
|
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
5
|
-
import { c as createElementListSearchAdapter, d as createDataListSearchAdapter, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-
|
|
5
|
+
import { c as createElementListSearchAdapter, d as createDataListSearchAdapter, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-CgbL-OlS.js";
|
|
6
6
|
import { i as resolveGroupKey, r as partitionByGroup } from "./grouping-RYPnHkrS.js";
|
|
7
7
|
import { a as listItemFadeKeyframes, t as ListNativeDragController } from "./list-native-drag-controller-CcXoS0YX.js";
|
|
8
8
|
import { r as ListDragSelectController, t as ListSelectionController } from "./list-selection-controller-5L0Nj9tR.js";
|
|
@@ -2007,6 +2007,7 @@ let GridListElement = class GridListElement extends LitElement {
|
|
|
2007
2007
|
}
|
|
2008
2008
|
updated(changed) {
|
|
2009
2009
|
super.updated(changed);
|
|
2010
|
+
if (this.search?.isOpen) this.search.repaintHighlights();
|
|
2010
2011
|
const pending = this.#mutationObserver?.takeRecords();
|
|
2011
2012
|
const pendingAttrs = this.#itemAttrObserver?.takeRecords();
|
|
2012
2013
|
if (pending !== void 0 && pending.length > 0) this.#onChildrenChanged(pending);
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { S as ListSearchController } from "./index-
|
|
4
|
+
import { S as ListSearchController } from "./index-CUErGhCg.js";
|
|
5
5
|
import "./pan-text-CoYmt2qd.js";
|
|
6
6
|
import { i as ListGroupChangeEvent, n as ListGroupBy, o as ListGroupInfo, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
|
|
7
7
|
import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
|
package/dist/grid-list.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
import { _ as GridListSelectEvent, a as GridListCaptionAlign, b as GridListViewportChangeDetail, c as GridListCaptionStyle, d as GridListFullElementEventMap, f as GridListItemClickDetail, g as GridListSelectDetail, h as GridListOrientation, i as GridListActivateEvent, l as GridListDataAdapter, m as GridListItemEventDetail, n as GridListViewState, o as GridListCaptionBackdrop, p as GridListItemClickEvent, r as GridListActivateDetail, s as GridListCaptionPosition, t as GridListElement, u as GridListElementEventMap, v as GridListTickleDetail, x as GridListViewportChangeEvent, y as GridListTickleEvent } from "./grid-list-
|
|
2
|
+
import { _ as GridListSelectEvent, a as GridListCaptionAlign, b as GridListViewportChangeDetail, c as GridListCaptionStyle, d as GridListFullElementEventMap, f as GridListItemClickDetail, g as GridListSelectDetail, h as GridListOrientation, i as GridListActivateEvent, l as GridListDataAdapter, m as GridListItemEventDetail, n as GridListViewState, o as GridListCaptionBackdrop, p as GridListItemClickEvent, r as GridListActivateDetail, s as GridListCaptionPosition, t as GridListElement, u as GridListElementEventMap, v as GridListTickleDetail, x as GridListViewportChangeEvent, y as GridListTickleEvent } from "./grid-list-DDLrWRxm.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
4
|
import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
|
|
5
5
|
export { type GridListActivateDetail, type GridListActivateEvent, type GridListCaptionAlign, type GridListCaptionBackdrop, type GridListCaptionPosition, type GridListCaptionStyle, type GridListDataAdapter, GridListElement, type GridListElementEventMap, type GridListFullElementEventMap, type GridListItemClickDetail, type GridListItemClickEvent, type GridListItemEventDetail, type GridListOrientation, type GridListSelectDetail, type GridListSelectEvent, type GridListTickleDetail, type GridListTickleEvent, type GridListViewState, type GridListViewportChangeDetail, type GridListViewportChangeEvent, 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 ListInteractionMode, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListSelectionMode };
|
package/dist/grid-list.js
CHANGED
|
@@ -572,6 +572,8 @@ var ListSearchController = class {
|
|
|
572
572
|
#matches = [];
|
|
573
573
|
/** Whether a filter has been pushed to the adapter and still needs undoing. */
|
|
574
574
|
#filterActive = false;
|
|
575
|
+
/** A filter committed with Enter (sticky) that stays applied while the popover is closed. */
|
|
576
|
+
#kept = false;
|
|
575
577
|
constructor(host, options) {
|
|
576
578
|
this.#host = host;
|
|
577
579
|
this.#adapter = options.adapter;
|
|
@@ -579,6 +581,7 @@ var ListSearchController = class {
|
|
|
579
581
|
this.#modes = LIST_SEARCH_MODES.filter((m) => requested.has(m));
|
|
580
582
|
this.#mode = this.#modes[0] ?? `filter`;
|
|
581
583
|
this.#placeholder = options.placeholder ?? `Search…`;
|
|
584
|
+
this.stickyFilter = options.stickyFilter ?? false;
|
|
582
585
|
this.#search = createIncrSearch({
|
|
583
586
|
selector: (i) => i.label,
|
|
584
587
|
fzf: options.fzf
|
|
@@ -605,6 +608,7 @@ var ListSearchController = class {
|
|
|
605
608
|
this.#modes = LIST_SEARCH_MODES.filter((m) => set.has(m));
|
|
606
609
|
if (!this.#modes.includes(this.#mode)) {
|
|
607
610
|
if (this.#open) this.close();
|
|
611
|
+
this.clearFilter();
|
|
608
612
|
this.#mode = this.#modes[0] ?? `filter`;
|
|
609
613
|
}
|
|
610
614
|
this.#host.requestUpdate();
|
|
@@ -624,6 +628,10 @@ var ListSearchController = class {
|
|
|
624
628
|
get matchIndex() {
|
|
625
629
|
return this.#matchIndex;
|
|
626
630
|
}
|
|
631
|
+
/** The query of a filter kept applied after the popover closed (see {@link stickyFilter}). */
|
|
632
|
+
get keptFilter() {
|
|
633
|
+
return this.#kept ? this.#query : void 0;
|
|
634
|
+
}
|
|
627
635
|
hostConnected() {
|
|
628
636
|
const container = this.#adapter.container?.();
|
|
629
637
|
if (container) {
|
|
@@ -633,29 +641,47 @@ var ListSearchController = class {
|
|
|
633
641
|
subtree: false
|
|
634
642
|
});
|
|
635
643
|
}
|
|
644
|
+
this.#host.addEventListener(`keydown`, this.#onHostKeydown);
|
|
636
645
|
this.refresh();
|
|
637
646
|
}
|
|
638
647
|
hostDisconnected() {
|
|
639
648
|
this.#observer?.disconnect();
|
|
640
649
|
this.#observer = void 0;
|
|
641
|
-
|
|
650
|
+
this.#host.removeEventListener(`keydown`, this.#onHostKeydown);
|
|
651
|
+
if (this.#open || this.#kept) this.#teardownEffects();
|
|
642
652
|
this.#open = false;
|
|
653
|
+
this.#kept = false;
|
|
643
654
|
this.#unsub?.();
|
|
644
655
|
this.#unsub = void 0;
|
|
645
656
|
this.#search.dispose();
|
|
646
657
|
}
|
|
647
|
-
/**
|
|
658
|
+
/**
|
|
659
|
+
* Open the popover in `mode` (clamped to the available set). When it is
|
|
660
|
+
* already open the query is kept: the mode switches if it differs and the
|
|
661
|
+
* input is refocused with its text selected.
|
|
662
|
+
*/
|
|
648
663
|
open(mode) {
|
|
649
664
|
if (!this.enabled) return;
|
|
665
|
+
if (this.#open) {
|
|
666
|
+
this.switchMode(this.#modes.includes(mode) ? mode : this.#mode);
|
|
667
|
+
this.focus();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
650
670
|
this.#mode = this.#modes.includes(mode) ? mode : this.#modes[0];
|
|
651
671
|
this.#open = true;
|
|
652
|
-
|
|
672
|
+
const resume = this.#kept;
|
|
673
|
+
this.#kept = false;
|
|
674
|
+
if (!resume) this.#query = ``;
|
|
653
675
|
this.#matchIndex = 0;
|
|
654
676
|
this.#matches = [];
|
|
677
|
+
if (resume && this.#mode !== `filter` && this.#filterActive) {
|
|
678
|
+
this.#adapter.applyFilter(void 0);
|
|
679
|
+
this.#filterActive = false;
|
|
680
|
+
}
|
|
655
681
|
this.refresh();
|
|
656
|
-
this.#search.setQuery(
|
|
682
|
+
this.#search.setQuery(this.#query);
|
|
657
683
|
this.#host.requestUpdate();
|
|
658
|
-
this.#host.updateComplete.then(() => this.#focusInput());
|
|
684
|
+
this.#host.updateComplete.then(() => this.#focusInput(resume));
|
|
659
685
|
}
|
|
660
686
|
/** Close the popover, restoring any live filter. Selection / cursor stay put. */
|
|
661
687
|
close() {
|
|
@@ -668,6 +694,16 @@ var ListSearchController = class {
|
|
|
668
694
|
this.#host.requestUpdate();
|
|
669
695
|
this.#host.focus();
|
|
670
696
|
}
|
|
697
|
+
/** Remove a filter kept by {@link stickyFilter}. No-op when none is kept. */
|
|
698
|
+
clearFilter() {
|
|
699
|
+
if (!this.#kept) return;
|
|
700
|
+
this.#kept = false;
|
|
701
|
+
this.#teardownEffects();
|
|
702
|
+
this.#query = ``;
|
|
703
|
+
this.#matches = [];
|
|
704
|
+
this.#search.clearQuery();
|
|
705
|
+
this.#host.requestUpdate();
|
|
706
|
+
}
|
|
671
707
|
setQuery(query) {
|
|
672
708
|
this.#query = query;
|
|
673
709
|
this.#matchIndex = 0;
|
|
@@ -685,6 +721,21 @@ var ListSearchController = class {
|
|
|
685
721
|
this.#host.requestUpdate();
|
|
686
722
|
this.#host.updateComplete.then(() => this.#focusInput());
|
|
687
723
|
}
|
|
724
|
+
/**
|
|
725
|
+
* Step through {@link registeredModes} (wrapping) and switch to the result.
|
|
726
|
+
* Bound to Tab / Shift+Tab in the popover input.
|
|
727
|
+
*/
|
|
728
|
+
cycleMode(delta) {
|
|
729
|
+
const n = this.#modes.length;
|
|
730
|
+
if (n < 2) return;
|
|
731
|
+
const index = this.#modes.indexOf(this.#mode);
|
|
732
|
+
this.switchMode(this.#modes[(index + delta + n) % n]);
|
|
733
|
+
}
|
|
734
|
+
/** Refocus the popover input (text selected) without touching the query. No-op when closed. */
|
|
735
|
+
focus() {
|
|
736
|
+
if (!this.#open) return;
|
|
737
|
+
this.#host.updateComplete.then(() => this.#focusInput(true));
|
|
738
|
+
}
|
|
688
739
|
/** One-shot: turn the current match set into the selection, staying in the current mode. */
|
|
689
740
|
selectMatches() {
|
|
690
741
|
if (!this.#modes.includes(`select`)) return;
|
|
@@ -697,8 +748,19 @@ var ListSearchController = class {
|
|
|
697
748
|
prevMatch() {
|
|
698
749
|
this.#cycle(-1);
|
|
699
750
|
}
|
|
700
|
-
/**
|
|
751
|
+
/**
|
|
752
|
+
* Enter: in `navigate` activate the current match; then close. In `filter`
|
|
753
|
+
* with {@link stickyFilter} and a query, close but keep the filter.
|
|
754
|
+
*/
|
|
701
755
|
commit() {
|
|
756
|
+
if (this.#mode === `filter` && this.stickyFilter && this.#filterActive) {
|
|
757
|
+
this.#open = false;
|
|
758
|
+
this.#kept = true;
|
|
759
|
+
clearHighlights({ key: this.#highlightKey });
|
|
760
|
+
this.#host.requestUpdate();
|
|
761
|
+
this.#host.focus();
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
702
764
|
if (this.#mode === `navigate`) {
|
|
703
765
|
const item = this.#itemFor(this.#matches[this.#matchIndex]);
|
|
704
766
|
if (item) {
|
|
@@ -729,6 +791,7 @@ var ListSearchController = class {
|
|
|
729
791
|
/** Popover markup. Pair with `listSearchStyles` in the host's `static styles`. */
|
|
730
792
|
renderField() {
|
|
731
793
|
if (!this.enabled) return nothing;
|
|
794
|
+
if (this.#kept) return this.#renderKeptFilter();
|
|
732
795
|
const hasQuery = this.#query.trim().length > 0;
|
|
733
796
|
const others = this.#modes.filter((m) => m !== this.#mode);
|
|
734
797
|
const showSelectMatches = this.#modes.includes(`select`) && this.#mode !== `select`;
|
|
@@ -754,15 +817,33 @@ var ListSearchController = class {
|
|
|
754
817
|
</div>
|
|
755
818
|
${others.length > 0 || showSelectMatches ? html`
|
|
756
819
|
<div class="list-search-switch">
|
|
757
|
-
${others.map((m) => html`<button class="list-search-btn" @click=${() => this.switchMode(m)}>${m}</button>`)}
|
|
820
|
+
${others.map((m) => html`<button class="list-search-btn" title=${this.#switchTitle(m)} @click=${() => this.switchMode(m)}>${m}</button>`)}
|
|
758
821
|
${showSelectMatches ? html`<button class="list-search-btn" @click=${() => this.selectMatches()}>Select matches</button>` : nothing}
|
|
759
822
|
</div>
|
|
760
823
|
` : nothing}
|
|
761
824
|
</div>
|
|
762
825
|
`;
|
|
763
826
|
}
|
|
764
|
-
#
|
|
765
|
-
|
|
827
|
+
#renderKeptFilter() {
|
|
828
|
+
return html`
|
|
829
|
+
<div class="list-search list-search-kept" part="search-kept">
|
|
830
|
+
<button class="list-search-kept-label" title="Edit filter" @click=${() => this.open(`filter`)}>
|
|
831
|
+
Filtered: <strong>${this.#query}</strong> <span class="list-search-count">(${this.#matches.length})</span>
|
|
832
|
+
</button>
|
|
833
|
+
<button class="list-search-icon-btn" title="Clear filter (Esc)" @click=${() => this.clearFilter()}><ixfx-icon name="close" size="14"></ixfx-icon></button>
|
|
834
|
+
</div>
|
|
835
|
+
`;
|
|
836
|
+
}
|
|
837
|
+
#focusInput(selectText = false) {
|
|
838
|
+
const input = this.#host.renderRoot?.querySelector(`.${INPUT_CLASS}`);
|
|
839
|
+
input?.focus();
|
|
840
|
+
if (selectText) input?.select();
|
|
841
|
+
}
|
|
842
|
+
/** Switch-row button title, naming the Tab chord that reaches `mode`. */
|
|
843
|
+
#switchTitle(mode) {
|
|
844
|
+
const n = this.#modes.length;
|
|
845
|
+
const index = this.#modes.indexOf(this.#mode);
|
|
846
|
+
return `Switch to ${mode} (${[this.#modes[(index + 1) % n] === mode ? `Tab` : void 0, this.#modes[(index - 1 + n) % n] === mode ? `Shift+Tab` : void 0].filter((k) => k !== void 0).join(` / `)})`;
|
|
766
847
|
}
|
|
767
848
|
#onInput = (e) => {
|
|
768
849
|
this.setQuery(e.target.value);
|
|
@@ -779,6 +860,13 @@ var ListSearchController = class {
|
|
|
779
860
|
e.stopPropagation();
|
|
780
861
|
this.commit();
|
|
781
862
|
break;
|
|
863
|
+
case `Tab`:
|
|
864
|
+
if (this.#modes.length > 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
865
|
+
e.preventDefault();
|
|
866
|
+
e.stopPropagation();
|
|
867
|
+
this.cycleMode(e.shiftKey ? -1 : 1);
|
|
868
|
+
}
|
|
869
|
+
break;
|
|
782
870
|
case `ArrowDown`:
|
|
783
871
|
if (this.#mode === `navigate`) {
|
|
784
872
|
e.preventDefault();
|
|
@@ -791,6 +879,13 @@ var ListSearchController = class {
|
|
|
791
879
|
}
|
|
792
880
|
}
|
|
793
881
|
};
|
|
882
|
+
/** Escape on the host clears a kept filter (the open popover's input handles its own Escape). */
|
|
883
|
+
#onHostKeydown = (e) => {
|
|
884
|
+
if (!this.#kept || this.#open || e.key !== `Escape` || e.defaultPrevented) return;
|
|
885
|
+
e.preventDefault();
|
|
886
|
+
e.stopPropagation();
|
|
887
|
+
this.clearFilter();
|
|
888
|
+
};
|
|
794
889
|
#cycle(delta) {
|
|
795
890
|
if (this.#matches.length === 0) return;
|
|
796
891
|
const n = this.#matches.length;
|
|
@@ -808,9 +903,14 @@ var ListSearchController = class {
|
|
|
808
903
|
return this.#adapter.highlightKey ?? DEFAULT_HIGHLIGHT_KEY;
|
|
809
904
|
}
|
|
810
905
|
#onState(state) {
|
|
811
|
-
if (!this.#open) return;
|
|
906
|
+
if (!this.#open && !this.#kept) return;
|
|
812
907
|
const hasQuery = state.query.trim().length > 0;
|
|
813
908
|
this.#matches = hasQuery ? [...state.results] : [];
|
|
909
|
+
if (!this.#open) {
|
|
910
|
+
this.#adapter.applyFilter(new Set(this.#matches.map((m) => m.item.key)));
|
|
911
|
+
this.#host.requestUpdate();
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
814
914
|
if (this.#matchIndex >= this.#matches.length) this.#matchIndex = 0;
|
|
815
915
|
this.#applyMode();
|
|
816
916
|
this.#host.requestUpdate();
|
|
@@ -970,6 +1070,36 @@ const listSearchStyles = css`
|
|
|
970
1070
|
.list-search-icon-btn:hover {
|
|
971
1071
|
color: inherit;
|
|
972
1072
|
}
|
|
1073
|
+
|
|
1074
|
+
.list-search-kept {
|
|
1075
|
+
flex-direction: row;
|
|
1076
|
+
align-items: center;
|
|
1077
|
+
padding: 2px 4px 2px 6px;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
.list-search-kept-label {
|
|
1081
|
+
padding: 0;
|
|
1082
|
+
background: transparent;
|
|
1083
|
+
border: none;
|
|
1084
|
+
color: inherit;
|
|
1085
|
+
cursor: pointer;
|
|
1086
|
+
font: inherit;
|
|
1087
|
+
white-space: nowrap;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.list-search-kept-label:hover strong {
|
|
1091
|
+
text-decoration: underline;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/* Matched characters for hosts that paint highlights inside their own shadow
|
|
1095
|
+
root, which a page-level ::highlight() rule cannot reach. Light-DOM items
|
|
1096
|
+
(e.g. detail-list rows) still need a page-level rule. */
|
|
1097
|
+
::highlight(incr-search-highlight),
|
|
1098
|
+
::highlight(grid-list-search),
|
|
1099
|
+
::highlight(data-grid-search) {
|
|
1100
|
+
background: var(--search-highlight-bg, var(--accent, #60a5fa));
|
|
1101
|
+
color: var(--search-highlight-color, var(--accent-text, #000));
|
|
1102
|
+
}
|
|
973
1103
|
`;
|
|
974
1104
|
//#endregion
|
|
975
1105
|
//#region src/incr-search/tree-list-search-adapter.ts
|
package/dist/incr-search.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as FuzzySearch, C as ListSearchControllerOptions, D as IncrSearchTreeOptions, E as IncrSearchTreeController, F as IncrSearchChangeCallback, I as IncrSearchOptions, L as IncrSearchResult, M as HighlightOptions, N as HighlightTarget, O as createAcCompletionProvider, P as IncrSearch, R as IncrSearchState, S as ListSearchController, T as ListSearchMode, _ as DataListSearchAdapterOptions, a as RegisterListSearchCommandsOptions, b as LIST_SEARCH_MODES, c as applyHighlights, d as createFuzzySearch, f as ElementIncrSearch, g as createElementListSearchAdapter, h as ElementListSearchHost, i as LIST_SEARCH_COMMAND_IDS, j as FuzzySearchOptions, k as ElementIncrSearchOptions, l as buildHighlightTargets, m as ElementListSearchAdapterOptions, n as createTreeListSearchAdapter, o as registerListSearchCommands, p as createElementIncrSearch, r as listSearchStyles, s as createIncrSearch, t as TreeListSearchAdapterOptions, u as clearHighlights, v as DataListSearchItem, w as ListSearchHost, x as ListSearchAdapter, y as createDataListSearchAdapter } from "./index-
|
|
1
|
+
import { A as FuzzySearch, C as ListSearchControllerOptions, D as IncrSearchTreeOptions, E as IncrSearchTreeController, F as IncrSearchChangeCallback, I as IncrSearchOptions, L as IncrSearchResult, M as HighlightOptions, N as HighlightTarget, O as createAcCompletionProvider, P as IncrSearch, R as IncrSearchState, S as ListSearchController, T as ListSearchMode, _ as DataListSearchAdapterOptions, a as RegisterListSearchCommandsOptions, b as LIST_SEARCH_MODES, c as applyHighlights, d as createFuzzySearch, f as ElementIncrSearch, g as createElementListSearchAdapter, h as ElementListSearchHost, i as LIST_SEARCH_COMMAND_IDS, j as FuzzySearchOptions, k as ElementIncrSearchOptions, l as buildHighlightTargets, m as ElementListSearchAdapterOptions, n as createTreeListSearchAdapter, o as registerListSearchCommands, p as createElementIncrSearch, r as listSearchStyles, s as createIncrSearch, t as TreeListSearchAdapterOptions, u as clearHighlights, v as DataListSearchItem, w as ListSearchHost, x as ListSearchAdapter, y as createDataListSearchAdapter } from "./index-CUErGhCg.js";
|
|
2
2
|
export { type DataListSearchAdapterOptions, type DataListSearchItem, type ElementIncrSearch, type ElementIncrSearchOptions, type ElementListSearchAdapterOptions, type ElementListSearchHost, type FuzzySearch, type FuzzySearchOptions, type HighlightOptions, type HighlightTarget, type IncrSearch, type IncrSearchChangeCallback, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, type IncrSearchTreeOptions as IncrSearchMillerOptions, type IncrSearchTreeOptions, type IncrSearchOptions, type IncrSearchResult, type IncrSearchState, LIST_SEARCH_COMMAND_IDS, LIST_SEARCH_MODES, type ListSearchAdapter, ListSearchController, type ListSearchControllerOptions, type ListSearchHost, type ListSearchMode, type RegisterListSearchCommandsOptions, type TreeListSearchAdapterOptions, applyHighlights, buildHighlightTargets, clearHighlights, createAcCompletionProvider, createDataListSearchAdapter, createElementIncrSearch, createElementListSearchAdapter, createFuzzySearch, createIncrSearch, createTreeListSearchAdapter, listSearchStyles, registerListSearchCommands };
|
package/dist/incr-search.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as buildHighlightTargets, r as clearHighlights, t as applyHighlights } from "./highlight-B-eQrhhb.js";
|
|
2
|
-
import { a as LIST_SEARCH_COMMAND_IDS, c as createElementListSearchAdapter, d as createDataListSearchAdapter, f as IncrSearchTreeController, h as createFuzzySearch, i as ListSearchController, m as createAcCompletionProvider, n as listSearchStyles, o as registerListSearchCommands, p as createIncrSearch, r as LIST_SEARCH_MODES, s as createElementIncrSearch, t as createTreeListSearchAdapter } from "./incr-search-
|
|
2
|
+
import { a as LIST_SEARCH_COMMAND_IDS, c as createElementListSearchAdapter, d as createDataListSearchAdapter, f as IncrSearchTreeController, h as createFuzzySearch, i as ListSearchController, m as createAcCompletionProvider, n as listSearchStyles, o as registerListSearchCommands, p as createIncrSearch, r as LIST_SEARCH_MODES, s as createElementIncrSearch, t as createTreeListSearchAdapter } from "./incr-search-CgbL-OlS.js";
|
|
3
3
|
export { IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, LIST_SEARCH_COMMAND_IDS, LIST_SEARCH_MODES, ListSearchController, applyHighlights, buildHighlightTargets, clearHighlights, createAcCompletionProvider, createDataListSearchAdapter, createElementIncrSearch, createElementListSearchAdapter, createFuzzySearch, createIncrSearch, createTreeListSearchAdapter, listSearchStyles, registerListSearchCommands };
|
|
@@ -2,7 +2,7 @@ import { E as TreeSearchHost, M as TreeDataModel, a as TreeComponent, i as TreeC
|
|
|
2
2
|
import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
|
|
3
3
|
import { a as ViewStateBase, n as ScrollState, t as GetViewStateOptions } from "./types-LU1u0CB8.js";
|
|
4
4
|
import "./index-9ttcdwlL.js";
|
|
5
|
-
import { S as ListSearchController } from "./index-
|
|
5
|
+
import { S as ListSearchController } from "./index-CUErGhCg.js";
|
|
6
6
|
import { n as TickledController } from "./tickled-controller-DodxD3eQ.js";
|
|
7
7
|
import { LitElement, PropertyValues, TemplateResult, nothing } from "lit";
|
|
8
8
|
import { CommandRegistry } from "@clinth/ui-commands";
|