@life-cockpit/angular-ui-kit 1.11.9 → 1.11.10
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.
|
@@ -12179,6 +12179,328 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
12179
12179
|
args: ['document:mouseup']
|
|
12180
12180
|
}] } });
|
|
12181
12181
|
|
|
12182
|
+
/**
|
|
12183
|
+
* File-type → icon mapping for the TreeView component.
|
|
12184
|
+
*
|
|
12185
|
+
* Icon names refer to Tabler Icons (the design system's icon source).
|
|
12186
|
+
* Resolution order for a file node:
|
|
12187
|
+
* 1. explicit `node.icon`
|
|
12188
|
+
* 2. exact file name match (e.g. `package.json`, `Dockerfile`)
|
|
12189
|
+
* 3. file extension match (e.g. `.ts`, `.png`)
|
|
12190
|
+
* 4. generic file fallback
|
|
12191
|
+
*/
|
|
12192
|
+
/** Icon used for collapsed folders. */
|
|
12193
|
+
const FOLDER_ICON = 'folder';
|
|
12194
|
+
/** Icon used for expanded (open) folders. */
|
|
12195
|
+
const FOLDER_OPEN_ICON = 'folder-open';
|
|
12196
|
+
/** Generic fallback icon for files with no specific match. */
|
|
12197
|
+
const FILE_FALLBACK_ICON = 'file';
|
|
12198
|
+
/** Map of well-known file names (lower-cased) to icons. */
|
|
12199
|
+
const FILE_NAME_ICONS = {
|
|
12200
|
+
'package.json': 'brand-npm',
|
|
12201
|
+
'package-lock.json': 'brand-npm',
|
|
12202
|
+
'yarn.lock': 'brand-yarn',
|
|
12203
|
+
'pnpm-lock.yaml': 'brand-pnpm',
|
|
12204
|
+
'dockerfile': 'brand-docker',
|
|
12205
|
+
'docker-compose.yml': 'brand-docker',
|
|
12206
|
+
'docker-compose.yaml': 'brand-docker',
|
|
12207
|
+
'.gitignore': 'brand-git',
|
|
12208
|
+
'.gitattributes': 'brand-git',
|
|
12209
|
+
'.gitmodules': 'brand-git',
|
|
12210
|
+
'readme.md': 'book',
|
|
12211
|
+
'license': 'license',
|
|
12212
|
+
'license.md': 'license',
|
|
12213
|
+
'.env': 'key',
|
|
12214
|
+
'.env.local': 'key',
|
|
12215
|
+
'.editorconfig': 'settings',
|
|
12216
|
+
'.prettierrc': 'settings',
|
|
12217
|
+
'.eslintrc': 'settings',
|
|
12218
|
+
'tsconfig.json': 'brand-typescript',
|
|
12219
|
+
'angular.json': 'brand-angular',
|
|
12220
|
+
'nx.json': 'settings',
|
|
12221
|
+
'makefile': 'terminal',
|
|
12222
|
+
};
|
|
12223
|
+
/** Map of file extensions (without dot, lower-cased) to icons. */
|
|
12224
|
+
const FILE_EXT_ICONS = {
|
|
12225
|
+
// Languages
|
|
12226
|
+
ts: 'brand-typescript',
|
|
12227
|
+
tsx: 'brand-typescript',
|
|
12228
|
+
js: 'brand-javascript',
|
|
12229
|
+
jsx: 'brand-javascript',
|
|
12230
|
+
mjs: 'brand-javascript',
|
|
12231
|
+
cjs: 'brand-javascript',
|
|
12232
|
+
html: 'brand-html5',
|
|
12233
|
+
htm: 'brand-html5',
|
|
12234
|
+
css: 'brand-css3',
|
|
12235
|
+
scss: 'brand-sass',
|
|
12236
|
+
sass: 'brand-sass',
|
|
12237
|
+
less: 'brand-css3',
|
|
12238
|
+
py: 'brand-python',
|
|
12239
|
+
rb: 'diamond',
|
|
12240
|
+
go: 'brand-golang',
|
|
12241
|
+
rs: 'brand-rust',
|
|
12242
|
+
java: 'coffee',
|
|
12243
|
+
kt: 'brand-kotlin',
|
|
12244
|
+
swift: 'brand-swift',
|
|
12245
|
+
c: 'file-code',
|
|
12246
|
+
h: 'file-code',
|
|
12247
|
+
cpp: 'brand-cpp',
|
|
12248
|
+
cs: 'brand-c-sharp',
|
|
12249
|
+
php: 'brand-php',
|
|
12250
|
+
dart: 'brand-flutter',
|
|
12251
|
+
sh: 'terminal-2',
|
|
12252
|
+
bash: 'terminal-2',
|
|
12253
|
+
zsh: 'terminal-2',
|
|
12254
|
+
sql: 'database',
|
|
12255
|
+
// Data / config
|
|
12256
|
+
json: 'braces',
|
|
12257
|
+
jsonc: 'braces',
|
|
12258
|
+
yml: 'file-code',
|
|
12259
|
+
yaml: 'file-code',
|
|
12260
|
+
toml: 'file-code',
|
|
12261
|
+
xml: 'file-code',
|
|
12262
|
+
ini: 'settings',
|
|
12263
|
+
env: 'key',
|
|
12264
|
+
// Docs
|
|
12265
|
+
md: 'markdown',
|
|
12266
|
+
mdx: 'markdown',
|
|
12267
|
+
txt: 'file-text',
|
|
12268
|
+
pdf: 'file-type-pdf',
|
|
12269
|
+
doc: 'file-text',
|
|
12270
|
+
docx: 'file-text',
|
|
12271
|
+
csv: 'file-spreadsheet',
|
|
12272
|
+
xls: 'file-spreadsheet',
|
|
12273
|
+
xlsx: 'file-spreadsheet',
|
|
12274
|
+
// Images
|
|
12275
|
+
png: 'photo',
|
|
12276
|
+
jpg: 'photo',
|
|
12277
|
+
jpeg: 'photo',
|
|
12278
|
+
gif: 'photo',
|
|
12279
|
+
webp: 'photo',
|
|
12280
|
+
svg: 'file-vector',
|
|
12281
|
+
ico: 'photo',
|
|
12282
|
+
bmp: 'photo',
|
|
12283
|
+
// Media
|
|
12284
|
+
mp3: 'music',
|
|
12285
|
+
wav: 'music',
|
|
12286
|
+
mp4: 'video',
|
|
12287
|
+
mov: 'video',
|
|
12288
|
+
webm: 'video',
|
|
12289
|
+
// Archives
|
|
12290
|
+
zip: 'file-zip',
|
|
12291
|
+
tar: 'file-zip',
|
|
12292
|
+
gz: 'file-zip',
|
|
12293
|
+
rar: 'file-zip',
|
|
12294
|
+
'7z': 'file-zip',
|
|
12295
|
+
// Fonts
|
|
12296
|
+
woff: 'typography',
|
|
12297
|
+
woff2: 'typography',
|
|
12298
|
+
ttf: 'typography',
|
|
12299
|
+
otf: 'typography',
|
|
12300
|
+
// Misc
|
|
12301
|
+
lock: 'lock',
|
|
12302
|
+
};
|
|
12303
|
+
/**
|
|
12304
|
+
* Resolve the icon name for a file based on its name.
|
|
12305
|
+
* Performs exact-name then extension lookup, falling back to a generic file icon.
|
|
12306
|
+
*/
|
|
12307
|
+
function resolveFileIcon(fileName) {
|
|
12308
|
+
const lower = fileName.toLowerCase();
|
|
12309
|
+
const byName = FILE_NAME_ICONS[lower];
|
|
12310
|
+
if (byName)
|
|
12311
|
+
return byName;
|
|
12312
|
+
const dotIndex = lower.lastIndexOf('.');
|
|
12313
|
+
if (dotIndex > 0 && dotIndex < lower.length - 1) {
|
|
12314
|
+
const ext = lower.slice(dotIndex + 1);
|
|
12315
|
+
const byExt = FILE_EXT_ICONS[ext];
|
|
12316
|
+
if (byExt)
|
|
12317
|
+
return byExt;
|
|
12318
|
+
}
|
|
12319
|
+
return FILE_FALLBACK_ICON;
|
|
12320
|
+
}
|
|
12321
|
+
|
|
12322
|
+
const BADGE_STATUS_COLOR = {
|
|
12323
|
+
default: 'var(--color-neutral-400)',
|
|
12324
|
+
added: 'var(--color-success-default, #16a34a)',
|
|
12325
|
+
modified: 'var(--color-warning-default, #d97706)',
|
|
12326
|
+
removed: 'var(--color-error-default, #dc2626)',
|
|
12327
|
+
muted: 'var(--color-neutral-300)',
|
|
12328
|
+
};
|
|
12329
|
+
function nodeType(node) {
|
|
12330
|
+
return node.type ?? (node.children ? 'folder' : 'file');
|
|
12331
|
+
}
|
|
12332
|
+
/**
|
|
12333
|
+
* Tree view component for visualizing file / folder hierarchies such as a
|
|
12334
|
+
* complete GitHub project.
|
|
12335
|
+
*
|
|
12336
|
+
* Features:
|
|
12337
|
+
* - Recursive folder / file rendering from a single `nodes` input
|
|
12338
|
+
* - Automatic file-type icons by extension and well-known file name,
|
|
12339
|
+
* with open / closed folder icons
|
|
12340
|
+
* - Expand / collapse folders, with expand-all / collapse-all helpers
|
|
12341
|
+
* - Two-way bound selection and a `nodeClick` event
|
|
12342
|
+
* - Indentation guide lines for readability
|
|
12343
|
+
* - Optional per-node status badges (added / modified / removed)
|
|
12344
|
+
* - Keyboard accessible (Enter / Space to toggle or select)
|
|
12345
|
+
* - Dark / light theme support via design tokens
|
|
12346
|
+
*
|
|
12347
|
+
* @example
|
|
12348
|
+
* ```html
|
|
12349
|
+
* <lc-tree-view [nodes]="projectTree" [(selectedId)]="selected" />
|
|
12350
|
+
* ```
|
|
12351
|
+
*/
|
|
12352
|
+
class TreeViewComponent {
|
|
12353
|
+
/** The root-level nodes of the tree. */
|
|
12354
|
+
nodes = input.required(...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
|
|
12355
|
+
/** Id (or path) of the currently selected node (two-way bindable). */
|
|
12356
|
+
selectedId = model(null, ...(ngDevMode ? [{ debugName: "selectedId" }] : /* istanbul ignore next */ []));
|
|
12357
|
+
/** Show indentation guide lines. */
|
|
12358
|
+
showGuides = input(true, ...(ngDevMode ? [{ debugName: "showGuides" }] : /* istanbul ignore next */ []));
|
|
12359
|
+
/** Show the expand-all / collapse-all toolbar. */
|
|
12360
|
+
showToolbar = input(true, ...(ngDevMode ? [{ debugName: "showToolbar" }] : /* istanbul ignore next */ []));
|
|
12361
|
+
/** Icon size for node icons. */
|
|
12362
|
+
iconSize = input('sm', ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
12363
|
+
/** Emitted when a node is clicked / activated. */
|
|
12364
|
+
nodeClick = output();
|
|
12365
|
+
/** Set of node ids the user has explicitly expanded / collapsed. */
|
|
12366
|
+
expandOverrides = signal(new Map(), ...(ngDevMode ? [{ debugName: "expandOverrides" }] : /* istanbul ignore next */ []));
|
|
12367
|
+
/** Flattened, render-ready list of visible nodes. */
|
|
12368
|
+
visibleNodes = computed(() => {
|
|
12369
|
+
const out = [];
|
|
12370
|
+
const overrides = this.expandOverrides();
|
|
12371
|
+
this.flatten(this.nodes(), 0, '', [], overrides, out);
|
|
12372
|
+
return out;
|
|
12373
|
+
}, ...(ngDevMode ? [{ debugName: "visibleNodes" }] : /* istanbul ignore next */ []));
|
|
12374
|
+
badgeColor(status) {
|
|
12375
|
+
return BADGE_STATUS_COLOR[status];
|
|
12376
|
+
}
|
|
12377
|
+
onNodeClick(flat) {
|
|
12378
|
+
if (flat.disabled)
|
|
12379
|
+
return;
|
|
12380
|
+
if (flat.hasChildren) {
|
|
12381
|
+
this.toggle(flat);
|
|
12382
|
+
}
|
|
12383
|
+
this.selectedId.set(flat.id);
|
|
12384
|
+
const original = this.findNode(this.nodes(), '', flat.id);
|
|
12385
|
+
if (original)
|
|
12386
|
+
this.nodeClick.emit(original);
|
|
12387
|
+
}
|
|
12388
|
+
onToggleClick(flat, event) {
|
|
12389
|
+
event.stopPropagation();
|
|
12390
|
+
if (!flat.disabled)
|
|
12391
|
+
this.toggle(flat);
|
|
12392
|
+
}
|
|
12393
|
+
onKeydown(flat, event) {
|
|
12394
|
+
if (flat.disabled)
|
|
12395
|
+
return;
|
|
12396
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
12397
|
+
event.preventDefault();
|
|
12398
|
+
this.onNodeClick(flat);
|
|
12399
|
+
}
|
|
12400
|
+
else if (event.key === 'ArrowRight' && flat.hasChildren && !flat.expanded) {
|
|
12401
|
+
event.preventDefault();
|
|
12402
|
+
this.setExpanded(flat.id, true);
|
|
12403
|
+
}
|
|
12404
|
+
else if (event.key === 'ArrowLeft' && flat.hasChildren && flat.expanded) {
|
|
12405
|
+
event.preventDefault();
|
|
12406
|
+
this.setExpanded(flat.id, false);
|
|
12407
|
+
}
|
|
12408
|
+
}
|
|
12409
|
+
/** Expand every folder in the tree. */
|
|
12410
|
+
expandAll() {
|
|
12411
|
+
this.setAll(true);
|
|
12412
|
+
}
|
|
12413
|
+
/** Collapse every folder in the tree. */
|
|
12414
|
+
collapseAll() {
|
|
12415
|
+
this.setAll(false);
|
|
12416
|
+
}
|
|
12417
|
+
trackById = (_, n) => n.id;
|
|
12418
|
+
// ── internals ──────────────────────────────────────────────────────────────
|
|
12419
|
+
toggle(flat) {
|
|
12420
|
+
this.setExpanded(flat.id, !flat.expanded);
|
|
12421
|
+
}
|
|
12422
|
+
setExpanded(id, value) {
|
|
12423
|
+
this.expandOverrides.update((map) => {
|
|
12424
|
+
const next = new Map(map);
|
|
12425
|
+
next.set(id, value);
|
|
12426
|
+
return next;
|
|
12427
|
+
});
|
|
12428
|
+
}
|
|
12429
|
+
setAll(value) {
|
|
12430
|
+
const next = new Map();
|
|
12431
|
+
const walk = (nodes, parentPath) => {
|
|
12432
|
+
for (const node of nodes) {
|
|
12433
|
+
const id = node.id ?? `${parentPath}/${node.name}`;
|
|
12434
|
+
if (nodeType(node) === 'folder') {
|
|
12435
|
+
next.set(id, value);
|
|
12436
|
+
if (node.children)
|
|
12437
|
+
walk(node.children, id);
|
|
12438
|
+
}
|
|
12439
|
+
}
|
|
12440
|
+
};
|
|
12441
|
+
walk(this.nodes(), '');
|
|
12442
|
+
this.expandOverrides.set(next);
|
|
12443
|
+
}
|
|
12444
|
+
isExpanded(id, node, overrides) {
|
|
12445
|
+
const override = overrides.get(id);
|
|
12446
|
+
if (override !== undefined)
|
|
12447
|
+
return override;
|
|
12448
|
+
return node.expanded ?? false;
|
|
12449
|
+
}
|
|
12450
|
+
flatten(nodes, depth, parentPath, ancestorHasSibling, overrides, out) {
|
|
12451
|
+
nodes.forEach((node, index) => {
|
|
12452
|
+
const id = node.id ?? `${parentPath}/${node.name}`;
|
|
12453
|
+
const type = nodeType(node);
|
|
12454
|
+
const hasChildren = type === 'folder' && !!node.children?.length;
|
|
12455
|
+
const expanded = hasChildren && this.isExpanded(id, node, overrides);
|
|
12456
|
+
const isLast = index === nodes.length - 1;
|
|
12457
|
+
out.push({
|
|
12458
|
+
id,
|
|
12459
|
+
name: node.name,
|
|
12460
|
+
type,
|
|
12461
|
+
depth,
|
|
12462
|
+
hasChildren,
|
|
12463
|
+
expanded,
|
|
12464
|
+
icon: this.resolveIcon(node, type, expanded),
|
|
12465
|
+
badge: node.badge,
|
|
12466
|
+
status: node.status ?? 'default',
|
|
12467
|
+
disabled: node.disabled ?? false,
|
|
12468
|
+
ancestorHasSibling,
|
|
12469
|
+
isLast,
|
|
12470
|
+
});
|
|
12471
|
+
if (expanded && node.children) {
|
|
12472
|
+
this.flatten(node.children, depth + 1, id, [...ancestorHasSibling, !isLast], overrides, out);
|
|
12473
|
+
}
|
|
12474
|
+
});
|
|
12475
|
+
}
|
|
12476
|
+
resolveIcon(node, type, expanded) {
|
|
12477
|
+
if (node.icon)
|
|
12478
|
+
return node.icon;
|
|
12479
|
+
if (type === 'folder')
|
|
12480
|
+
return expanded ? FOLDER_OPEN_ICON : FOLDER_ICON;
|
|
12481
|
+
return node.name ? resolveFileIcon(node.name) : FILE_FALLBACK_ICON;
|
|
12482
|
+
}
|
|
12483
|
+
findNode(nodes, parentPath, targetId) {
|
|
12484
|
+
for (const node of nodes) {
|
|
12485
|
+
const id = node.id ?? `${parentPath}/${node.name}`;
|
|
12486
|
+
if (id === targetId)
|
|
12487
|
+
return node;
|
|
12488
|
+
if (node.children) {
|
|
12489
|
+
const found = this.findNode(node.children, id, targetId);
|
|
12490
|
+
if (found)
|
|
12491
|
+
return found;
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12494
|
+
return null;
|
|
12495
|
+
}
|
|
12496
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TreeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12497
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: TreeViewComponent, isStandalone: true, selector: "lc-tree-view", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: true, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, showGuides: { classPropertyName: "showGuides", publicName: "showGuides", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedId: "selectedIdChange", nodeClick: "nodeClick" }, host: { classAttribute: "lc-tree-view" }, ngImport: i0, template: "@if (showToolbar()) {\n <div class=\"lc-tree-view__toolbar\">\n <button type=\"button\" class=\"lc-tree-view__tool-btn\" (click)=\"expandAll()\" title=\"Expand all\">\n <lc-icon name=\"fold-down\" size=\"xs\" [decorative]=\"true\" />\n <span>Expand all</span>\n </button>\n <button type=\"button\" class=\"lc-tree-view__tool-btn\" (click)=\"collapseAll()\" title=\"Collapse all\">\n <lc-icon name=\"fold-up\" size=\"xs\" [decorative]=\"true\" />\n <span>Collapse all</span>\n </button>\n </div>\n}\n\n<ul class=\"lc-tree-view__list\" role=\"tree\">\n @for (node of visibleNodes(); track trackById($index, node)) {\n <li\n class=\"lc-tree-view__item\"\n [class.lc-tree-view__item--selected]=\"node.id === selectedId()\"\n [class.lc-tree-view__item--disabled]=\"node.disabled\"\n [class.lc-tree-view__item--folder]=\"node.type === 'folder'\"\n role=\"treeitem\"\n [attr.aria-level]=\"node.depth + 1\"\n [attr.aria-expanded]=\"node.hasChildren ? node.expanded : null\"\n [attr.aria-selected]=\"node.id === selectedId()\"\n [attr.aria-disabled]=\"node.disabled ? true : null\"\n [tabindex]=\"node.disabled ? -1 : 0\"\n (click)=\"onNodeClick(node)\"\n (keydown)=\"onKeydown(node, $event)\"\n >\n <!-- indentation + guide lines -->\n @for (hasSibling of node.ancestorHasSibling; track $index) {\n <span\n class=\"lc-tree-view__indent\"\n [class.lc-tree-view__indent--guide]=\"showGuides() && hasSibling\"\n ></span>\n }\n\n <!-- expand / collapse chevron -->\n <span class=\"lc-tree-view__chevron\">\n @if (node.hasChildren) {\n <button\n type=\"button\"\n class=\"lc-tree-view__chevron-btn\"\n [class.lc-tree-view__chevron-btn--expanded]=\"node.expanded\"\n (click)=\"onToggleClick(node, $event)\"\n [attr.aria-label]=\"node.expanded ? 'Collapse' : 'Expand'\"\n tabindex=\"-1\"\n >\n <lc-icon name=\"chevron-right\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </span>\n\n <!-- type / file icon -->\n <span\n class=\"lc-tree-view__icon\"\n [style.color]=\"\n node.status === 'default' ? null : badgeColor(node.status)\n \"\n >\n <lc-icon [name]=\"node.icon\" [size]=\"iconSize()\" [decorative]=\"true\" />\n </span>\n\n <!-- label -->\n <span class=\"lc-tree-view__label\">{{ node.name }}</span>\n\n <!-- badge -->\n @if (node.badge) {\n <span\n class=\"lc-tree-view__badge\"\n [style.color]=\"badgeColor(node.status)\"\n [style.border-color]=\"badgeColor(node.status)\"\n >{{ node.badge }}</span\n >\n }\n </li>\n }\n</ul>\n", styles: [":host{display:block;border:1px solid var(--color-neutral-200);border-radius:8px;background:var(--color-neutral-0, #fff);overflow:hidden;font-size:13px;color:var(--color-neutral-900)}.lc-tree-view__toolbar{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--color-neutral-200);background:var(--color-neutral-50);-webkit-user-select:none;user-select:none}.lc-tree-view__tool-btn{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--color-neutral-600);font-size:12px;cursor:pointer;line-height:1}.lc-tree-view__tool-btn:hover{background:var(--color-neutral-100);color:var(--color-neutral-900)}.lc-tree-view__list{list-style:none;margin:0;padding:4px 0}.lc-tree-view__item{display:flex;align-items:center;height:26px;padding-right:8px;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;outline:none}.lc-tree-view__item:hover{background:var(--color-neutral-100)}.lc-tree-view__item:focus-visible{box-shadow:inset 0 0 0 2px var(--color-primary-400)}.lc-tree-view__item--selected{background:var(--color-primary-50)}.lc-tree-view__item--selected:hover{background:var(--color-primary-100, var(--color-primary-50))}.lc-tree-view__item--selected .lc-tree-view__label{color:var(--color-primary-700);font-weight:500}.lc-tree-view__item--disabled{opacity:.5;cursor:not-allowed}.lc-tree-view__item--disabled:hover{background:transparent}.lc-tree-view__indent{flex:0 0 18px;width:18px;height:100%;position:relative}.lc-tree-view__indent--guide:before{content:\"\";position:absolute;left:50%;top:0;bottom:0;width:1px;background:var(--color-neutral-200)}.lc-tree-view__chevron{flex:0 0 18px;width:18px;display:flex;align-items:center;justify-content:center;color:var(--color-neutral-500)}.lc-tree-view__chevron-btn{display:flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;background:transparent;color:inherit;cursor:pointer;border-radius:3px;transition:transform .12s ease}.lc-tree-view__chevron-btn:hover{background:var(--color-neutral-200)}.lc-tree-view__chevron-btn--expanded{transform:rotate(90deg)}.lc-tree-view__icon{display:flex;align-items:center;margin-right:6px;color:var(--color-neutral-500)}.lc-tree-view__item--folder .lc-tree-view__icon{color:var(--color-primary-500, #6366f1)}.lc-tree-view__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-neutral-800)}.lc-tree-view__badge{flex:0 0 auto;margin-left:8px;padding:1px 6px;border:1px solid;border-radius:10px;font-size:10px;line-height:1.4;font-weight:600;text-transform:uppercase;letter-spacing:.02em}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "lc-icon", inputs: ["name", "variant", "size", "color", "ariaLabel", "decorative"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12498
|
+
}
|
|
12499
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TreeViewComponent, decorators: [{
|
|
12500
|
+
type: Component,
|
|
12501
|
+
args: [{ selector: 'lc-tree-view', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'lc-tree-view' }, template: "@if (showToolbar()) {\n <div class=\"lc-tree-view__toolbar\">\n <button type=\"button\" class=\"lc-tree-view__tool-btn\" (click)=\"expandAll()\" title=\"Expand all\">\n <lc-icon name=\"fold-down\" size=\"xs\" [decorative]=\"true\" />\n <span>Expand all</span>\n </button>\n <button type=\"button\" class=\"lc-tree-view__tool-btn\" (click)=\"collapseAll()\" title=\"Collapse all\">\n <lc-icon name=\"fold-up\" size=\"xs\" [decorative]=\"true\" />\n <span>Collapse all</span>\n </button>\n </div>\n}\n\n<ul class=\"lc-tree-view__list\" role=\"tree\">\n @for (node of visibleNodes(); track trackById($index, node)) {\n <li\n class=\"lc-tree-view__item\"\n [class.lc-tree-view__item--selected]=\"node.id === selectedId()\"\n [class.lc-tree-view__item--disabled]=\"node.disabled\"\n [class.lc-tree-view__item--folder]=\"node.type === 'folder'\"\n role=\"treeitem\"\n [attr.aria-level]=\"node.depth + 1\"\n [attr.aria-expanded]=\"node.hasChildren ? node.expanded : null\"\n [attr.aria-selected]=\"node.id === selectedId()\"\n [attr.aria-disabled]=\"node.disabled ? true : null\"\n [tabindex]=\"node.disabled ? -1 : 0\"\n (click)=\"onNodeClick(node)\"\n (keydown)=\"onKeydown(node, $event)\"\n >\n <!-- indentation + guide lines -->\n @for (hasSibling of node.ancestorHasSibling; track $index) {\n <span\n class=\"lc-tree-view__indent\"\n [class.lc-tree-view__indent--guide]=\"showGuides() && hasSibling\"\n ></span>\n }\n\n <!-- expand / collapse chevron -->\n <span class=\"lc-tree-view__chevron\">\n @if (node.hasChildren) {\n <button\n type=\"button\"\n class=\"lc-tree-view__chevron-btn\"\n [class.lc-tree-view__chevron-btn--expanded]=\"node.expanded\"\n (click)=\"onToggleClick(node, $event)\"\n [attr.aria-label]=\"node.expanded ? 'Collapse' : 'Expand'\"\n tabindex=\"-1\"\n >\n <lc-icon name=\"chevron-right\" size=\"xs\" [decorative]=\"true\" />\n </button>\n }\n </span>\n\n <!-- type / file icon -->\n <span\n class=\"lc-tree-view__icon\"\n [style.color]=\"\n node.status === 'default' ? null : badgeColor(node.status)\n \"\n >\n <lc-icon [name]=\"node.icon\" [size]=\"iconSize()\" [decorative]=\"true\" />\n </span>\n\n <!-- label -->\n <span class=\"lc-tree-view__label\">{{ node.name }}</span>\n\n <!-- badge -->\n @if (node.badge) {\n <span\n class=\"lc-tree-view__badge\"\n [style.color]=\"badgeColor(node.status)\"\n [style.border-color]=\"badgeColor(node.status)\"\n >{{ node.badge }}</span\n >\n }\n </li>\n }\n</ul>\n", styles: [":host{display:block;border:1px solid var(--color-neutral-200);border-radius:8px;background:var(--color-neutral-0, #fff);overflow:hidden;font-size:13px;color:var(--color-neutral-900)}.lc-tree-view__toolbar{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--color-neutral-200);background:var(--color-neutral-50);-webkit-user-select:none;user-select:none}.lc-tree-view__tool-btn{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--color-neutral-600);font-size:12px;cursor:pointer;line-height:1}.lc-tree-view__tool-btn:hover{background:var(--color-neutral-100);color:var(--color-neutral-900)}.lc-tree-view__list{list-style:none;margin:0;padding:4px 0}.lc-tree-view__item{display:flex;align-items:center;height:26px;padding-right:8px;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;outline:none}.lc-tree-view__item:hover{background:var(--color-neutral-100)}.lc-tree-view__item:focus-visible{box-shadow:inset 0 0 0 2px var(--color-primary-400)}.lc-tree-view__item--selected{background:var(--color-primary-50)}.lc-tree-view__item--selected:hover{background:var(--color-primary-100, var(--color-primary-50))}.lc-tree-view__item--selected .lc-tree-view__label{color:var(--color-primary-700);font-weight:500}.lc-tree-view__item--disabled{opacity:.5;cursor:not-allowed}.lc-tree-view__item--disabled:hover{background:transparent}.lc-tree-view__indent{flex:0 0 18px;width:18px;height:100%;position:relative}.lc-tree-view__indent--guide:before{content:\"\";position:absolute;left:50%;top:0;bottom:0;width:1px;background:var(--color-neutral-200)}.lc-tree-view__chevron{flex:0 0 18px;width:18px;display:flex;align-items:center;justify-content:center;color:var(--color-neutral-500)}.lc-tree-view__chevron-btn{display:flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;background:transparent;color:inherit;cursor:pointer;border-radius:3px;transition:transform .12s ease}.lc-tree-view__chevron-btn:hover{background:var(--color-neutral-200)}.lc-tree-view__chevron-btn--expanded{transform:rotate(90deg)}.lc-tree-view__icon{display:flex;align-items:center;margin-right:6px;color:var(--color-neutral-500)}.lc-tree-view__item--folder .lc-tree-view__icon{color:var(--color-primary-500, #6366f1)}.lc-tree-view__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-neutral-800)}.lc-tree-view__badge{flex:0 0 auto;margin-left:8px;padding:1px 6px;border:1px solid;border-radius:10px;font-size:10px;line-height:1.4;font-weight:600;text-transform:uppercase;letter-spacing:.02em}\n"] }]
|
|
12502
|
+
}], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: true }] }], selectedId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedId", required: false }] }, { type: i0.Output, args: ["selectedIdChange"] }], showGuides: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGuides", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }] } });
|
|
12503
|
+
|
|
12182
12504
|
const DEFAULT_COLORS$1 = [
|
|
12183
12505
|
'var(--color-primary-500)',
|
|
12184
12506
|
'var(--color-secondary-500)',
|
|
@@ -14266,5 +14588,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
14266
14588
|
* Generated bundle index. Do not edit.
|
|
14267
14589
|
*/
|
|
14268
14590
|
|
|
14269
|
-
export { AccordionComponent, AccordionGroupComponent, AlertComponent, AnimationDurationFast, AnimationEasingEaseIn, AnimationEasingEaseInOut, AnimationEasingEaseOut, AreaChartComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BarChartComponent, BorderRadius2xl, BorderRadiusFull, BorderRadiusLg, BorderRadiusMd, BorderRadiusNone, BorderRadiusSm, BorderRadiusXl, BreadcrumbsComponent, ButtonComponent, CalendarComponent, CalloutComponent, CardComponent, ChatComponent, CheckboxComponent, ChipComponent, CodeBlockComponent, ColorAccentOrange, ColorAccentPurple, ColorAccentRed, ColorAccentRust, ColorAccentViolet, ColorErrorDark, ColorErrorDefault, ColorErrorLight, ColorInfoDark, ColorInfoDefault, ColorInfoLight, ColorNeutral100, ColorNeutral200, ColorNeutral300, ColorNeutral400, ColorNeutral50, ColorNeutral500, ColorNeutral600, ColorNeutral700, ColorNeutral800, ColorNeutral900, ColorPickerComponent, ColorPrimary100, ColorPrimary200, ColorPrimary300, ColorPrimary400, ColorPrimary50, ColorPrimary500, ColorPrimary600, ColorPrimary700, ColorPrimary800, ColorPrimary900, ColorSecondary100, ColorSecondary200, ColorSecondary300, ColorSecondary400, ColorSecondary50, ColorSecondary500, ColorSecondary600, ColorSecondary700, ColorSecondary800, ColorSecondary900, ColorSuccessDark, ColorSuccessDefault, ColorSuccessLight, ColorWarningDark, ColorWarningDefault, ColorWarningLight, ComboboxComponent, ConfirmDialogComponent, ConfirmService, ContainerComponent, DateRangePickerComponent, DatepickerComponent, DependencyViewerComponent, DiffViewerComponent, DividerComponent, DocumentViewerComponent, DonutChartComponent, DrawerComponent, Elevation1, Elevation2, Elevation3, Elevation4, EmailInputComponent, EmptyStateComponent, ErrorDisplayComponent, FieldGroupComponent, FileUploadComponent, FilterBarComponent, FooterComponent, FunnelChartComponent, GalleryComponent, GanttChartComponent, GaugeComponent, HeaderComponent, HeatmapComponent, HeroComponent, IconComponent, InputComponent, KanbanBoardComponent, LC_LOGO_BASE_PATH, LineChartComponent, ListComponent, ListItemTemplateDirective, LogViewerComponent, LogoComponent, MarkdownComponent, MenuComponent, ModalComponent, NotificationCenterComponent, NumberInputComponent, PageHeaderComponent, PaginationComponent, PasswordInputComponent, PieChartComponent, PopoverComponent, ProgressBarComponent, ProgressRingComponent, RadarChartComponent, RadioComponent, RatingComponent, RichTextEditorComponent, ScatterPlotComponent, SearchInputComponent, SectionComponent, SelectComponent, SidenavComponent, SizeInteractiveLgFontSize, SizeInteractiveLgHeight, SizeInteractiveLgPadding, SizeInteractiveMdFontSize, SizeInteractiveMdHeight, SizeInteractiveMdPadding, SizeInteractiveSmFontSize, SizeInteractiveSmHeight, SizeInteractiveSmPadding, SizeInteractiveXsFontSize, SizeInteractiveXsHeight, SizeInteractiveXsPadding, SizeMinTouchHeight, SizeMinTouchWidth, SkeletonComponent, SliderComponent, SpacerComponent, Spacing0, Spacing05, Spacing1, Spacing10, Spacing11, Spacing12, Spacing14, Spacing15, Spacing16, Spacing2, Spacing25, Spacing3, Spacing35, Spacing4, Spacing5, Spacing6, Spacing7, Spacing8, Spacing9, SparklineComponent, SpinnerComponent, StackComponent, StackedBarChartComponent, StatTrendComponent, StepperComponent, SwitchComponent, TabComponent, TableCellDirective, TableComponent, TabsComponent, TagInputComponent, TextareaComponent, ThemeService, TimelineComponent, ToastComponent, ToastService, ToggleGroupComponent, ToolbarComponent, TooltipContentComponent, TooltipDirective, TypographyComponent, TypographyFontFamilyBase, TypographyFontFamilyMono, TypographyFontSize2xl, TypographyFontSize3xl, TypographyFontSize4xl, TypographyFontSize5xl, TypographyFontSize6xl, TypographyFontSizeBase, TypographyFontSizeLg, TypographyFontSizeSm, TypographyFontSizeXl, TypographyFontSizeXs, TypographyFontWeightBold, TypographyFontWeightMedium, TypographyFontWeightNormal, TypographyFontWeightSemibold, TypographyLineHeightNormal, TypographyLineHeightRelaxed, TypographyLineHeightTight, VerificationCodeInputComponent, WaterfallChartComponent };
|
|
14591
|
+
export { AccordionComponent, AccordionGroupComponent, AlertComponent, AnimationDurationFast, AnimationEasingEaseIn, AnimationEasingEaseInOut, AnimationEasingEaseOut, AreaChartComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BarChartComponent, BorderRadius2xl, BorderRadiusFull, BorderRadiusLg, BorderRadiusMd, BorderRadiusNone, BorderRadiusSm, BorderRadiusXl, BreadcrumbsComponent, ButtonComponent, CalendarComponent, CalloutComponent, CardComponent, ChatComponent, CheckboxComponent, ChipComponent, CodeBlockComponent, ColorAccentOrange, ColorAccentPurple, ColorAccentRed, ColorAccentRust, ColorAccentViolet, ColorErrorDark, ColorErrorDefault, ColorErrorLight, ColorInfoDark, ColorInfoDefault, ColorInfoLight, ColorNeutral100, ColorNeutral200, ColorNeutral300, ColorNeutral400, ColorNeutral50, ColorNeutral500, ColorNeutral600, ColorNeutral700, ColorNeutral800, ColorNeutral900, ColorPickerComponent, ColorPrimary100, ColorPrimary200, ColorPrimary300, ColorPrimary400, ColorPrimary50, ColorPrimary500, ColorPrimary600, ColorPrimary700, ColorPrimary800, ColorPrimary900, ColorSecondary100, ColorSecondary200, ColorSecondary300, ColorSecondary400, ColorSecondary50, ColorSecondary500, ColorSecondary600, ColorSecondary700, ColorSecondary800, ColorSecondary900, ColorSuccessDark, ColorSuccessDefault, ColorSuccessLight, ColorWarningDark, ColorWarningDefault, ColorWarningLight, ComboboxComponent, ConfirmDialogComponent, ConfirmService, ContainerComponent, DateRangePickerComponent, DatepickerComponent, DependencyViewerComponent, DiffViewerComponent, DividerComponent, DocumentViewerComponent, DonutChartComponent, DrawerComponent, Elevation1, Elevation2, Elevation3, Elevation4, EmailInputComponent, EmptyStateComponent, ErrorDisplayComponent, FILE_FALLBACK_ICON, FOLDER_ICON, FOLDER_OPEN_ICON, FieldGroupComponent, FileUploadComponent, FilterBarComponent, FooterComponent, FunnelChartComponent, GalleryComponent, GanttChartComponent, GaugeComponent, HeaderComponent, HeatmapComponent, HeroComponent, IconComponent, InputComponent, KanbanBoardComponent, LC_LOGO_BASE_PATH, LineChartComponent, ListComponent, ListItemTemplateDirective, LogViewerComponent, LogoComponent, MarkdownComponent, MenuComponent, ModalComponent, NotificationCenterComponent, NumberInputComponent, PageHeaderComponent, PaginationComponent, PasswordInputComponent, PieChartComponent, PopoverComponent, ProgressBarComponent, ProgressRingComponent, RadarChartComponent, RadioComponent, RatingComponent, RichTextEditorComponent, ScatterPlotComponent, SearchInputComponent, SectionComponent, SelectComponent, SidenavComponent, SizeInteractiveLgFontSize, SizeInteractiveLgHeight, SizeInteractiveLgPadding, SizeInteractiveMdFontSize, SizeInteractiveMdHeight, SizeInteractiveMdPadding, SizeInteractiveSmFontSize, SizeInteractiveSmHeight, SizeInteractiveSmPadding, SizeInteractiveXsFontSize, SizeInteractiveXsHeight, SizeInteractiveXsPadding, SizeMinTouchHeight, SizeMinTouchWidth, SkeletonComponent, SliderComponent, SpacerComponent, Spacing0, Spacing05, Spacing1, Spacing10, Spacing11, Spacing12, Spacing14, Spacing15, Spacing16, Spacing2, Spacing25, Spacing3, Spacing35, Spacing4, Spacing5, Spacing6, Spacing7, Spacing8, Spacing9, SparklineComponent, SpinnerComponent, StackComponent, StackedBarChartComponent, StatTrendComponent, StepperComponent, SwitchComponent, TabComponent, TableCellDirective, TableComponent, TabsComponent, TagInputComponent, TextareaComponent, ThemeService, TimelineComponent, ToastComponent, ToastService, ToggleGroupComponent, ToolbarComponent, TooltipContentComponent, TooltipDirective, TreeViewComponent, TypographyComponent, TypographyFontFamilyBase, TypographyFontFamilyMono, TypographyFontSize2xl, TypographyFontSize3xl, TypographyFontSize4xl, TypographyFontSize5xl, TypographyFontSize6xl, TypographyFontSizeBase, TypographyFontSizeLg, TypographyFontSizeSm, TypographyFontSizeXl, TypographyFontSizeXs, TypographyFontWeightBold, TypographyFontWeightMedium, TypographyFontWeightNormal, TypographyFontWeightSemibold, TypographyLineHeightNormal, TypographyLineHeightRelaxed, TypographyLineHeightTight, VerificationCodeInputComponent, WaterfallChartComponent, resolveFileIcon };
|
|
14270
14592
|
//# sourceMappingURL=life-cockpit-angular-ui-kit.mjs.map
|