@tectra-ng/ui 0.4.4 → 0.4.5
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/amount/README.md +19 -1
- package/analog-clock/README.md +1 -1
- package/autocomplete/README.md +1 -1
- package/avatar/README.md +24 -4
- package/cascade-select/README.md +1 -1
- package/chips-input/README.md +10 -5
- package/color-picker/README.md +5 -0
- package/countdown/README.md +7 -1
- package/country/README.md +14 -1
- package/country-select/README.md +2 -1
- package/export/README.md +27 -2
- package/export-font/README.md +1 -1
- package/fesm2022/tectra-ng-ui-amount.mjs +96 -14
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +6 -19
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +5 -4
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-avatar.mjs +59 -17
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-button.mjs +2 -2
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-card.mjs +2 -2
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +7 -4
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +114 -15
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +93 -6
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-countdown.mjs +39 -10
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country-select.mjs +28 -5
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country.mjs +15 -6
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-datepicker.mjs +10 -8
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-dialog.mjs +6 -6
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-export.mjs +1237 -84
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-fieldset.mjs +2 -2
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-icon-field.mjs +51 -23
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input-number.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +5 -4
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-key-filter.mjs +84 -19
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-knob.mjs +24 -2
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +68 -9
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-link.mjs +38 -14
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +16 -5
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-message.mjs +5 -1
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +26 -9
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-multiselect.mjs +3 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +45 -14
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel.mjs +4 -2
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password-generator.mjs +18 -1
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password.mjs +2 -2
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-pill.mjs +36 -16
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-rating.mjs +2 -2
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-select.mjs +30 -7
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +93 -8
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-status-icon.mjs +40 -3
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-table.mjs +20 -6
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tag.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-toast.mjs +2 -2
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-select.mjs +10 -8
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +4 -4
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-truncate-text.mjs +33 -9
- package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui.mjs +1 -1
- package/icon-field/README.md +2 -1
- package/key-filter/README.md +3 -2
- package/knob/README.md +3 -1
- package/label/README.md +4 -1
- package/link/README.md +4 -1
- package/message/README.md +2 -2
- package/month-calendar/README.md +2 -1
- package/multiselect/README.md +1 -1
- package/package.json +4 -4
- package/panel/README.md +3 -1
- package/panel-menu/README.md +3 -2
- package/password-generator/README.md +2 -0
- package/pill/README.md +4 -4
- package/select/README.md +1 -1
- package/stat-tiles/README.md +17 -1
- package/status-icon/README.md +3 -1
- package/table/README.md +1 -1
- package/tag/README.md +2 -0
- package/tree-select/README.md +1 -1
- package/truncate-text/README.md +2 -1
- package/types/tectra-ng-ui-amount.d.ts +41 -1
- package/types/tectra-ng-ui-amount.d.ts.map +1 -1
- package/types/tectra-ng-ui-analog-clock.d.ts +1 -4
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -1
- package/types/tectra-ng-ui-autocomplete.d.ts +1 -1
- package/types/tectra-ng-ui-avatar.d.ts +45 -12
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
- package/types/tectra-ng-ui-cascade-select.d.ts +3 -2
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-chips-input.d.ts +54 -6
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -1
- package/types/tectra-ng-ui-color-picker.d.ts +38 -1
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
- package/types/tectra-ng-ui-countdown.d.ts +12 -1
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -1
- package/types/tectra-ng-ui-country-select.d.ts +17 -4
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-country.d.ts +7 -1
- package/types/tectra-ng-ui-country.d.ts.map +1 -1
- package/types/tectra-ng-ui-datepicker.d.ts +2 -2
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
- package/types/tectra-ng-ui-export.d.ts +68 -8
- package/types/tectra-ng-ui-export.d.ts.map +1 -1
- package/types/tectra-ng-ui-icon-field.d.ts +9 -2
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -1
- package/types/tectra-ng-ui-key-filter.d.ts +19 -4
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -1
- package/types/tectra-ng-ui-knob.d.ts +10 -2
- package/types/tectra-ng-ui-knob.d.ts.map +1 -1
- package/types/tectra-ng-ui-label.d.ts +8 -1
- package/types/tectra-ng-ui-label.d.ts.map +1 -1
- package/types/tectra-ng-ui-link.d.ts +8 -2
- package/types/tectra-ng-ui-link.d.ts.map +1 -1
- package/types/tectra-ng-ui-mention-textarea.d.ts +5 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-message.d.ts +1 -1
- package/types/tectra-ng-ui-message.d.ts.map +1 -1
- package/types/tectra-ng-ui-month-calendar.d.ts +14 -4
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -1
- package/types/tectra-ng-ui-multiselect.d.ts +1 -1
- package/types/tectra-ng-ui-panel-menu.d.ts +34 -6
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -1
- package/types/tectra-ng-ui-panel.d.ts +1 -1
- package/types/tectra-ng-ui-panel.d.ts.map +1 -1
- package/types/tectra-ng-ui-password-generator.d.ts +10 -3
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -1
- package/types/tectra-ng-ui-pill.d.ts +9 -5
- package/types/tectra-ng-ui-pill.d.ts.map +1 -1
- package/types/tectra-ng-ui-select.d.ts +5 -2
- package/types/tectra-ng-ui-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-stat-tiles.d.ts +49 -5
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -1
- package/types/tectra-ng-ui-status-icon.d.ts +20 -2
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -1
- package/types/tectra-ng-ui-table.d.ts +2 -1
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-select.d.ts +3 -3
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-truncate-text.d.ts +7 -2
- package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -1
- package/types/tectra-ng-ui.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-panel-menu.mjs","names":[],"sources":["../../../../packages/ui/panel-menu/src/panel-menu.templates.ts","../../../../packages/ui/panel-menu/src/panel-menu.icons.ts","../../../../packages/ui/panel-menu/src/panel-menu.theme.ts","../../../../packages/ui/panel-menu/src/panel-menu.component.ts","../../../../packages/ui/panel-menu/src/panel-menu.component.html"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxPanelMenuItemContext } from './panel-menu.types';\n\n@Directive({ selector: 'ng-template[txPanelMenuItem]' })\nexport class TxPanelMenuItemTemplate {\n readonly template = inject<TemplateRef<TxPanelMenuItemContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxPanelMenuItemTemplate, context: unknown): context is TxPanelMenuItemContext {\n return !!context;\n }\n}\n","import { TxIconSet, txIconAngleDown, txIconChevronDown, txIconLock, txIconSidebar } from '@tectra-ng/icons';\n\nexport const PANEL_MENU_ICON_DEFAULTS: TxIconSet = {\n 'angle-down': txIconAngleDown,\n 'chevron-down': txIconChevronDown,\n lock: txIconLock,\n sidebar: txIconSidebar,\n};\n","import { panelMenuTokens } from '@tectra-ng/themes';\n\nexport const PANEL_MENU_THEME = {\n panelMenu: panelMenuTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n contentChild,\n effect,\n inject,\n input,\n model,\n numberAttribute,\n output,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport {\n ActivatedRoute,\n ActivatedRouteSnapshot,\n Event as RouterEvent,\n GuardsCheckEnd,\n IsActiveMatchOptions,\n NavigationCancel,\n NavigationEnd,\n NavigationError,\n NavigationSkipped,\n NavigationStart,\n Router,\n RouterLink,\n containsTree,\n} from '@angular/router';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxAnimationReplay, optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPanelMenuTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxBadge } from '@tectra-ng/ui/badge';\nimport { filter, map } from 'rxjs';\nimport { TxPanelMenuItemTemplate } from './panel-menu.templates';\nimport {\n TxPanelMenuExpandedKeys,\n TxPanelMenuItem,\n TxPanelMenuItemContext,\n TxPanelMenuItemEvent,\n TxPanelMenuPart,\n TxPanelMenuVariant,\n} from './panel-menu.types';\nimport { PANEL_MENU_ICON_DEFAULTS } from './panel-menu.icons';\nimport { PANEL_MENU_THEME } from './panel-menu.theme';\n\n/** Internal tree node of `tx-panel-menu`: an item with its key, depth, ancestors and children. */\nexport interface TxPanelMenuNode {\n /** The menu item behind the node. */\n item: TxPanelMenuItem;\n /** Key of the node: the item `id` or its position path; used in `expandedKeys`. */\n key: string;\n /** DOM id of the node element. */\n id: string;\n /** Nesting depth of the node, from `0` at the top. */\n level: number;\n /** Keys of the parent nodes, outermost first. */\n ancestors: string[];\n /** Parent node, or `null` at the top level. */\n parent: TxPanelMenuNode | null;\n /** Child nodes shown in the submenu. */\n children: TxPanelMenuNode[];\n /** Whether the node is a separator line, not an item. */\n separator: boolean;\n}\n\n/** Internal render block of `tx-panel-menu`: a top-level node and the nodes shown under it. */\ninterface TxPanelMenuBlock {\n /** The top-level node of the block. */\n node: TxPanelMenuNode;\n /** Nodes rendered inside the block. */\n tree: TxPanelMenuNode[];\n /** Whether the block shows its node as a section title. */\n titled: boolean;\n}\n\nfunction mayAskToLeave(router: Router): boolean {\n const routes: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root];\n for (let route = routes.pop(); route; route = routes.pop()) {\n if (route.routeConfig?.canDeactivate?.length) {\n return true;\n }\n routes.push(...route.children);\n }\n return false;\n}\n\nfunction routeUrl(router: Router): Signal<string> {\n return toSignal(\n router.events.pipe(\n map((event) => navigationUrl(router, event)),\n filter((url): url is string => url !== null),\n ),\n { initialValue: router.url },\n );\n}\n\nfunction navigationUrl(router: Router, event: RouterEvent): string | null {\n if (event instanceof NavigationStart) {\n return mayAskToLeave(router) ? null : event.url;\n }\n if (event instanceof GuardsCheckEnd) {\n return event.shouldActivate ? event.urlAfterRedirects : null;\n }\n if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError || event instanceof NavigationSkipped) {\n return router.url;\n }\n return null;\n}\n\n/** How a node navigates: through the router, as a plain URL, or not at all. */\ntype TxPanelMenuLink = 'router' | 'url' | 'none';\n\nconst SUBSET_MATCH: IsActiveMatchOptions = { paths: 'subset', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' };\nconst EXACT_MATCH: IsActiveMatchOptions = { paths: 'exact', queryParams: 'exact', matrixParams: 'ignored', fragment: 'ignored' };\n\n@Component({\n selector: 'tx-panel-menu',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxBadge, TxAnimationReplay],\n templateUrl: './panel-menu.component.html',\n styleUrl: './panel-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-panel-menu',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-variant]': 'variant()',\n '[class.tx-panel-menu--collapsed]': 'collapsed() && variant() === \"sidebar\"',\n '[attr.role]': 'ariaLabel() ? \"navigation\" : null',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n },\n viewProviders: [provideTxIconDefaults(PANEL_MENU_ICON_DEFAULTS)],\n})\nexport class TxPanelMenu {\n private readonly panelMenuTheme = injectTokens(PANEL_MENU_THEME);\n\n private readonly router = inject(ActivatedRoute, { optional: true }) ? inject(Router) : null;\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly txIconRegistry = injectTxIcons();\n private readonly baseId = uniqueId('tx-panel-menu');\n\n readonly model = input<TxPanelMenuItem[]>([]);\n readonly variant = input<TxPanelMenuVariant>('panel');\n readonly collapsed = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly multiple = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly expandedKeys = model<TxPanelMenuExpandedKeys>({});\n readonly badgeMax = input<number, unknown>(99, { transform: numberAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPanelMenuTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPanelMenuPart, TxPanelMenu> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly itemClick = output<TxPanelMenuItemEvent>();\n\n protected readonly itemTemplate = contentChild(TxPanelMenuItemTemplate);\n protected readonly focusKey = signal<string | null>(null);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('panelMenu', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-panel-menu'), ...this.passThrough().root?.style }));\n\n readonly nodes = computed(() => this.build(this.model(), null));\n protected readonly blocks = computed<TxPanelMenuBlock[]>(() =>\n this.nodes().map((node) =>\n this.variant() === 'sidebar' && !node.children.length && !node.separator\n ? { node, tree: [node], titled: false }\n : { node, tree: node.children, titled: true },\n ),\n );\n\n private readonly url = this.router ? routeUrl(this.router) : signal('');\n\n readonly activeKeys = computed(() => {\n const active = new Set<string>();\n const current = this.currentTree();\n const visit = (nodes: TxPanelMenuNode[]) => {\n for (const node of nodes) {\n if (node.item.active ?? (!!current && this.matches(node.item, current))) {\n active.add(node.key);\n }\n visit(node.children);\n }\n };\n visit(this.nodes());\n return active;\n });\n\n private readonly activeAncestors = computed(() => {\n const keys = new Set<string>();\n const visit = (nodes: TxPanelMenuNode[]) => {\n for (const node of nodes) {\n if (this.activeKeys().has(node.key)) {\n node.ancestors.forEach((key) => keys.add(key));\n }\n visit(node.children);\n }\n };\n visit(this.nodes());\n return [...keys].sort().join('|');\n });\n\n constructor() {\n effect(() => {\n const ancestors = this.activeAncestors();\n if (!ancestors) {\n return;\n }\n untracked(() => {\n const open = Object.fromEntries(ancestors.split('|').map((key) => [key, true]));\n const current = this.expandedKeys();\n const next = this.multiple() ? { ...current, ...open } : open;\n if (Object.keys(next).some((key) => current[key] !== next[key]) || (!this.multiple() && Object.keys(current).some((key) => current[key] && !next[key]))) {\n this.expandedKeys.set(next);\n }\n });\n });\n }\n\n isExpanded(node: TxPanelMenuNode): boolean {\n if (this.variant() === 'sidebar' && node.level === 0) {\n return true;\n }\n return this.expandedKeys()[node.key] ?? node.item.expanded ?? false;\n }\n\n isActive(node: TxPanelMenuNode): boolean {\n return this.activeKeys().has(node.key);\n }\n\n toggle(node: TxPanelMenuNode): void {\n if (!node.children.length || node.item.disabled) {\n return;\n }\n const open = !this.isExpanded(node);\n const keys = { ...this.expandedKeys() };\n if (open && !this.multiple() && (this.variant() === 'sidebar' || node.level === 0)) {\n for (const sibling of node.parent ? node.parent.children : this.nodes()) {\n if (sibling !== node) {\n keys[sibling.key] = false;\n }\n }\n }\n keys[node.key] = open;\n this.expandedKeys.set(keys);\n }\n\n protected linkKind(node: TxPanelMenuNode): TxPanelMenuLink {\n const item = node.item;\n if (node.children.length || item.disabled) {\n return 'none';\n }\n if (item.routerLink !== undefined && this.router) {\n return 'router';\n }\n return item.url !== undefined || item.routerLink !== undefined ? 'url' : 'none';\n }\n\n protected href(item: TxPanelMenuItem): string {\n if (item.url !== undefined) {\n return item.url;\n }\n const commands = item.routerLink;\n return typeof commands === 'string' ? commands : (commands ?? []).join('/');\n }\n\n protected routerCommands(item: TxPanelMenuItem): readonly unknown[] | string {\n return item.routerLink ?? [];\n }\n\n protected iconName(icon: string | undefined): string | null {\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n }\n\n protected badgeText(item: TxPanelMenuItem): string {\n const badge = item.badge;\n if (badge === undefined || badge === null || badge === '') {\n return '';\n }\n if (this.variant() === 'sidebar' && typeof badge === 'number') {\n if (badge <= 0) {\n return '';\n }\n return badge > this.badgeMax() ? `${this.badgeMax()}+` : String(badge);\n }\n return String(badge);\n }\n\n protected ariaLevel(node: TxPanelMenuNode): number {\n return Math.max(node.level, 1);\n }\n\n protected context(node: TxPanelMenuNode): TxPanelMenuItemContext {\n return {\n $implicit: node.item,\n item: node.item,\n level: node.level,\n active: this.isActive(node),\n expanded: node.children.length ? this.isExpanded(node) : false,\n hasSubmenu: node.children.length > 0,\n };\n }\n\n protected tabKey(tree: TxPanelMenuNode[]): string | null {\n const visible = this.visible(tree).filter((node) => !node.item.disabled);\n const focus = this.focusKey();\n return (visible.find((node) => node.key === focus) ?? visible.find((node) => this.isActive(node)) ?? visible[0])?.key ?? null;\n }\n\n protected onItemClick(node: TxPanelMenuNode, event: Event): void {\n if (node.item.disabled) {\n event.preventDefault();\n return;\n }\n this.focusKey.set(node.key);\n if (node.children.length) {\n this.toggle(node);\n }\n const itemEvent: TxPanelMenuItemEvent = { item: node.item, originalEvent: event };\n node.item.command?.(itemEvent);\n this.itemClick.emit(itemEvent);\n }\n\n protected onHeaderKeydown(event: KeyboardEvent): void {\n const headers = Array.from(this.host.querySelectorAll<HTMLElement>('.tx-panel-menu__header')).filter(\n (header) => !header.hasAttribute('disabled') && header.closest('.tx-panel-menu') === this.host,\n );\n const current = headers.indexOf(event.currentTarget as HTMLElement);\n let target: HTMLElement | undefined;\n switch (event.key) {\n case 'ArrowDown':\n target = headers[Math.min(current + 1, headers.length - 1)];\n break;\n case 'ArrowUp':\n target = headers[Math.max(current - 1, 0)];\n break;\n case 'Home':\n target = headers[0];\n break;\n case 'End':\n target = headers[headers.length - 1];\n break;\n default:\n return;\n }\n event.preventDefault();\n target?.focus();\n }\n\n protected onTreeKeydown(event: KeyboardEvent, tree: TxPanelMenuNode[]): void {\n const element = (event.target as HTMLElement).closest<HTMLElement>('[role=\"treeitem\"]');\n const visible = this.visible(tree).filter((node) => !node.item.disabled);\n const index = visible.findIndex((node) => node.id === element?.id);\n const node = visible[index];\n if (!node) {\n return;\n }\n let target: TxPanelMenuNode | undefined;\n switch (event.key) {\n case 'ArrowDown':\n target = visible[index + 1];\n break;\n case 'ArrowUp':\n target = visible[index - 1];\n break;\n case 'Home':\n target = visible[0];\n break;\n case 'End':\n target = visible[visible.length - 1];\n break;\n case 'ArrowRight':\n if (node.children.length && !this.isExpanded(node)) {\n this.toggle(node);\n } else if (node.children.length) {\n target = node.children.find((child) => !child.separator && !child.item.disabled);\n }\n break;\n case 'ArrowLeft':\n if (node.children.length && this.isExpanded(node)) {\n this.toggle(node);\n } else if (node.parent && tree.includes(node) === false) {\n target = node.parent;\n }\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n element?.click();\n return;\n default:\n return;\n }\n event.preventDefault();\n if (target) {\n this.focusNode(target);\n }\n }\n\n private focusNode(node: TxPanelMenuNode): void {\n this.focusKey.set(node.key);\n this.host.querySelector<HTMLElement>(`#${node.id}`)?.focus();\n }\n\n private visible(nodes: TxPanelMenuNode[]): TxPanelMenuNode[] {\n return nodes.flatMap((node) =>\n node.separator ? [] : [node, ...(node.children.length && this.isExpanded(node) ? this.visible(node.children) : [])],\n );\n }\n\n private currentTree() {\n const router = this.router;\n const url = this.url();\n return router ? router.parseUrl(url) : null;\n }\n\n private matches(item: TxPanelMenuItem, current: ReturnType<Router['parseUrl']>): boolean {\n const router = this.router;\n if (!router || item.routerLink === undefined) {\n return false;\n }\n const commands = typeof item.routerLink === 'string' ? [item.routerLink] : [...item.routerLink];\n const target = router.createUrlTree(commands, { queryParams: item.queryParams, fragment: item.fragment });\n const options = item.routerLinkActiveOptions;\n const match = options && 'exact' in options ? (options.exact ? EXACT_MATCH : SUBSET_MATCH) : { ...SUBSET_MATCH, ...options };\n return containsTree(current, target, match);\n }\n\n private build(items: TxPanelMenuItem[], parent: TxPanelMenuNode | null): TxPanelMenuNode[] {\n return items\n .filter((item) => item.visible !== false)\n .map((item, index) => {\n const key = item.id ?? (parent ? `${parent.key}-${index}` : `${index}`);\n const node: TxPanelMenuNode = {\n item,\n key,\n id: `${this.baseId}-${key.replace(/[^\\w-]/g, '_')}`,\n level: parent ? parent.level + 1 : 0,\n ancestors: parent ? [...parent.ancestors, parent.key] : [],\n parent,\n children: [],\n separator: Boolean(item.separator),\n };\n node.children = item.items ? this.build(item.items, node) : [];\n return node;\n });\n }\n}\n","@for (block of blocks(); track block.node.key) {\n @let node = block.node;\n @if (node.separator) {\n <div role=\"separator\" class=\"tx-panel-menu__separator\" [class]=\"passThrough().separator?.class\" [style]=\"passThrough().separator?.style\"></div>\n } @else if (variant() === 'sidebar') {\n @if (block.titled) {\n <div class=\"tx-panel-menu__section\" [id]=\"node.id\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">{{ node.item.label }}</div>\n }\n <ng-container *ngTemplateOutlet=\"tree; context: { $implicit: block.tree, labelledBy: block.titled ? node.id : null, label: block.titled ? null : node.item.label }\" />\n } @else {\n <div\n class=\"tx-panel-menu__panel\"\n [class.tx-panel-menu__panel--expanded]=\"node.children.length && isExpanded(node)\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"passThrough().panel?.style\"\n >\n @switch (linkKind(node)) {\n @case ('router') {\n <a\n class=\"tx-panel-menu__header\"\n [id]=\"node.id\"\n [class.tx-panel-menu__header--active]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.title]=\"node.item.title ?? null\"\n [target]=\"node.item.target\"\n [routerLink]=\"routerCommands(node.item)\"\n [queryParams]=\"node.item.queryParams\"\n [fragment]=\"node.item.fragment\"\n [class]=\"passThrough().header?.class\"\n [style]=\"passThrough().header?.style\"\n (click)=\"onItemClick(node, $event)\"\n (keydown)=\"onHeaderKeydown($event)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @case ('url') {\n <a\n class=\"tx-panel-menu__header\"\n [id]=\"node.id\"\n [attr.href]=\"href(node.item)\"\n [attr.title]=\"node.item.title ?? null\"\n [attr.target]=\"node.item.target ?? null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().header?.class\"\n [style]=\"passThrough().header?.style\"\n (click)=\"onItemClick(node, $event)\"\n (keydown)=\"onHeaderKeydown($event)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @default {\n <button\n type=\"button\"\n class=\"tx-panel-menu__header\"\n [id]=\"node.id\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.title]=\"node.item.title ?? null\"\n [attr.aria-expanded]=\"node.children.length ? isExpanded(node) : null\"\n [attr.aria-controls]=\"node.children.length ? node.id + '-content' : null\"\n [class]=\"passThrough().header?.class\"\n [style]=\"passThrough().header?.style\"\n (click)=\"onItemClick(node, $event)\"\n (keydown)=\"onHeaderKeydown($event)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </button>\n }\n }\n @if (node.children.length) {\n <div\n class=\"tx-panel-menu__collapse\"\n role=\"region\"\n [id]=\"node.id + '-content'\"\n [attr.aria-labelledby]=\"node.id\"\n [class.tx-panel-menu__collapse--open]=\"isExpanded(node)\"\n [attr.inert]=\"isExpanded(node) ? null : ''\"\n >\n <div class=\"tx-panel-menu__collapse-inner\">\n <ng-container *ngTemplateOutlet=\"tree; context: { $implicit: block.tree, labelledBy: node.id, label: null }\" />\n </div>\n </div>\n }\n </div>\n }\n}\n\n<ng-template #tree let-nodes let-labelledBy=\"labelledBy\" let-label=\"label\">\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the tree items take focus; the tree handles their arrow keys -->\n <ul\n class=\"tx-panel-menu__tree\"\n role=\"tree\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-label]=\"label\"\n [class]=\"passThrough().tree?.class\"\n [style]=\"passThrough().tree?.style\"\n (keydown)=\"onTreeKeydown($event, nodes)\"\n >\n <ng-container *ngTemplateOutlet=\"branch; context: { $implicit: nodes, tree: nodes }\" />\n </ul>\n</ng-template>\n\n<ng-template #branch let-nodes let-tree=\"tree\">\n @for (node of nodes; track node.key) {\n @if (node.separator) {\n <li role=\"none\" aria-hidden=\"true\" class=\"tx-panel-menu__separator\" [class]=\"passThrough().separator?.class\" [style]=\"passThrough().separator?.style\"></li>\n } @else {\n <li role=\"none\" class=\"tx-panel-menu__node\">\n @switch (linkKind(node)) {\n @case ('router') {\n <a\n role=\"treeitem\"\n class=\"tx-panel-menu__item\"\n [id]=\"node.id\"\n [attr.data-level]=\"ariaLevel(node)\"\n [style.--_level]=\"ariaLevel(node)\"\n [class.tx-panel-menu__item--active]=\"isActive(node)\"\n [attr.tabindex]=\"tabKey(tree) === node.key ? 0 : -1\"\n [attr.aria-level]=\"ariaLevel(node)\"\n [attr.aria-selected]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.title]=\"node.item.title ?? null\"\n [target]=\"node.item.target\"\n [routerLink]=\"routerCommands(node.item)\"\n [queryParams]=\"node.item.queryParams\"\n [fragment]=\"node.item.fragment\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(node, $event)\"\n (focus)=\"focusKey.set(node.key)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @case ('url') {\n <a\n role=\"treeitem\"\n class=\"tx-panel-menu__item\"\n [id]=\"node.id\"\n [attr.data-level]=\"ariaLevel(node)\"\n [style.--_level]=\"ariaLevel(node)\"\n [class.tx-panel-menu__item--active]=\"isActive(node)\"\n [attr.tabindex]=\"tabKey(tree) === node.key ? 0 : -1\"\n [attr.aria-level]=\"ariaLevel(node)\"\n [attr.aria-selected]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.href]=\"href(node.item)\"\n [attr.title]=\"node.item.title ?? null\"\n [attr.target]=\"node.item.target ?? null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(node, $event)\"\n (focus)=\"focusKey.set(node.key)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @default {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- the tree handles the keys of its items -->\n <div\n role=\"treeitem\"\n class=\"tx-panel-menu__item\"\n [id]=\"node.id\"\n [attr.data-level]=\"ariaLevel(node)\"\n [style.--_level]=\"ariaLevel(node)\"\n [class.tx-panel-menu__item--expanded]=\"node.children.length && isExpanded(node)\"\n [class.tx-panel-menu__item--active]=\"isActive(node)\"\n [attr.tabindex]=\"node.item.disabled ? null : tabKey(tree) === node.key ? 0 : -1\"\n [attr.aria-level]=\"ariaLevel(node)\"\n [attr.aria-disabled]=\"node.item.disabled || null\"\n [attr.aria-selected]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.aria-expanded]=\"node.children.length ? isExpanded(node) : null\"\n [attr.aria-owns]=\"node.children.length ? node.id + '-group' : null\"\n [attr.title]=\"node.item.title ?? null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(node, $event)\"\n (focus)=\"focusKey.set(node.key)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </div>\n }\n }\n @if (node.children.length) {\n <div class=\"tx-panel-menu__collapse\" [class.tx-panel-menu__collapse--open]=\"isExpanded(node)\" [attr.inert]=\"isExpanded(node) ? null : ''\">\n <div class=\"tx-panel-menu__collapse-inner\">\n <ul role=\"group\" class=\"tx-panel-menu__group\" [id]=\"node.id + '-group'\">\n <ng-container *ngTemplateOutlet=\"branch; context: { $implicit: node.children, tree: tree }\" />\n </ul>\n </div>\n </div>\n }\n </li>\n }\n }\n</ng-template>\n\n<ng-template #content let-node>\n @if (itemTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template.template; context: context(node)\" />\n } @else {\n @if (variant() === 'panel' && node.children.length) {\n <tx-icon\n class=\"tx-panel-menu__submenu-icon\"\n aria-hidden=\"true\"\n name=\"chevron-down\"\n [class]=\"passThrough().submenuIcon?.class\"\n [style]=\"passThrough().submenuIcon?.style\"\n />\n } @else if (variant() === 'panel') {\n <span class=\"tx-panel-menu__submenu-icon tx-panel-menu__submenu-icon--spacer\" aria-hidden=\"true\"></span>\n }\n @if (node.item.icon; as icon) {\n <span class=\"tx-panel-menu__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(icon); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <span class=\"tx-panel-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ node.item.label }}</span>\n @if (badgeText(node.item); as badge) {\n @if (variant() === 'sidebar') {\n <span class=\"tx-panel-menu__badge\" [txAnimationReplay]=\"badge\" [class]=\"passThrough().badge?.class\" [style]=\"passThrough().badge?.style\">{{ badge }}</span>\n } @else {\n <tx-badge class=\"tx-panel-menu__badge\" size=\"small\" severity=\"secondary\" [value]=\"badge\" [unstyled]=\"isUnstyled()\" />\n }\n }\n @if (variant() === 'sidebar' && node.item.disabled) {\n <tx-icon class=\"tx-panel-menu__lock\" aria-hidden=\"true\" name=\"lock\" [class]=\"passThrough().lock?.class\" [style]=\"passThrough().lock?.style\" />\n }\n @if (variant() === 'sidebar' && node.children.length) {\n <tx-icon\n class=\"tx-panel-menu__submenu-icon\"\n aria-hidden=\"true\"\n name=\"angle-down\"\n [class]=\"passThrough().submenuIcon?.class\"\n [style]=\"passThrough().submenuIcon?.style\"\n />\n }\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;AAIA,IAAa,0BAAb,MAAa,wBAAuB;CACzB,WAAW,OAA4C,WAAW;CAE3E,OAAO,uBAAuB,YAAqC,SAAgB;EACjF,OAAO,CAAC,CAAC;CACX;CALW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAuB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAvB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAuB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAvB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EADnC,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,+BAA8B,CAAE;;;ACDvD,MAAa,2BAAsC;CACjD,cAAc;CACd,gBAAgB;CAChB,MAAM;CACN,SAAS;AACV;ACLD,MAAa,mBAAmB,EAC9B,WAAW,gBACZ;AC+ED,SAAS,cAAc,QAAc;CACnC,MAAM,SAAmC,CAAC,OAAO,YAAY,SAAS,IAAI;CAC1E,KAAK,IAAI,QAAQ,OAAO,IAAG,GAAI,OAAO,QAAQ,OAAO,IAAG,GAAI;EAC1D,IAAI,MAAM,aAAa,eAAe,QACpC,OAAO;EAET,OAAO,KAAK,GAAG,MAAM,QAAQ;CAC/B;CACA,OAAO;AACT;AAEA,SAAS,SAAS,QAAc;CAC9B,OAAO,SACL,OAAO,OAAO,KACZ,KAAK,UAAU,cAAc,QAAQ,KAAK,CAAC,GAC3C,QAAQ,QAAuB,QAAQ,IAAI,CAAC,GAE9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,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,oBAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-panel-menu.mjs","names":[],"sources":["../../../../packages/ui/panel-menu/src/panel-menu.templates.ts","../../../../packages/ui/panel-menu/src/panel-menu.icons.ts","../../../../packages/ui/panel-menu/src/panel-menu.theme.ts","../../../../packages/ui/panel-menu/src/panel-menu.component.ts","../../../../packages/ui/panel-menu/src/panel-menu.component.html"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxPanelMenuItemContext } from './panel-menu.types';\n\n@Directive({ selector: 'ng-template[txPanelMenuItem]' })\nexport class TxPanelMenuItemTemplate {\n readonly template = inject<TemplateRef<TxPanelMenuItemContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxPanelMenuItemTemplate, context: unknown): context is TxPanelMenuItemContext {\n return !!context;\n }\n}\n","import { TxIconSet, txIconAngleDown, txIconChevronDown, txIconLock, txIconSidebar } from '@tectra-ng/icons';\n\nexport const PANEL_MENU_ICON_DEFAULTS: TxIconSet = {\n 'angle-down': txIconAngleDown,\n 'chevron-down': txIconChevronDown,\n lock: txIconLock,\n sidebar: txIconSidebar,\n};\n","import { panelMenuTokens } from '@tectra-ng/themes';\n\nexport const PANEL_MENU_THEME = {\n panelMenu: panelMenuTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n contentChild,\n effect,\n inject,\n input,\n isSignal,\n model,\n numberAttribute,\n output,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport {\n ActivatedRoute,\n ActivatedRouteSnapshot,\n Event as RouterEvent,\n GuardsCheckEnd,\n IsActiveMatchOptions,\n NavigationCancel,\n NavigationEnd,\n NavigationError,\n NavigationSkipped,\n NavigationStart,\n Router,\n RouterLink,\n containsTree,\n} from '@angular/router';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxAnimationReplay, optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPanelMenuTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxBadge } from '@tectra-ng/ui/badge';\nimport { filter, map } from 'rxjs';\nimport { TxPanelMenuItemTemplate } from './panel-menu.templates';\nimport {\n TxPanelMenuExpandedKeys,\n TxPanelMenuItem,\n TxPanelMenuItemContext,\n TxPanelMenuItemEvent,\n TxPanelMenuPart,\n TxPanelMenuTranslate,\n TxPanelMenuVariant,\n} from './panel-menu.types';\nimport { PANEL_MENU_ICON_DEFAULTS } from './panel-menu.icons';\nimport { PANEL_MENU_THEME } from './panel-menu.theme';\n\n/** Internal tree node of `tx-panel-menu`: an item with its key, depth, ancestors and children. */\nexport interface TxPanelMenuNode {\n /** The menu item behind the node. */\n item: TxPanelMenuItem;\n /** Key of the node: the item `id` or its position path; used in `expandedKeys`. */\n key: string;\n /** DOM id of the node element. */\n id: string;\n /** Nesting depth of the node, from `0` at the top. */\n level: number;\n /** Keys of the parent nodes, outermost first. */\n ancestors: string[];\n /** Parent node, or `null` at the top level. */\n parent: TxPanelMenuNode | null;\n /** Child nodes shown in the submenu. */\n children: TxPanelMenuNode[];\n /** Whether the node is a separator line, not an item. */\n separator: boolean;\n}\n\n/** Internal render block of `tx-panel-menu`: a top-level node and the nodes shown under it. */\ninterface TxPanelMenuBlock {\n /** The top-level node of the block. */\n node: TxPanelMenuNode;\n /** Nodes rendered inside the block. */\n tree: TxPanelMenuNode[];\n /** Whether the block shows its node as a section title. */\n titled: boolean;\n}\n\nfunction mayAskToLeave(router: Router): boolean {\n const routes: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root];\n for (let route = routes.pop(); route; route = routes.pop()) {\n if (route.routeConfig?.canDeactivate?.length) {\n return true;\n }\n routes.push(...route.children);\n }\n return false;\n}\n\nfunction routeUrl(router: Router): Signal<string> {\n return toSignal(\n router.events.pipe(\n map((event) => navigationUrl(router, event)),\n filter((url): url is string => url !== null),\n ),\n { initialValue: router.url },\n );\n}\n\nfunction navigationUrl(router: Router, event: RouterEvent): string | null {\n if (event instanceof NavigationStart) {\n return mayAskToLeave(router) ? null : event.url;\n }\n if (event instanceof GuardsCheckEnd) {\n return event.shouldActivate ? event.urlAfterRedirects : null;\n }\n if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError || event instanceof NavigationSkipped) {\n return router.url;\n }\n return null;\n}\n\n/** How a node navigates: through the router, as a plain URL, or not at all. */\ntype TxPanelMenuLink = 'router' | 'url' | 'none';\n\nconst SUBSET_MATCH: IsActiveMatchOptions = { paths: 'subset', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' };\nconst EXACT_MATCH: IsActiveMatchOptions = { paths: 'exact', queryParams: 'exact', matrixParams: 'ignored', fragment: 'ignored' };\n\n@Component({\n selector: 'tx-panel-menu',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxBadge, TxAnimationReplay],\n templateUrl: './panel-menu.component.html',\n styleUrl: './panel-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-panel-menu',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-variant]': 'variant()',\n '[class.tx-panel-menu--collapsed]': 'collapsed() && variant() === \"sidebar\"',\n '[attr.role]': 'ariaLabel() ? \"navigation\" : null',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n },\n viewProviders: [provideTxIconDefaults(PANEL_MENU_ICON_DEFAULTS)],\n})\nexport class TxPanelMenu {\n private readonly panelMenuTheme = injectTokens(PANEL_MENU_THEME);\n\n private readonly router = inject(ActivatedRoute, { optional: true }) ? inject(Router) : null;\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly txIconRegistry = injectTxIcons();\n private readonly baseId = uniqueId('tx-panel-menu');\n\n readonly model = input<TxPanelMenuItem[]>([]);\n readonly variant = input<TxPanelMenuVariant>('panel');\n readonly collapsed = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly multiple = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly expandedKeys = model<TxPanelMenuExpandedKeys>({});\n readonly badgeMax = input<number, unknown>(99, { transform: numberAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly translate = input<TxPanelMenuTranslate | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPanelMenuTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPanelMenuPart, TxPanelMenu> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly itemClick = output<TxPanelMenuItemEvent>();\n\n protected readonly itemTemplate = contentChild(TxPanelMenuItemTemplate);\n protected readonly focusKey = signal<string | null>(null);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('panelMenu', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-panel-menu'), ...this.passThrough().root?.style }));\n\n readonly nodes = computed(() => this.build(this.model(), null));\n protected readonly blocks = computed<TxPanelMenuBlock[]>(() =>\n this.nodes().map((node) =>\n this.variant() === 'sidebar' && !node.children.length && !node.separator\n ? { node, tree: [node], titled: false }\n : { node, tree: node.children, titled: this.variant() !== 'sidebar' || !!node.item.label?.trim() },\n ),\n );\n\n private readonly url = this.router ? routeUrl(this.router) : signal('');\n\n private readonly routeState = computed(() => {\n const active = new Set<string>();\n const open = new Set<string>();\n const current = this.currentTree();\n const visit = (nodes: TxPanelMenuNode[]) => {\n for (const node of nodes) {\n const marked = node.item.active;\n if (marked ?? (!!current && this.matches(node.item, current))) {\n (marked || !node.children.length ? active : open).add(node.key);\n }\n visit(node.children);\n }\n };\n visit(this.nodes());\n return { active, open };\n });\n\n readonly activeKeys = computed(() => this.routeState().active);\n\n private readonly activeAncestors = computed(() => {\n const { active, open } = this.routeState();\n const keys = new Set<string>(open);\n const visit = (nodes: TxPanelMenuNode[]) => {\n for (const node of nodes) {\n if (active.has(node.key) || open.has(node.key)) {\n node.ancestors.forEach((key) => keys.add(key));\n }\n visit(node.children);\n }\n };\n visit(this.nodes());\n return [...keys].sort().join('|');\n });\n\n constructor() {\n effect(() => {\n const ancestors = this.activeAncestors();\n if (!ancestors) {\n return;\n }\n untracked(() => {\n const open = Object.fromEntries(ancestors.split('|').map((key) => [key, true]));\n const current = this.expandedKeys();\n const next = this.multiple() ? { ...current, ...open } : open;\n if (Object.keys(next).some((key) => current[key] !== next[key]) || (!this.multiple() && Object.keys(current).some((key) => current[key] && !next[key]))) {\n this.expandedKeys.set(next);\n }\n });\n });\n }\n\n isExpanded(node: TxPanelMenuNode): boolean {\n if (this.variant() === 'sidebar' && node.level === 0) {\n return true;\n }\n return this.expandedKeys()[node.key] ?? node.item.expanded ?? false;\n }\n\n isActive(node: TxPanelMenuNode): boolean {\n return this.activeKeys().has(node.key);\n }\n\n toggle(node: TxPanelMenuNode): void {\n if (!node.children.length || node.item.disabled) {\n return;\n }\n const open = !this.isExpanded(node);\n const keys = { ...this.expandedKeys() };\n if (open && !this.multiple() && (this.variant() === 'sidebar' || node.level === 0)) {\n for (const sibling of node.parent ? node.parent.children : this.nodes()) {\n if (sibling !== node) {\n keys[sibling.key] = false;\n }\n }\n }\n keys[node.key] = open;\n this.expandedKeys.set(keys);\n }\n\n protected linkKind(node: TxPanelMenuNode): TxPanelMenuLink {\n const item = node.item;\n if (node.children.length || item.disabled) {\n return 'none';\n }\n if (item.routerLink !== undefined && this.router) {\n return 'router';\n }\n return item.url !== undefined || item.routerLink !== undefined ? 'url' : 'none';\n }\n\n protected href(item: TxPanelMenuItem): string {\n if (item.url !== undefined) {\n return item.url;\n }\n const commands = item.routerLink;\n return typeof commands === 'string' ? commands : (commands ?? []).join('/');\n }\n\n protected routerCommands(item: TxPanelMenuItem): readonly unknown[] | string {\n return item.routerLink ?? [];\n }\n\n protected iconName(icon: string | undefined): string | null {\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n }\n\n protected text(key: string | undefined): string {\n if (!key) {\n return '';\n }\n return this.translate()?.(key) ?? key;\n }\n\n protected badgeText(item: TxPanelMenuItem): string {\n const badge = isSignal(item.badge) ? item.badge() : item.badge;\n if (badge === undefined || badge === null || badge === '') {\n return '';\n }\n if (this.variant() === 'sidebar' && typeof badge === 'number') {\n if (badge <= 0) {\n return '';\n }\n return badge > this.badgeMax() ? `${this.badgeMax()}+` : String(badge);\n }\n return String(badge);\n }\n\n protected ariaLevel(node: TxPanelMenuNode): number {\n return Math.max(node.level, 1);\n }\n\n protected context(node: TxPanelMenuNode): TxPanelMenuItemContext {\n return {\n $implicit: node.item,\n item: node.item,\n label: this.text(node.item.label),\n level: node.level,\n active: this.isActive(node),\n expanded: node.children.length ? this.isExpanded(node) : false,\n hasSubmenu: node.children.length > 0,\n };\n }\n\n protected tabKey(tree: TxPanelMenuNode[]): string | null {\n const visible = this.visible(tree).filter((node) => !node.item.disabled);\n const focus = this.focusKey();\n return (visible.find((node) => node.key === focus) ?? visible.find((node) => this.isActive(node)) ?? visible[0])?.key ?? null;\n }\n\n protected onItemClick(node: TxPanelMenuNode, event: Event): void {\n if (node.item.disabled) {\n event.preventDefault();\n return;\n }\n this.focusKey.set(node.key);\n if (node.children.length) {\n this.toggle(node);\n }\n const itemEvent: TxPanelMenuItemEvent = { item: node.item, originalEvent: event };\n node.item.command?.(itemEvent);\n this.itemClick.emit(itemEvent);\n }\n\n protected onHeaderKeydown(event: KeyboardEvent): void {\n const headers = Array.from(this.host.querySelectorAll<HTMLElement>('.tx-panel-menu__header')).filter(\n (header) => !header.hasAttribute('disabled') && header.closest('.tx-panel-menu') === this.host,\n );\n const current = headers.indexOf(event.currentTarget as HTMLElement);\n let target: HTMLElement | undefined;\n switch (event.key) {\n case 'ArrowDown':\n target = headers[Math.min(current + 1, headers.length - 1)];\n break;\n case 'ArrowUp':\n target = headers[Math.max(current - 1, 0)];\n break;\n case 'Home':\n target = headers[0];\n break;\n case 'End':\n target = headers[headers.length - 1];\n break;\n default:\n return;\n }\n event.preventDefault();\n target?.focus();\n }\n\n protected onTreeKeydown(event: KeyboardEvent, tree: TxPanelMenuNode[]): void {\n const element = (event.target as HTMLElement).closest<HTMLElement>('[role=\"treeitem\"]');\n const visible = this.visible(tree).filter((node) => !node.item.disabled);\n const index = visible.findIndex((node) => node.id === element?.id);\n const node = visible[index];\n if (!node) {\n return;\n }\n let target: TxPanelMenuNode | undefined;\n switch (event.key) {\n case 'ArrowDown':\n target = visible[index + 1];\n break;\n case 'ArrowUp':\n target = visible[index - 1];\n break;\n case 'Home':\n target = visible[0];\n break;\n case 'End':\n target = visible[visible.length - 1];\n break;\n case 'ArrowRight':\n if (node.children.length && !this.isExpanded(node)) {\n this.toggle(node);\n } else if (node.children.length) {\n target = node.children.find((child) => !child.separator && !child.item.disabled);\n }\n break;\n case 'ArrowLeft':\n if (node.children.length && this.isExpanded(node)) {\n this.toggle(node);\n } else if (node.parent && tree.includes(node) === false) {\n target = node.parent;\n }\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n element?.click();\n return;\n default:\n return;\n }\n event.preventDefault();\n if (target) {\n this.focusNode(target);\n }\n }\n\n private focusNode(node: TxPanelMenuNode): void {\n this.focusKey.set(node.key);\n this.host.querySelector<HTMLElement>(`#${node.id}`)?.focus();\n }\n\n private visible(nodes: TxPanelMenuNode[]): TxPanelMenuNode[] {\n return nodes.flatMap((node) =>\n node.separator ? [] : [node, ...(node.children.length && this.isExpanded(node) ? this.visible(node.children) : [])],\n );\n }\n\n private currentTree() {\n const router = this.router;\n const url = this.url();\n return router ? router.parseUrl(url) : null;\n }\n\n private matches(item: TxPanelMenuItem, current: ReturnType<Router['parseUrl']>): boolean {\n const router = this.router;\n if (!router || item.routerLink === undefined) {\n return false;\n }\n const target = router.createUrlTree(this.commands(item.routerLink), { queryParams: item.queryParams, fragment: item.fragment });\n const options = item.routerLinkActiveOptions;\n const match = options && 'exact' in options ? (options.exact ? EXACT_MATCH : SUBSET_MATCH) : { ...SUBSET_MATCH, ...options };\n if (!containsTree(current, target, match)) {\n return false;\n }\n return !item.routerLinkActiveExclude?.some((link) => containsTree(current, router.createUrlTree(this.commands(link)), SUBSET_MATCH));\n }\n\n private commands(link: string | readonly unknown[]): unknown[] {\n return typeof link === 'string' ? [link] : [...link];\n }\n\n private build(items: TxPanelMenuItem[], parent: TxPanelMenuNode | null): TxPanelMenuNode[] {\n return items\n .filter((item) => item.visible !== false)\n .map((item, index) => {\n const key = item.id ?? (parent ? `${parent.key}-${index}` : `${index}`);\n const node: TxPanelMenuNode = {\n item,\n key,\n id: `${this.baseId}-${key.replace(/[^\\w-]/g, '_')}`,\n level: parent ? parent.level + 1 : 0,\n ancestors: parent ? [...parent.ancestors, parent.key] : [],\n parent,\n children: [],\n separator: Boolean(item.separator),\n };\n node.children = item.items ? this.build(item.items, node) : [];\n return node;\n });\n }\n}\n","@for (block of blocks(); track block.node.key) {\n @let node = block.node;\n @if (node.separator) {\n <div role=\"separator\" class=\"tx-panel-menu__separator\" [class]=\"passThrough().separator?.class\" [style]=\"passThrough().separator?.style\"></div>\n } @else if (variant() === 'sidebar') {\n @if (block.titled) {\n <div class=\"tx-panel-menu__section\" [id]=\"node.id\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">{{ text(node.item.label) }}</div>\n }\n <ng-container *ngTemplateOutlet=\"tree; context: { $implicit: block.tree, labelledBy: block.titled ? node.id : null, label: block.titled ? null : text(node.item.label).trim() || null }\" />\n } @else {\n <div\n class=\"tx-panel-menu__panel\"\n [class.tx-panel-menu__panel--expanded]=\"node.children.length && isExpanded(node)\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"passThrough().panel?.style\"\n >\n @switch (linkKind(node)) {\n @case ('router') {\n <a\n class=\"tx-panel-menu__header\"\n [id]=\"node.id\"\n [class.tx-panel-menu__header--active]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.title]=\"text(node.item.title) || null\"\n [target]=\"node.item.target\"\n [routerLink]=\"routerCommands(node.item)\"\n [queryParams]=\"node.item.queryParams\"\n [fragment]=\"node.item.fragment\"\n [class]=\"passThrough().header?.class\"\n [style]=\"passThrough().header?.style\"\n (click)=\"onItemClick(node, $event)\"\n (keydown)=\"onHeaderKeydown($event)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @case ('url') {\n <a\n class=\"tx-panel-menu__header\"\n [id]=\"node.id\"\n [attr.href]=\"href(node.item)\"\n [attr.title]=\"text(node.item.title) || null\"\n [attr.target]=\"node.item.target ?? null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().header?.class\"\n [style]=\"passThrough().header?.style\"\n (click)=\"onItemClick(node, $event)\"\n (keydown)=\"onHeaderKeydown($event)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @default {\n <button\n type=\"button\"\n class=\"tx-panel-menu__header\"\n [id]=\"node.id\"\n [disabled]=\"node.item.disabled ?? false\"\n [attr.title]=\"text(node.item.title) || null\"\n [attr.aria-expanded]=\"node.children.length ? isExpanded(node) : null\"\n [attr.aria-controls]=\"node.children.length ? node.id + '-content' : null\"\n [class]=\"passThrough().header?.class\"\n [style]=\"passThrough().header?.style\"\n (click)=\"onItemClick(node, $event)\"\n (keydown)=\"onHeaderKeydown($event)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </button>\n }\n }\n @if (node.children.length) {\n <div\n class=\"tx-panel-menu__collapse\"\n role=\"region\"\n [id]=\"node.id + '-content'\"\n [attr.aria-labelledby]=\"node.id\"\n [class.tx-panel-menu__collapse--open]=\"isExpanded(node)\"\n [attr.inert]=\"isExpanded(node) ? null : ''\"\n >\n <div class=\"tx-panel-menu__collapse-inner\">\n <ng-container *ngTemplateOutlet=\"tree; context: { $implicit: block.tree, labelledBy: node.id, label: null }\" />\n </div>\n </div>\n }\n </div>\n }\n}\n\n<ng-template #tree let-nodes let-labelledBy=\"labelledBy\" let-label=\"label\">\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the tree items take focus; the tree handles their arrow keys -->\n <ul\n class=\"tx-panel-menu__tree\"\n role=\"tree\"\n [attr.aria-labelledby]=\"labelledBy\"\n [attr.aria-label]=\"label\"\n [class]=\"passThrough().tree?.class\"\n [style]=\"passThrough().tree?.style\"\n (keydown)=\"onTreeKeydown($event, nodes)\"\n >\n <ng-container *ngTemplateOutlet=\"branch; context: { $implicit: nodes, tree: nodes }\" />\n </ul>\n</ng-template>\n\n<ng-template #branch let-nodes let-tree=\"tree\">\n @for (node of nodes; track node.key) {\n @if (node.separator) {\n <li role=\"none\" aria-hidden=\"true\" class=\"tx-panel-menu__separator\" [class]=\"passThrough().separator?.class\" [style]=\"passThrough().separator?.style\"></li>\n } @else {\n <li role=\"none\" class=\"tx-panel-menu__node\">\n @switch (linkKind(node)) {\n @case ('router') {\n <a\n role=\"treeitem\"\n class=\"tx-panel-menu__item\"\n [id]=\"node.id\"\n [attr.data-level]=\"ariaLevel(node)\"\n [style.--_level]=\"ariaLevel(node)\"\n [class.tx-panel-menu__item--active]=\"isActive(node)\"\n [attr.tabindex]=\"tabKey(tree) === node.key ? 0 : -1\"\n [attr.aria-level]=\"ariaLevel(node)\"\n [attr.aria-selected]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.title]=\"text(node.item.title) || null\"\n [target]=\"node.item.target\"\n [routerLink]=\"routerCommands(node.item)\"\n [queryParams]=\"node.item.queryParams\"\n [fragment]=\"node.item.fragment\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(node, $event)\"\n (focus)=\"focusKey.set(node.key)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @case ('url') {\n <a\n role=\"treeitem\"\n class=\"tx-panel-menu__item\"\n [id]=\"node.id\"\n [attr.data-level]=\"ariaLevel(node)\"\n [style.--_level]=\"ariaLevel(node)\"\n [class.tx-panel-menu__item--active]=\"isActive(node)\"\n [attr.tabindex]=\"tabKey(tree) === node.key ? 0 : -1\"\n [attr.aria-level]=\"ariaLevel(node)\"\n [attr.aria-selected]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.href]=\"href(node.item)\"\n [attr.title]=\"text(node.item.title) || null\"\n [attr.target]=\"node.item.target ?? null\"\n [attr.rel]=\"node.item.target === '_blank' ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(node, $event)\"\n (focus)=\"focusKey.set(node.key)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </a>\n }\n @default {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -- the tree handles the keys of its items -->\n <div\n role=\"treeitem\"\n class=\"tx-panel-menu__item\"\n [id]=\"node.id\"\n [attr.data-level]=\"ariaLevel(node)\"\n [style.--_level]=\"ariaLevel(node)\"\n [class.tx-panel-menu__item--expanded]=\"node.children.length && isExpanded(node)\"\n [class.tx-panel-menu__item--active]=\"isActive(node)\"\n [attr.tabindex]=\"node.item.disabled ? null : tabKey(tree) === node.key ? 0 : -1\"\n [attr.aria-level]=\"ariaLevel(node)\"\n [attr.aria-disabled]=\"node.item.disabled || null\"\n [attr.aria-selected]=\"isActive(node)\"\n [attr.aria-current]=\"isActive(node) ? 'page' : null\"\n [attr.aria-expanded]=\"node.children.length ? isExpanded(node) : null\"\n [attr.aria-owns]=\"node.children.length ? node.id + '-group' : null\"\n [attr.title]=\"text(node.item.title) || null\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"onItemClick(node, $event)\"\n (focus)=\"focusKey.set(node.key)\"\n >\n <ng-container *ngTemplateOutlet=\"content; context: { $implicit: node }\" />\n </div>\n }\n }\n @if (node.children.length) {\n <div class=\"tx-panel-menu__collapse\" [class.tx-panel-menu__collapse--open]=\"isExpanded(node)\" [attr.inert]=\"isExpanded(node) ? null : ''\">\n <div class=\"tx-panel-menu__collapse-inner\">\n <ul role=\"group\" class=\"tx-panel-menu__group\" [id]=\"node.id + '-group'\">\n <ng-container *ngTemplateOutlet=\"branch; context: { $implicit: node.children, tree: tree }\" />\n </ul>\n </div>\n </div>\n }\n </li>\n }\n }\n</ng-template>\n\n<ng-template #content let-node>\n @if (itemTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template.template; context: context(node)\" />\n } @else {\n @if (variant() === 'panel' && node.children.length) {\n <tx-icon\n class=\"tx-panel-menu__submenu-icon\"\n aria-hidden=\"true\"\n name=\"chevron-down\"\n [class]=\"passThrough().submenuIcon?.class\"\n [style]=\"passThrough().submenuIcon?.style\"\n />\n } @else if (variant() === 'panel') {\n <span class=\"tx-panel-menu__submenu-icon tx-panel-menu__submenu-icon--spacer\" aria-hidden=\"true\"></span>\n }\n @if (node.item.icon; as icon) {\n <span class=\"tx-panel-menu__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(icon); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <span class=\"tx-panel-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ text(node.item.label) }}</span>\n @if (badgeText(node.item); as badge) {\n @if (variant() === 'sidebar') {\n <span class=\"tx-panel-menu__badge\" [txAnimationReplay]=\"badge\" [class]=\"passThrough().badge?.class\" [style]=\"passThrough().badge?.style\">{{ badge }}</span>\n } @else {\n <tx-badge class=\"tx-panel-menu__badge\" size=\"small\" severity=\"secondary\" [value]=\"badge\" [unstyled]=\"isUnstyled()\" />\n }\n }\n @if (variant() === 'sidebar' && node.item.disabled) {\n <tx-icon class=\"tx-panel-menu__lock\" aria-hidden=\"true\" name=\"lock\" [class]=\"passThrough().lock?.class\" [style]=\"passThrough().lock?.style\" />\n }\n @if (variant() === 'sidebar' && node.children.length) {\n <tx-icon\n class=\"tx-panel-menu__submenu-icon\"\n aria-hidden=\"true\"\n name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AAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -165,6 +165,7 @@ var TxPanel = class TxPanel {
|
|
|
165
165
|
"attr.title": "null",
|
|
166
166
|
"attr.data-variant": "variant()",
|
|
167
167
|
"attr.data-align": "align()",
|
|
168
|
+
"class.tx-panel--toggleable": "toggleable()",
|
|
168
169
|
"class.tx-panel--collapsed": "toggleable() && collapsed()",
|
|
169
170
|
"attr.role": "title() ? \"region\" : null",
|
|
170
171
|
"attr.aria-labelledby": "title() ? titleId : null"
|
|
@@ -173,7 +174,7 @@ var TxPanel = class TxPanel {
|
|
|
173
174
|
},
|
|
174
175
|
ngImport: i0,
|
|
175
176
|
template: "<header class=\"tx-panel__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <div class=\"tx-panel__lead\">\n @if (icon(); as icon) {\n <span class=\"tx-panel__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <div class=\"tx-panel__heading\">\n @if (title()) {\n <div class=\"tx-panel__title\" role=\"heading\" [id]=\"titleId\" [attr.aria-level]=\"headingLevel()\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n {{ title() }}\n </div>\n }\n @if (subtitle()) {\n <p class=\"tx-panel__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n <ng-content select=\"[txPanelHeader]\" />\n </div>\n </div>\n <div class=\"tx-panel__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPanelActions]\" />\n @if (toggleable()) {\n <button\n type=\"button\"\n class=\"tx-panel__toggle\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"bodyId\"\n [attr.aria-label]=\"toggleLabel() ?? title() ?? null\"\n (click)=\"toggle()\"\n >\n <tx-icon [name]=\"'chevron-down'\" />\n </button>\n }\n </div>\n</header>\n<div class=\"tx-panel__collapse\" [id]=\"bodyId\" [attr.inert]=\"isOpen() ? null : ''\">\n <div class=\"tx-panel__collapse-inner\">\n <div class=\"tx-panel__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\"><ng-content /></div>\n <div class=\"tx-panel__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\"><ng-content select=\"[txPanelFooter]\" /></div>\n </div>\n</div>\n",
|
|
176
|
-
styles: [":host{display:block;min-width:0}.tx-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between}.tx-panel__lead{display:flex;align-items:center;min-width:0}.tx-panel__heading{display:flex;flex-direction:column;min-width:0}.tx-panel__actions{display:flex;align-items:center}.tx-panel__actions:empty,.tx-panel__body:empty,.tx-panel__footer:empty,.tx-panel__collapse:has(.tx-panel__body:empty):has(.tx-panel__footer:empty){display:none}.tx-panel__collapse{display:grid;grid-template-rows:1fr}:host(.tx-panel--collapsed) .tx-panel__collapse{grid-template-rows:0fr}.tx-panel__collapse-inner{min-height:0
|
|
177
|
+
styles: [":host{display:block;min-width:0}.tx-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between}.tx-panel__lead{display:flex;align-items:center;min-width:0}.tx-panel__heading{display:flex;flex-direction:column;min-width:0}.tx-panel__actions{display:flex;align-items:center}.tx-panel__actions:empty,.tx-panel__body:empty,.tx-panel__footer:empty,.tx-panel__collapse:has(.tx-panel__body:empty):has(.tx-panel__footer:empty){display:none}.tx-panel__collapse{display:grid;flex-grow:1;grid-template-rows:1fr}:host(.tx-panel--collapsed) .tx-panel__collapse{grid-template-rows:0fr}.tx-panel__collapse-inner{display:flex;flex-direction:column;min-height:0}.tx-panel__body{flex-grow:1}:host(.tx-panel--toggleable) .tx-panel__collapse-inner{overflow:hidden}:host(.tx-panel--collapsed) .tx-panel__collapse-inner{visibility:hidden}:host([data-styled]){--_gap: var(--tx-panel-gap);--_icon: var(--tx-panel-icon-size);--_title: var(--tx-panel-title-font-size);display:flex;flex-direction:column;gap:var(--_gap);padding:var(--tx-panel-padding);border-radius:var(--tx-panel-border-radius);background:var(--tx-panel-background);box-shadow:inset 0 0 0 1px var(--tx-panel-border-color),var(--tx-panel-shadow);color:var(--tx-panel-color);font-family:var(--tx-font-family);transition:gap var(--tx-panel-transition-duration)}:host([data-styled].tx-panel--collapsed){gap:0}:host([data-styled][data-variant=inset]){--_gap: var(--tx-panel-inset-gap);padding:var(--tx-panel-inset-padding);background:var(--tx-panel-inset-background);box-shadow:none}:host([data-styled][data-variant=plain]){--_gap: var(--tx-panel-plain-gap);--_icon: var(--tx-panel-plain-icon-size);--_title: var(--tx-panel-plain-title-font-size);padding:0;border-radius:0;background:transparent;box-shadow:none}:host([data-styled]) .tx-panel__header{gap:var(--tx-panel-header-gap)}:host([data-styled][data-align=start]) .tx-panel__header{align-items:flex-start}:host([data-styled][data-align=center]) .tx-panel__header{align-items:center}:host([data-styled][data-align=end]) .tx-panel__header{align-items:flex-end;gap:var(--tx-panel-header-end-gap)}:host([data-styled][data-align=end]) .tx-panel__header .tx-panel__lead{align-self:flex-start}:host([data-styled][data-align=end]) .tx-panel__header .tx-panel__actions{align-items:flex-end}:host([data-styled]) .tx-panel__lead{gap:var(--tx-panel-lead-gap)}:host([data-styled]) .tx-panel__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--_icon);height:var(--_icon);border-radius:var(--tx-panel-icon-border-radius);background:var(--tx-panel-icon-background);color:var(--tx-panel-icon-color);font-size:calc(var(--_icon) * var(--tx-panel-icon-scale))}:host([data-styled]) .tx-panel__heading{gap:var(--tx-panel-heading-gap)}:host([data-styled]) .tx-panel__title{font-size:var(--_title);font-weight:var(--tx-panel-title-font-weight);line-height:var(--tx-panel-title-line-height)}:host([data-styled]) .tx-panel__subtitle{margin:0;color:var(--tx-panel-subtitle-color);font-size:var(--tx-panel-subtitle-font-size);line-height:var(--tx-panel-subtitle-line-height)}:host([data-styled]) .tx-panel__actions{flex-wrap:wrap;gap:var(--tx-panel-actions-gap)}:host([data-styled]) .tx-panel__toggle{display:inline-flex;align-items:center;justify-content:center;width:var(--tx-panel-toggle-size);height:var(--tx-panel-toggle-size);padding:0;border:none;border-radius:var(--tx-radius-md);background:transparent;color:var(--tx-text-muted);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-panel__toggle tx-icon{transition:transform var(--tx-panel-transition-duration) cubic-bezier(.2,0,0,1)}:host([data-styled]) .tx-panel__toggle:hover{background:var(--tx-surface-hover);color:var(--tx-text-primary)}:host([data-styled]) .tx-panel__toggle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled].tx-panel--collapsed) .tx-panel__toggle tx-icon{transform:rotate(-90deg)}:host([data-styled]) .tx-panel__collapse{transition:grid-template-rows var(--tx-panel-transition-duration) cubic-bezier(.2,0,0,1)}:host([data-styled]) .tx-panel__footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--tx-panel-footer-gap);margin-top:var(--_gap)}:host([data-styled]) .tx-panel__body:empty+.tx-panel__footer{margin-top:0}:host([data-styled]) .tx-panel__footer:empty{display:none}:host([data-styled].tx-panel--collapsed) .tx-panel__collapse-inner{transition:visibility 0s linear var(--tx-panel-transition-duration)}@media(prefers-reduced-motion:reduce){:host([data-styled]),:host([data-styled]) .tx-panel__collapse,:host([data-styled]) .tx-panel__toggle,:host([data-styled].tx-panel--collapsed) .tx-panel__collapse-inner,:host([data-styled]) .tx-panel__toggle tx-icon{transition:none}}\n"],
|
|
177
178
|
dependencies: [{
|
|
178
179
|
kind: "component",
|
|
179
180
|
type: TxIcon,
|
|
@@ -203,13 +204,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
203
204
|
"[attr.title]": "null",
|
|
204
205
|
"[attr.data-variant]": "variant()",
|
|
205
206
|
"[attr.data-align]": "align()",
|
|
207
|
+
"[class.tx-panel--toggleable]": "toggleable()",
|
|
206
208
|
"[class.tx-panel--collapsed]": "toggleable() && collapsed()",
|
|
207
209
|
"[attr.role]": "title() ? \"region\" : null",
|
|
208
210
|
"[attr.aria-labelledby]": "title() ? titleId : null"
|
|
209
211
|
},
|
|
210
212
|
viewProviders: [provideTxIconDefaults(PANEL_ICON_DEFAULTS)],
|
|
211
213
|
template: "<header class=\"tx-panel__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <div class=\"tx-panel__lead\">\n @if (icon(); as icon) {\n <span class=\"tx-panel__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <div class=\"tx-panel__heading\">\n @if (title()) {\n <div class=\"tx-panel__title\" role=\"heading\" [id]=\"titleId\" [attr.aria-level]=\"headingLevel()\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n {{ title() }}\n </div>\n }\n @if (subtitle()) {\n <p class=\"tx-panel__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n <ng-content select=\"[txPanelHeader]\" />\n </div>\n </div>\n <div class=\"tx-panel__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPanelActions]\" />\n @if (toggleable()) {\n <button\n type=\"button\"\n class=\"tx-panel__toggle\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"bodyId\"\n [attr.aria-label]=\"toggleLabel() ?? title() ?? null\"\n (click)=\"toggle()\"\n >\n <tx-icon [name]=\"'chevron-down'\" />\n </button>\n }\n </div>\n</header>\n<div class=\"tx-panel__collapse\" [id]=\"bodyId\" [attr.inert]=\"isOpen() ? null : ''\">\n <div class=\"tx-panel__collapse-inner\">\n <div class=\"tx-panel__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\"><ng-content /></div>\n <div class=\"tx-panel__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\"><ng-content select=\"[txPanelFooter]\" /></div>\n </div>\n</div>\n",
|
|
212
|
-
styles: [":host{display:block;min-width:0}.tx-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between}.tx-panel__lead{display:flex;align-items:center;min-width:0}.tx-panel__heading{display:flex;flex-direction:column;min-width:0}.tx-panel__actions{display:flex;align-items:center}.tx-panel__actions:empty,.tx-panel__body:empty,.tx-panel__footer:empty,.tx-panel__collapse:has(.tx-panel__body:empty):has(.tx-panel__footer:empty){display:none}.tx-panel__collapse{display:grid;grid-template-rows:1fr}:host(.tx-panel--collapsed) .tx-panel__collapse{grid-template-rows:0fr}.tx-panel__collapse-inner{min-height:0
|
|
214
|
+
styles: [":host{display:block;min-width:0}.tx-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between}.tx-panel__lead{display:flex;align-items:center;min-width:0}.tx-panel__heading{display:flex;flex-direction:column;min-width:0}.tx-panel__actions{display:flex;align-items:center}.tx-panel__actions:empty,.tx-panel__body:empty,.tx-panel__footer:empty,.tx-panel__collapse:has(.tx-panel__body:empty):has(.tx-panel__footer:empty){display:none}.tx-panel__collapse{display:grid;flex-grow:1;grid-template-rows:1fr}:host(.tx-panel--collapsed) .tx-panel__collapse{grid-template-rows:0fr}.tx-panel__collapse-inner{display:flex;flex-direction:column;min-height:0}.tx-panel__body{flex-grow:1}:host(.tx-panel--toggleable) .tx-panel__collapse-inner{overflow:hidden}:host(.tx-panel--collapsed) .tx-panel__collapse-inner{visibility:hidden}:host([data-styled]){--_gap: var(--tx-panel-gap);--_icon: var(--tx-panel-icon-size);--_title: var(--tx-panel-title-font-size);display:flex;flex-direction:column;gap:var(--_gap);padding:var(--tx-panel-padding);border-radius:var(--tx-panel-border-radius);background:var(--tx-panel-background);box-shadow:inset 0 0 0 1px var(--tx-panel-border-color),var(--tx-panel-shadow);color:var(--tx-panel-color);font-family:var(--tx-font-family);transition:gap var(--tx-panel-transition-duration)}:host([data-styled].tx-panel--collapsed){gap:0}:host([data-styled][data-variant=inset]){--_gap: var(--tx-panel-inset-gap);padding:var(--tx-panel-inset-padding);background:var(--tx-panel-inset-background);box-shadow:none}:host([data-styled][data-variant=plain]){--_gap: var(--tx-panel-plain-gap);--_icon: var(--tx-panel-plain-icon-size);--_title: var(--tx-panel-plain-title-font-size);padding:0;border-radius:0;background:transparent;box-shadow:none}:host([data-styled]) .tx-panel__header{gap:var(--tx-panel-header-gap)}:host([data-styled][data-align=start]) .tx-panel__header{align-items:flex-start}:host([data-styled][data-align=center]) .tx-panel__header{align-items:center}:host([data-styled][data-align=end]) .tx-panel__header{align-items:flex-end;gap:var(--tx-panel-header-end-gap)}:host([data-styled][data-align=end]) .tx-panel__header .tx-panel__lead{align-self:flex-start}:host([data-styled][data-align=end]) .tx-panel__header .tx-panel__actions{align-items:flex-end}:host([data-styled]) .tx-panel__lead{gap:var(--tx-panel-lead-gap)}:host([data-styled]) .tx-panel__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--_icon);height:var(--_icon);border-radius:var(--tx-panel-icon-border-radius);background:var(--tx-panel-icon-background);color:var(--tx-panel-icon-color);font-size:calc(var(--_icon) * var(--tx-panel-icon-scale))}:host([data-styled]) .tx-panel__heading{gap:var(--tx-panel-heading-gap)}:host([data-styled]) .tx-panel__title{font-size:var(--_title);font-weight:var(--tx-panel-title-font-weight);line-height:var(--tx-panel-title-line-height)}:host([data-styled]) .tx-panel__subtitle{margin:0;color:var(--tx-panel-subtitle-color);font-size:var(--tx-panel-subtitle-font-size);line-height:var(--tx-panel-subtitle-line-height)}:host([data-styled]) .tx-panel__actions{flex-wrap:wrap;gap:var(--tx-panel-actions-gap)}:host([data-styled]) .tx-panel__toggle{display:inline-flex;align-items:center;justify-content:center;width:var(--tx-panel-toggle-size);height:var(--tx-panel-toggle-size);padding:0;border:none;border-radius:var(--tx-radius-md);background:transparent;color:var(--tx-text-muted);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-panel__toggle tx-icon{transition:transform var(--tx-panel-transition-duration) cubic-bezier(.2,0,0,1)}:host([data-styled]) .tx-panel__toggle:hover{background:var(--tx-surface-hover);color:var(--tx-text-primary)}:host([data-styled]) .tx-panel__toggle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled].tx-panel--collapsed) .tx-panel__toggle tx-icon{transform:rotate(-90deg)}:host([data-styled]) .tx-panel__collapse{transition:grid-template-rows var(--tx-panel-transition-duration) cubic-bezier(.2,0,0,1)}:host([data-styled]) .tx-panel__footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--tx-panel-footer-gap);margin-top:var(--_gap)}:host([data-styled]) .tx-panel__body:empty+.tx-panel__footer{margin-top:0}:host([data-styled]) .tx-panel__footer:empty{display:none}:host([data-styled].tx-panel--collapsed) .tx-panel__collapse-inner{transition:visibility 0s linear var(--tx-panel-transition-duration)}@media(prefers-reduced-motion:reduce){:host([data-styled]),:host([data-styled]) .tx-panel__collapse,:host([data-styled]) .tx-panel__toggle,:host([data-styled].tx-panel--collapsed) .tx-panel__collapse-inner,:host([data-styled]) .tx-panel__toggle tx-icon{transition:none}}\n"]
|
|
213
215
|
}]
|
|
214
216
|
}],
|
|
215
217
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-panel.mjs","names":[],"sources":["../../../../packages/ui/panel/src/panel.icons.ts","../../../../packages/ui/panel/src/panel.theme.ts","../../../../packages/ui/panel/src/panel.component.ts","../../../../packages/ui/panel/src/panel.component.html"],"sourcesContent":["import { TxIconSet, txIconChevronDown, txIconHeading } from '@tectra-ng/icons';\n\nexport const PANEL_ICON_DEFAULTS: TxIconSet = {\n 'chevron-down': txIconChevronDown,\n heading: txIconHeading,\n};\n","import { panelTokens } from '@tectra-ng/themes';\n\nexport const PANEL_THEME = {\n panel: panelTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, model } from '@angular/core';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPanelTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPanelAlign, TxPanelPart, TxPanelVariant } from './panel.types';\nimport { PANEL_ICON_DEFAULTS } from './panel.icons';\nimport { PANEL_THEME } from './panel.theme';\n\n@Component({\n selector: 'tx-panel',\n imports: [TxIcon],\n templateUrl: './panel.component.html',\n styleUrl: './panel.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-panel',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.title]': 'null',\n '[attr.data-variant]': 'variant()',\n '[attr.data-align]': 'align()',\n '[class.tx-panel--collapsed]': 'toggleable() && collapsed()',\n '[attr.role]': 'title() ? \"region\" : null',\n '[attr.aria-labelledby]': 'title() ? titleId : null',\n },\n viewProviders: [provideTxIconDefaults(PANEL_ICON_DEFAULTS)],\n})\nexport class TxPanel {\n private readonly panelTheme = injectTokens(PANEL_THEME);\n\n private txIconRegistry = injectTxIcons();\n private id = uniqueId('tx-panel');\n\n readonly title = input<string | undefined>(undefined);\n readonly subtitle = input<string | undefined>(undefined);\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly variant = input<TxPanelVariant>('card');\n readonly align = input<TxPanelAlign>('start');\n readonly headingLevel = input<number>(2);\n readonly toggleable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly collapsed = model<boolean>(false);\n readonly toggleLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPanelTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPanelPart, TxPanel> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('panel', this, this.pt, this.ptOptions);\n readonly titleId = `${this.id}-title`;\n readonly bodyId = `${this.id}-body`;\n readonly isOpen = computed(() => !this.toggleable() || !this.collapsed());\n readonly iconName = computed(() => {\n const icon = this.icon();\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-panel'), ...this.passThrough().root?.style }));\n\n toggle(): void {\n this.collapsed.update((collapsed) => !collapsed);\n }\n}\n","<header class=\"tx-panel__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <div class=\"tx-panel__lead\">\n @if (icon(); as icon) {\n <span class=\"tx-panel__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <div class=\"tx-panel__heading\">\n @if (title()) {\n <div class=\"tx-panel__title\" role=\"heading\" [id]=\"titleId\" [attr.aria-level]=\"headingLevel()\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n {{ title() }}\n </div>\n }\n @if (subtitle()) {\n <p class=\"tx-panel__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n <ng-content select=\"[txPanelHeader]\" />\n </div>\n </div>\n <div class=\"tx-panel__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPanelActions]\" />\n @if (toggleable()) {\n <button\n type=\"button\"\n class=\"tx-panel__toggle\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"bodyId\"\n [attr.aria-label]=\"toggleLabel() ?? title() ?? null\"\n (click)=\"toggle()\"\n >\n <tx-icon [name]=\"'chevron-down'\" />\n </button>\n }\n </div>\n</header>\n<div class=\"tx-panel__collapse\" [id]=\"bodyId\" [attr.inert]=\"isOpen() ? null : ''\">\n <div class=\"tx-panel__collapse-inner\">\n <div class=\"tx-panel__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\"><ng-content /></div>\n <div class=\"tx-panel__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\"><ng-content select=\"[txPanelFooter]\" /></div>\n </div>\n</div>\n"],"mappings":";;;;;;;AAEA,MAAa,sBAAiC;CAC5C,gBAAgB;CAChB,SAAS;AACV;ACHD,MAAa,cAAc,EACzB,OAAO,YACR;
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-panel.mjs","names":[],"sources":["../../../../packages/ui/panel/src/panel.icons.ts","../../../../packages/ui/panel/src/panel.theme.ts","../../../../packages/ui/panel/src/panel.component.ts","../../../../packages/ui/panel/src/panel.component.html"],"sourcesContent":["import { TxIconSet, txIconChevronDown, txIconHeading } from '@tectra-ng/icons';\n\nexport const PANEL_ICON_DEFAULTS: TxIconSet = {\n 'chevron-down': txIconChevronDown,\n heading: txIconHeading,\n};\n","import { panelTokens } from '@tectra-ng/themes';\n\nexport const PANEL_THEME = {\n panel: panelTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, model } from '@angular/core';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPanelTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPanelAlign, TxPanelPart, TxPanelVariant } from './panel.types';\nimport { PANEL_ICON_DEFAULTS } from './panel.icons';\nimport { PANEL_THEME } from './panel.theme';\n\n@Component({\n selector: 'tx-panel',\n imports: [TxIcon],\n templateUrl: './panel.component.html',\n styleUrl: './panel.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-panel',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.title]': 'null',\n '[attr.data-variant]': 'variant()',\n '[attr.data-align]': 'align()',\n '[class.tx-panel--toggleable]': 'toggleable()',\n '[class.tx-panel--collapsed]': 'toggleable() && collapsed()',\n '[attr.role]': 'title() ? \"region\" : null',\n '[attr.aria-labelledby]': 'title() ? titleId : null',\n },\n viewProviders: [provideTxIconDefaults(PANEL_ICON_DEFAULTS)],\n})\nexport class TxPanel {\n private readonly panelTheme = injectTokens(PANEL_THEME);\n\n private txIconRegistry = injectTxIcons();\n private id = uniqueId('tx-panel');\n\n readonly title = input<string | undefined>(undefined);\n readonly subtitle = input<string | undefined>(undefined);\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly variant = input<TxPanelVariant>('card');\n readonly align = input<TxPanelAlign>('start');\n readonly headingLevel = input<number>(2);\n readonly toggleable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly collapsed = model<boolean>(false);\n readonly toggleLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPanelTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPanelPart, TxPanel> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('panel', this, this.pt, this.ptOptions);\n readonly titleId = `${this.id}-title`;\n readonly bodyId = `${this.id}-body`;\n readonly isOpen = computed(() => !this.toggleable() || !this.collapsed());\n readonly iconName = computed(() => {\n const icon = this.icon();\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-panel'), ...this.passThrough().root?.style }));\n\n toggle(): void {\n this.collapsed.update((collapsed) => !collapsed);\n }\n}\n","<header class=\"tx-panel__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <div class=\"tx-panel__lead\">\n @if (icon(); as icon) {\n <span class=\"tx-panel__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n </span>\n }\n <div class=\"tx-panel__heading\">\n @if (title()) {\n <div class=\"tx-panel__title\" role=\"heading\" [id]=\"titleId\" [attr.aria-level]=\"headingLevel()\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n {{ title() }}\n </div>\n }\n @if (subtitle()) {\n <p class=\"tx-panel__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n <ng-content select=\"[txPanelHeader]\" />\n </div>\n </div>\n <div class=\"tx-panel__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPanelActions]\" />\n @if (toggleable()) {\n <button\n type=\"button\"\n class=\"tx-panel__toggle\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n [attr.aria-expanded]=\"!collapsed()\"\n [attr.aria-controls]=\"bodyId\"\n [attr.aria-label]=\"toggleLabel() ?? title() ?? null\"\n (click)=\"toggle()\"\n >\n <tx-icon [name]=\"'chevron-down'\" />\n </button>\n }\n </div>\n</header>\n<div class=\"tx-panel__collapse\" [id]=\"bodyId\" [attr.inert]=\"isOpen() ? null : ''\">\n <div class=\"tx-panel__collapse-inner\">\n <div class=\"tx-panel__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\"><ng-content /></div>\n <div class=\"tx-panel__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\"><ng-content select=\"[txPanelFooter]\" /></div>\n </div>\n</div>\n"],"mappings":";;;;;;;AAEA,MAAa,sBAAiC;CAC5C,gBAAgB;CAChB,SAAS;AACV;ACHD,MAAa,cAAc,EACzB,OAAO,YACR;AC2BD,IAAa,UAAb,MAAa,QAAO;CACD,aAAa,aAAa,WAAW;CAE9C,iBAAiB,cAAa;CAC9B,KAAK,SAAS,UAAU;CAEvB,QAAQ,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,WAAW,MAA0B,QAAU,GAAA,YAAA,CAAA,E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ChB,uBAAuB;IACvB,qBAAqB;IACrB,gCAAgC;IAChC,+BAA+B;IAC/B,eAAe;IACf,0BAA0B;GAC3B;GAAA,eACc,CAAC,sBAAsB,mBAAmB,CAAC;GAAC,UAAA;GAAA,QAAA,CAAA,qtJAAA;EAAA,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { DOCUMENT, Directive, Injectable, booleanAttribute, inject, input, output } from "@angular/core";
|
|
2
|
+
import { DOCUMENT, Directive, ElementRef, Injectable, Renderer2, booleanAttribute, effect, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
3
4
|
import { optionalNumber } from "@tectra-ng/core/utils";
|
|
4
5
|
import { TxPassword } from "@tectra-ng/ui/password";
|
|
5
6
|
const LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
|
|
@@ -68,8 +69,20 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
68
69
|
args: [{ providedIn: "root" }]
|
|
69
70
|
}]
|
|
70
71
|
});
|
|
72
|
+
const NAME_ATTRIBUTES = [
|
|
73
|
+
"aria-label",
|
|
74
|
+
"aria-labelledby",
|
|
75
|
+
"title"
|
|
76
|
+
];
|
|
71
77
|
var TxPasswordGenerate = class TxPasswordGenerate {
|
|
72
78
|
generator = inject(TxPasswordGenerator);
|
|
79
|
+
element = inject(ElementRef).nativeElement;
|
|
80
|
+
renderer = inject(Renderer2);
|
|
81
|
+
translations = injectTranslations();
|
|
82
|
+
needsName = signal(false, ...ngDevMode ? [{ debugName: "needsName" }] : /* istanbul ignore next */ []);
|
|
83
|
+
defaultName = effect(() => {
|
|
84
|
+
if (this.needsName()) this.renderer.setAttribute(this.element, "aria-label", this.translations().generatePassword);
|
|
85
|
+
}, ...ngDevMode ? [{ debugName: "defaultName" }] : /* istanbul ignore next */ []);
|
|
73
86
|
target = input(void 0, {
|
|
74
87
|
...ngDevMode ? { debugName: "target" } : /* istanbul ignore next */ {},
|
|
75
88
|
alias: "txPasswordGenerate"
|
|
@@ -103,6 +116,10 @@ var TxPasswordGenerate = class TxPasswordGenerate {
|
|
|
103
116
|
transform: booleanAttribute
|
|
104
117
|
});
|
|
105
118
|
generated = output();
|
|
119
|
+
ngAfterViewInit() {
|
|
120
|
+
const element = this.element;
|
|
121
|
+
this.needsName.set(!element.textContent?.trim() && !NAME_ATTRIBUTES.some((name) => element.hasAttribute(name)));
|
|
122
|
+
}
|
|
106
123
|
generate() {
|
|
107
124
|
const password = this.generator.generate({
|
|
108
125
|
length: this.length(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-password-generator.mjs","names":[],"sources":["../../../../packages/ui/password-generator/src/password-generator.service.ts","../../../../packages/ui/password-generator/src/password-generate.directive.ts"],"sourcesContent":["import { DOCUMENT, Injectable, inject } from '@angular/core';\nimport { TxPasswordGeneratorOptions } from './password-generator.types';\n\nconst LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst DIGITS = '0123456789';\nconst SYMBOLS = '!@#$%^&*()-_=+[]{};:,.?/~';\nconst SIMILAR = /[0O1lI|]/g;\n\n/**\n * Makes strong random passwords from `crypto.getRandomValues`, with at least one character of every\n * enabled set.\n */\n@Injectable({ providedIn: 'root' })\nexport class TxPasswordGenerator {\n private crypto = inject(DOCUMENT).defaultView?.crypto ?? globalThis.crypto;\n\n /** Makes a password; throws when every character set is turned off. */\n generate(options: TxPasswordGeneratorOptions = {}): string {\n const sets = this.sets(options);\n if (!sets.length) {\n throw new Error('TxPasswordGenerator: enable at least one character set');\n }\n const length = Math.max(options.length ?? 16, sets.length);\n const all = sets.join('');\n const chars = sets.map((set) => set[this.randomIndex(set.length)]);\n while (chars.length < length) {\n chars.push(all[this.randomIndex(all.length)]);\n }\n for (let index = chars.length - 1; index > 0; index -= 1) {\n const swap = this.randomIndex(index + 1);\n [chars[index], chars[swap]] = [chars[swap], chars[index]];\n }\n return chars.join('');\n }\n\n /** Makes a password of the given length (default 16) with all character sets. */\n generatePassword(length = 16): string {\n return this.generate({ length });\n }\n\n private sets(options: TxPasswordGeneratorOptions): string[] {\n const clean = (set: string) => (options.excludeSimilar ? set.replace(SIMILAR, '') : set);\n return [\n options.lowercase !== false ? clean(LOWERCASE) : '',\n options.uppercase !== false ? clean(UPPERCASE) : '',\n options.digits !== false ? clean(DIGITS) : '',\n options.symbols !== false ? clean(options.symbolSet ?? SYMBOLS) : '',\n ].filter(Boolean);\n }\n\n private randomIndex(size: number): number {\n const limit = Math.floor(0x100000000 / size) * size;\n const buffer = new Uint32Array(1);\n do {\n this.crypto.getRandomValues(buffer);\n } while (buffer[0] >= limit);\n return buffer[0] % size;\n }\n}\n","import { Directive, booleanAttribute, inject, input, output } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\nimport { optionalNumber } from '@tectra-ng/core/utils';\nimport { TxPassword } from '@tectra-ng/ui/password';\nimport { TxPasswordGenerator } from './password-generator.service';\n\n@Directive({\n selector: 'button[txPasswordGenerate]',\n host: {\n type: 'button',\n '(click)': 'generate()',\n },\n})\nexport class TxPasswordGenerate {\n private generator = inject(TxPasswordGenerator);\n\n readonly target = input<TxPassword | AbstractControl | null | undefined>(undefined, { alias: 'txPasswordGenerate' });\n readonly length = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly lowercase = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly uppercase = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly digits = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly symbols = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly excludeSimilar = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly reveal = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n readonly generated = output<string>();\n\n generate(): string {\n const password = this.generator.generate({\n length: this.length(),\n lowercase: this.lowercase(),\n uppercase: this.uppercase(),\n digits: this.digits(),\n symbols: this.symbols(),\n excludeSimilar: this.excludeSimilar(),\n });\n const target = this.target();\n if (target instanceof TxPassword) {\n target.fill(password, this.reveal());\n } else if (target) {\n target.setValue(password);\n target.markAsDirty();\n }\n this.generated.emit(password);\n return password;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-password-generator.mjs","names":[],"sources":["../../../../packages/ui/password-generator/src/password-generator.service.ts","../../../../packages/ui/password-generator/src/password-generate.directive.ts"],"sourcesContent":["import { DOCUMENT, Injectable, inject } from '@angular/core';\nimport { TxPasswordGeneratorOptions } from './password-generator.types';\n\nconst LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst DIGITS = '0123456789';\nconst SYMBOLS = '!@#$%^&*()-_=+[]{};:,.?/~';\nconst SIMILAR = /[0O1lI|]/g;\n\n/**\n * Makes strong random passwords from `crypto.getRandomValues`, with at least one character of every\n * enabled set.\n */\n@Injectable({ providedIn: 'root' })\nexport class TxPasswordGenerator {\n private crypto = inject(DOCUMENT).defaultView?.crypto ?? globalThis.crypto;\n\n /** Makes a password; throws when every character set is turned off. */\n generate(options: TxPasswordGeneratorOptions = {}): string {\n const sets = this.sets(options);\n if (!sets.length) {\n throw new Error('TxPasswordGenerator: enable at least one character set');\n }\n const length = Math.max(options.length ?? 16, sets.length);\n const all = sets.join('');\n const chars = sets.map((set) => set[this.randomIndex(set.length)]);\n while (chars.length < length) {\n chars.push(all[this.randomIndex(all.length)]);\n }\n for (let index = chars.length - 1; index > 0; index -= 1) {\n const swap = this.randomIndex(index + 1);\n [chars[index], chars[swap]] = [chars[swap], chars[index]];\n }\n return chars.join('');\n }\n\n /** Makes a password of the given length (default 16) with all character sets. */\n generatePassword(length = 16): string {\n return this.generate({ length });\n }\n\n private sets(options: TxPasswordGeneratorOptions): string[] {\n const clean = (set: string) => (options.excludeSimilar ? set.replace(SIMILAR, '') : set);\n return [\n options.lowercase !== false ? clean(LOWERCASE) : '',\n options.uppercase !== false ? clean(UPPERCASE) : '',\n options.digits !== false ? clean(DIGITS) : '',\n options.symbols !== false ? clean(options.symbolSet ?? SYMBOLS) : '',\n ].filter(Boolean);\n }\n\n private randomIndex(size: number): number {\n const limit = Math.floor(0x100000000 / size) * size;\n const buffer = new Uint32Array(1);\n do {\n this.crypto.getRandomValues(buffer);\n } while (buffer[0] >= limit);\n return buffer[0] % size;\n }\n}\n","import { AfterViewInit, Directive, ElementRef, Renderer2, booleanAttribute, effect, inject, input, output, signal } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalNumber } from '@tectra-ng/core/utils';\nimport { TxPassword } from '@tectra-ng/ui/password';\nimport { TxPasswordGenerator } from './password-generator.service';\n\nconst NAME_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'title'];\n\n/**\n * Generates a password on click and puts it into a `tx-password` or a form control. Works on any `button`, also\n * `txButton`; an icon-only button without its own name gets the translated \"Generate password\" as its accessible name.\n */\n@Directive({\n selector: 'button[txPasswordGenerate]',\n host: {\n type: 'button',\n '(click)': 'generate()',\n },\n})\nexport class TxPasswordGenerate implements AfterViewInit {\n private generator = inject(TxPasswordGenerator);\n private element = inject<ElementRef<HTMLButtonElement>>(ElementRef).nativeElement;\n private renderer = inject(Renderer2);\n private translations = injectTranslations();\n private readonly needsName = signal(false);\n private readonly defaultName = effect(() => {\n if (this.needsName()) {\n this.renderer.setAttribute(this.element, 'aria-label', this.translations().generatePassword);\n }\n });\n\n readonly target = input<TxPassword | AbstractControl | null | undefined>(undefined, { alias: 'txPasswordGenerate' });\n readonly length = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly lowercase = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly uppercase = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly digits = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly symbols = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly excludeSimilar = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly reveal = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n readonly generated = output<string>();\n\n ngAfterViewInit(): void {\n const element = this.element;\n this.needsName.set(!element.textContent?.trim() && !NAME_ATTRIBUTES.some((name) => element.hasAttribute(name)));\n }\n\n generate(): string {\n const password = this.generator.generate({\n length: this.length(),\n lowercase: this.lowercase(),\n uppercase: this.uppercase(),\n digits: this.digits(),\n symbols: this.symbols(),\n excludeSimilar: this.excludeSimilar(),\n });\n const target = this.target();\n if (target instanceof TxPassword) {\n target.fill(password, this.reveal());\n } else if (target) {\n target.setValue(password);\n target.markAsDirty();\n }\n this.generated.emit(password);\n return password;\n }\n}\n"],"mappings":";;;;;AAGA,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,UAAU;AAOhB,IAAa,sBAAb,MAAa,oBAAmB;CACtB,SAAS,OAAO,QAAQ,CAAC,CAAC,aAAa,UAAU,WAAW;CAGpE,SAAS,UAAsC,CAAA,GAAE;EAC/C,MAAM,OAAO,KAAK,KAAK,OAAO;EAC9B,IAAI,CAAC,KAAK,QACR,MAAM,IAAI,MAAM,wDAAwD;EAE1E,MAAM,SAAS,KAAK,IAAI,QAAQ,UAAU,IAAI,KAAK,MAAM;EACzD,MAAM,MAAM,KAAK,KAAK,EAAE;EACxB,MAAM,QAAQ,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,IAAI,MAAM,EAAE;EACjE,OAAO,MAAM,SAAS,QACpB,MAAM,KAAK,IAAI,KAAK,YAAY,IAAI,MAAM,EAAE;EAE9C,KAAK,IAAI,QAAQ,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG;GACxD,MAAM,OAAO,KAAK,YAAY,QAAQ,CAAC;GACvC,CAAC,MAAM,QAAQ,MAAM,SAAS,CAAC,MAAM,OAAO,MAAM,MAAM;EAC1D;EACA,O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AAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,WAAA,YAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,SAAA;GAAA,WAAA,EAAA,SAAA,aAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAlB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EAP9B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,MAAM;IACN,WAAW;GACZ;EACF,CAAA"}
|
|
@@ -558,7 +558,7 @@ var TxPassword = class TxPassword extends TxFormControlBase {
|
|
|
558
558
|
usesInheritance: true,
|
|
559
559
|
ngImport: i0,
|
|
560
560
|
template: "<input\n #input\n txInput\n class=\"tx-password__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [type]=\"isMasked() ? 'password' : 'text'\"\n [value]=\"text()\"\n [id]=\"resolvedId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.maxlength]=\"maxlength() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.tabindex]=\"tabindex() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"feedback() && isFocused() ? infoId : null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n/>\n<span class=\"tx-password__actions\">\n @if (showClear() && hasValue() && isEditable()) {\n <button\n type=\"button\"\n class=\"tx-password__action tx-password__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n [title]=\"translations().clear\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n @if (toggleMask()) {\n <button\n type=\"button\"\n class=\"tx-password__action tx-password__toggle\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n [attr.aria-label]=\"translations().showPassword\"\n [attr.aria-pressed]=\"!isMasked()\"\n [attr.aria-controls]=\"resolvedId()\"\n [title]=\"isMasked() ? translations().showPassword : translations().hidePassword\"\n [disabled]=\"isDisabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggleVisibility()\"\n >\n <tx-icon [name]=\"isMasked() ? 'eye' : 'eye-slash'\" />\n </button>\n }\n</span>\n\n<ng-template #panel>\n <div class=\"tx-password__panel\" [attr.data-styled]=\"!isUnstyled() || null\" [style]=\"hostStyle()\" [class]=\"passThrough().panel?.class\">\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"templateContext()\" />\n }\n <div class=\"tx-password__meter\" [attr.data-strength]=\"strength()\" [class]=\"passThrough().meter?.class\" [style]=\"passThrough().meter?.style\">\n <span class=\"tx-password__meter-bar\"></span>\n </div>\n <div class=\"tx-password__info\" aria-live=\"polite\" [id]=\"infoId\" [class]=\"passThrough().info?.class\" [style]=\"passThrough().info?.style\">\n {{ info() }}\n </div>\n @if (contentTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"templateContext()\" />\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"templateContext()\" />\n }\n </div>\n</ng-template>\n",
|
|
561
|
-
styles: [":host{position:relative;display:inline-flex;vertical-align:top}:host(.tx-password--fluid){display:flex;width:100%}.tx-password__input{flex:1 1 auto;min-width:0;--tx-field-inset-end: calc(var(--tx-password-actions) * (
|
|
561
|
+
styles: [":host{position:relative;display:inline-flex;vertical-align:top}:host(.tx-password--fluid){display:flex;width:100%}.tx-password__input{flex:1 1 auto;min-width:0;--tx-field-inset-end: calc(var(--tx-password-actions) * (var(--tx-form-field-action-size) + var(--tx-password-action-gap)))}.tx-password__input::-ms-reveal{display:none}.tx-password__actions{position:absolute;top:50%;right:var(--tx-password-action-inset);display:flex;gap:var(--tx-password-action-gap);transform:translateY(-50%)}.tx-password__action{display:grid;place-items:center;width:var(--tx-form-field-action-size);height:var(--tx-form-field-action-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}.tx-password__action:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}.tx-password__action:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}.tx-password__action:disabled{cursor:not-allowed;opacity:.6}.tx-password__panel{width:100%}.tx-password__panel[data-styled]{display:grid;gap:var(--tx-password-panel-gap);box-sizing:border-box;padding:var(--tx-password-panel-padding);border:1px solid var(--tx-password-panel-border-color);border-radius:var(--tx-password-panel-border-radius);background:var(--tx-password-panel-background);box-shadow:var(--tx-password-panel-shadow);color:var(--tx-password-panel-color);font-family:var(--tx-font-family);font-size:var(--tx-password-panel-font-size)}.tx-password__panel[data-styled] .tx-password__meter{height:var(--tx-password-meter-height);overflow:hidden;border-radius:var(--tx-password-meter-border-radius);background:var(--tx-password-meter-background)}.tx-password__panel[data-styled] .tx-password__meter-bar{display:block;width:0;height:100%;border-radius:inherit;transition:width var(--tx-password-meter-transition-duration) cubic-bezier(.2,0,0,1),background-color var(--tx-password-meter-transition-duration)}.tx-password__panel[data-styled] .tx-password__meter[data-strength=weak] .tx-password__meter-bar{width:33.33%;background:var(--tx-password-meter-weak-background)}.tx-password__panel[data-styled] .tx-password__meter[data-strength=medium] .tx-password__meter-bar{width:66.66%;background:var(--tx-password-meter-medium-background)}.tx-password__panel[data-styled] .tx-password__meter[data-strength=strong] .tx-password__meter-bar{width:100%;background:var(--tx-password-meter-strong-background)}@media(prefers-reduced-motion:reduce){.tx-password__panel[data-styled] .tx-password__meter-bar{transition:none}}\n"],
|
|
562
562
|
dependencies: [
|
|
563
563
|
{
|
|
564
564
|
kind: "directive",
|
|
@@ -628,7 +628,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
628
628
|
},
|
|
629
629
|
viewProviders: [provideTxIconDefaults(PASSWORD_ICON_DEFAULTS)],
|
|
630
630
|
template: "<input\n #input\n txInput\n class=\"tx-password__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [type]=\"isMasked() ? 'password' : 'text'\"\n [value]=\"text()\"\n [id]=\"resolvedId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.maxlength]=\"maxlength() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.tabindex]=\"tabindex() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"feedback() && isFocused() ? infoId : null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n/>\n<span class=\"tx-password__actions\">\n @if (showClear() && hasValue() && isEditable()) {\n <button\n type=\"button\"\n class=\"tx-password__action tx-password__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n [title]=\"translations().clear\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clear()\"\n >\n <tx-icon [name]=\"'times'\" />\n </button>\n }\n @if (toggleMask()) {\n <button\n type=\"button\"\n class=\"tx-password__action tx-password__toggle\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n [attr.aria-label]=\"translations().showPassword\"\n [attr.aria-pressed]=\"!isMasked()\"\n [attr.aria-controls]=\"resolvedId()\"\n [title]=\"isMasked() ? translations().showPassword : translations().hidePassword\"\n [disabled]=\"isDisabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggleVisibility()\"\n >\n <tx-icon [name]=\"isMasked() ? 'eye' : 'eye-slash'\" />\n </button>\n }\n</span>\n\n<ng-template #panel>\n <div class=\"tx-password__panel\" [attr.data-styled]=\"!isUnstyled() || null\" [style]=\"hostStyle()\" [class]=\"passThrough().panel?.class\">\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"templateContext()\" />\n }\n <div class=\"tx-password__meter\" [attr.data-strength]=\"strength()\" [class]=\"passThrough().meter?.class\" [style]=\"passThrough().meter?.style\">\n <span class=\"tx-password__meter-bar\"></span>\n </div>\n <div class=\"tx-password__info\" aria-live=\"polite\" [id]=\"infoId\" [class]=\"passThrough().info?.class\" [style]=\"passThrough().info?.style\">\n {{ info() }}\n </div>\n @if (contentTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"templateContext()\" />\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"templateContext()\" />\n }\n </div>\n</ng-template>\n",
|
|
631
|
-
styles: [":host{position:relative;display:inline-flex;vertical-align:top}:host(.tx-password--fluid){display:flex;width:100%}.tx-password__input{flex:1 1 auto;min-width:0;--tx-field-inset-end: calc(var(--tx-password-actions) * (
|
|
631
|
+
styles: [":host{position:relative;display:inline-flex;vertical-align:top}:host(.tx-password--fluid){display:flex;width:100%}.tx-password__input{flex:1 1 auto;min-width:0;--tx-field-inset-end: calc(var(--tx-password-actions) * (var(--tx-form-field-action-size) + var(--tx-password-action-gap)))}.tx-password__input::-ms-reveal{display:none}.tx-password__actions{position:absolute;top:50%;right:var(--tx-password-action-inset);display:flex;gap:var(--tx-password-action-gap);transform:translateY(-50%)}.tx-password__action{display:grid;place-items:center;width:var(--tx-form-field-action-size);height:var(--tx-form-field-action-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}.tx-password__action:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}.tx-password__action:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}.tx-password__action:disabled{cursor:not-allowed;opacity:.6}.tx-password__panel{width:100%}.tx-password__panel[data-styled]{display:grid;gap:var(--tx-password-panel-gap);box-sizing:border-box;padding:var(--tx-password-panel-padding);border:1px solid var(--tx-password-panel-border-color);border-radius:var(--tx-password-panel-border-radius);background:var(--tx-password-panel-background);box-shadow:var(--tx-password-panel-shadow);color:var(--tx-password-panel-color);font-family:var(--tx-font-family);font-size:var(--tx-password-panel-font-size)}.tx-password__panel[data-styled] .tx-password__meter{height:var(--tx-password-meter-height);overflow:hidden;border-radius:var(--tx-password-meter-border-radius);background:var(--tx-password-meter-background)}.tx-password__panel[data-styled] .tx-password__meter-bar{display:block;width:0;height:100%;border-radius:inherit;transition:width var(--tx-password-meter-transition-duration) cubic-bezier(.2,0,0,1),background-color var(--tx-password-meter-transition-duration)}.tx-password__panel[data-styled] .tx-password__meter[data-strength=weak] .tx-password__meter-bar{width:33.33%;background:var(--tx-password-meter-weak-background)}.tx-password__panel[data-styled] .tx-password__meter[data-strength=medium] .tx-password__meter-bar{width:66.66%;background:var(--tx-password-meter-medium-background)}.tx-password__panel[data-styled] .tx-password__meter[data-strength=strong] .tx-password__meter-bar{width:100%;background:var(--tx-password-meter-strong-background)}@media(prefers-reduced-motion:reduce){.tx-password__panel[data-styled] .tx-password__meter-bar{transition:none}}\n"]
|
|
632
632
|
}]
|
|
633
633
|
}],
|
|
634
634
|
ctorParameters: () => [],
|