@ixfx/components 0.12.0 → 0.13.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 +337 -73
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +7396 -6523
- package/bundle/index.js.map +1 -1
- package/dist/ac-text.d.ts +1 -1
- package/dist/ac-text.js +1 -1
- package/dist/{ac-token--_vCHXWw.d.ts → ac-token-TCLAZeVg.d.ts} +2 -2
- package/dist/{ac-token--_vCHXWw.d.ts.map → ac-token-TCLAZeVg.d.ts.map} +1 -1
- package/dist/ac-token.d.ts +1 -1
- package/dist/ac-token.js +1 -1
- package/dist/{button-BYuf72aR.d.ts → button-CTL45aBl.d.ts} +2 -2
- package/dist/{button-BYuf72aR.d.ts.map → button-CTL45aBl.d.ts.map} +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/{checked-select-Dejl13qd.js → checked-select-lDgAQQ7v.js} +3 -3
- package/dist/{checked-select-Dejl13qd.js.map → checked-select-lDgAQQ7v.js.map} +1 -1
- package/dist/checked-select.js +1 -1
- package/dist/colour-picker.d.ts +1 -1
- package/dist/crumbs.d.ts +4 -4
- package/dist/crumbs.d.ts.map +1 -1
- package/dist/crumbs.js +26 -10
- package/dist/crumbs.js.map +1 -1
- package/dist/{data-grid-Cl_CPSD7.d.ts → data-grid-Ck1Qx2H1.d.ts} +5 -5
- package/dist/{data-grid-Cl_CPSD7.d.ts.map → data-grid-Ck1Qx2H1.d.ts.map} +1 -1
- package/dist/data-grid.d.ts +2 -2
- package/dist/data-grid.js +3 -3
- package/dist/{detail-list-lE_5UWVl.d.ts → detail-list-C1xzr1z7.d.ts} +5 -5
- package/dist/{detail-list-lE_5UWVl.d.ts.map → detail-list-C1xzr1z7.d.ts.map} +1 -1
- package/dist/detail-list.d.ts +3 -3
- package/dist/detail-list.js +1 -1
- package/dist/editable-label-rzXkjf1H.d.ts.map +1 -1
- package/dist/editable-label.js +2 -2
- package/dist/editable-label.js.map +1 -1
- package/dist/flat-list-DEDG6epz.d.ts +181 -0
- package/dist/flat-list-DEDG6epz.d.ts.map +1 -0
- package/dist/flat-list.d.ts +2 -0
- package/dist/flat-list.js +654 -0
- package/dist/flat-list.js.map +1 -0
- package/dist/{grid-list-Bwaf61is.js → grid-list-DjIl910A.js} +3 -3
- package/dist/{grid-list-Bwaf61is.js.map → grid-list-DjIl910A.js.map} +1 -1
- package/dist/{grid-list-Bc-RkDoO.d.ts → grid-list-pefLORIr.d.ts} +5 -5
- package/dist/{grid-list-Bc-RkDoO.d.ts.map → grid-list-pefLORIr.d.ts.map} +1 -1
- 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-Bhyo-dkH.d.ts} +2 -2
- package/dist/{grouped-item-lister-DETte0Dh.d.ts.map → grouped-item-lister-Bhyo-dkH.d.ts.map} +1 -1
- package/dist/grouped-item-lister.d.ts +1 -1
- package/dist/{icon-CDGprSdE.d.ts → icon-DR_3rSyZ.d.ts} +2 -2
- package/dist/icon-DR_3rSyZ.d.ts.map +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/incr-search.d.ts +1 -1
- package/dist/{index-tq6f8007.d.ts → index-BOUaDIW-.d.ts} +2 -2
- package/dist/{index-tq6f8007.d.ts.map → index-BOUaDIW-.d.ts.map} +1 -1
- package/dist/{index-CoqtMSd9.d.ts → index-BUB5SICW.d.ts} +2 -2
- package/dist/{index-CoqtMSd9.d.ts.map → index-BUB5SICW.d.ts.map} +1 -1
- package/dist/{index-UvnoZUAo.d.ts → index-CJ5fshD3.d.ts} +2 -2
- package/dist/{index-UvnoZUAo.d.ts.map → index-CJ5fshD3.d.ts.map} +1 -1
- package/dist/{index-CMsmZ6Or.d.ts → index-CxZ61DO1.d.ts} +4 -4
- package/dist/{index-CMsmZ6Or.d.ts.map → index-CxZ61DO1.d.ts.map} +1 -1
- package/dist/{index-CSEtqm1T.d.ts → index-Dq30pOnn.d.ts} +4 -4
- package/dist/{index-CSEtqm1T.d.ts.map → index-Dq30pOnn.d.ts.map} +1 -1
- package/dist/{index-CYndvTWH.d.ts → index-garxxqgV.d.ts} +2 -2
- package/dist/{index-CYndvTWH.d.ts.map → index-garxxqgV.d.ts.map} +1 -1
- package/dist/index-o-CWDt11.d.ts +78 -0
- package/dist/index-o-CWDt11.d.ts.map +1 -0
- package/dist/index.d.ts +26 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/{interaction-BskmlA9t.js → interaction-ZTh4htzr.js} +1 -1
- package/dist/{labelled-input-base-DiTme1JO.d.ts → labelled-input-base-Dp_9KP0G.d.ts} +2 -2
- package/dist/{labelled-input-base-DiTme1JO.d.ts.map → labelled-input-base-Dp_9KP0G.d.ts.map} +1 -1
- package/dist/labelled-radial-input.d.ts +2 -2
- package/dist/labelled-radial-input.d.ts.map +1 -1
- package/dist/labelled-range-input.d.ts +1 -1
- package/dist/labelled-slider-input.d.ts +1 -1
- package/dist/list-group-header.d.ts +1 -1
- package/dist/{list-native-drag-controller-CllsHLxw.d.ts → list-native-drag-controller-ChIi3eK5.d.ts} +2 -2
- package/dist/{list-native-drag-controller-CllsHLxw.d.ts.map → list-native-drag-controller-ChIi3eK5.d.ts.map} +1 -1
- package/dist/{menu-DaAlsyhf.js → menu-CwcXXeLM.js} +3 -3
- package/dist/{menu-DaAlsyhf.js.map → menu-CwcXXeLM.js.map} +1 -1
- package/dist/{menu-item-bF6narIz.d.ts → menu-item-B0zqw2xp.d.ts} +2 -2
- package/dist/{menu-item-bF6narIz.d.ts.map → menu-item-B0zqw2xp.d.ts.map} +1 -1
- package/dist/{menu-item-CDPFgaSF.js → menu-item-BDEekBVy.js} +3 -3
- package/dist/{menu-item-CDPFgaSF.js.map → menu-item-BDEekBVy.js.map} +1 -1
- package/dist/menu.d.ts +2 -2
- package/dist/menu.js +2 -2
- package/dist/miller.d.ts +4 -4
- package/dist/miller.js +2 -2
- package/dist/narrowed-text.d.ts +2 -78
- package/dist/narrowed-text.js +2 -2
- package/dist/panel.d.ts +1 -1
- package/dist/select-horiz.js +2 -2
- package/dist/{split-layout-JK3xWVX2.d.ts → split-layout-C5SYbDrq.d.ts} +2 -2
- package/dist/{split-layout-JK3xWVX2.d.ts.map → split-layout-C5SYbDrq.d.ts.map} +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/{tab-list-pqfKaVAE.d.ts → tab-list-v8mKX7Fu.d.ts} +2 -2
- package/dist/{tab-list-pqfKaVAE.d.ts.map → tab-list-v8mKX7Fu.d.ts.map} +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/{tickled-controller-Dh1Uh_vG.js → tickled-controller-D-HZymaZ.js} +10 -1
- package/dist/tickled-controller-D-HZymaZ.js.map +1 -0
- package/dist/{tickled-controller-C1ZsHpyg.d.ts → tickled-controller-DodxD3eQ.d.ts} +7 -1
- package/dist/{tickled-controller-C1ZsHpyg.d.ts.map → tickled-controller-DodxD3eQ.d.ts.map} +1 -1
- package/dist/{titlebar-Tqu-VvMU.d.ts → titlebar-B5zSTZnF.d.ts} +2 -2
- package/dist/{titlebar-Tqu-VvMU.d.ts.map → titlebar-B5zSTZnF.d.ts.map} +1 -1
- package/dist/titlebar.d.ts +1 -1
- package/dist/{tree-Bm2TzTfe.js → tree-DGveys4K.js} +3 -3
- package/dist/{tree-Bm2TzTfe.js.map → tree-DGveys4K.js.map} +1 -1
- package/dist/{tree-component-DukLqesg.d.ts → tree-component-Cj8V3uar.d.ts} +2 -2
- package/dist/{tree-component-DukLqesg.d.ts.map → tree-component-Cj8V3uar.d.ts.map} +1 -1
- package/dist/tree.d.ts +5 -5
- package/dist/tree.js +1 -1
- package/dist/{types-D-kYF16b.d.ts → types-DQ7KOUIj.d.ts} +6 -1
- package/dist/types-DQ7KOUIj.d.ts.map +1 -0
- package/dist/{vertical-list-DTp-UIUE.d.ts → vertical-list-CqBc-t8w.d.ts} +86 -4
- package/dist/vertical-list-CqBc-t8w.d.ts.map +1 -0
- package/dist/vertical-list.d.ts +3 -3
- package/dist/vertical-list.js +211 -3
- package/dist/vertical-list.js.map +1 -1
- package/docs-user/README.md +1 -0
- package/docs-user/flat-list.md +110 -0
- package/docs-user/index.json +7 -2
- package/docs-user/llms.txt +1 -0
- package/docs-user/vertical-list.md +59 -3
- package/llms.txt +1 -0
- package/package.json +5 -1
- package/dist/icon-CDGprSdE.d.ts.map +0 -1
- package/dist/narrowed-text.d.ts.map +0 -1
- package/dist/tickled-controller-Dh1Uh_vG.js.map +0 -1
- package/dist/types-D-kYF16b.d.ts.map +0 -1
- package/dist/vertical-list-DTp-UIUE.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-
|
|
1
|
+
import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
|
|
2
2
|
//#region src/interaction/list-drag-types.d.ts
|
|
3
3
|
interface ListDragEntry<T> {
|
|
4
4
|
readonly key: string;
|
|
@@ -409,4 +409,4 @@ interface TreeSearchHost extends TreeComponent {
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
export { TreeDataModelOptions as A, TreeItemDblClickEvent as C, TreeTickleDetail as D, TreeSelectEvent as E, ListDragPreviewSourceResolver as F, ListDragSource as I, ListNativeDragStartDetail as L, ListDragPreview as M, ListDragPreviewContext as N, TreeTickleEvent as O, ListDragPreviewRenderer as P, ListNativeDragStartEvent as R, TreeItemDblClickDetail as S, TreeSelectDetail as T, TreeDropTarget as _, TreeComponent as a, TreeItemClickDetail as b, TreeDragContext as c, TreeDragStartEvent as d, TreeDropApplyContext as f, TreeDropPosition as g, TreeDropEvent as h, TreeCollapseEvent as i, ListDragEntry as j, TreeDataModel as k, TreeDragEndEvent as l, TreeDropDetail as m, TreeActivateEvent as n, TreeComponentEventMap as o, TreeDropContext as p, TreeCollapseDetail as r, TreeDndMode as s, TreeActivateDetail as t, TreeDragOverEvent as u, TreeExpandDetail as v, TreeSearchHost as w, TreeItemClickEvent as x, TreeExpandEvent as y };
|
|
412
|
-
//# sourceMappingURL=tree-component-
|
|
412
|
+
//# sourceMappingURL=tree-component-Cj8V3uar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-component-
|
|
1
|
+
{"version":3,"file":"tree-component-Cj8V3uar.d.ts","names":[],"sources":["../src/interaction/list-drag-types.ts","../src/common/tree-data-model.ts","../src/common/tree-component.ts"],"mappings":";;UAAiB,cAAc;WACpB;WACA;WACA,MAAM,IAAI;;;;;;;;;;;;;;WAcV,UAAU;;KAGT;UAEK,uBAAuB;WAC7B,QAAQ;WACR,QAAQ,cAAc;WACtB,UAAU,cAAc,cAAc;WACtC;aACE;aACA;aACA;aACA;;WAEF,WAAW;WACX,2BAA2B,8BAA8B;;UAGnD;WACN,SAAS;WACT,UAAU;IAAW;IAAW;;WAChC,SAAS;WACT;;KAGC,wBAAwB,MAAM,SAAS,uBAAuB,OAAO;KAErE,8BAA8B,MACxC,OAAO,cAAc,OAClB;UAEY,0BAA0B;WAChC;WACA;WACA,MAAM,IAAI;WACV;WACA,UAAU,cAAc,cAAc;WACtC,UAAU;;KAGT,yBAAyB,eAAe,YAAY,0BAA0B;;;KCjDrF;EAAoB;EAAoB;;KACxC;EAAc;EAAc,MAAM;;KAClC,aAAa,kBAAkB;KAE/B,mBAAmB,OAAO;KA6DnB;;EAEV,MAAM;;;;;EAKN,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgCJ;;EAMC,YAAA,SAAS;;MAUjB,QAAQ;;;;;EAQZ,QAAQ,MAAM;;;;;;;;;EAkBR,YAAY,MAAM,UAAU,eAAe,QAAQ,cAAc,QAAQ;;;;;;EAyB/E,WAAW;;;;;EAaX,QAAQ,mBAAmB,MAAM,WAAW;;;;;EAU5C,WAAW,cAAc;;;;;EAWzB,WAAW,aAAa,OAAO,QAAQ,YAAY;;;;;;EAcnD,SAAS,aAAa,sBAAsB,iBAAiB;;;;;;;EAmB7D,iBAAiB,aAAa,sBAAsB,+BAA+B;;;;;;EAkBnF,UAAU,KAAK,uBAAuB;;;;;;EActC,WAAW,+BAA+B,MAAM,UAAU,iBAAiB;;;;;;;EA6B3E,WAAW,UAAU;;;;KC/RX;KAEA;UAEK;WACN;WACA;WACA;WACA,UAAU;WACV;;UAGM;WACN,gBAAgB;WAChB;;;;;;UAOM;WACN;;;;;WAKA,mBAAmB;WACnB;WACA,QAAQ;;UAGF,wBAAwB;WAC9B,cAAc;;UAGR,uBAAuB;WAC7B,oBAAoB;;KAGnB,qBAAqB,YAAY;KACjC,oBAAoB,YAAY;KAChC,gBAAgB,YAAY;KAC5B,mBAAmB;EAAc;;;;;;KAUjC;;WAED,UAAU,YAAY;;WAEtB,UAAU,YAAY;;;;;;;KAQrB;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;;;;;;KAQC;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;;;;;KAOC;WACD,MAAM;WACN;;KAIC,kBAAkB,YAAY;KAC9B,kBAAkB,YAAY;KAC9B,oBAAoB,YAAY;KAChC,qBAAqB,YAAY;KACjC,wBAAwB,YAAY;KACpC,kBAAkB,YAAY;KAC9B,oBAAoB,YAAY;UAM3B;EACf,UAAU;EACV,UAAU;EACV,YAAY;EACZ,cAAc;EACd,UAAU;EACV,YAAY;EACZ,0BAA0B,YAAY,0BAA0B;EAChE,mBAAmB;EACnB,kBAAkB;EAClB,aAAa;EACb,iBAAiB;;;;;;;;;;;;;;;UAoBF,sBAAsB;;;;;;EAQrC,MAAM;;;;;;;EAQN,OAAO;;;;;;EAOP,cAAc;;;;;EAQd,cAAc;;;;;WAML,eAAe,YAAY;;;;;;EASpC,iBAAiB;;;;;;EASjB,iBAAiB;;;;;;EASjB,aAAa;;EAKb,SAAS,MAAM;;EAEf,WAAW,MAAM;;EAEjB;;;;;;EAMA;;EAEA;;;;;EAQA,aAAa;;;;;EAMb,iBAAiB,YAAY,MAAM;;;;;;EAOnC,YAAY;;EAGZ,aAAa,OAAO,SAAS;;;;;EAQ7B,gBAAgB;IAAgB,MAAM;IAAU;;;;;;;;;;;UAejC,uBAAuB;WAC7B,YAAY;WACZ,gBAAgB"}
|
package/dist/tree.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as TreeDataModelOptions, C as TreeItemDblClickEvent, D as TreeTickleDetail, E as TreeSelectEvent, F as ListDragPreviewSourceResolver, L as ListNativeDragStartDetail, O as TreeTickleEvent, P as ListDragPreviewRenderer, T as TreeSelectDetail, _ as TreeDropTarget, a as TreeComponent, b as TreeItemClickDetail, c as TreeDragContext, d as TreeDragStartEvent, g as TreeDropPosition, h as TreeDropEvent, i as TreeCollapseEvent, k as TreeDataModel, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, r as TreeCollapseDetail, s as TreeDndMode, t as TreeActivateDetail, u as TreeDragOverEvent, v as TreeExpandDetail, w as TreeSearchHost, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-
|
|
2
|
-
import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-
|
|
3
|
-
import { S as ListSearchController } from "./index-
|
|
4
|
-
import { t as ListNativeDragController } from "./list-native-drag-controller-
|
|
5
|
-
import { n as TickledController } from "./tickled-controller-
|
|
1
|
+
import { A as TreeDataModelOptions, C as TreeItemDblClickEvent, D as TreeTickleDetail, E as TreeSelectEvent, F as ListDragPreviewSourceResolver, L as ListNativeDragStartDetail, O as TreeTickleEvent, P as ListDragPreviewRenderer, T as TreeSelectDetail, _ as TreeDropTarget, a as TreeComponent, b as TreeItemClickDetail, c as TreeDragContext, d as TreeDragStartEvent, g as TreeDropPosition, h as TreeDropEvent, i as TreeCollapseEvent, k as TreeDataModel, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, r as TreeCollapseDetail, s as TreeDndMode, t as TreeActivateDetail, u as TreeDragOverEvent, v as TreeExpandDetail, w as TreeSearchHost, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-Cj8V3uar.js";
|
|
2
|
+
import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
|
|
3
|
+
import { S as ListSearchController } from "./index-CxZ61DO1.js";
|
|
4
|
+
import { t as ListNativeDragController } from "./list-native-drag-controller-ChIi3eK5.js";
|
|
5
|
+
import { n as TickledController } from "./tickled-controller-DodxD3eQ.js";
|
|
6
6
|
import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, TemplateResult, nothing } from "lit";
|
|
7
7
|
import { CommandRegistry } from "@clinth/ui-commands";
|
|
8
8
|
import { TraversableTree } from "@ixfx/collections";
|
package/dist/tree.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TreeDataModel, i as TreeDropController, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-
|
|
1
|
+
import { a as TreeDataModel, i as TreeDropController, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-DGveys4K.js";
|
|
2
2
|
export { TreeBaseElement, TreeController, TreeDataModel, TreeDropController, TreeListElement };
|
|
@@ -31,6 +31,11 @@ type TreeItem = {
|
|
|
31
31
|
* name, list-style views right-justify it on the same line.
|
|
32
32
|
*/
|
|
33
33
|
badge?: unknown;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the label may be renamed in place. Only `ixfx-flat-list`
|
|
36
|
+
* (`beginEdit`) uses it; other components ignore it.
|
|
37
|
+
*/
|
|
38
|
+
editable?: boolean;
|
|
34
39
|
/** Tooltip text shown on hover. */
|
|
35
40
|
tooltip?: string;
|
|
36
41
|
/** Optional string value, e.g. for use as a command/route. */
|
|
@@ -96,4 +101,4 @@ type TreeSelectionFilter = `none` | `leaf` | `branch` | `all`;
|
|
|
96
101
|
type TreeInteractionMode = `implicit` | `standard` | `manual` | `checked` | `vscode`;
|
|
97
102
|
//#endregion
|
|
98
103
|
export { TreeItem as a, TreeInteractionMode as i, TreeExclusivity as n, TreeNode as o, TreeFilterPredicate as r, TreeSelectionFilter as s, LoadChildrenCallback as t };
|
|
99
|
-
//# sourceMappingURL=types-
|
|
104
|
+
//# sourceMappingURL=types-DQ7KOUIj.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-DQ7KOUIj.d.ts","names":[],"sources":["../src/common/types.ts"],"mappings":";;KAQY;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA;;;;;;EAMA;;;;;;;;EAQA;;;;;EAKA;;EAEA;;EAEA;;;;;;;EAOA;;;KAIU;EACV,MAAM;;;;;;;EAON,WAAW;;;;;;;KAQD,uBAAuB;EAAgB,MAAM;EAAU;GAAiB;;;;;;KAOxE,uBAAuB,MAAM,UAAU;;;;;;;KAQvC;;;;;;;;;KAUA;;;;;;;;;KAUA"}
|
|
@@ -1,9 +1,46 @@
|
|
|
1
|
-
import { F as ListDragPreviewSourceResolver, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent } from "./tree-component-
|
|
1
|
+
import { F as ListDragPreviewSourceResolver, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent } from "./tree-component-Cj8V3uar.js";
|
|
2
2
|
import { n as ListViewportChangeEvent } from "./list-viewport-types-BRZsLcvp.js";
|
|
3
|
-
import { S as ListSearchController } from "./index-
|
|
3
|
+
import { S as ListSearchController } from "./index-CxZ61DO1.js";
|
|
4
4
|
import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-PjKdhF-a.js";
|
|
5
|
+
import "./editable-label-rzXkjf1H.js";
|
|
5
6
|
import { LitElement, PropertyValues } from "lit";
|
|
6
7
|
import { CommandId, CommandRegistry } from "@clinth/ui-commands";
|
|
8
|
+
//#region src/vertical-list/types.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* `list-drag-over` / `list-drop`. `key` and `item` are `undefined` when the
|
|
11
|
+
* drag is over empty list space rather than a row.
|
|
12
|
+
*/
|
|
13
|
+
type ListDropDetail = {
|
|
14
|
+
readonly key: string | undefined;
|
|
15
|
+
readonly item: Element | undefined;
|
|
16
|
+
readonly dataTransfer: DataTransfer;
|
|
17
|
+
};
|
|
18
|
+
type ListDragLeaveDetail = {
|
|
19
|
+
readonly key: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
type ListContextMenuDetail = {
|
|
22
|
+
readonly key: string | undefined;
|
|
23
|
+
readonly item: Element;
|
|
24
|
+
/** Viewport coordinates to open the menu at. */
|
|
25
|
+
readonly x: number;
|
|
26
|
+
readonly y: number;
|
|
27
|
+
/** The selection at the time of the request — a row that was not selected has been selected first. */
|
|
28
|
+
readonly selectedKeys: ReadonlySet<string>;
|
|
29
|
+
};
|
|
30
|
+
type ListEditCommitDetail = {
|
|
31
|
+
readonly key: string | undefined;
|
|
32
|
+
readonly value: string;
|
|
33
|
+
};
|
|
34
|
+
type ListEditCancelDetail = {
|
|
35
|
+
readonly key: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
type ListDragOverEvent = CustomEvent<ListDropDetail>;
|
|
38
|
+
type ListDropEvent = CustomEvent<ListDropDetail>;
|
|
39
|
+
type ListDragLeaveEvent = CustomEvent<ListDragLeaveDetail>;
|
|
40
|
+
type ListContextMenuEvent = CustomEvent<ListContextMenuDetail>;
|
|
41
|
+
type ListEditCommitEvent = CustomEvent<ListEditCommitDetail>;
|
|
42
|
+
type ListEditCancelEvent = CustomEvent<ListEditCancelDetail>;
|
|
43
|
+
//#endregion
|
|
7
44
|
//#region src/vertical-list/vertical-list.d.ts
|
|
8
45
|
interface CustomCheckboxOptions {
|
|
9
46
|
renderer: (checked: boolean) => unknown;
|
|
@@ -138,6 +175,27 @@ declare class VerticalListElement extends LitElement {
|
|
|
138
175
|
* `ixfx-grid-list`'s `itemSize`.
|
|
139
176
|
*/
|
|
140
177
|
itemHeight: number;
|
|
178
|
+
/**
|
|
179
|
+
* Make rows (and the empty space around them) drop targets for native
|
|
180
|
+
* drags — including OS drags carrying files. The list fires `list-drag-over`
|
|
181
|
+
* (cancelable: `preventDefault()` accepts the drop), `list-drop` and
|
|
182
|
+
* `list-drag-leave`, and highlights the row under the drag with
|
|
183
|
+
* `data-drop-target` (`--list-drop-target-bg`, `--list-drop-target-outline`).
|
|
184
|
+
*/
|
|
185
|
+
itemsDroppable: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Opt in to in-place rename (`beginEdit`). Called with the typed text and
|
|
188
|
+
* the row's key when the user commits; return `false` to reject it (the
|
|
189
|
+
* edit then ends as a cancel). Without it `beginEdit` does nothing and rows
|
|
190
|
+
* stay plain text.
|
|
191
|
+
*/
|
|
192
|
+
editValidator: ((value: string, key: string | undefined) => boolean) | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Refuse a drop before any event fires or any highlight shows. `item` is the
|
|
195
|
+
* row under the drag, or `undefined` over empty space. Only used while
|
|
196
|
+
* `itemsDroppable` is set.
|
|
197
|
+
*/
|
|
198
|
+
canDrop: ((item: Element | undefined, dataTransfer: DataTransfer) => boolean) | undefined;
|
|
141
199
|
private readonly selection;
|
|
142
200
|
private tickled;
|
|
143
201
|
private _syncNativeDraggable;
|
|
@@ -261,6 +319,24 @@ declare class VerticalListElement extends LitElement {
|
|
|
261
319
|
private _onClick;
|
|
262
320
|
private _onDblClick;
|
|
263
321
|
private _activateItem;
|
|
322
|
+
private _onDragOver;
|
|
323
|
+
private _onDragLeave;
|
|
324
|
+
private _onDrop;
|
|
325
|
+
private _onContextMenu;
|
|
326
|
+
/** The key of the row being edited, if any. */
|
|
327
|
+
get editingKey(): string | undefined;
|
|
328
|
+
/**
|
|
329
|
+
* Edit a row's label in place with an `ixfx-editable-label`. The editor
|
|
330
|
+
* replaces the row's `[data-edit-label]` element (else the whole row) and
|
|
331
|
+
* the original content returns when editing ends. Fires `list-edit-commit`
|
|
332
|
+
* `{ key, value }` when the text changed, otherwise `list-edit-cancel`
|
|
333
|
+
* `{ key }` (Escape, an unchanged value, or one the label rejects). The list
|
|
334
|
+
* never rewrites the label itself — update your data in response.
|
|
335
|
+
*
|
|
336
|
+
* Returns false when `editValidator` is not set, or the row is unknown or
|
|
337
|
+
* not currently rendered.
|
|
338
|
+
*/
|
|
339
|
+
beginEdit(key: string): boolean;
|
|
264
340
|
static styles: import("lit").CSSResult[];
|
|
265
341
|
render(): import("lit").TemplateResult<1>;
|
|
266
342
|
}
|
|
@@ -273,7 +349,13 @@ declare global {
|
|
|
273
349
|
interface VerticalListElementEventMap extends ListElementEventMap {
|
|
274
350
|
'vertical-list-viewport-change': ListViewportChangeEvent;
|
|
275
351
|
'list-native-drag-start': ListNativeDragStartEvent<Element>;
|
|
352
|
+
'list-drag-over': ListDragOverEvent;
|
|
353
|
+
'list-drop': ListDropEvent;
|
|
354
|
+
'list-drag-leave': ListDragLeaveEvent;
|
|
355
|
+
'list-context-menu': ListContextMenuEvent;
|
|
356
|
+
'list-edit-commit': ListEditCommitEvent;
|
|
357
|
+
'list-edit-cancel': ListEditCancelEvent;
|
|
276
358
|
}
|
|
277
359
|
//#endregion
|
|
278
|
-
export { VerticalListElementEventMap as i, CustomCheckboxOptions as n, VerticalListElement as r, AddItemOptions as t };
|
|
279
|
-
//# sourceMappingURL=vertical-list-
|
|
360
|
+
export { ListContextMenuDetail as a, ListDragLeaveEvent as c, ListDropEvent as d, ListEditCancelDetail as f, ListEditCommitEvent as h, VerticalListElementEventMap as i, ListDragOverEvent as l, ListEditCommitDetail as m, CustomCheckboxOptions as n, ListContextMenuEvent as o, ListEditCancelEvent as p, VerticalListElement as r, ListDragLeaveDetail as s, AddItemOptions as t, ListDropDetail as u };
|
|
361
|
+
//# sourceMappingURL=vertical-list-CqBc-t8w.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-list-CqBc-t8w.d.ts","names":[],"sources":["../src/vertical-list/types.ts","../src/vertical-list/vertical-list.ts"],"mappings":";;;;;;;;;;;;KAuBY;WACD;WACA,MAAM;WACN,cAAc;;KAGb;WACD;;KAGC;WACD;WACA,MAAM;;WAEN;WACA;;WAEA,cAAc;;KAGb;WACD;WACA;;KAGC;WACD;;KAGC,oBAAoB,YAAY;KAChC,gBAAgB,YAAY;KAC5B,qBAAqB,YAAY;KACjC,uBAAuB,YAAY;KACnC,sBAAsB,YAAY;KAClC,sBAAsB,YAAY;;;UC+B7B;EACf,WAAW;EACX;EACA;;UAGe;;;;;;EAMf;;cAkCW,4BAA4B;;EAEvC,eAAe;EAGf,iBAAiB;EAGjB,mBAAmB,IAAI;;;;;;EAQvB;;;;;;;;;;;;;;;;;;;EAqBA,oBAAoB,gCAAgC;;;;;;EAQpD;;;;;;EAQA;;;;;EAOA,qBAAqB,wBAAwB;EAG7C,mBAAmB,8BAA8B;;;;;;;;;;;EAajD;;;;;EAOA;;;;;;;;;EAWA,aAAa,eAAe;;;;;;;EAS5B,QAAQ,eAAe;;;;;EAOvB,aAAa,eAAe;;;;;EAO5B,aAAa,eAAe;;;;;;EAQ5B,SAAS,eAAe;;;;;;;;;;;;;;;;;;EAoBxB;;;;;;EAQA;;;;;;;;EAUA;;;;;;;EASA,iBAAiB,eAAe;;;;;;EAQhC,WAAW,MAAM,qBAAqB,cAAc;mBAyCnC;UAeT;UA6EA;;WA6EC,QAAM,qBAAA;;MAYX,YAAY;EA2BP;EA0BA;;;;;;YAkCU;EAwDV,QAAQ,SAAS;;MAgFtB,gBAAgB;;MAKhB,iBAAiB,YAAY;EAIjC,QAAQ,MAAM,kBAAkB,UAAU;;;;;;;EA4B1C,WAAW,MAAM,UAAU;;EA2B3B,YAAY,OAAO,SAAS,WAAW;EAIvC;;;;;;EAmBA,SAAS,gBAAgB;;;;;;EAwBzB,SAAS,WAAW,WAAW,OAAO;EAItC,OAAO,MAAM;EAIb,WAAW,OAAO,SAAS;EAI3B,SAAS,MAAM;EAIf;EAIA;;MAQI,gBAAgB;;MAKhB;;EAMJ,WAAW,MAAM;;EAKjB,gBAAgB,MAAM;;EAKtB,mBAAmB,MAAM;;;;;;EASzB,SAAS;;EAgCT,aAAa,cAAc;;;;;;;;EAW3B;;;;;;;EAuBA;EAsBE,eAAe,0CAA0C,UAAU;;;;;EA2CrE,YAAY,MAAM;;;;;;;;;;;EAclB,WAAW,aAAa;UAmiBhB;UAgBA;UAOA;UAiBA;;;;;;;UA4GA;;;;;UAuBA;UAcA;UAYA;UAQA;UAWA;UAMA;UAIA;UAmEA;UAYA;UAQA;UAaA;UA2BA;UAOA;UAwCA;;MAuCJ;;;;;;;;;;;;EAmBJ,UAAU;SAiEM,sBAAM;EAuLb,wBAAM;;QAeT;YACI;IACR,sBAAsB;;YAGd,4BAA4B;;UAGvB,oCAAoC;EACnD,iCAAiC;EACjC,0BAA0B,yBAAyB;EACnD,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;EACrB,oBAAoB;EACpB,oBAAoB"}
|
package/dist/vertical-list.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ListDragSource, L as ListNativeDragStartDetail, M as ListDragPreview, N as ListDragPreviewContext, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent, j as ListDragEntry } from "./tree-component-
|
|
1
|
+
import { I as ListDragSource, L as ListNativeDragStartDetail, M as ListDragPreview, N as ListDragPreviewContext, P as ListDragPreviewRenderer, R as ListNativeDragStartEvent, j as ListDragEntry } from "./tree-component-Cj8V3uar.js";
|
|
2
2
|
import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
|
|
3
3
|
import { a as ListItemClickDetail, c as ListSelectEvent, d as ListTickleEvent, i as ListInteractionMode, l as ListSelectionMode, n as ListActivateEvent, o as ListItemClickEvent, r as ListElementEventMap, s as ListSelectDetail, t as ListActivateDetail, u as ListTickleDetail } from "./list-selection-types-PjKdhF-a.js";
|
|
4
|
-
import { i as VerticalListElementEventMap, n as CustomCheckboxOptions, r as VerticalListElement, t as AddItemOptions } from "./vertical-list-
|
|
5
|
-
export { AddItemOptions, CustomCheckboxOptions, type ListActivateDetail, type ListActivateEvent, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListElementEventMap, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListSelectDetail, type ListSelectEvent, type ListSelectionMode, type ListTickleDetail, type ListTickleEvent, type ListViewportChangeDetail, type ListViewportChangeEvent, VerticalListElement, VerticalListElementEventMap };
|
|
4
|
+
import { a as ListContextMenuDetail, c as ListDragLeaveEvent, d as ListDropEvent, f as ListEditCancelDetail, h as ListEditCommitEvent, i as VerticalListElementEventMap, l as ListDragOverEvent, m as ListEditCommitDetail, n as CustomCheckboxOptions, o as ListContextMenuEvent, p as ListEditCancelEvent, r as VerticalListElement, s as ListDragLeaveDetail, t as AddItemOptions, u as ListDropDetail } from "./vertical-list-CqBc-t8w.js";
|
|
5
|
+
export { AddItemOptions, CustomCheckboxOptions, type ListActivateDetail, type ListActivateEvent, type ListContextMenuDetail, type ListContextMenuEvent, type ListDragEntry, type ListDragLeaveDetail, type ListDragLeaveEvent, type ListDragOverEvent, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListDropDetail, type ListDropEvent, type ListEditCancelDetail, type ListEditCancelEvent, type ListEditCommitDetail, type ListEditCommitEvent, type ListElementEventMap, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListSelectDetail, type ListSelectEvent, type ListSelectionMode, type ListTickleDetail, type ListTickleEvent, type ListViewportChangeDetail, type ListViewportChangeEvent, VerticalListElement, VerticalListElementEventMap };
|
package/dist/vertical-list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as TickledController } from "./tickled-controller-
|
|
1
|
+
import { t as TickledController } from "./tickled-controller-D-HZymaZ.js";
|
|
2
2
|
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 { c as createElementListSearchAdapter, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-D91M4Ozq.js";
|
|
@@ -7,6 +7,7 @@ import { r as ListDragSelectController, t as ListSelectionController } from "./l
|
|
|
7
7
|
import { n as animateListItemIn, r as animateListItemOut } from "./list-item-animation-BUoEKi5s.js";
|
|
8
8
|
import { t as scrollFadeStyles } from "./scroll-fade-BrNUIYnm.js";
|
|
9
9
|
import { n as appearanceColor, t as appearanceAbsent } from "./item-appearance-BjcMyauw.js";
|
|
10
|
+
import "./editable-label.js";
|
|
10
11
|
import { LitElement, css, html, render } from "lit";
|
|
11
12
|
import { property } from "lit/decorators.js";
|
|
12
13
|
import { createCommandRegistry } from "@clinth/ui-commands";
|
|
@@ -43,6 +44,7 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
43
44
|
this.keyProperty = ``;
|
|
44
45
|
this.virtualize = false;
|
|
45
46
|
this.itemHeight = 0;
|
|
47
|
+
this.itemsDroppable = false;
|
|
46
48
|
this.#customWrappers = /* @__PURE__ */ new Map();
|
|
47
49
|
this.#wrappedElements = /* @__PURE__ */ new Set();
|
|
48
50
|
this.#itemData = /* @__PURE__ */ new WeakMap();
|
|
@@ -162,7 +164,16 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
162
164
|
this.tickled.handlePointerLeave(e);
|
|
163
165
|
};
|
|
164
166
|
this._onKeyDown = (e) => {
|
|
165
|
-
if (this.search.isOpen) return;
|
|
167
|
+
if (this.search.isOpen || this.#isEditEvent(e)) return;
|
|
168
|
+
if (e.key === `ContextMenu` || e.shiftKey && e.key === `F10`) {
|
|
169
|
+
const id = this.tickled.tickledId;
|
|
170
|
+
if (id) {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
const rect = id.getBoundingClientRect();
|
|
173
|
+
this.#requestContextMenu(id, rect.left, rect.bottom);
|
|
174
|
+
}
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
166
177
|
if ((e.ctrlKey || e.metaKey) && e.key === `a`) {
|
|
167
178
|
if (this.selection.canSelectAll()) {
|
|
168
179
|
e.preventDefault();
|
|
@@ -174,6 +185,10 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
174
185
|
case `ArrowDown`:
|
|
175
186
|
e.preventDefault();
|
|
176
187
|
this.tickled.handleKeyboardNavigation(`next`);
|
|
188
|
+
this.tickled.tickledId?.scrollIntoView({
|
|
189
|
+
block: `nearest`,
|
|
190
|
+
inline: `nearest`
|
|
191
|
+
});
|
|
177
192
|
if (e.shiftKey && this.interactionMode === `vscode`) {
|
|
178
193
|
const cur = this.tickled.tickledId;
|
|
179
194
|
if (cur) this.selection.rangeTo(cur);
|
|
@@ -182,6 +197,10 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
182
197
|
case `ArrowUp`:
|
|
183
198
|
e.preventDefault();
|
|
184
199
|
this.tickled.handleKeyboardNavigation(`previous`);
|
|
200
|
+
this.tickled.tickledId?.scrollIntoView({
|
|
201
|
+
block: `nearest`,
|
|
202
|
+
inline: `nearest`
|
|
203
|
+
});
|
|
185
204
|
if (e.shiftKey && this.interactionMode === `vscode`) {
|
|
186
205
|
const cur = this.tickled.tickledId;
|
|
187
206
|
if (cur) this.selection.rangeTo(cur);
|
|
@@ -208,6 +227,7 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
208
227
|
}
|
|
209
228
|
};
|
|
210
229
|
this._onClick = (e) => {
|
|
230
|
+
if (this.#isEditEvent(e)) return;
|
|
211
231
|
if (this.#dragSelect.isDragging || this.#nativeDrag.isDragging || this.#postDragSuppressTimer !== 0) return;
|
|
212
232
|
const item = this._findListItem(e.composedPath());
|
|
213
233
|
if (!item) return;
|
|
@@ -215,9 +235,60 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
215
235
|
this.selection.handleClick(item, e);
|
|
216
236
|
};
|
|
217
237
|
this._onDblClick = (e) => {
|
|
238
|
+
if (this.#isEditEvent(e)) return;
|
|
218
239
|
const item = this._findListItem(e.composedPath());
|
|
219
240
|
if (item) this._activateItem(item);
|
|
220
241
|
};
|
|
242
|
+
this._onDragOver = (e) => {
|
|
243
|
+
const dt = e.dataTransfer;
|
|
244
|
+
if (!this.itemsDroppable || !dt || this.#isEditEvent(e)) return;
|
|
245
|
+
const item = this._findListItem(e.composedPath());
|
|
246
|
+
if (this.canDrop && !this.canDrop(item, dt)) {
|
|
247
|
+
this.#clearDropTarget();
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (this.#dragOver && this.#dragOver.item !== item) this.#clearDropTarget();
|
|
251
|
+
this.#dragOver = { item };
|
|
252
|
+
if (!!this._dispatchCancelable(`list-drag-over`, {
|
|
253
|
+
key: item ? keyForElement(item) : void 0,
|
|
254
|
+
item,
|
|
255
|
+
dataTransfer: dt
|
|
256
|
+
})) {
|
|
257
|
+
this.#highlightDropTarget(void 0, false);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
e.preventDefault();
|
|
261
|
+
if (dt.dropEffect === `none`) dt.dropEffect = `copy`;
|
|
262
|
+
this.#highlightDropTarget(item, true);
|
|
263
|
+
};
|
|
264
|
+
this._onDragLeave = (e) => {
|
|
265
|
+
const next = e.relatedTarget;
|
|
266
|
+
if (next instanceof Node && this.contains(next)) return;
|
|
267
|
+
this.#clearDropTarget();
|
|
268
|
+
};
|
|
269
|
+
this._onDrop = (e) => {
|
|
270
|
+
const dt = e.dataTransfer;
|
|
271
|
+
if (!this.itemsDroppable || !dt || this.#isEditEvent(e)) return;
|
|
272
|
+
const item = this._findListItem(e.composedPath());
|
|
273
|
+
if (this.canDrop && !this.canDrop(item, dt)) {
|
|
274
|
+
this.#clearDropTarget();
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
e.preventDefault();
|
|
278
|
+
this.#dragOver = void 0;
|
|
279
|
+
this.#highlightDropTarget(void 0, false);
|
|
280
|
+
this._dispatch(`list-drop`, {
|
|
281
|
+
key: item ? keyForElement(item) : void 0,
|
|
282
|
+
item,
|
|
283
|
+
dataTransfer: dt
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
this._onContextMenu = (e) => {
|
|
287
|
+
if (this.#isEditEvent(e)) return;
|
|
288
|
+
const item = this._findListItem(e.composedPath());
|
|
289
|
+
if (!item) return;
|
|
290
|
+
if (!this.#requestContextMenu(item, e.clientX, e.clientY)) e.preventDefault();
|
|
291
|
+
};
|
|
221
292
|
}
|
|
222
293
|
#customWrappers;
|
|
223
294
|
#wrappedElements;
|
|
@@ -344,6 +415,10 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
344
415
|
this.addEventListener(`keydown`, this._onKeyDown);
|
|
345
416
|
this.addEventListener(`click`, this._onClick);
|
|
346
417
|
this.addEventListener(`dblclick`, this._onDblClick);
|
|
418
|
+
this.addEventListener(`dragover`, this._onDragOver);
|
|
419
|
+
this.addEventListener(`dragleave`, this._onDragLeave);
|
|
420
|
+
this.addEventListener(`drop`, this._onDrop);
|
|
421
|
+
this.addEventListener(`contextmenu`, this._onContextMenu);
|
|
347
422
|
for (const el of this.querySelectorAll(ITEM_SELECTOR)) this.#animatedItems.add(el);
|
|
348
423
|
this.#itemObserver ??= new MutationObserver((records) => this.#onItemsMutated(records));
|
|
349
424
|
this.#itemObserver.observe(this, { childList: true });
|
|
@@ -358,6 +433,12 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
358
433
|
this.removeEventListener(`keydown`, this._onKeyDown);
|
|
359
434
|
this.removeEventListener(`click`, this._onClick);
|
|
360
435
|
this.removeEventListener(`dblclick`, this._onDblClick);
|
|
436
|
+
this.removeEventListener(`dragover`, this._onDragOver);
|
|
437
|
+
this.removeEventListener(`dragleave`, this._onDragLeave);
|
|
438
|
+
this.removeEventListener(`drop`, this._onDrop);
|
|
439
|
+
this.removeEventListener(`contextmenu`, this._onContextMenu);
|
|
440
|
+
this.#clearDropTarget();
|
|
441
|
+
this.#edit = void 0;
|
|
361
442
|
this.#itemObserver?.disconnect();
|
|
362
443
|
this.#resizeObserver?.disconnect();
|
|
363
444
|
this.#resizeObserver = void 0;
|
|
@@ -1044,7 +1125,7 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
1044
1125
|
}
|
|
1045
1126
|
/** Per-attach state the attached sweep can't cover (it only sees the window). */
|
|
1046
1127
|
#applyRowState(el) {
|
|
1047
|
-
if (el instanceof HTMLElement) el.draggable = this.itemsDraggable && this._isCheckable(el);
|
|
1128
|
+
if (el instanceof HTMLElement) el.draggable = this.itemsDraggable && this._isCheckable(el) && !el.hasAttribute(`data-editing`);
|
|
1048
1129
|
el.removeAttribute(`data-marquee`);
|
|
1049
1130
|
el.removeAttribute(`data-drag-origin`);
|
|
1050
1131
|
}
|
|
@@ -1254,6 +1335,114 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
1254
1335
|
if (this.interactionMode !== `manual`) this.selection.replace(item);
|
|
1255
1336
|
this._dispatch(`list-activate`, { item });
|
|
1256
1337
|
}
|
|
1338
|
+
/** The row (or `undefined` for empty space) the last `list-drag-over` was fired for. */
|
|
1339
|
+
#dragOver;
|
|
1340
|
+
/** Tell the consumer the drag left its last target and drop the highlight. */
|
|
1341
|
+
#clearDropTarget() {
|
|
1342
|
+
const last = this.#dragOver;
|
|
1343
|
+
this.#dragOver = void 0;
|
|
1344
|
+
this.#highlightDropTarget(void 0, false);
|
|
1345
|
+
if (last) this._dispatch(`list-drag-leave`, { key: last.item ? keyForElement(last.item) : void 0 });
|
|
1346
|
+
}
|
|
1347
|
+
/** Mark one row (or, for empty space, the host) as the drop target. */
|
|
1348
|
+
#highlightDropTarget(item, active) {
|
|
1349
|
+
for (const el of this.querySelectorAll(`[data-drop-target]`)) el.removeAttribute(`data-drop-target`);
|
|
1350
|
+
this.toggleAttribute(`data-drop-target`, active && item === void 0);
|
|
1351
|
+
if (active && item) item.setAttribute(`data-drop-target`, ``);
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Select the row if it is not already, then fire `list-context-menu`.
|
|
1355
|
+
* Returns false when a listener cancelled it (the native menu is then suppressed).
|
|
1356
|
+
*/
|
|
1357
|
+
#requestContextMenu(item, x, y) {
|
|
1358
|
+
if (!this.selection.selected.has(item) && this.interactionMode !== `manual` && this._isCheckable(item)) this.selection.replace(item);
|
|
1359
|
+
return this._dispatchCancelable(`list-context-menu`, {
|
|
1360
|
+
key: keyForElement(item),
|
|
1361
|
+
item,
|
|
1362
|
+
x,
|
|
1363
|
+
y,
|
|
1364
|
+
selectedKeys: this.selection.selectedKeys
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
#edit;
|
|
1368
|
+
/** The key of the row being edited, if any. */
|
|
1369
|
+
get editingKey() {
|
|
1370
|
+
return this.#edit?.key;
|
|
1371
|
+
}
|
|
1372
|
+
#isEditEvent(e) {
|
|
1373
|
+
return this.#edit !== void 0 && e.composedPath().includes(this.#edit.label);
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Edit a row's label in place with an `ixfx-editable-label`. The editor
|
|
1377
|
+
* replaces the row's `[data-edit-label]` element (else the whole row) and
|
|
1378
|
+
* the original content returns when editing ends. Fires `list-edit-commit`
|
|
1379
|
+
* `{ key, value }` when the text changed, otherwise `list-edit-cancel`
|
|
1380
|
+
* `{ key }` (Escape, an unchanged value, or one the label rejects). The list
|
|
1381
|
+
* never rewrites the label itself — update your data in response.
|
|
1382
|
+
*
|
|
1383
|
+
* Returns false when `editValidator` is not set, or the row is unknown or
|
|
1384
|
+
* not currently rendered.
|
|
1385
|
+
*/
|
|
1386
|
+
beginEdit(key) {
|
|
1387
|
+
this.#finishEdit();
|
|
1388
|
+
const validate = this.editValidator;
|
|
1389
|
+
if (!validate) return false;
|
|
1390
|
+
const row = this.#itemForKey(key);
|
|
1391
|
+
if (!(row instanceof HTMLElement) || row.parentNode !== this) return false;
|
|
1392
|
+
const container = row.querySelector(`[data-edit-label]`) ?? row;
|
|
1393
|
+
const value = container.getAttribute(`data-edit-value`) ?? container.textContent?.trim() ?? ``;
|
|
1394
|
+
const label = document.createElement(`ixfx-editable-label`);
|
|
1395
|
+
label.mode = `label`;
|
|
1396
|
+
label.value = value;
|
|
1397
|
+
label.validator = (text) => validate(text, key);
|
|
1398
|
+
label.style.cssText = `flex:1;min-width:0;--label-align:left;--label-padding:0 var(--space-xs,3px)`;
|
|
1399
|
+
const edit = {
|
|
1400
|
+
key,
|
|
1401
|
+
row,
|
|
1402
|
+
container,
|
|
1403
|
+
saved: [...container.childNodes],
|
|
1404
|
+
label,
|
|
1405
|
+
committed: void 0,
|
|
1406
|
+
refocus: false
|
|
1407
|
+
};
|
|
1408
|
+
this.#edit = edit;
|
|
1409
|
+
label.addEventListener(`change`, (e) => {
|
|
1410
|
+
e.stopPropagation();
|
|
1411
|
+
edit.committed = e.detail.value;
|
|
1412
|
+
});
|
|
1413
|
+
label.addEventListener(`input`, (e) => e.stopPropagation());
|
|
1414
|
+
label.addEventListener(`keydown`, (e) => {
|
|
1415
|
+
edit.refocus = e.key === `Enter` || e.key === `Escape`;
|
|
1416
|
+
});
|
|
1417
|
+
for (const type of [`pointerdown`, `dragstart`]) label.addEventListener(type, (e) => e.stopPropagation());
|
|
1418
|
+
label.addEventListener(`focusout`, () => this.#finishEdit());
|
|
1419
|
+
container.replaceChildren(label);
|
|
1420
|
+
row.setAttribute(`data-editing`, ``);
|
|
1421
|
+
row.draggable = false;
|
|
1422
|
+
row.scrollIntoView({
|
|
1423
|
+
block: `nearest`,
|
|
1424
|
+
inline: `nearest`
|
|
1425
|
+
});
|
|
1426
|
+
label.updateComplete.then(() => {
|
|
1427
|
+
if (this.#edit === edit) label.shadowRoot?.querySelector(`.content`)?.click();
|
|
1428
|
+
});
|
|
1429
|
+
return true;
|
|
1430
|
+
}
|
|
1431
|
+
/** Restore the row's content and report how the edit ended. */
|
|
1432
|
+
#finishEdit() {
|
|
1433
|
+
const edit = this.#edit;
|
|
1434
|
+
if (!edit) return;
|
|
1435
|
+
this.#edit = void 0;
|
|
1436
|
+
if (edit.container.isConnected) edit.container.replaceChildren(...edit.saved);
|
|
1437
|
+
edit.row.removeAttribute(`data-editing`);
|
|
1438
|
+
this.#applyRowState(edit.row);
|
|
1439
|
+
if (edit.refocus) this.focus();
|
|
1440
|
+
if (edit.committed === void 0) this._dispatch(`list-edit-cancel`, { key: edit.key });
|
|
1441
|
+
else this._dispatch(`list-edit-commit`, {
|
|
1442
|
+
key: edit.key,
|
|
1443
|
+
value: edit.committed
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1257
1446
|
static {
|
|
1258
1447
|
this.styles = [
|
|
1259
1448
|
themeFallbacks,
|
|
@@ -1414,6 +1603,18 @@ let VerticalListElement = class VerticalListElement extends LitElement {
|
|
|
1414
1603
|
opacity: 0.6;
|
|
1415
1604
|
}
|
|
1416
1605
|
|
|
1606
|
+
/* Native drop target: the row under a drag, or the whole list over empty space. */
|
|
1607
|
+
::slotted([data-drop-target]) {
|
|
1608
|
+
background: var(--list-drop-target-bg, color-mix(in srgb, var(--accent) 25%, transparent));
|
|
1609
|
+
outline: 2px solid var(--list-drop-target-outline, var(--accent));
|
|
1610
|
+
outline-offset: -2px;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
:host([data-drop-target]) {
|
|
1614
|
+
outline: 2px solid var(--list-drop-target-outline, var(--accent));
|
|
1615
|
+
outline-offset: -2px;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1417
1618
|
/* checked mode: checkbox (injected into li) communicates selection — suppress bg highlight */
|
|
1418
1619
|
:host([interaction-mode="checked"]) ::slotted([data-selected]) {
|
|
1419
1620
|
background: transparent;
|
|
@@ -1486,6 +1687,13 @@ __decorate([property({
|
|
|
1486
1687
|
type: Number,
|
|
1487
1688
|
attribute: `item-height`
|
|
1488
1689
|
})], VerticalListElement.prototype, "itemHeight", void 0);
|
|
1690
|
+
__decorate([property({
|
|
1691
|
+
type: Boolean,
|
|
1692
|
+
attribute: `items-droppable`,
|
|
1693
|
+
reflect: true
|
|
1694
|
+
})], VerticalListElement.prototype, "itemsDroppable", void 0);
|
|
1695
|
+
__decorate([property({ attribute: false })], VerticalListElement.prototype, "editValidator", void 0);
|
|
1696
|
+
__decorate([property({ attribute: false })], VerticalListElement.prototype, "canDrop", void 0);
|
|
1489
1697
|
VerticalListElement = __decorate([safeCustomElement(`ixfx-vertical-list`)], VerticalListElement);
|
|
1490
1698
|
//#endregion
|
|
1491
1699
|
export { VerticalListElement };
|