@ixfx/components 0.5.2 → 0.5.4
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 +97 -2
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +348 -30
- package/bundle/index.js.map +1 -1
- package/dist/index.d.ts +97 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +326 -8
- package/dist/index.js.map +1 -1
- package/docs-user/tabs.md +95 -1
- package/docs-user/vertical-list.md +44 -4
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -11807,12 +11807,15 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11807
11807
|
get selectedItems() {
|
|
11808
11808
|
return this._selectedItems;
|
|
11809
11809
|
}
|
|
11810
|
-
addItem(item) {
|
|
11810
|
+
addItem(item, options) {
|
|
11811
|
+
let el;
|
|
11811
11812
|
if (typeof item === `string`) {
|
|
11812
11813
|
const li = document.createElement(`li`);
|
|
11813
11814
|
li.textContent = item;
|
|
11814
|
-
|
|
11815
|
-
} else
|
|
11815
|
+
el = li;
|
|
11816
|
+
} else el = item;
|
|
11817
|
+
if (options?.notChecked) el.setAttribute(`not-checked`, ``);
|
|
11818
|
+
this.appendChild(el);
|
|
11816
11819
|
if (this.interactionMode === `checked`) this._syncCheckboxes();
|
|
11817
11820
|
}
|
|
11818
11821
|
removeItem(item) {
|
|
@@ -11847,7 +11850,7 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11847
11850
|
selectMany(items) {
|
|
11848
11851
|
if (this.selectionMode !== `multiple`) throw new Error(`selectMany requires selectionMode="multiple" (current: "${this.selectionMode}")`);
|
|
11849
11852
|
const previous = this._selectedItems;
|
|
11850
|
-
const next = new Set(items);
|
|
11853
|
+
const next = new Set([...items].filter((el) => this._isCheckable(el)));
|
|
11851
11854
|
if (next.size === 0) return;
|
|
11852
11855
|
this._selectedItems = next;
|
|
11853
11856
|
this.#selectionAnchor = [...next].at(-1);
|
|
@@ -11877,6 +11880,7 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11877
11880
|
}
|
|
11878
11881
|
_replaceSelection(item) {
|
|
11879
11882
|
if (this.selectionMode === `none`) return;
|
|
11883
|
+
if (!this._isCheckable(item)) return;
|
|
11880
11884
|
const previous = this._selectedItems;
|
|
11881
11885
|
const next = /* @__PURE__ */ new Set([item]);
|
|
11882
11886
|
this._selectedItems = next;
|
|
@@ -11888,6 +11892,7 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11888
11892
|
});
|
|
11889
11893
|
}
|
|
11890
11894
|
_toggleItem(item) {
|
|
11895
|
+
if (!this._isCheckable(item)) return;
|
|
11891
11896
|
const effectiveMultiple = this.selectionMode === `multiple` || isMultiMode(this.interactionMode);
|
|
11892
11897
|
if (this.selectionMode === `none` && this.interactionMode !== `checked`) return;
|
|
11893
11898
|
const previous = this._selectedItems;
|
|
@@ -11920,7 +11925,7 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11920
11925
|
const start = Math.min(anchorIdx, targetIdx);
|
|
11921
11926
|
const end = Math.max(anchorIdx, targetIdx);
|
|
11922
11927
|
const previous = this._selectedItems;
|
|
11923
|
-
const next = new Set(visible.slice(start, end + 1));
|
|
11928
|
+
const next = new Set(visible.slice(start, end + 1).filter((el) => this._isCheckable(el)));
|
|
11924
11929
|
this._selectedItems = next;
|
|
11925
11930
|
this._syncItemStates();
|
|
11926
11931
|
this._dispatch(`list-select`, {
|
|
@@ -11942,7 +11947,8 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11942
11947
|
const visible = this._getVisibleItems();
|
|
11943
11948
|
if (visible.length === 0) return;
|
|
11944
11949
|
const previous = this._selectedItems;
|
|
11945
|
-
const next = new Set(visible);
|
|
11950
|
+
const next = new Set(visible.filter((el) => this._isCheckable(el)));
|
|
11951
|
+
if (next.size === 0) return;
|
|
11946
11952
|
this._selectedItems = next;
|
|
11947
11953
|
this._syncItemStates();
|
|
11948
11954
|
this._dispatch(`list-select`, {
|
|
@@ -11981,11 +11987,16 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11981
11987
|
return true;
|
|
11982
11988
|
});
|
|
11983
11989
|
}
|
|
11990
|
+
_isCheckable(item) {
|
|
11991
|
+
if (this.interactionMode !== `checked`) return true;
|
|
11992
|
+
return !(this.#customWrappers.get(item) ?? item).hasAttribute(`not-checked`);
|
|
11993
|
+
}
|
|
11984
11994
|
_syncItemStates() {
|
|
11985
11995
|
for (const el of this.querySelectorAll(ITEM_SELECTOR)) {
|
|
11996
|
+
const item = this.#customWrappers.get(el) ?? el;
|
|
11986
11997
|
el.toggleAttribute(`data-tickled`, this.tickled.isTickled(el));
|
|
11987
11998
|
el.toggleAttribute(`data-selected`, this._selectedItems.has(el));
|
|
11988
|
-
if (this.interactionMode === `checked`) el.toggleAttribute(`data-checked`, this._selectedItems.has(el));
|
|
11999
|
+
if (this.interactionMode === `checked`) el.toggleAttribute(`data-checked`, !item.hasAttribute(`not-checked`) && this._selectedItems.has(el));
|
|
11989
12000
|
else el.removeAttribute(`data-checked`);
|
|
11990
12001
|
}
|
|
11991
12002
|
this.dataset.inputMode = this.tickled.inputMode;
|
|
@@ -12023,6 +12034,10 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
12023
12034
|
if (existing) existing.remove();
|
|
12024
12035
|
continue;
|
|
12025
12036
|
}
|
|
12037
|
+
if ((this.#customWrappers.get(el) ?? el).hasAttribute(`not-checked`)) {
|
|
12038
|
+
if (existing) existing.remove();
|
|
12039
|
+
continue;
|
|
12040
|
+
}
|
|
12026
12041
|
const existingIsCustom = existing?.classList.contains(`ixfx-list-checkbox-custom`) ?? false;
|
|
12027
12042
|
if (existing && existingIsCustom !== wantsCustom) existing.remove();
|
|
12028
12043
|
let cb = el.querySelector(`.ixfx-list-checkbox`);
|
|
@@ -23925,6 +23940,331 @@ __decorate([property({ attribute: false })], TabListItemElement.prototype, "regi
|
|
|
23925
23940
|
__decorate([state()], TabListItemElement.prototype, "_compact", void 0);
|
|
23926
23941
|
TabListItemElement = __decorate([safeCustomElement(`ixfx-tab-list-item`)], TabListItemElement);
|
|
23927
23942
|
//#endregion
|
|
23943
|
+
//#region src/tabs/tab-panel.ts
|
|
23944
|
+
let TabPanelElement = class TabPanelElement extends i {
|
|
23945
|
+
render() {
|
|
23946
|
+
return b`<slot></slot>`;
|
|
23947
|
+
}
|
|
23948
|
+
static {
|
|
23949
|
+
this.styles = [themeFallbacks, i$3`
|
|
23950
|
+
:host {
|
|
23951
|
+
display:none;
|
|
23952
|
+
height:100%;
|
|
23953
|
+
width:100%;
|
|
23954
|
+
}
|
|
23955
|
+
|
|
23956
|
+
:host([selected]) {
|
|
23957
|
+
background: var(--surface-3);
|
|
23958
|
+
display:block;
|
|
23959
|
+
}
|
|
23960
|
+
`];
|
|
23961
|
+
}
|
|
23962
|
+
};
|
|
23963
|
+
TabPanelElement = __decorate([safeCustomElement(`ixfx-tab-panel`)], TabPanelElement);
|
|
23964
|
+
//#endregion
|
|
23965
|
+
//#region src/tabs/tab-controller.ts
|
|
23966
|
+
/**
|
|
23967
|
+
* Connects an `ixfx-tab-list` to an `ixfx-tab-panels` container, handling the
|
|
23968
|
+
* wiring between them (header clicks show the matching panel, closing a tab
|
|
23969
|
+
* removes its panel, etc.) and offering an API to select, add, remove, rename
|
|
23970
|
+
* and reorder tabs.
|
|
23971
|
+
*
|
|
23972
|
+
* @example
|
|
23973
|
+
* ```ts
|
|
23974
|
+
* const ctrl = new TabController(
|
|
23975
|
+
* document.querySelector('ixfx-tab-list'),
|
|
23976
|
+
* document.querySelector('ixfx-tab-panels'),
|
|
23977
|
+
* );
|
|
23978
|
+
* ctrl.connect();
|
|
23979
|
+
*
|
|
23980
|
+
* ctrl.addTab({ label: 'Console', content: 'Console panel' });
|
|
23981
|
+
* ctrl.selectTab('Console');
|
|
23982
|
+
* ```
|
|
23983
|
+
*/
|
|
23984
|
+
var TabController = class {
|
|
23985
|
+
#list;
|
|
23986
|
+
#panels;
|
|
23987
|
+
#opts;
|
|
23988
|
+
#tabs = [];
|
|
23989
|
+
#signal;
|
|
23990
|
+
#observer;
|
|
23991
|
+
#commands;
|
|
23992
|
+
#registeredCommands = /* @__PURE__ */ new Set();
|
|
23993
|
+
constructor(list, panels, options = {}) {
|
|
23994
|
+
this.#list = list;
|
|
23995
|
+
this.#panels = panels;
|
|
23996
|
+
this.#opts = options;
|
|
23997
|
+
this.#commands = options.commands;
|
|
23998
|
+
}
|
|
23999
|
+
connect() {
|
|
24000
|
+
this.disconnect();
|
|
24001
|
+
this.#signal = new AbortController();
|
|
24002
|
+
const { signal } = this.#signal;
|
|
24003
|
+
this.#list.addEventListener(`change`, this.#onChange, { signal });
|
|
24004
|
+
this.#list.addEventListener(`reorder`, this.#onReorder, { signal });
|
|
24005
|
+
this.#list.addEventListener(`close`, this.#onClose, { signal });
|
|
24006
|
+
this.#observer = new MutationObserver(() => this.#rebuild());
|
|
24007
|
+
this.#observer.observe(this.#list, { childList: true });
|
|
24008
|
+
this.#observer.observe(this.#panels, { childList: true });
|
|
24009
|
+
this.#rebuild();
|
|
24010
|
+
this.#panels.syncWithList(this.#list);
|
|
24011
|
+
for (const tab of this.#tabs) this.#registerCommand(tab);
|
|
24012
|
+
}
|
|
24013
|
+
disconnect() {
|
|
24014
|
+
this.#signal?.abort();
|
|
24015
|
+
this.#signal = void 0;
|
|
24016
|
+
this.#observer?.disconnect();
|
|
24017
|
+
this.#observer = void 0;
|
|
24018
|
+
for (const tab of this.#tabs) this.#unregisterCommand(tab);
|
|
24019
|
+
this.#registeredCommands.clear();
|
|
24020
|
+
this.#tabs = [];
|
|
24021
|
+
}
|
|
24022
|
+
/**
|
|
24023
|
+
* Select a tab as if it was clicked — activates the header (deactivating the
|
|
24024
|
+
* others) and shows its panel.
|
|
24025
|
+
*
|
|
24026
|
+
* `sel` may be a tab id, the panel id its `for` points at, its label text
|
|
24027
|
+
* (case-insensitive), or the tab item element itself.
|
|
24028
|
+
*
|
|
24029
|
+
* Returns true if a tab was found.
|
|
24030
|
+
*/
|
|
24031
|
+
selectTab(sel) {
|
|
24032
|
+
const tab = this.#resolveTab(sel);
|
|
24033
|
+
if (!tab) return false;
|
|
24034
|
+
const previous = this.getSelected();
|
|
24035
|
+
if (previous?.id === tab.id) {
|
|
24036
|
+
this.#panels.selectPanel(tab.forId);
|
|
24037
|
+
return true;
|
|
24038
|
+
}
|
|
24039
|
+
this.#list.selectElement(tab.item);
|
|
24040
|
+
this.#panels.selectPanel(tab.forId);
|
|
24041
|
+
this.#opts.onSelect?.(tab, previous);
|
|
24042
|
+
return true;
|
|
24043
|
+
}
|
|
24044
|
+
selectNext() {
|
|
24045
|
+
return this.#selectOffset(1);
|
|
24046
|
+
}
|
|
24047
|
+
selectPrevious() {
|
|
24048
|
+
return this.#selectOffset(-1);
|
|
24049
|
+
}
|
|
24050
|
+
getSelected() {
|
|
24051
|
+
return this.#tabs.find((t) => t.item.hasAttribute(`selected`));
|
|
24052
|
+
}
|
|
24053
|
+
getTabs() {
|
|
24054
|
+
return [...this.#tabs];
|
|
24055
|
+
}
|
|
24056
|
+
getTab(id) {
|
|
24057
|
+
return this.#tabs.find((t) => t.id === id);
|
|
24058
|
+
}
|
|
24059
|
+
addTab(opts) {
|
|
24060
|
+
const { id, forId } = this.#idsFor(opts);
|
|
24061
|
+
const item = document.createElement(`ixfx-tab-list-item`);
|
|
24062
|
+
item.id = id;
|
|
24063
|
+
item.setAttribute(`for`, forId);
|
|
24064
|
+
item.closeable = opts.closeable ?? true;
|
|
24065
|
+
item.append(opts.label);
|
|
24066
|
+
if (opts.iconName) item.iconName = opts.iconName;
|
|
24067
|
+
if (opts.description) item.description = opts.description;
|
|
24068
|
+
for (const el of opts.toolbar ?? []) {
|
|
24069
|
+
el.slot = `toolbar`;
|
|
24070
|
+
item.append(el);
|
|
24071
|
+
}
|
|
24072
|
+
const panel = document.createElement(`ixfx-tab-panel`);
|
|
24073
|
+
panel.id = forId;
|
|
24074
|
+
if (opts.content !== void 0) this.#fillContent(panel, opts.content);
|
|
24075
|
+
const index = Math.max(0, Math.min(opts.index ?? this.#tabs.length, this.#tabs.length));
|
|
24076
|
+
this.#insertElement(this.#list, item, index);
|
|
24077
|
+
this.#insertElement(this.#panels, panel, index);
|
|
24078
|
+
const tab = {
|
|
24079
|
+
id,
|
|
24080
|
+
forId,
|
|
24081
|
+
item,
|
|
24082
|
+
panel,
|
|
24083
|
+
label: opts.label,
|
|
24084
|
+
iconName: opts.iconName
|
|
24085
|
+
};
|
|
24086
|
+
this.#tabs.splice(index, 0, tab);
|
|
24087
|
+
this.#registerCommand(tab);
|
|
24088
|
+
this.#opts.onAdd?.(tab);
|
|
24089
|
+
if (opts.select ?? true) this.selectTab(id);
|
|
24090
|
+
return tab;
|
|
24091
|
+
}
|
|
24092
|
+
removeTab(sel) {
|
|
24093
|
+
const tab = this.#resolveTab(sel);
|
|
24094
|
+
if (!tab) return false;
|
|
24095
|
+
const index = this.#tabs.indexOf(tab);
|
|
24096
|
+
const adjacent = tab.item.hasAttribute(`selected`) ? this.#adjacentTab(index) : void 0;
|
|
24097
|
+
tab.item.remove();
|
|
24098
|
+
tab.panel.remove();
|
|
24099
|
+
this.#removeFromIndex(tab);
|
|
24100
|
+
this.#unregisterCommand(tab);
|
|
24101
|
+
this.#opts.onRemove?.(tab);
|
|
24102
|
+
if (adjacent) this.selectTab(adjacent.id);
|
|
24103
|
+
return true;
|
|
24104
|
+
}
|
|
24105
|
+
renameTab(sel, label) {
|
|
24106
|
+
const tab = this.#resolveTab(sel);
|
|
24107
|
+
if (!tab) return false;
|
|
24108
|
+
for (const child of [...tab.item.childNodes]) {
|
|
24109
|
+
if (child.nodeType === Node.ELEMENT_NODE && child.slot === `toolbar`) continue;
|
|
24110
|
+
tab.item.removeChild(child);
|
|
24111
|
+
}
|
|
24112
|
+
tab.item.prepend(label);
|
|
24113
|
+
tab.label = label;
|
|
24114
|
+
this.#reregisterCommand(tab);
|
|
24115
|
+
return true;
|
|
24116
|
+
}
|
|
24117
|
+
setTabIcon(sel, iconName) {
|
|
24118
|
+
const tab = this.#resolveTab(sel);
|
|
24119
|
+
if (!tab) return false;
|
|
24120
|
+
if (iconName) {
|
|
24121
|
+
tab.item.iconName = iconName;
|
|
24122
|
+
tab.iconName = iconName;
|
|
24123
|
+
} else {
|
|
24124
|
+
tab.item.iconName = void 0;
|
|
24125
|
+
tab.item.removeAttribute(`icon-name`);
|
|
24126
|
+
tab.iconName = void 0;
|
|
24127
|
+
}
|
|
24128
|
+
return true;
|
|
24129
|
+
}
|
|
24130
|
+
#onChange = (event) => {
|
|
24131
|
+
const detail = event.detail;
|
|
24132
|
+
this.#panels.selectPanel(detail.for);
|
|
24133
|
+
const tab = this.#tabs.find((t) => t.forId === detail.for);
|
|
24134
|
+
if (!tab) return;
|
|
24135
|
+
const previous = detail.previous ? this.#tabs.find((t) => t.id === detail.previous) : void 0;
|
|
24136
|
+
this.#opts.onSelect?.(tab, previous);
|
|
24137
|
+
};
|
|
24138
|
+
#onReorder = () => {
|
|
24139
|
+
this.#rebuild();
|
|
24140
|
+
this.#opts.onReorder?.(this.#tabs);
|
|
24141
|
+
};
|
|
24142
|
+
#onClose = (event) => {
|
|
24143
|
+
const item = event.target?.closest(`ixfx-tab-list-item`);
|
|
24144
|
+
const tab = item ? this.#tabByItem(item) : void 0;
|
|
24145
|
+
if (!tab) return;
|
|
24146
|
+
const index = this.#tabs.indexOf(tab);
|
|
24147
|
+
const adjacent = tab.item.hasAttribute(`selected`) ? this.#adjacentTab(index) : void 0;
|
|
24148
|
+
tab.panel.remove();
|
|
24149
|
+
this.#removeFromIndex(tab);
|
|
24150
|
+
this.#unregisterCommand(tab);
|
|
24151
|
+
this.#opts.onRemove?.(tab);
|
|
24152
|
+
if (adjacent) this.selectTab(adjacent.id);
|
|
24153
|
+
};
|
|
24154
|
+
#selectOffset(offset) {
|
|
24155
|
+
const tabs = this.#tabs;
|
|
24156
|
+
if (tabs.length === 0) return false;
|
|
24157
|
+
const current = this.getSelected();
|
|
24158
|
+
const next = ((current ? tabs.indexOf(current) : offset === 1 ? -1 : 0) + offset + tabs.length) % tabs.length;
|
|
24159
|
+
return this.selectTab(tabs[next].id);
|
|
24160
|
+
}
|
|
24161
|
+
#resolveTab(sel) {
|
|
24162
|
+
if (typeof sel !== `string`) return this.#tabs.find((t) => t.item === sel);
|
|
24163
|
+
const label = sel.trim().toLowerCase();
|
|
24164
|
+
return this.#tabs.find((t) => t.id === sel) ?? this.#tabs.find((t) => t.forId === sel) ?? this.#tabs.find((t) => t.label.toLowerCase() === label);
|
|
24165
|
+
}
|
|
24166
|
+
#tabByItem(item) {
|
|
24167
|
+
return this.#tabs.find((t) => t.item === item);
|
|
24168
|
+
}
|
|
24169
|
+
#adjacentTab(index) {
|
|
24170
|
+
const tabs = this.#tabs;
|
|
24171
|
+
if (tabs.length <= 1) return void 0;
|
|
24172
|
+
return tabs[index + 1] ?? tabs[index - 1];
|
|
24173
|
+
}
|
|
24174
|
+
#removeFromIndex(tab) {
|
|
24175
|
+
const index = this.#tabs.indexOf(tab);
|
|
24176
|
+
if (index >= 0) this.#tabs.splice(index, 1);
|
|
24177
|
+
}
|
|
24178
|
+
#idsFor(opts) {
|
|
24179
|
+
const base = this.#slug(opts.label) || `tab`;
|
|
24180
|
+
return {
|
|
24181
|
+
id: opts.id ?? this.#uniqueId(`tab-${base}`),
|
|
24182
|
+
forId: opts.forId ?? this.#uniqueId(`panel-${base}`)
|
|
24183
|
+
};
|
|
24184
|
+
}
|
|
24185
|
+
#slug(value) {
|
|
24186
|
+
return value.toLowerCase().replace(/[^a-z0-9]+/g, `-`).replace(/^-+|-+$/g, ``);
|
|
24187
|
+
}
|
|
24188
|
+
#uniqueId(base) {
|
|
24189
|
+
let candidate = base;
|
|
24190
|
+
let n = 2;
|
|
24191
|
+
while (document.getElementById(candidate)) candidate = `${base}-${n++}`;
|
|
24192
|
+
return candidate;
|
|
24193
|
+
}
|
|
24194
|
+
#fillContent(panel, content) {
|
|
24195
|
+
if (typeof content === `function`) {
|
|
24196
|
+
content(panel);
|
|
24197
|
+
return;
|
|
24198
|
+
}
|
|
24199
|
+
if (typeof content === `string`) {
|
|
24200
|
+
panel.append(document.createTextNode(content));
|
|
24201
|
+
return;
|
|
24202
|
+
}
|
|
24203
|
+
panel.append(content);
|
|
24204
|
+
}
|
|
24205
|
+
#insertElement(container, el, index) {
|
|
24206
|
+
const children = Array.from(container.children);
|
|
24207
|
+
container.insertBefore(el, children[index] ?? null);
|
|
24208
|
+
}
|
|
24209
|
+
#rebuild() {
|
|
24210
|
+
const panels = /* @__PURE__ */ new Map();
|
|
24211
|
+
for (const el of this.#panels.querySelectorAll(`ixfx-tab-panel`)) panels.set(el.id, el);
|
|
24212
|
+
const tabs = [];
|
|
24213
|
+
for (const item of this.#list.querySelectorAll(`ixfx-tab-list-item`)) {
|
|
24214
|
+
const forId = item.getAttribute(`for`) ?? ``;
|
|
24215
|
+
const panel = panels.get(forId);
|
|
24216
|
+
if (!panel) continue;
|
|
24217
|
+
tabs.push({
|
|
24218
|
+
id: item.id || forId,
|
|
24219
|
+
forId,
|
|
24220
|
+
item,
|
|
24221
|
+
panel,
|
|
24222
|
+
label: this.#labelOf(item),
|
|
24223
|
+
iconName: item.iconName
|
|
24224
|
+
});
|
|
24225
|
+
}
|
|
24226
|
+
this.#tabs = tabs;
|
|
24227
|
+
}
|
|
24228
|
+
/** The tab's visible label text, excluding any `slot="toolbar"` content. */
|
|
24229
|
+
#labelOf(item) {
|
|
24230
|
+
const clone = item.cloneNode(true);
|
|
24231
|
+
clone.querySelectorAll(`[slot="toolbar"]`).forEach((el) => el.remove());
|
|
24232
|
+
return (clone.textContent ?? ``).trim();
|
|
24233
|
+
}
|
|
24234
|
+
#registerCommand(tab) {
|
|
24235
|
+
if (!this.#commands) return;
|
|
24236
|
+
if (tab.item.commandActive) return;
|
|
24237
|
+
if (this.#commands.has(tab.id)) return;
|
|
24238
|
+
this.#commands.register({
|
|
24239
|
+
id: tab.id,
|
|
24240
|
+
label: tab.label,
|
|
24241
|
+
description: tab.item.description ?? tab.label,
|
|
24242
|
+
icon: tab.iconName,
|
|
24243
|
+
execute: () => {
|
|
24244
|
+
this.selectTab(tab.id);
|
|
24245
|
+
}
|
|
24246
|
+
});
|
|
24247
|
+
this.#registeredCommands.add(tab.id);
|
|
24248
|
+
}
|
|
24249
|
+
#unregisterCommand(tab) {
|
|
24250
|
+
if (!this.#commands) return;
|
|
24251
|
+
if (this.#registeredCommands.has(tab.id)) {
|
|
24252
|
+
this.#commands.unregister(tab.id);
|
|
24253
|
+
this.#registeredCommands.delete(tab.id);
|
|
24254
|
+
}
|
|
24255
|
+
}
|
|
24256
|
+
#reregisterCommand(tab) {
|
|
24257
|
+
if (!this.#commands || !this.#registeredCommands.has(tab.id)) return;
|
|
24258
|
+
const existing = this.#commands.get(tab.id);
|
|
24259
|
+
if (!existing) return;
|
|
24260
|
+
this.#commands.unregister(tab.id);
|
|
24261
|
+
this.#commands.register({
|
|
24262
|
+
...existing,
|
|
24263
|
+
label: tab.label
|
|
24264
|
+
});
|
|
24265
|
+
}
|
|
24266
|
+
};
|
|
24267
|
+
//#endregion
|
|
23928
24268
|
//#region src/util/drag-ghost.ts
|
|
23929
24269
|
/**
|
|
23930
24270
|
* Theme-aware floating element helper.
|
|
@@ -24515,28 +24855,6 @@ __decorate([property({
|
|
|
24515
24855
|
})], TabListElement.prototype, "dragMode", void 0);
|
|
24516
24856
|
TabListElement = __decorate([safeCustomElement(`ixfx-tab-list`)], TabListElement);
|
|
24517
24857
|
//#endregion
|
|
24518
|
-
//#region src/tabs/tab-panel.ts
|
|
24519
|
-
let TabPanelElement = class TabPanelElement extends i {
|
|
24520
|
-
render() {
|
|
24521
|
-
return b`<slot></slot>`;
|
|
24522
|
-
}
|
|
24523
|
-
static {
|
|
24524
|
-
this.styles = [themeFallbacks, i$3`
|
|
24525
|
-
:host {
|
|
24526
|
-
display:none;
|
|
24527
|
-
height:100%;
|
|
24528
|
-
width:100%;
|
|
24529
|
-
}
|
|
24530
|
-
|
|
24531
|
-
:host([selected]) {
|
|
24532
|
-
background: var(--surface-3);
|
|
24533
|
-
display:block;
|
|
24534
|
-
}
|
|
24535
|
-
`];
|
|
24536
|
-
}
|
|
24537
|
-
};
|
|
24538
|
-
TabPanelElement = __decorate([safeCustomElement(`ixfx-tab-panel`)], TabPanelElement);
|
|
24539
|
-
//#endregion
|
|
24540
24858
|
//#region src/tabs/tab-panels.ts
|
|
24541
24859
|
let TabPanelsElement = class TabPanelsElement extends i {
|
|
24542
24860
|
/**
|
|
@@ -27238,6 +27556,6 @@ function init() {
|
|
|
27238
27556
|
console.log(`Init`);
|
|
27239
27557
|
}
|
|
27240
27558
|
//#endregion
|
|
27241
|
-
export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataController, DataDisplayComponent, EditableLabel, EditableNumber, FormElement, FormGroupElement, FormPartElement, GroupedItemListerElement, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, NotificationManager, NotificationPillElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotHistogram, PlotMultiAxis, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SliderInputElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, collectDataResult, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, createPillRenderer, createTreeListAdapter, createVerticalListAdapter, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
|
|
27559
|
+
export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataController, DataDisplayComponent, EditableLabel, EditableNumber, FormElement, FormGroupElement, FormPartElement, GroupedItemListerElement, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, NotificationManager, NotificationPillElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotHistogram, PlotMultiAxis, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SliderInputElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabController, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, collectDataResult, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, createPillRenderer, createTreeListAdapter, createVerticalListAdapter, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
|
|
27242
27560
|
|
|
27243
27561
|
//# sourceMappingURL=index.js.map
|