@tectra-ng/blocks 0.2.6 → 0.3.0
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/fesm2022/tectra-ng-blocks-action-tile.mjs +12 -3
- package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-actions-menu.mjs +11 -3
- package/fesm2022/tectra-ng-blocks-actions-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-app-footer.mjs +11 -2
- package/fesm2022/tectra-ng-blocks-app-footer.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-app-layout.mjs +16 -3
- package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-command-palette.mjs +15 -3
- package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-confetti.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-confetti.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-console-layout.mjs +17 -3
- package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +12 -3
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-empty-state.mjs +12 -3
- package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs +27 -6
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-hover-effect.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-hover-effect.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-kanban.mjs +12 -3
- package/fesm2022/tectra-ng-blocks-kanban.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-mascot.mjs +8 -2
- package/fesm2022/tectra-ng-blocks-mascot.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-network-status.mjs +12 -3
- package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-page-header.mjs +11 -2
- package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +17 -3
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-public-header.mjs +11 -3
- package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-qr-code.mjs +8 -2
- package/fesm2022/tectra-ng-blocks-qr-code.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-switch-language.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-switch-language.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-switch-theme.mjs +18 -4
- package/fesm2022/tectra-ng-blocks-switch-theme.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs +8 -2
- package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-wizard.mjs +24 -3
- package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -1
- package/package.json +6 -6
- package/types/tectra-ng-blocks-action-tile.d.ts +1 -0
- package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -1
- package/types/tectra-ng-blocks-actions-menu.d.ts +1 -0
- package/types/tectra-ng-blocks-actions-menu.d.ts.map +1 -1
- package/types/tectra-ng-blocks-app-footer.d.ts +1 -0
- package/types/tectra-ng-blocks-app-footer.d.ts.map +1 -1
- package/types/tectra-ng-blocks-app-layout.d.ts +1 -0
- package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -1
- package/types/tectra-ng-blocks-command-palette.d.ts +1 -0
- package/types/tectra-ng-blocks-command-palette.d.ts.map +1 -1
- package/types/tectra-ng-blocks-confetti.d.ts +1 -0
- package/types/tectra-ng-blocks-confetti.d.ts.map +1 -1
- package/types/tectra-ng-blocks-console-layout.d.ts +4 -1
- package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -1
- package/types/tectra-ng-blocks-cookie-notice.d.ts +1 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -1
- package/types/tectra-ng-blocks-empty-state.d.ts +1 -0
- package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -1
- package/types/tectra-ng-blocks-filters-panel.d.ts +3 -0
- package/types/tectra-ng-blocks-filters-panel.d.ts.map +1 -1
- package/types/tectra-ng-blocks-hover-effect.d.ts +1 -0
- package/types/tectra-ng-blocks-hover-effect.d.ts.map +1 -1
- package/types/tectra-ng-blocks-kanban.d.ts +1 -0
- package/types/tectra-ng-blocks-kanban.d.ts.map +1 -1
- package/types/tectra-ng-blocks-mascot.d.ts +1 -0
- package/types/tectra-ng-blocks-mascot.d.ts.map +1 -1
- package/types/tectra-ng-blocks-network-status.d.ts +1 -0
- package/types/tectra-ng-blocks-network-status.d.ts.map +1 -1
- package/types/tectra-ng-blocks-page-header.d.ts +1 -0
- package/types/tectra-ng-blocks-page-header.d.ts.map +1 -1
- package/types/tectra-ng-blocks-pinned-tabs.d.ts +3 -1
- package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -1
- package/types/tectra-ng-blocks-public-header.d.ts +1 -0
- package/types/tectra-ng-blocks-public-header.d.ts.map +1 -1
- package/types/tectra-ng-blocks-qr-code.d.ts +1 -0
- package/types/tectra-ng-blocks-qr-code.d.ts.map +1 -1
- package/types/tectra-ng-blocks-switch-language.d.ts +1 -0
- package/types/tectra-ng-blocks-switch-language.d.ts.map +1 -1
- package/types/tectra-ng-blocks-switch-theme.d.ts +2 -0
- package/types/tectra-ng-blocks-switch-theme.d.ts.map +1 -1
- package/types/tectra-ng-blocks-topbar-preferences.d.ts +1 -0
- package/types/tectra-ng-blocks-topbar-preferences.d.ts.map +1 -1
- package/types/tectra-ng-blocks-wizard.d.ts +5 -0
- package/types/tectra-ng-blocks-wizard.d.ts.map +1 -1
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, output } from "@angular/core";
|
|
3
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
3
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
4
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
5
|
-
import { TxIcon } from "@tectra-ng/icons";
|
|
6
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
5
|
+
import { TxIcon, provideTxIconDefaults, txIconAngleRight, txIconSpinner, txIconText } from "@tectra-ng/icons";
|
|
6
|
+
import { actionTileTokens, toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
const ACTION_TILE_ICON_DEFAULTS = {
|
|
8
|
+
"angle-right": txIconAngleRight,
|
|
9
|
+
spinner: txIconSpinner,
|
|
10
|
+
text: txIconText
|
|
11
|
+
};
|
|
12
|
+
const ACTION_TILE_THEME = { actionTile: actionTileTokens };
|
|
7
13
|
var TxActionTile = class TxActionTile {
|
|
14
|
+
actionTileTheme = injectTokens(ACTION_TILE_THEME);
|
|
8
15
|
icon = input(void 0, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
9
16
|
title = input.required(...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
10
17
|
text = input(void 0, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
@@ -159,6 +166,7 @@ var TxActionTile = class TxActionTile {
|
|
|
159
166
|
selector: "tx-icon",
|
|
160
167
|
inputs: ["name"]
|
|
161
168
|
}],
|
|
169
|
+
viewProviders: [provideTxIconDefaults(ACTION_TILE_ICON_DEFAULTS)],
|
|
162
170
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
163
171
|
});
|
|
164
172
|
};
|
|
@@ -207,6 +215,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
207
215
|
"[class.tx-action-tile--loading]": "loading()",
|
|
208
216
|
"[class.tx-action-tile--disabled]": "disabled()"
|
|
209
217
|
},
|
|
218
|
+
viewProviders: [provideTxIconDefaults(ACTION_TILE_ICON_DEFAULTS)],
|
|
210
219
|
styles: [":host{display:block}.tx-action-tile__button{display:flex;align-items:center;box-sizing:border-box;width:100%;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.tx-action-tile__button:disabled{cursor:default}.tx-action-tile__icon,.tx-action-tile__end{display:flex;flex-shrink:0;align-items:center;justify-content:center}.tx-action-tile__body{display:flex;flex:1;flex-direction:column;min-width:0}.tx-action-tile__text{overflow-wrap:break-word}.tx-action-tile__spinner{animation:tx-action-tile-spin 1s linear infinite}@keyframes tx-action-tile-spin{to{transform:rotate(360deg)}}:host([data-styled]) .tx-action-tile__button{gap:var(--tx-action-tile-gap);padding:var(--tx-action-tile-padding);border-radius:var(--tx-action-tile-border-radius);background:var(--tx-action-tile-background);box-shadow:0 0 0 1px var(--tx-action-tile-border-color);font-family:var(--tx-font-family);transition:box-shadow var(--tx-action-tile-transition-duration),background-color var(--tx-action-tile-transition-duration)}:host([data-styled]) .tx-action-tile__button:not(:disabled):hover{background:var(--tx-action-tile-hover-background);box-shadow:0 0 0 1px var(--tx-action-tile-hover-border-color)}:host([data-styled]) .tx-action-tile__button:focus-visible{outline:none;box-shadow:0 0 0 1px var(--tx-action-tile-border-color),var(--tx-action-tile-focus-ring-shadow)}:host([data-styled]) .tx-action-tile__button:disabled{opacity:var(--tx-action-tile-disabled-opacity)}:host([data-styled]) .tx-action-tile__icon{width:var(--tx-action-tile-icon-size);height:var(--tx-action-tile-icon-size);border-radius:var(--tx-action-tile-icon-border-radius);background:var(--tx-action-tile-icon-background);color:var(--tx-action-tile-icon-color);font-size:var(--tx-action-tile-icon-font-size)}:host([data-styled]) .tx-action-tile__body{gap:var(--tx-action-tile-body-gap)}:host([data-styled]) .tx-action-tile__title{color:var(--tx-action-tile-title-color);font-size:var(--tx-action-tile-title-font-size);font-weight:var(--tx-action-tile-title-font-weight);line-height:var(--tx-action-tile-title-line-height)}:host([data-styled]) .tx-action-tile__text{color:var(--tx-action-tile-text-color);font-size:var(--tx-action-tile-text-font-size);line-height:var(--tx-action-tile-text-line-height)}:host([data-styled]) .tx-action-tile__end{color:var(--tx-action-tile-end-color);font-size:var(--tx-action-tile-end-font-size);transition:transform var(--tx-action-tile-transition-duration),color var(--tx-action-tile-transition-duration)}:host([data-styled]) .tx-action-tile__button:not(:disabled):hover .tx-action-tile__end{color:var(--tx-action-tile-end-hover-color);transform:translate(var(--tx-action-tile-end-hover-shift))}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-action-tile__button,:host([data-styled]) .tx-action-tile__end{transition:none}.tx-action-tile__spinner{animation-duration:2s}}\n"]
|
|
211
220
|
}]
|
|
212
221
|
}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-action-tile.mjs","names":[],"sources":["../../../../packages/blocks/action-tile/src/action-tile.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, output } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-action-tile.mjs","names":[],"sources":["../../../../packages/blocks/action-tile/src/action-tile.icons.ts","../../../../packages/blocks/action-tile/src/action-tile.theme.ts","../../../../packages/blocks/action-tile/src/action-tile.component.ts"],"sourcesContent":["import { TxIconSet, txIconAngleRight, txIconSpinner, txIconText } from '@tectra-ng/icons';\n\nexport const ACTION_TILE_ICON_DEFAULTS: TxIconSet = {\n 'angle-right': txIconAngleRight,\n spinner: txIconSpinner,\n text: txIconText,\n};\n","import { actionTileTokens } from '@tectra-ng/themes';\n\nexport const ACTION_TILE_THEME = {\n actionTile: actionTileTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, output } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraActionTileTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxActionTilePart } from './action-tile.types';\nimport { ACTION_TILE_ICON_DEFAULTS } from './action-tile.icons';\nimport { ACTION_TILE_THEME } from './action-tile.theme';\n\n@Component({\n selector: 'tx-action-tile',\n imports: [TxIcon],\n template: `\n <button\n type=\"button\"\n class=\"tx-action-tile__button\"\n [disabled]=\"disabled() || loading()\"\n [attr.aria-busy]=\"loading() || null\"\n [class]=\"passThrough().button?.class\"\n [style]=\"passThrough().button?.style\"\n (click)=\"onClick()\"\n >\n @if (icon(); as icon) {\n <span class=\"tx-action-tile__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"icon\" />\n </span>\n }\n <span class=\"tx-action-tile__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\">\n <span class=\"tx-action-tile__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">{{ title() }}</span>\n @if (text()) {\n <span class=\"tx-action-tile__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() }}</span>\n }\n </span>\n <span class=\"tx-action-tile__end\" aria-hidden=\"true\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n <tx-icon [class.tx-action-tile__spinner]=\"loading()\" [name]=\"loading() ? 'spinner' : 'angle-right'\" />\n </span>\n </button>\n `,\n styleUrl: './action-tile.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-action-tile',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-action-tile--loading]': 'loading()',\n '[class.tx-action-tile--disabled]': 'disabled()',\n },\n viewProviders: [provideTxIconDefaults(ACTION_TILE_ICON_DEFAULTS)],\n})\nexport class TxActionTile {\n private readonly actionTileTheme = injectTokens(ACTION_TILE_THEME);\n\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly title = input.required<string>();\n readonly text = input<string | undefined>(undefined);\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly disabled = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraActionTileTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxActionTilePart, TxActionTile> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly tileClick = output<void>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('actionTile', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-action-tile'), ...this.passThrough().root?.style }));\n\n protected onClick(): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n this.tileClick.emit();\n }\n}\n"],"mappings":";;;;;;AAEA,MAAa,4BAAuC;CAClD,eAAe;CACf,SAAS;CACT,MAAM;AACP;ACJD,MAAa,oBAAoB,EAC/B,YAAY,iBACb;AC8CD,IAAa,eAAb,MAAa,aAAY;CACN,kBAAkB,aAAa,iBAAiB;CAExD,OAAO,MAA8C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/D,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,OAAO,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC3C,UAAU,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;C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AO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,mCAAmC;IACnC,oCAAoC;GACrC;GAAA,eACc,CAAC,sBAAsB,yBAAyB,CAAC;GAAC,QAAA,CAAA,o2FAAA;EAAA,CAAA"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input, output, viewChild } from "@angular/core";
|
|
3
3
|
import { nextListIndex } from "@tectra-ng/core/a11y";
|
|
4
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
5
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
6
6
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
7
|
-
import { TxIcon } from "@tectra-ng/icons";
|
|
8
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
import { TxIcon, provideTxIconDefaults, txIconEllipsisH, txIconList } from "@tectra-ng/icons";
|
|
8
|
+
import { actionsMenuTokens, toStyleObject } from "@tectra-ng/themes";
|
|
9
9
|
import { TxButton } from "@tectra-ng/ui/button";
|
|
10
10
|
import { TxPopover, TxPopoverTrigger } from "@tectra-ng/ui/popover";
|
|
11
11
|
import { TxTooltip } from "@tectra-ng/ui/tooltip";
|
|
12
|
+
const ACTIONS_MENU_ICON_DEFAULTS = {
|
|
13
|
+
"ellipsis-h": txIconEllipsisH,
|
|
14
|
+
list: txIconList
|
|
15
|
+
};
|
|
16
|
+
const ACTIONS_MENU_THEME = { actionsMenu: actionsMenuTokens };
|
|
12
17
|
const MENU_KEYS = /* @__PURE__ */ new Set([
|
|
13
18
|
"ArrowDown",
|
|
14
19
|
"ArrowUp",
|
|
@@ -16,6 +21,7 @@ const MENU_KEYS = /* @__PURE__ */ new Set([
|
|
|
16
21
|
"End"
|
|
17
22
|
]);
|
|
18
23
|
var TxActionsMenu = class TxActionsMenu {
|
|
24
|
+
actionsMenuTheme = injectTokens(ACTIONS_MENU_THEME);
|
|
19
25
|
popover = viewChild(TxPopover, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
20
26
|
list = viewChild("list", ...ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []);
|
|
21
27
|
pending = null;
|
|
@@ -265,6 +271,7 @@ var TxActionsMenu = class TxActionsMenu {
|
|
|
265
271
|
exportAs: ["txTooltip"]
|
|
266
272
|
}
|
|
267
273
|
],
|
|
274
|
+
viewProviders: [provideTxIconDefaults(ACTIONS_MENU_ICON_DEFAULTS)],
|
|
268
275
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
269
276
|
});
|
|
270
277
|
};
|
|
@@ -292,6 +299,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
292
299
|
"[attr.data-styled]": "!isUnstyled() || null",
|
|
293
300
|
"[attr.data-size]": "size()"
|
|
294
301
|
},
|
|
302
|
+
viewProviders: [provideTxIconDefaults(ACTIONS_MENU_ICON_DEFAULTS)],
|
|
295
303
|
template: "@if (items().length) {\n <button\n txButton\n type=\"button\"\n class=\"tx-actions-menu__trigger\"\n severity=\"secondary\"\n outlined\n icon=\"ellipsis-h\"\n [size]=\"size()\"\n [txTooltip]=\"tooltip()\"\n [txPopoverTrigger]=\"popover\"\n [attr.aria-label]=\"name()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n ></button>\n <tx-popover #popover [ariaLabel]=\"name()\" [dt]=\"popoverTokens\" [unstyled]=\"isUnstyled()\" (closed)=\"onClosed()\">\n <div\n #list\n class=\"tx-actions-menu__list\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"name()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().list?.class\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (item of items(); track item.id) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"tx-actions-menu__item\"\n [class.tx-actions-menu__item--danger]=\"item.danger\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <tx-icon\n class=\"tx-actions-menu__icon\"\n aria-hidden=\"true\"\n [name]=\"item.icon\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n />\n }\n <span class=\"tx-actions-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ item.label }}</span>\n </button>\n }\n </div>\n </tx-popover>\n}\n",
|
|
296
304
|
styles: [":host{display:inline-flex}.tx-actions-menu__list{display:flex;flex-direction:column}.tx-actions-menu__item{display:flex;align-items:center;width:100%;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;white-space:nowrap;cursor:pointer}.tx-actions-menu__icon{flex-shrink:0}.tx-actions-menu__list[data-styled]{gap:var(--tx-actions-menu-list-gap);min-width:var(--tx-actions-menu-list-min-width);padding:var(--tx-actions-menu-list-padding)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item{gap:var(--tx-actions-menu-item-gap);padding:var(--tx-actions-menu-item-padding-y) var(--tx-actions-menu-item-padding-x);border-radius:var(--tx-actions-menu-item-border-radius);color:var(--tx-actions-menu-item-color);font-family:var(--tx-font-family);font-size:var(--tx-actions-menu-item-font-size);font-weight:var(--tx-actions-menu-item-font-weight);line-height:var(--tx-actions-menu-item-line-height);transition:background-color var(--tx-actions-menu-item-transition-duration)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:hover{background:var(--tx-actions-menu-item-hover-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:active{background:var(--tx-actions-menu-item-active-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item:focus-visible{outline:2px solid var(--tx-actions-menu-item-focus-ring-color);outline-offset:-2px}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger{color:var(--tx-actions-menu-item-danger-color)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger:hover{background:var(--tx-actions-menu-item-danger-hover-background)}.tx-actions-menu__list[data-styled] .tx-actions-menu__item--danger:active{background:var(--tx-actions-menu-item-danger-active-background)}@media(prefers-reduced-motion:reduce){.tx-actions-menu__list[data-styled] .tx-actions-menu__item{transition:none}}\n"]
|
|
297
305
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-actions-menu.mjs","names":[],"sources":["../../../../packages/blocks/actions-menu/src/actions-menu.component.ts","../../../../packages/blocks/actions-menu/src/actions-menu.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, computed, input, output, viewChild } from '@angular/core';\nimport { nextListIndex } from '@tectra-ng/core/a11y';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TectraActionsMenuTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxPopover, TxPopoverTrigger } from '@tectra-ng/ui/popover';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxActionsMenuItem, TxActionsMenuPart, TxActionsMenuSize } from './actions-menu.types';\n\nconst MENU_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End']);\n\n@Component({\n selector: 'tx-actions-menu',\n imports: [TxButton, TxIcon, TxPopover, TxPopoverTrigger, TxTooltip],\n templateUrl: './actions-menu.component.html',\n styleUrl: './actions-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-actions-menu',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n },\n})\nexport class TxActionsMenu {\n private readonly popover = viewChild(TxPopover);\n private readonly list = viewChild<ElementRef<HTMLElement>>('list');\n private pending: TxActionsMenuItem | null = null;\n\n readonly items = input.required<readonly TxActionsMenuItem[]>();\n readonly tooltip = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly size = input<TxActionsMenuSize>('medium');\n readonly dt = input<TectraDeepPartial<TectraActionsMenuTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxActionsMenuPart, TxActionsMenu> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly itemSelect = output<string>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('actionsMenu', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-actions-menu'));\n readonly hostStyle = computed(() => ({ ...this.tokenStyle(), ...this.passThrough().root?.style }));\n protected readonly popoverTokens = { content: { padding: '0' } };\n protected readonly name = computed(() => this.ariaLabel() ?? this.tooltip() ?? this.translations().moreActions);\n\n close(): void {\n this.popover()?.hide();\n }\n\n protected select(item: TxActionsMenuItem): void {\n this.pending = item;\n this.close();\n }\n\n protected onClosed(): void {\n const item = this.pending;\n this.pending = null;\n if (item) {\n this.itemSelect.emit(item.id);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!MENU_KEYS.has(event.key)) {\n return;\n }\n const items = Array.from(this.list()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n const current = items.indexOf(event.target as HTMLElement);\n const next = nextListIndex(event.key, { count: items.length, current });\n if (next === null) {\n return;\n }\n event.preventDefault();\n items[next]?.focus();\n }\n}\n","@if (items().length) {\n <button\n txButton\n type=\"button\"\n class=\"tx-actions-menu__trigger\"\n severity=\"secondary\"\n outlined\n icon=\"ellipsis-h\"\n [size]=\"size()\"\n [txTooltip]=\"tooltip()\"\n [txPopoverTrigger]=\"popover\"\n [attr.aria-label]=\"name()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n ></button>\n <tx-popover #popover [ariaLabel]=\"name()\" [dt]=\"popoverTokens\" [unstyled]=\"isUnstyled()\" (closed)=\"onClosed()\">\n <div\n #list\n class=\"tx-actions-menu__list\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"name()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().list?.class\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (item of items(); track item.id) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"tx-actions-menu__item\"\n [class.tx-actions-menu__item--danger]=\"item.danger\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <tx-icon\n class=\"tx-actions-menu__icon\"\n aria-hidden=\"true\"\n [name]=\"item.icon\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n />\n }\n <span class=\"tx-actions-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ item.label }}</span>\n </button>\n }\n </div>\n </tx-popover>\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,4BAAY,IAAI,IAAI;CAAC;CAAa;CAAW;CAAQ;AAAK,CAAC;AAgBjE,IAAa,gBAAb,MAAa,cAAa;CACP,UAAU,UAAU,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9B,OAAO,UAAmC,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC1D,UAAoC;CAEnC,QAAQ,MAAM,SAAwC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA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AA;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,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-actions-menu.mjs","names":[],"sources":["../../../../packages/blocks/actions-menu/src/actions-menu.icons.ts","../../../../packages/blocks/actions-menu/src/actions-menu.theme.ts","../../../../packages/blocks/actions-menu/src/actions-menu.component.ts","../../../../packages/blocks/actions-menu/src/actions-menu.component.html"],"sourcesContent":["import { TxIconSet, txIconEllipsisH, txIconList } from '@tectra-ng/icons';\n\nexport const ACTIONS_MENU_ICON_DEFAULTS: TxIconSet = {\n 'ellipsis-h': txIconEllipsisH,\n list: txIconList,\n};\n","import { actionsMenuTokens } from '@tectra-ng/themes';\n\nexport const ACTIONS_MENU_THEME = {\n actionsMenu: actionsMenuTokens,\n};\n","import { ChangeDetectionStrategy, Component, ElementRef, computed, input, output, viewChild } from '@angular/core';\nimport { nextListIndex } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraActionsMenuTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxPopover, TxPopoverTrigger } from '@tectra-ng/ui/popover';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxActionsMenuItem, TxActionsMenuPart, TxActionsMenuSize } from './actions-menu.types';\nimport { ACTIONS_MENU_ICON_DEFAULTS } from './actions-menu.icons';\nimport { ACTIONS_MENU_THEME } from './actions-menu.theme';\n\nconst MENU_KEYS = new Set(['ArrowDown', 'ArrowUp', 'Home', 'End']);\n\n@Component({\n selector: 'tx-actions-menu',\n imports: [TxButton, TxIcon, TxPopover, TxPopoverTrigger, TxTooltip],\n templateUrl: './actions-menu.component.html',\n styleUrl: './actions-menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-actions-menu',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n },\n viewProviders: [provideTxIconDefaults(ACTIONS_MENU_ICON_DEFAULTS)],\n})\nexport class TxActionsMenu {\n private readonly actionsMenuTheme = injectTokens(ACTIONS_MENU_THEME);\n\n private readonly popover = viewChild(TxPopover);\n private readonly list = viewChild<ElementRef<HTMLElement>>('list');\n private pending: TxActionsMenuItem | null = null;\n\n readonly items = input.required<readonly TxActionsMenuItem[]>();\n readonly tooltip = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly size = input<TxActionsMenuSize>('medium');\n readonly dt = input<TectraDeepPartial<TectraActionsMenuTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxActionsMenuPart, TxActionsMenu> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly itemSelect = output<string>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('actionsMenu', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-actions-menu'));\n readonly hostStyle = computed(() => ({ ...this.tokenStyle(), ...this.passThrough().root?.style }));\n protected readonly popoverTokens = { content: { padding: '0' } };\n protected readonly name = computed(() => this.ariaLabel() ?? this.tooltip() ?? this.translations().moreActions);\n\n close(): void {\n this.popover()?.hide();\n }\n\n protected select(item: TxActionsMenuItem): void {\n this.pending = item;\n this.close();\n }\n\n protected onClosed(): void {\n const item = this.pending;\n this.pending = null;\n if (item) {\n this.itemSelect.emit(item.id);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!MENU_KEYS.has(event.key)) {\n return;\n }\n const items = Array.from(this.list()?.nativeElement.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n const current = items.indexOf(event.target as HTMLElement);\n const next = nextListIndex(event.key, { count: items.length, current });\n if (next === null) {\n return;\n }\n event.preventDefault();\n items[next]?.focus();\n }\n}\n","@if (items().length) {\n <button\n txButton\n type=\"button\"\n class=\"tx-actions-menu__trigger\"\n severity=\"secondary\"\n outlined\n icon=\"ellipsis-h\"\n [size]=\"size()\"\n [txTooltip]=\"tooltip()\"\n [txPopoverTrigger]=\"popover\"\n [attr.aria-label]=\"name()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n ></button>\n <tx-popover #popover [ariaLabel]=\"name()\" [dt]=\"popoverTokens\" [unstyled]=\"isUnstyled()\" (closed)=\"onClosed()\">\n <div\n #list\n class=\"tx-actions-menu__list\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"name()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().list?.class\"\n (keydown)=\"onKeydown($event)\"\n >\n @for (item of items(); track item.id) {\n <button\n type=\"button\"\n role=\"menuitem\"\n class=\"tx-actions-menu__item\"\n [class.tx-actions-menu__item--danger]=\"item.danger\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <tx-icon\n class=\"tx-actions-menu__icon\"\n aria-hidden=\"true\"\n [name]=\"item.icon\"\n [class]=\"passThrough().icon?.class\"\n [style]=\"passThrough().icon?.style\"\n />\n }\n <span class=\"tx-actions-menu__label\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ item.label }}</span>\n </button>\n }\n </div>\n </tx-popover>\n}\n"],"mappings":";;;;;;;;;;;AAEA,MAAa,6BAAwC;CACnD,cAAc;CACd,MAAM;AACP;ACHD,MAAa,qBAAqB,EAChC,aAAa,kBACd;ACUD,MAAM,4BAAY,IAAI,IAAI;CAAC;CAAa;CAAW;CAAQ;AAAK,CAAC;AAiBjE,IAAa,gBAAb,MAAa,cAAa;CACP,mBAAmB,aAAa,kBAAkB;CAElD,UAAU,UAAU,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9B,OAAO,UAAmC,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC1D,UAAoC;CAEnC,QAAQ,MAAM,SAAwC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACtD,UAAU,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAC9C,YAAY,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAChD,OAAO,MAAyB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACzC,KAAK,MAA8D,QAAU,GAA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AAA,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,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
|
|
3
3
|
import { RouterLink } from "@angular/router";
|
|
4
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
5
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
6
6
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
7
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
import { appFooterTokens, toStyleObject } from "@tectra-ng/themes";
|
|
8
|
+
import { provideTxIconDefaults, txIconCopy, txIconLink } from "@tectra-ng/icons";
|
|
9
|
+
const APP_FOOTER_ICON_DEFAULTS = {
|
|
10
|
+
copy: txIconCopy,
|
|
11
|
+
link: txIconLink
|
|
12
|
+
};
|
|
13
|
+
const APP_FOOTER_THEME = { appFooter: appFooterTokens };
|
|
8
14
|
var TxAppFooter = class TxAppFooter {
|
|
15
|
+
appFooterTheme = injectTokens(APP_FOOTER_THEME);
|
|
9
16
|
name = input.required(...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
10
17
|
links = input([], ...ngDevMode ? [{ debugName: "links" }] : /* istanbul ignore next */ []);
|
|
11
18
|
variant = input("page", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
@@ -154,6 +161,7 @@ var TxAppFooter = class TxAppFooter {
|
|
|
154
161
|
"routerLink"
|
|
155
162
|
]
|
|
156
163
|
}],
|
|
164
|
+
viewProviders: [provideTxIconDefaults(APP_FOOTER_ICON_DEFAULTS)],
|
|
157
165
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
158
166
|
});
|
|
159
167
|
};
|
|
@@ -193,6 +201,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
193
201
|
"[attr.data-styled]": "!isUnstyled() || null",
|
|
194
202
|
"[attr.data-variant]": "variant()"
|
|
195
203
|
},
|
|
204
|
+
viewProviders: [provideTxIconDefaults(APP_FOOTER_ICON_DEFAULTS)],
|
|
196
205
|
styles: [":host{display:block;container:tx-app-footer/inline-size}.tx-app-footer__inner{display:flex;flex-direction:column-reverse}.tx-app-footer__copy{white-space:nowrap}.tx-app-footer__nav{display:flex;flex-wrap:wrap;align-items:center}.tx-app-footer__link{position:relative;white-space:nowrap}@container tx-app-footer (width >= 768px){.tx-app-footer__inner{flex-direction:row;align-items:center;justify-content:space-between}.tx-app-footer__nav{justify-content:flex-end}}:host([data-styled]) .tx-app-footer__root{border-top:1px solid var(--tx-app-footer-border-color);font-family:var(--tx-font-family)}:host([data-styled]) .tx-app-footer__inner{gap:var(--tx-app-footer-gap);color:var(--tx-app-footer-color);font-size:var(--tx-app-footer-font-size);line-height:var(--tx-app-footer-line-height)}:host([data-styled][data-variant=page]) .tx-app-footer__inner{max-width:var(--tx-app-footer-page-max-width);margin-inline:auto;padding:var(--tx-app-footer-page-padding)}:host([data-styled][data-variant=app]) .tx-app-footer__root{margin-top:var(--tx-app-footer-app-margin-top)}:host([data-styled][data-variant=app]) .tx-app-footer__inner{padding:var(--tx-app-footer-app-padding)}:host([data-styled][data-variant=console]) .tx-app-footer__inner{padding:var(--tx-app-footer-console-padding)}:host([data-styled]) .tx-app-footer__copy{font-variant-numeric:tabular-nums}:host([data-styled]) .tx-app-footer__link+.tx-app-footer__link:before{position:absolute;top:50%;left:0;width:1px;height:var(--tx-app-footer-link-separator-height);transform:translateY(-50%);background:var(--tx-app-footer-link-separator-color);content:\"\"}:host([data-styled]) .tx-app-footer__nav{row-gap:var(--tx-app-footer-link-row-gap)}:host([data-styled]) .tx-app-footer__link{padding-inline:var(--tx-app-footer-link-padding-x);border-radius:var(--tx-app-footer-link-border-radius);color:var(--tx-app-footer-link-color);text-decoration:none;text-underline-offset:2px;transition:color var(--tx-app-footer-link-transition-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-app-footer__link:first-child{padding-inline-start:0}:host([data-styled]) .tx-app-footer__link:hover{color:var(--tx-app-footer-link-hover-color);text-decoration:underline}:host([data-styled]) .tx-app-footer__link:focus-visible{outline:none;box-shadow:var(--tx-app-footer-link-focus-ring-shadow)}@container tx-app-footer (width >= 768px){:host([data-styled]) .tx-app-footer__inner{gap:var(--tx-app-footer-wide-gap)}:host([data-styled]) .tx-app-footer__link:last-child{padding-inline-end:0}}@container tx-app-footer (width < 768px){:host([data-styled][data-variant=console]) .tx-app-footer__inner{padding-inline:var(--tx-app-footer-console-mobile-padding)}}\n"]
|
|
197
206
|
}]
|
|
198
207
|
}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-app-footer.mjs","names":[],"sources":["../../../../packages/blocks/app-footer/src/app-footer.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport {
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-app-footer.mjs","names":[],"sources":["../../../../packages/blocks/app-footer/src/app-footer.icons.ts","../../../../packages/blocks/app-footer/src/app-footer.theme.ts","../../../../packages/blocks/app-footer/src/app-footer.component.ts"],"sourcesContent":["import { TxIconSet, txIconCopy, txIconLink } from '@tectra-ng/icons';\n\nexport const APP_FOOTER_ICON_DEFAULTS: TxIconSet = {\n copy: txIconCopy,\n link: txIconLink,\n};\n","import { appFooterTokens } from '@tectra-ng/themes';\n\nexport const APP_FOOTER_THEME = {\n appFooter: appFooterTokens,\n};\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraAppFooterTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxAppFooterLink, TxAppFooterPart, TxAppFooterVariant } from './app-footer.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { APP_FOOTER_ICON_DEFAULTS } from './app-footer.icons';\nimport { APP_FOOTER_THEME } from './app-footer.theme';\n\n@Component({\n selector: 'tx-app-footer',\n imports: [RouterLink],\n template: `\n <footer class=\"tx-app-footer__root\">\n <div class=\"tx-app-footer__inner\" [class]=\"passThrough().inner?.class\" [style]=\"passThrough().inner?.style\">\n <span class=\"tx-app-footer__copy\" [class]=\"passThrough().copy?.class\" [style]=\"passThrough().copy?.style\">© {{ currentYear() }} {{ name() }}</span>\n @if (links().length) {\n <nav class=\"tx-app-footer__nav\" [attr.aria-label]=\"navLabel() ?? translations().legal\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n @for (item of links(); track item.label) {\n @if (item.routerLink !== undefined) {\n <a class=\"tx-app-footer__link\" [routerLink]=\"item.routerLink\" [queryParams]=\"item.queryParams\" [attr.target]=\"item.target ?? null\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ item.label }}</a>\n } @else {\n <a class=\"tx-app-footer__link\" [attr.href]=\"item.url ?? null\" [attr.target]=\"item.target ?? null\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ item.label }}</a>\n }\n }\n </nav>\n }\n </div>\n </footer>\n `,\n styleUrl: './app-footer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-app-footer',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-variant]': 'variant()',\n },\n viewProviders: [provideTxIconDefaults(APP_FOOTER_ICON_DEFAULTS)],\n})\nexport class TxAppFooter {\n private readonly appFooterTheme = injectTokens(APP_FOOTER_THEME);\n\n readonly name = input.required<string>();\n readonly links = input<readonly TxAppFooterLink[]>([]);\n readonly variant = input<TxAppFooterVariant>('page');\n readonly navLabel = input<string | undefined>(undefined);\n readonly year = input<number | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraAppFooterTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAppFooterPart, TxAppFooter> | 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('appFooter', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly currentYear = computed(() => this.year() ?? new Date().getFullYear());\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-app-footer'), ...this.passThrough().root?.style }));\n}\n"],"mappings":";;;;;;;;AAEA,MAAa,2BAAsC;CACjD,MAAM;CACN,MAAM;AACP;ACHD,MAAa,mBAAmB,EAC9B,WAAW,gBACZ;ACuCD,IAAa,cAAb,MAAa,YAAW;CACL,iBAAiB,aAAa,gBAAgB;CAEtD,OAAO,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,QAAQ,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC7C,UAAU,MAA0B,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+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;EAhCvB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,SAChB,CAAC,UAAU;GAAC,UACX;;;;;;;;;;;;;;;;;;GAiBT,iBAEgB,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,uBAAuB;GACxB;GAAA,eACc,CAAC,sBAAsB,wBAAwB,CAAC;GAAC,QAAA,CAAA,moFAAA;EAAA,CAAA"}
|
|
@@ -4,17 +4,28 @@ import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, ElementRef, a
|
|
|
4
4
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
5
5
|
import { NavigationEnd, Router, RouterLink } from "@angular/router";
|
|
6
6
|
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
7
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
7
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
8
8
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
9
9
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
10
|
-
import { TxIcon } from "@tectra-ng/icons";
|
|
11
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
10
|
+
import { TxIcon, provideTxIconDefaults, txIconAngleDoubleLeft, txIconBars, txIconSidebar, txIconThumbtack } from "@tectra-ng/icons";
|
|
11
|
+
import { appLayoutTokens, panelMenuTokens, toStyleObject } from "@tectra-ng/themes";
|
|
12
12
|
import { TxPanelMenu } from "@tectra-ng/ui/panel-menu";
|
|
13
13
|
import { TxTooltip } from "@tectra-ng/ui/tooltip";
|
|
14
14
|
import { filter } from "rxjs";
|
|
15
|
+
const APP_LAYOUT_ICON_DEFAULTS = {
|
|
16
|
+
"angle-double-left": txIconAngleDoubleLeft,
|
|
17
|
+
bars: txIconBars,
|
|
18
|
+
sidebar: txIconSidebar,
|
|
19
|
+
thumbtack: txIconThumbtack
|
|
20
|
+
};
|
|
21
|
+
const APP_LAYOUT_THEME = {
|
|
22
|
+
appLayout: appLayoutTokens,
|
|
23
|
+
panelMenu: panelMenuTokens
|
|
24
|
+
};
|
|
15
25
|
const MOBILE_WIDTH = 1024;
|
|
16
26
|
const PICKED = "a[href], [role=\"treeitem\"]:not([aria-expanded])";
|
|
17
27
|
var TxAppLayout = class TxAppLayout {
|
|
28
|
+
appLayoutTheme = injectTokens(APP_LAYOUT_THEME);
|
|
18
29
|
document = inject(DOCUMENT);
|
|
19
30
|
host = inject(ElementRef);
|
|
20
31
|
menuButton = viewChild("menuButton", ...ngDevMode ? [{ debugName: "menuButton" }] : /* istanbul ignore next */ []);
|
|
@@ -372,6 +383,7 @@ var TxAppLayout = class TxAppLayout {
|
|
|
372
383
|
exportAs: ["txTooltip"]
|
|
373
384
|
}
|
|
374
385
|
],
|
|
386
|
+
viewProviders: [provideTxIconDefaults(APP_LAYOUT_ICON_DEFAULTS)],
|
|
375
387
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
376
388
|
});
|
|
377
389
|
};
|
|
@@ -404,6 +416,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
404
416
|
"[class.tx-app-layout--open]": "sidebar() && mobileOpen()",
|
|
405
417
|
"(keydown.escape)": "closeFromKeyboard()"
|
|
406
418
|
},
|
|
419
|
+
viewProviders: [provideTxIconDefaults(APP_LAYOUT_ICON_DEFAULTS)],
|
|
407
420
|
template: "@if (backdrop()) {\n <div class=\"tx-app-layout__backdrop\" aria-hidden=\"true\" [attr.data-variant]=\"backdropVariant()\"></div>\n}\n@if (sidebar()) {\n <div class=\"tx-app-layout__slot\">\n <aside\n class=\"tx-app-layout__sidebar\"\n [id]=\"id + '-sidebar'\"\n [attr.aria-label]=\"menuName()\"\n [attr.inert]=\"mobile() && !mobileOpen() ? '' : null\"\n [class]=\"passThrough().sidebar?.class\"\n [style]=\"passThrough().sidebar?.style\"\n (mouseenter)=\"setHovered(true)\"\n (mouseleave)=\"setHovered(false)\"\n (focusin)=\"onFocusIn($event)\"\n (focusout)=\"onFocusOut($event)\"\n >\n <div class=\"tx-app-layout__sidebar-header\">\n @if (homeLink() !== undefined) {\n <a class=\"tx-app-layout__brand\" [routerLink]=\"homeLink()\" [attr.aria-label]=\"title() ?? null\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-app-layout__brand\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n <button\n type=\"button\"\n class=\"tx-app-layout__anchor\"\n tooltipPlacement=\"right\"\n [attr.aria-pressed]=\"anchored()\"\n [attr.aria-label]=\"anchored() ? translations().unpinMenu : translations().pinMenu\"\n [txTooltip]=\"anchored() ? translations().unpinMenu : translations().pinMenu\"\n (click)=\"toggleAnchored()\"\n >\n <tx-icon class=\"tx-app-layout__pin-icon\" aria-hidden=\"true\" name=\"thumbtack\" [class.tx-app-layout__pin-icon--on]=\"!anchored()\" />\n <tx-icon class=\"tx-app-layout__pin-icon\" aria-hidden=\"true\" name=\"angle-double-left\" [class.tx-app-layout__pin-icon--on]=\"anchored()\" />\n </button>\n </div>\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- picks inside the menu are its own links and tree items -->\n <div class=\"tx-app-layout__menu\" (click)=\"onSidebarClick($event)\">\n <tx-panel-menu\n variant=\"sidebar\"\n [ariaLabel]=\"menuName()\"\n [model]=\"model()\"\n [collapsed]=\"!wide()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().menu?.class\"\n [style]=\"passThrough().menu?.style\"\n />\n </div>\n </aside>\n </div>\n <div class=\"tx-app-layout__mask\" aria-hidden=\"true\" [class]=\"passThrough().mask?.class\" [style]=\"passThrough().mask?.style\" (click)=\"closeMobile()\"></div>\n}\n<div class=\"tx-app-layout__column\">\n <header class=\"tx-app-layout__topbar\" [class]=\"passThrough().topbar?.class\" [style]=\"passThrough().topbar?.style\">\n @if (sidebar()) {\n <button\n #menuButton\n type=\"button\"\n class=\"tx-app-layout__menu-button\"\n [attr.aria-label]=\"menuName()\"\n [attr.aria-expanded]=\"mobileOpen()\"\n [attr.aria-controls]=\"id + '-sidebar'\"\n [class]=\"passThrough().menuButton?.class\"\n [style]=\"passThrough().menuButton?.style\"\n (click)=\"toggleMobile()\"\n >\n <tx-icon name=\"bars\" aria-hidden=\"true\" />\n </button>\n } @else {\n @if (homeLink() !== undefined) {\n <a class=\"tx-app-layout__plain-brand\" [routerLink]=\"homeLink()\" [attr.aria-label]=\"title() ?? null\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-app-layout__plain-brand\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n }\n <div class=\"tx-app-layout__topbar-end\">\n <ng-content select=\"[txAppTopbar]\" />\n </div>\n </header>\n <div class=\"tx-app-layout__wrapper\">\n <main class=\"tx-app-layout__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n <ng-content />\n </main>\n <ng-content select=\"[txAppFooter]\" />\n </div>\n</div>\n\n<ng-template #brand>\n @if (logo()) {\n <img class=\"tx-app-layout__logo\" alt=\"\" [src]=\"logo()\" />\n }\n @if (title()) {\n <span class=\"tx-app-layout__name\">{{ title() }}</span>\n }\n</ng-template>\n",
|
|
408
421
|
styles: [":host{position:relative;display:flex;isolation:isolate}:host([data-responsive=container]){container:tx-app-layout/inline-size;contain:layout}.tx-app-layout__backdrop{position:fixed;inset:0;z-index:-1;pointer-events:none}.tx-app-layout__slot{position:sticky;flex-shrink:0}.tx-app-layout__sidebar{position:absolute;top:0;left:0;display:flex;flex-direction:column;box-sizing:border-box;height:100%}.tx-app-layout__sidebar-header{display:flex;flex-shrink:0;align-items:center;overflow:hidden}.tx-app-layout__brand,.tx-app-layout__plain-brand{display:inline-flex;align-items:center;color:inherit;text-decoration:none}.tx-app-layout__name{white-space:nowrap}.tx-app-layout__anchor{display:none;flex-shrink:0;place-items:center;margin-inline-start:auto;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}.tx-app-layout__menu{flex:1;min-height:0;overflow:hidden}.tx-app-layout__mask{position:fixed;inset:0;display:none}.tx-app-layout__column{display:flex;flex:1;flex-direction:column;min-width:0}.tx-app-layout__topbar{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.tx-app-layout__menu-button{display:none;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}.tx-app-layout__topbar-end{display:flex;flex:1;align-items:center;justify-content:flex-end;min-width:0}.tx-app-layout__wrapper{display:flex;flex:1;flex-direction:column;box-sizing:border-box}.tx-app-layout__content{flex:1;width:100%}.tx-app-layout__pin-icon{grid-area:1/1}:host(.tx-app-layout--wide) .tx-app-layout__anchor{display:inline-grid}:host(.tx-app-layout--wide) .tx-app-layout__menu{overflow:auto}:host([data-styled]){min-height:var(--tx-app-layout-min-height);background:var(--tx-app-layout-background);color:var(--tx-app-layout-color);font-family:var(--tx-font-family)}:host([data-styled]) .tx-app-layout__backdrop{background:var(--tx-app-layout-backdrop-spectrum)}:host([data-styled]) .tx-app-layout__backdrop[data-variant=accent]{background:var(--tx-app-layout-backdrop-accent)}:host([data-styled]) .tx-app-layout__backdrop:after{position:absolute;inset:0;background-image:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>\");background-size:var(--tx-app-layout-backdrop-noise-size) var(--tx-app-layout-backdrop-noise-size);opacity:var(--tx-app-layout-backdrop-noise-opacity);content:\"\"}:host([data-styled]):has(.tx-app-layout__backdrop){background:transparent}:host([data-styled]) .tx-app-layout__slot{top:var(--tx-app-layout-top-offset);width:var(--tx-app-layout-sidebar-rail-width);height:calc(var(--tx-app-layout-viewport-height) - var(--tx-app-layout-top-offset));transition:width var(--tx-app-layout-sidebar-duration) var(--tx-app-layout-sidebar-easing)}:host([data-styled]) .tx-app-layout__sidebar{z-index:var(--tx-app-layout-sidebar-z-index);width:var(--tx-app-layout-sidebar-rail-width);border-inline-end:1px solid var(--tx-app-layout-sidebar-border-color);background:var(--tx-app-layout-sidebar-background);transition:width var(--tx-app-layout-sidebar-duration) var(--tx-app-layout-sidebar-easing)}:host([data-styled]) .tx-app-layout__sidebar-header{height:var(--tx-app-layout-sidebar-header-height);padding-inline-start:calc((var(--tx-app-layout-sidebar-rail-width) - var(--tx-app-layout-sidebar-logo-size)) / 2);border-bottom:1px solid var(--tx-app-layout-sidebar-border-color);transition:padding var(--tx-app-layout-sidebar-duration) var(--tx-app-layout-sidebar-easing)}:host([data-styled]) .tx-app-layout__brand{color:var(--tx-app-layout-sidebar-name-color)}:host([data-styled]) .tx-app-layout__brand .tx-app-layout__logo{flex-shrink:0;width:var(--tx-app-layout-sidebar-logo-size);height:var(--tx-app-layout-sidebar-logo-size)}:host([data-styled]) .tx-app-layout__brand .tx-app-layout__name{width:0;overflow:hidden;opacity:0;font-size:var(--tx-app-layout-sidebar-name-font-size);font-weight:var(--tx-app-layout-sidebar-name-font-weight);letter-spacing:var(--tx-app-layout-sidebar-name-letter-spacing);transition:opacity var(--tx-app-layout-sidebar-name-hide-duration)}:host([data-styled]) .tx-app-layout__anchor{width:var(--tx-app-layout-sidebar-pin-size);height:var(--tx-app-layout-sidebar-pin-size);border-radius:var(--tx-app-layout-sidebar-pin-border-radius);color:var(--tx-app-layout-sidebar-pin-color);font-size:var(--tx-app-layout-sidebar-pin-icon-size);transition:background-color var(--tx-motion-duration) var(--tx-motion-easing),color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-app-layout__anchor:hover{background:var(--tx-app-layout-sidebar-pin-hover-background);color:var(--tx-app-layout-sidebar-pin-hover-color)}:host([data-styled]) .tx-app-layout__anchor:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) .tx-app-layout__pin-icon{opacity:0;scale:.5;rotate:-45deg;transition:opacity var(--tx-app-layout-sidebar-pin-swap-duration) var(--tx-motion-easing),scale var(--tx-app-layout-sidebar-pin-swap-duration) var(--tx-motion-easing),rotate var(--tx-app-layout-sidebar-pin-swap-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-app-layout__pin-icon--on{opacity:1;scale:1;rotate:0deg}:host([data-styled]) .tx-app-layout__sidebar{--tx-app-layout-menu-indent1: var(--tx-panel-menu-sidebar-indent1);--tx-app-layout-menu-indent2: var(--tx-panel-menu-sidebar-indent2);--tx-app-layout-menu-indent3: var(--tx-panel-menu-sidebar-indent3);--tx-app-layout-menu-badge-start: var(--tx-panel-menu-sidebar-collapsed-badge-start);--tx-app-layout-menu-lock-start: var(--tx-panel-menu-sidebar-collapsed-lock-start);--tx-app-layout-menu-shift: calc( (var(--tx-app-layout-sidebar-rail-width) - var(--tx-panel-menu-sidebar-icon-size)) / 2 - var(--tx-app-layout-sidebar-menu-item-inset) - var(--tx-panel-menu-sidebar-indent1) )}:host([data-styled]) .tx-app-layout__menu{--tx-panel-menu-sidebar-indent1: calc(var(--tx-app-layout-menu-indent1) + var(--tx-app-layout-menu-shift));--tx-panel-menu-sidebar-indent2: calc(var(--tx-app-layout-menu-indent2) + var(--tx-app-layout-menu-shift));--tx-panel-menu-sidebar-indent3: calc(var(--tx-app-layout-menu-indent3) + var(--tx-app-layout-menu-shift));--tx-panel-menu-sidebar-collapsed-badge-start: calc(var(--tx-app-layout-menu-badge-start) + var(--tx-app-layout-menu-shift));--tx-panel-menu-sidebar-collapsed-lock-start: calc(var(--tx-app-layout-menu-lock-start) + var(--tx-app-layout-menu-shift));padding:var(--tx-app-layout-sidebar-menu-padding);scrollbar-color:var(--tx-app-layout-sidebar-scrollbar-color) transparent;scrollbar-width:thin}:host([data-styled]) .tx-app-layout__mask{z-index:var(--tx-app-layout-mask-z-index);background:var(--tx-app-layout-mask-background);animation:tx-app-layout-fade var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-app-layout__topbar{gap:var(--tx-app-layout-topbar-gap);min-height:var(--tx-app-layout-topbar-min-height);padding:var(--tx-app-layout-topbar-padding);background:var(--tx-app-layout-topbar-background)}:host([data-styled]) .tx-app-layout__menu-button{width:var(--tx-app-layout-menu-button-size);height:var(--tx-app-layout-menu-button-size);margin-inline-end:var(--tx-app-layout-menu-button-margin-end);border-radius:var(--tx-app-layout-menu-button-border-radius);color:var(--tx-app-layout-menu-button-color);font-size:var(--tx-app-layout-menu-button-icon-size);transition:background-color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-app-layout__menu-button:hover{background:var(--tx-app-layout-menu-button-hover-background)}:host([data-styled]) .tx-app-layout__menu-button:focus-visible{outline:none;box-shadow:var(--tx-app-layout-menu-button-focus-ring-shadow)}:host([data-styled]) .tx-app-layout__wrapper{padding:var(--tx-app-layout-content-padding)}:host([data-styled]) .tx-app-layout__content{max-width:var(--tx-app-layout-content-max-width);margin-inline:auto}:host([data-styled].tx-app-layout--wide) .tx-app-layout__sidebar{width:var(--tx-app-layout-sidebar-width)}:host([data-styled].tx-app-layout--wide) .tx-app-layout__sidebar-header{padding:var(--tx-app-layout-sidebar-header-padding)}:host([data-styled].tx-app-layout--wide) .tx-app-layout__brand{gap:var(--tx-app-layout-sidebar-brand-gap)}:host([data-styled].tx-app-layout--wide) .tx-app-layout__brand .tx-app-layout__name{width:auto;opacity:1;transition-duration:var(--tx-app-layout-sidebar-name-reveal-duration)}:host([data-styled].tx-app-layout--wide) .tx-app-layout__anchor{animation:tx-app-layout-fade var(--tx-motion-duration) linear}:host([data-styled].tx-app-layout--anchored) .tx-app-layout__slot{width:var(--tx-app-layout-sidebar-width)}:host([data-styled].tx-app-layout--plain) .tx-app-layout__topbar{padding-inline:var(--tx-app-layout-plain-padding)}:host([data-styled].tx-app-layout--plain) .tx-app-layout__plain-brand{gap:var(--tx-app-layout-plain-brand-gap);color:var(--tx-app-layout-plain-color)}:host([data-styled].tx-app-layout--plain) .tx-app-layout__plain-brand .tx-app-layout__logo{width:var(--tx-app-layout-plain-logo-size);height:var(--tx-app-layout-plain-logo-size)}:host([data-styled].tx-app-layout--plain) .tx-app-layout__plain-brand .tx-app-layout__name{font-size:var(--tx-app-layout-plain-name-font-size);font-weight:var(--tx-app-layout-plain-name-font-weight);line-height:var(--tx-app-layout-plain-name-line-height)}@media(width<1024px){:host([data-responsive=viewport]) .tx-app-layout__slot{position:static}:host([data-responsive=viewport]) .tx-app-layout__sidebar{position:fixed;transform:translate(-100%)}:host([data-responsive=viewport].tx-app-layout--open) .tx-app-layout__sidebar{transform:none}:host([data-responsive=viewport].tx-app-layout--open) .tx-app-layout__mask{display:block}:host([data-responsive=viewport]) .tx-app-layout__menu-button{display:inline-flex}:host([data-responsive=viewport]) .tx-app-layout__anchor{display:none}:host([data-responsive=viewport][data-styled]) .tx-app-layout__slot{width:0;height:auto}:host([data-responsive=viewport][data-styled]) .tx-app-layout__sidebar{top:var(--tx-app-layout-top-offset);height:calc(var(--tx-app-layout-viewport-height) - var(--tx-app-layout-top-offset));width:var(--tx-app-layout-sidebar-width);transition:transform var(--tx-app-layout-sidebar-duration) var(--tx-app-layout-sidebar-easing)}:host([data-responsive=viewport][data-styled]) .tx-app-layout__topbar{padding-inline-start:var(--tx-app-layout-topbar-mobile-padding-start)}:host([data-responsive=viewport][data-styled]) .tx-app-layout__wrapper{padding:var(--tx-app-layout-content-mobile-padding)}}@container tx-app-layout (width < 1024px){:host([data-responsive=container]) .tx-app-layout__slot{position:static}:host([data-responsive=container]) .tx-app-layout__sidebar{position:fixed;transform:translate(-100%)}:host([data-responsive=container].tx-app-layout--open) .tx-app-layout__sidebar{transform:none}:host([data-responsive=container].tx-app-layout--open) .tx-app-layout__mask{display:block}:host([data-responsive=container]) .tx-app-layout__menu-button{display:inline-flex}:host([data-responsive=container]) .tx-app-layout__anchor{display:none}:host([data-responsive=container][data-styled]) .tx-app-layout__slot{width:0;height:auto}:host([data-responsive=container][data-styled]) .tx-app-layout__sidebar{top:var(--tx-app-layout-top-offset);height:calc(var(--tx-app-layout-viewport-height) - var(--tx-app-layout-top-offset));width:var(--tx-app-layout-sidebar-width);transition:transform var(--tx-app-layout-sidebar-duration) var(--tx-app-layout-sidebar-easing)}:host([data-responsive=container][data-styled]) .tx-app-layout__topbar{padding-inline-start:var(--tx-app-layout-topbar-mobile-padding-start)}:host([data-responsive=container][data-styled]) .tx-app-layout__wrapper{padding:var(--tx-app-layout-content-mobile-padding)}}@keyframes tx-app-layout-fade{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-app-layout__slot,:host([data-styled]) .tx-app-layout__sidebar,:host([data-styled]) .tx-app-layout__sidebar-header,:host([data-styled]) .tx-app-layout__menu-button,:host([data-styled]) .tx-app-layout__anchor,:host([data-styled]) .tx-app-layout__pin-icon{transition:none}:host([data-styled]) .tx-app-layout__mask{animation:none}:host([data-styled].tx-app-layout--wide) .tx-app-layout__anchor{animation:none}:host([data-styled]) .tx-app-layout__brand .tx-app-layout__name{transition:none}}\n"]
|
|
409
422
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-app-layout.mjs","names":[],"sources":["../../../../packages/blocks/app-layout/src/app-layout.component.ts","../../../../packages/blocks/app-layout/src/app-layout.component.html"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n DestroyRef,\n ElementRef,\n OnInit,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router, RouterLink } from '@angular/router';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TectraAppLayoutTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxPanelMenu, TxPanelMenuItem } from '@tectra-ng/ui/panel-menu';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { filter } from 'rxjs';\nimport { TxAppLayoutBackdrop, TxAppLayoutPart, TxAppLayoutResponsive } from './app-layout.types';\n\nconst MOBILE_WIDTH = 1024;\nconst PICKED = 'a[href], [role=\"treeitem\"]:not([aria-expanded])';\n\n@Component({\n selector: 'tx-app-layout',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxPanelMenu, TxTooltip],\n templateUrl: './app-layout.component.html',\n styleUrl: './app-layout.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-app-layout',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-responsive]': 'responsive()',\n '[class.tx-app-layout--plain]': '!sidebar()',\n '[class.tx-app-layout--anchored]': 'sidebar() && anchored()',\n '[class.tx-app-layout--wide]': 'sidebar() && wide()',\n '[class.tx-app-layout--open]': 'sidebar() && mobileOpen()',\n '(keydown.escape)': 'closeFromKeyboard()',\n },\n})\nexport class TxAppLayout implements OnInit {\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly menuButton = viewChild<ElementRef<HTMLButtonElement>>('menuButton');\n\n readonly model = input<TxPanelMenuItem[]>([]);\n readonly logo = input<string | undefined>(undefined);\n readonly title = input<string | undefined>(undefined);\n readonly homeLink = input<string | readonly unknown[] | undefined>('/');\n readonly sidebar = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly anchored = model(true);\n readonly stateKey = input<string | undefined>(undefined);\n readonly backdrop = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly backdropVariant = input<TxAppLayoutBackdrop>('spectrum');\n readonly responsive = input<TxAppLayoutResponsive>('viewport');\n readonly menuLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraAppLayoutTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAppLayoutPart, TxAppLayout> | 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('appLayout', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly id = uniqueId('tx-app-layout');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-app-layout'), ...this.passThrough().root?.style }));\n\n readonly mobile = signal(false);\n readonly mobileOpen = signal(false);\n private readonly hovered = signal(false);\n private readonly focused = signal(false);\n readonly expanded = computed(() => this.anchored() || this.hovered() || this.focused());\n readonly wide = computed(() => this.mobile() || this.expanded());\n protected readonly menuName = computed(() => this.menuLabel() ?? this.translations().menu);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n inject(Router, { optional: true })\n ?.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.mobileOpen.set(false));\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n const update = (mobile: boolean) => {\n this.mobile.set(mobile);\n if (!mobile) {\n this.mobileOpen.set(false);\n }\n };\n if (this.responsive() === 'container' && 'ResizeObserver' in view) {\n const observer = new view.ResizeObserver(([entry]) => update(entry.contentRect.width < MOBILE_WIDTH));\n observer.observe(this.host.nativeElement);\n destroyRef.onDestroy(() => observer.disconnect());\n return;\n }\n const media = view.matchMedia?.(`(width < ${MOBILE_WIDTH}px)`);\n if (media) {\n const change = () => update(media.matches);\n change();\n media.addEventListener?.('change', change);\n destroyRef.onDestroy(() => media.removeEventListener?.('change', change));\n }\n });\n }\n\n ngOnInit(): void {\n const stored = this.readAnchored();\n if (stored !== null) {\n this.anchored.set(stored);\n }\n }\n\n toggleAnchored(): void {\n const next = !this.anchored();\n this.anchored.set(next);\n this.hovered.set(true);\n this.writeAnchored(next);\n }\n\n toggleMobile(): void {\n this.mobileOpen.update((open) => !open);\n }\n\n closeMobile(): void {\n this.mobileOpen.set(false);\n }\n\n protected setHovered(hovered: boolean): void {\n this.hovered.set(hovered);\n }\n\n protected onFocusIn(event: FocusEvent): void {\n this.focused.set((event.target as HTMLElement | null)?.matches(':focus-visible') ?? false);\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !(event.currentTarget as HTMLElement).contains(next)) {\n this.focused.set(false);\n }\n }\n\n protected onSidebarClick(event: Event): void {\n if (this.mobile() && (event.target as HTMLElement | null)?.closest(PICKED)) {\n this.mobileOpen.set(false);\n }\n }\n\n protected closeFromKeyboard(): void {\n if (this.mobileOpen()) {\n this.mobileOpen.set(false);\n this.menuButton()?.nativeElement.focus();\n }\n }\n\n private storage(): Storage | null {\n try {\n return this.document.defaultView?.localStorage ?? null;\n } catch {\n return null;\n }\n }\n\n private readAnchored(): boolean | null {\n const key = this.stateKey();\n if (!key) {\n return null;\n }\n try {\n const value = this.storage()?.getItem(key);\n return value === null || value === undefined ? null : value === 'true';\n } catch {\n return null;\n }\n }\n\n private writeAnchored(value: boolean): void {\n const key = this.stateKey();\n if (!key) {\n return;\n }\n try {\n this.storage()?.setItem(key, String(value));\n } catch {\n return;\n }\n }\n}\n","@if (backdrop()) {\n <div class=\"tx-app-layout__backdrop\" aria-hidden=\"true\" [attr.data-variant]=\"backdropVariant()\"></div>\n}\n@if (sidebar()) {\n <div class=\"tx-app-layout__slot\">\n <aside\n class=\"tx-app-layout__sidebar\"\n [id]=\"id + '-sidebar'\"\n [attr.aria-label]=\"menuName()\"\n [attr.inert]=\"mobile() && !mobileOpen() ? '' : null\"\n [class]=\"passThrough().sidebar?.class\"\n [style]=\"passThrough().sidebar?.style\"\n (mouseenter)=\"setHovered(true)\"\n (mouseleave)=\"setHovered(false)\"\n (focusin)=\"onFocusIn($event)\"\n (focusout)=\"onFocusOut($event)\"\n >\n <div class=\"tx-app-layout__sidebar-header\">\n @if (homeLink() !== undefined) {\n <a class=\"tx-app-layout__brand\" [routerLink]=\"homeLink()\" [attr.aria-label]=\"title() ?? null\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-app-layout__brand\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n <button\n type=\"button\"\n class=\"tx-app-layout__anchor\"\n tooltipPlacement=\"right\"\n [attr.aria-pressed]=\"anchored()\"\n [attr.aria-label]=\"anchored() ? translations().unpinMenu : translations().pinMenu\"\n [txTooltip]=\"anchored() ? translations().unpinMenu : translations().pinMenu\"\n (click)=\"toggleAnchored()\"\n >\n <tx-icon class=\"tx-app-layout__pin-icon\" aria-hidden=\"true\" name=\"thumbtack\" [class.tx-app-layout__pin-icon--on]=\"!anchored()\" />\n <tx-icon class=\"tx-app-layout__pin-icon\" aria-hidden=\"true\" name=\"angle-double-left\" [class.tx-app-layout__pin-icon--on]=\"anchored()\" />\n </button>\n </div>\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- picks inside the menu are its own links and tree items -->\n <div class=\"tx-app-layout__menu\" (click)=\"onSidebarClick($event)\">\n <tx-panel-menu\n variant=\"sidebar\"\n [ariaLabel]=\"menuName()\"\n [model]=\"model()\"\n [collapsed]=\"!wide()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().menu?.class\"\n [style]=\"passThrough().menu?.style\"\n />\n </div>\n </aside>\n </div>\n <div class=\"tx-app-layout__mask\" aria-hidden=\"true\" [class]=\"passThrough().mask?.class\" [style]=\"passThrough().mask?.style\" (click)=\"closeMobile()\"></div>\n}\n<div class=\"tx-app-layout__column\">\n <header class=\"tx-app-layout__topbar\" [class]=\"passThrough().topbar?.class\" [style]=\"passThrough().topbar?.style\">\n @if (sidebar()) {\n <button\n #menuButton\n type=\"button\"\n class=\"tx-app-layout__menu-button\"\n [attr.aria-label]=\"menuName()\"\n [attr.aria-expanded]=\"mobileOpen()\"\n [attr.aria-controls]=\"id + '-sidebar'\"\n [class]=\"passThrough().menuButton?.class\"\n [style]=\"passThrough().menuButton?.style\"\n (click)=\"toggleMobile()\"\n >\n <tx-icon name=\"bars\" aria-hidden=\"true\" />\n </button>\n } @else {\n @if (homeLink() !== undefined) {\n <a class=\"tx-app-layout__plain-brand\" [routerLink]=\"homeLink()\" [attr.aria-label]=\"title() ?? null\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-app-layout__plain-brand\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n }\n <div class=\"tx-app-layout__topbar-end\">\n <ng-content select=\"[txAppTopbar]\" />\n </div>\n </header>\n <div class=\"tx-app-layout__wrapper\">\n <main class=\"tx-app-layout__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n <ng-content />\n </main>\n <ng-content select=\"[txAppFooter]\" />\n </div>\n</div>\n\n<ng-template #brand>\n @if (logo()) {\n <img class=\"tx-app-layout__logo\" alt=\"\" [src]=\"logo()\" />\n }\n @if (title()) {\n <span class=\"tx-app-layout__name\">{{ title() }}</span>\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,eAAe;AACrB,MAAM,SAAS;AAqBf,IAAa,cAAb,MAAa,YAAW;CACL,WAAW,OAAO,QAAQ;CAC1B,OAAO,OAAgC,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AA;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,iBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,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;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-app-layout.mjs","names":[],"sources":["../../../../packages/blocks/app-layout/src/app-layout.icons.ts","../../../../packages/blocks/app-layout/src/app-layout.theme.ts","../../../../packages/blocks/app-layout/src/app-layout.component.ts","../../../../packages/blocks/app-layout/src/app-layout.component.html"],"sourcesContent":["import { TxIconSet, txIconAngleDoubleLeft, txIconBars, txIconSidebar, txIconThumbtack } from '@tectra-ng/icons';\n\nexport const APP_LAYOUT_ICON_DEFAULTS: TxIconSet = {\n 'angle-double-left': txIconAngleDoubleLeft,\n bars: txIconBars,\n sidebar: txIconSidebar,\n thumbtack: txIconThumbtack,\n};\n","import { appLayoutTokens, panelMenuTokens } from '@tectra-ng/themes';\n\nexport const APP_LAYOUT_THEME = {\n appLayout: appLayoutTokens,\n panelMenu: panelMenuTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n DestroyRef,\n ElementRef,\n OnInit,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router, RouterLink } from '@angular/router';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraAppLayoutTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxPanelMenu, TxPanelMenuItem } from '@tectra-ng/ui/panel-menu';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { filter } from 'rxjs';\nimport { TxAppLayoutBackdrop, TxAppLayoutPart, TxAppLayoutResponsive } from './app-layout.types';\nimport { APP_LAYOUT_ICON_DEFAULTS } from './app-layout.icons';\nimport { APP_LAYOUT_THEME } from './app-layout.theme';\n\nconst MOBILE_WIDTH = 1024;\nconst PICKED = 'a[href], [role=\"treeitem\"]:not([aria-expanded])';\n\n@Component({\n selector: 'tx-app-layout',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxPanelMenu, TxTooltip],\n templateUrl: './app-layout.component.html',\n styleUrl: './app-layout.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-app-layout',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-responsive]': 'responsive()',\n '[class.tx-app-layout--plain]': '!sidebar()',\n '[class.tx-app-layout--anchored]': 'sidebar() && anchored()',\n '[class.tx-app-layout--wide]': 'sidebar() && wide()',\n '[class.tx-app-layout--open]': 'sidebar() && mobileOpen()',\n '(keydown.escape)': 'closeFromKeyboard()',\n },\n viewProviders: [provideTxIconDefaults(APP_LAYOUT_ICON_DEFAULTS)],\n})\nexport class TxAppLayout implements OnInit {\n private readonly appLayoutTheme = injectTokens(APP_LAYOUT_THEME);\n\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly menuButton = viewChild<ElementRef<HTMLButtonElement>>('menuButton');\n\n readonly model = input<TxPanelMenuItem[]>([]);\n readonly logo = input<string | undefined>(undefined);\n readonly title = input<string | undefined>(undefined);\n readonly homeLink = input<string | readonly unknown[] | undefined>('/');\n readonly sidebar = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly anchored = model(true);\n readonly stateKey = input<string | undefined>(undefined);\n readonly backdrop = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly backdropVariant = input<TxAppLayoutBackdrop>('spectrum');\n readonly responsive = input<TxAppLayoutResponsive>('viewport');\n readonly menuLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraAppLayoutTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAppLayoutPart, TxAppLayout> | 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('appLayout', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly id = uniqueId('tx-app-layout');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-app-layout'), ...this.passThrough().root?.style }));\n\n readonly mobile = signal(false);\n readonly mobileOpen = signal(false);\n private readonly hovered = signal(false);\n private readonly focused = signal(false);\n readonly expanded = computed(() => this.anchored() || this.hovered() || this.focused());\n readonly wide = computed(() => this.mobile() || this.expanded());\n protected readonly menuName = computed(() => this.menuLabel() ?? this.translations().menu);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n inject(Router, { optional: true })\n ?.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.mobileOpen.set(false));\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n const update = (mobile: boolean) => {\n this.mobile.set(mobile);\n if (!mobile) {\n this.mobileOpen.set(false);\n }\n };\n if (this.responsive() === 'container' && 'ResizeObserver' in view) {\n const observer = new view.ResizeObserver(([entry]) => update(entry.contentRect.width < MOBILE_WIDTH));\n observer.observe(this.host.nativeElement);\n destroyRef.onDestroy(() => observer.disconnect());\n return;\n }\n const media = view.matchMedia?.(`(width < ${MOBILE_WIDTH}px)`);\n if (media) {\n const change = () => update(media.matches);\n change();\n media.addEventListener?.('change', change);\n destroyRef.onDestroy(() => media.removeEventListener?.('change', change));\n }\n });\n }\n\n ngOnInit(): void {\n const stored = this.readAnchored();\n if (stored !== null) {\n this.anchored.set(stored);\n }\n }\n\n toggleAnchored(): void {\n const next = !this.anchored();\n this.anchored.set(next);\n this.hovered.set(true);\n this.writeAnchored(next);\n }\n\n toggleMobile(): void {\n this.mobileOpen.update((open) => !open);\n }\n\n closeMobile(): void {\n this.mobileOpen.set(false);\n }\n\n protected setHovered(hovered: boolean): void {\n this.hovered.set(hovered);\n }\n\n protected onFocusIn(event: FocusEvent): void {\n this.focused.set((event.target as HTMLElement | null)?.matches(':focus-visible') ?? false);\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !(event.currentTarget as HTMLElement).contains(next)) {\n this.focused.set(false);\n }\n }\n\n protected onSidebarClick(event: Event): void {\n if (this.mobile() && (event.target as HTMLElement | null)?.closest(PICKED)) {\n this.mobileOpen.set(false);\n }\n }\n\n protected closeFromKeyboard(): void {\n if (this.mobileOpen()) {\n this.mobileOpen.set(false);\n this.menuButton()?.nativeElement.focus();\n }\n }\n\n private storage(): Storage | null {\n try {\n return this.document.defaultView?.localStorage ?? null;\n } catch {\n return null;\n }\n }\n\n private readAnchored(): boolean | null {\n const key = this.stateKey();\n if (!key) {\n return null;\n }\n try {\n const value = this.storage()?.getItem(key);\n return value === null || value === undefined ? null : value === 'true';\n } catch {\n return null;\n }\n }\n\n private writeAnchored(value: boolean): void {\n const key = this.stateKey();\n if (!key) {\n return;\n }\n try {\n this.storage()?.setItem(key, String(value));\n } catch {\n return;\n }\n }\n}\n","@if (backdrop()) {\n <div class=\"tx-app-layout__backdrop\" aria-hidden=\"true\" [attr.data-variant]=\"backdropVariant()\"></div>\n}\n@if (sidebar()) {\n <div class=\"tx-app-layout__slot\">\n <aside\n class=\"tx-app-layout__sidebar\"\n [id]=\"id + '-sidebar'\"\n [attr.aria-label]=\"menuName()\"\n [attr.inert]=\"mobile() && !mobileOpen() ? '' : null\"\n [class]=\"passThrough().sidebar?.class\"\n [style]=\"passThrough().sidebar?.style\"\n (mouseenter)=\"setHovered(true)\"\n (mouseleave)=\"setHovered(false)\"\n (focusin)=\"onFocusIn($event)\"\n (focusout)=\"onFocusOut($event)\"\n >\n <div class=\"tx-app-layout__sidebar-header\">\n @if (homeLink() !== undefined) {\n <a class=\"tx-app-layout__brand\" [routerLink]=\"homeLink()\" [attr.aria-label]=\"title() ?? null\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-app-layout__brand\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n <button\n type=\"button\"\n class=\"tx-app-layout__anchor\"\n tooltipPlacement=\"right\"\n [attr.aria-pressed]=\"anchored()\"\n [attr.aria-label]=\"anchored() ? translations().unpinMenu : translations().pinMenu\"\n [txTooltip]=\"anchored() ? translations().unpinMenu : translations().pinMenu\"\n (click)=\"toggleAnchored()\"\n >\n <tx-icon class=\"tx-app-layout__pin-icon\" aria-hidden=\"true\" name=\"thumbtack\" [class.tx-app-layout__pin-icon--on]=\"!anchored()\" />\n <tx-icon class=\"tx-app-layout__pin-icon\" aria-hidden=\"true\" name=\"angle-double-left\" [class.tx-app-layout__pin-icon--on]=\"anchored()\" />\n </button>\n </div>\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- picks inside the menu are its own links and tree items -->\n <div class=\"tx-app-layout__menu\" (click)=\"onSidebarClick($event)\">\n <tx-panel-menu\n variant=\"sidebar\"\n [ariaLabel]=\"menuName()\"\n [model]=\"model()\"\n [collapsed]=\"!wide()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().menu?.class\"\n [style]=\"passThrough().menu?.style\"\n />\n </div>\n </aside>\n </div>\n <div class=\"tx-app-layout__mask\" aria-hidden=\"true\" [class]=\"passThrough().mask?.class\" [style]=\"passThrough().mask?.style\" (click)=\"closeMobile()\"></div>\n}\n<div class=\"tx-app-layout__column\">\n <header class=\"tx-app-layout__topbar\" [class]=\"passThrough().topbar?.class\" [style]=\"passThrough().topbar?.style\">\n @if (sidebar()) {\n <button\n #menuButton\n type=\"button\"\n class=\"tx-app-layout__menu-button\"\n [attr.aria-label]=\"menuName()\"\n [attr.aria-expanded]=\"mobileOpen()\"\n [attr.aria-controls]=\"id + '-sidebar'\"\n [class]=\"passThrough().menuButton?.class\"\n [style]=\"passThrough().menuButton?.style\"\n (click)=\"toggleMobile()\"\n >\n <tx-icon name=\"bars\" aria-hidden=\"true\" />\n </button>\n } @else {\n @if (homeLink() !== undefined) {\n <a class=\"tx-app-layout__plain-brand\" [routerLink]=\"homeLink()\" [attr.aria-label]=\"title() ?? null\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-app-layout__plain-brand\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n }\n <div class=\"tx-app-layout__topbar-end\">\n <ng-content select=\"[txAppTopbar]\" />\n </div>\n </header>\n <div class=\"tx-app-layout__wrapper\">\n <main class=\"tx-app-layout__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n <ng-content />\n </main>\n <ng-content select=\"[txAppFooter]\" />\n </div>\n</div>\n\n<ng-template #brand>\n @if (logo()) {\n <img class=\"tx-app-layout__logo\" alt=\"\" [src]=\"logo()\" />\n }\n @if (title()) {\n <span class=\"tx-app-layout__name\">{{ title() }}</span>\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;AAEA,MAAa,2BAAsC;CACjD,qBAAqB;CACrB,MAAM;CACN,SAAS;CACT,WAAW;AACZ;ACLD,MAAa,mBAAmB;CAC9B,WAAW;CACX,WAAW;AACZ;AC2BD,MAAM,eAAe;AACrB,MAAM,SAAS;AAsBf,IAAa,cAAb,MAAa,YAAW;CACL,iBAAiB,aAAa,gBAAgB;CAE9C,WAAW,OAAO,QAAQ;CAC1B,OAAO,OAAgC,UAAU;CACjD,aAAa,UAAyC,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAE3E,QAAQ,MAAyB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,OAAO,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC3C,QAAQ,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,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,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;CAAA;AAAA,CAAA"}
|
|
@@ -4,11 +4,11 @@ import { Overlay } from "@angular/cdk/overlay";
|
|
|
4
4
|
import { TemplatePortal } from "@angular/cdk/portal";
|
|
5
5
|
import { Router } from "@angular/router";
|
|
6
6
|
import { TxFocusTrap, uniqueId } from "@tectra-ng/core/a11y";
|
|
7
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
7
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
8
8
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
9
9
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
10
|
-
import { TxIcon } from "@tectra-ng/icons";
|
|
11
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
10
|
+
import { TxIcon, provideTxIconDefaults, txIconArrowRight, txIconFile, txIconList, txIconSearch, txIconSpinner, txIconText } from "@tectra-ng/icons";
|
|
11
|
+
import { commandPaletteTokens, toStyleObject } from "@tectra-ng/themes";
|
|
12
12
|
function filterPaletteItems(items, query) {
|
|
13
13
|
const term = (query ?? "").trim().toLowerCase();
|
|
14
14
|
if (!term) return [...items];
|
|
@@ -101,8 +101,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
101
101
|
args: [{ name: "menuPaletteItems" }]
|
|
102
102
|
}]
|
|
103
103
|
});
|
|
104
|
+
const COMMAND_PALETTE_ICON_DEFAULTS = {
|
|
105
|
+
"arrow-right": txIconArrowRight,
|
|
106
|
+
file: txIconFile,
|
|
107
|
+
list: txIconList,
|
|
108
|
+
search: txIconSearch,
|
|
109
|
+
spinner: txIconSpinner,
|
|
110
|
+
text: txIconText
|
|
111
|
+
};
|
|
112
|
+
const COMMAND_PALETTE_THEME = { commandPalette: commandPaletteTokens };
|
|
104
113
|
const MAC = /mac|iphone|ipad/i;
|
|
105
114
|
var TxCommandPalette = class TxCommandPalette {
|
|
115
|
+
commandPaletteTheme = injectTokens(COMMAND_PALETTE_THEME);
|
|
106
116
|
document = inject(DOCUMENT);
|
|
107
117
|
injector = inject(Injector);
|
|
108
118
|
host = inject(ElementRef);
|
|
@@ -468,6 +478,7 @@ var TxCommandPalette = class TxCommandPalette {
|
|
|
468
478
|
selector: "tx-icon",
|
|
469
479
|
inputs: ["name"]
|
|
470
480
|
}],
|
|
481
|
+
viewProviders: [provideTxIconDefaults(COMMAND_PALETTE_ICON_DEFAULTS)],
|
|
471
482
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
472
483
|
});
|
|
473
484
|
};
|
|
@@ -490,6 +501,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
490
501
|
"[class.tx-command-palette--compact]": "compact()",
|
|
491
502
|
"(document:keydown)": "onDocumentKeydown($event)"
|
|
492
503
|
},
|
|
504
|
+
viewProviders: [provideTxIconDefaults(COMMAND_PALETTE_ICON_DEFAULTS)],
|
|
493
505
|
template: "<button\n type=\"button\"\n class=\"tx-command-palette__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-keyshortcuts]=\"shortcutAria()\"\n [class]=\"passThrough().trigger?.class\"\n [style]=\"passThrough().trigger?.style\"\n (click)=\"open()\"\n>\n <tx-icon class=\"tx-command-palette__trigger-icon\" aria-hidden=\"true\" [name]=\"icon()\" />\n <span class=\"tx-command-palette__trigger-text\">{{ name() }}</span>\n <kbd class=\"tx-command-palette__kbd\" aria-hidden=\"true\">{{ shortcutLabel() }}</kbd>\n</button>\n<ng-template #layer>\n @if (isOpen()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- the mask closes on a click; Escape closes from the panel -->\n <div\n class=\"tx-command-palette__overlay\"\n animate.enter=\"tx-command-palette__overlay--enter\"\n animate.leave=\"tx-command-palette__overlay--leave\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [style]=\"tokenStyle()\"\n [class]=\"passThrough().overlay?.class\"\n (click)=\"close()\"\n >\n <div\n class=\"tx-command-palette__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n txFocusTrap\n animate.enter=\"tx-command-palette__panel--enter\"\n animate.leave=\"tx-command-palette__panel--leave\"\n [attr.aria-label]=\"name()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"passThrough().panel?.style\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onPanelKeydown($event)\"\n >\n <div class=\"tx-command-palette__search\" [class]=\"passThrough().search?.class\" [style]=\"passThrough().search?.style\">\n <tx-icon class=\"tx-command-palette__search-icon\" aria-hidden=\"true\" name=\"search\" />\n <input\n class=\"tx-command-palette__input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n aria-expanded=\"true\"\n [attr.aria-controls]=\"id + '-list'\"\n [attr.aria-activedescendant]=\"activeId()\"\n [attr.aria-label]=\"hint()\"\n [placeholder]=\"hint()\"\n (input)=\"onInput($event)\"\n />\n @if (loading()) {\n <tx-icon class=\"tx-command-palette__spinner\" aria-hidden=\"true\" name=\"spinner\" />\n }\n </div>\n <div class=\"tx-command-palette__results\" [class]=\"passThrough().results?.class\" [style]=\"passThrough().results?.style\">\n <div class=\"tx-command-palette__list\" role=\"listbox\" [id]=\"id + '-list'\" [attr.aria-label]=\"name()\">\n @for (item of visibleItems(); track item.id; let index = $index) {\n @if (isNewGroup(index)) {\n <div class=\"tx-command-palette__group\" role=\"presentation\">{{ groupLabel(item.group) }}</div>\n }\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"tx-command-palette__item\"\n [id]=\"id + '-option-' + index\"\n [class.tx-command-palette__item--active]=\"activeIndex() === index\"\n [attr.aria-selected]=\"activeIndex() === index\"\n [class]=\"passThrough().item?.class\"\n [style]=\"passThrough().item?.style\"\n (mouseenter)=\"activeIndex.set(index)\"\n (click)=\"select(item)\"\n >\n <span class=\"tx-command-palette__item-icon\" aria-hidden=\"true\"><tx-icon [name]=\"item.icon ?? 'file'\" /></span>\n <span class=\"tx-command-palette__label\">{{ item.label }}</span>\n @if (item.sublabel) {\n <span class=\"tx-command-palette__sublabel\">{{ item.sublabel }}</span>\n }\n <tx-icon class=\"tx-command-palette__arrow\" aria-hidden=\"true\" name=\"arrow-right\" />\n </button>\n }\n </div>\n @if (loading()) {\n <div class=\"tx-command-palette__status\" role=\"status\">\n <tx-icon class=\"tx-command-palette__spinner\" aria-hidden=\"true\" name=\"spinner\" />\n <span>{{ loadingText() ?? translations().searching }}</span>\n </div>\n } @else if (!visibleItems().length && query()) {\n <div class=\"tx-command-palette__status tx-command-palette__status--empty\" role=\"status\">{{ emptyText() ?? translations().nothingFound }}</div>\n }\n </div>\n <div class=\"tx-command-palette__footer\" aria-hidden=\"true\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <span class=\"tx-command-palette__hint\"><kbd>↑</kbd><kbd>↓</kbd> {{ translations().paletteNavigate }}</span>\n <span class=\"tx-command-palette__hint\"><kbd>↵</kbd> {{ translations().paletteOpen }}</span>\n <span class=\"tx-command-palette__hint\"><kbd>esc</kbd> {{ translations().paletteClose }}</span>\n </div>\n </div>\n </div>\n }\n</ng-template>\n",
|
|
494
506
|
styles: [":host{display:inline-flex}.tx-command-palette__trigger{position:relative;display:inline-flex;align-items:center;border:0;cursor:pointer;font:inherit}.tx-command-palette__overlay{position:fixed;inset:0;display:flex;align-items:flex-start;justify-content:center}.tx-command-palette__panel{display:flex;flex-direction:column;box-sizing:border-box;width:100%;overflow:hidden}.tx-command-palette__search{display:flex;align-items:center}.tx-command-palette__input{flex:1;min-width:0;padding:0;border:0;outline:none;background:transparent;color:inherit;font:inherit}.tx-command-palette__results{flex:1;min-height:0;overflow-y:auto}.tx-command-palette__list{display:flex;flex-direction:column}.tx-command-palette__item{display:flex;align-items:center;width:100%;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:start}.tx-command-palette__item-icon{display:grid;flex-shrink:0;place-items:center}.tx-command-palette__label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-command-palette__sublabel{flex-shrink:0;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-command-palette__arrow{opacity:0}.tx-command-palette__item--active .tx-command-palette__arrow{opacity:1}.tx-command-palette__status{display:flex;align-items:center;justify-content:center}.tx-command-palette__footer,.tx-command-palette__hint{display:flex;align-items:center}.tx-command-palette__spinner{animation:tx-command-palette-spin 1s linear infinite}:host([data-styled]){font-family:var(--tx-font-family)}:host([data-styled]) .tx-command-palette__trigger{gap:var(--tx-command-palette-trigger-gap);height:var(--tx-command-palette-trigger-height);padding:var(--tx-command-palette-trigger-padding);border-radius:var(--tx-command-palette-trigger-border-radius);background:var(--tx-command-palette-trigger-background);box-shadow:inset 0 0 0 1px var(--tx-command-palette-trigger-ring-color),var(--tx-command-palette-trigger-shadow);color:var(--tx-command-palette-trigger-color);font-size:var(--tx-command-palette-trigger-font-size);transition:background-color var(--tx-command-palette-trigger-duration),color var(--tx-command-palette-trigger-duration),box-shadow var(--tx-command-palette-trigger-duration),scale var(--tx-command-palette-trigger-duration)}:host([data-styled]) .tx-command-palette__trigger:hover{background:var(--tx-command-palette-trigger-hover-background);box-shadow:inset 0 0 0 1px var(--tx-command-palette-trigger-ring-color),var(--tx-command-palette-trigger-hover-shadow);color:var(--tx-command-palette-trigger-hover-color)}:host([data-styled]) .tx-command-palette__trigger:active{scale:var(--tx-command-palette-trigger-active-scale)}:host([data-styled]) .tx-command-palette__trigger:focus-visible{outline:none;box-shadow:var(--tx-command-palette-trigger-focus-ring-shadow)}:host([data-styled]) .tx-command-palette__kbd{margin-inline-start:var(--tx-command-palette-trigger-kbd-margin-start);padding:var(--tx-command-palette-trigger-kbd-padding);border-radius:var(--tx-command-palette-trigger-kbd-border-radius);background:var(--tx-command-palette-trigger-kbd-background);box-shadow:inset 0 0 0 1px var(--tx-command-palette-trigger-kbd-ring-color);font-family:inherit;font-size:var(--tx-command-palette-trigger-kbd-font-size);font-weight:var(--tx-command-palette-trigger-kbd-font-weight);line-height:1}.tx-command-palette__overlay[data-styled]{z-index:var(--tx-command-palette-overlay-z-index);padding:var(--tx-command-palette-overlay-padding);background:var(--tx-command-palette-overlay-background);font-family:var(--tx-font-family);-webkit-backdrop-filter:blur(var(--tx-command-palette-overlay-blur));backdrop-filter:blur(var(--tx-command-palette-overlay-blur))}.tx-command-palette__overlay[data-styled].tx-command-palette__overlay--enter{animation:tx-command-palette-fade-in var(--tx-command-palette-overlay-enter-duration) ease-out}.tx-command-palette__overlay[data-styled].tx-command-palette__overlay--leave{animation:tx-command-palette-fade-out var(--tx-command-palette-overlay-leave-duration) ease-in forwards}.tx-command-palette__overlay[data-styled] .tx-command-palette__panel{max-width:var(--tx-command-palette-panel-max-width);max-height:var(--tx-command-palette-panel-max-height);border:1px solid var(--tx-command-palette-panel-border-color);border-radius:var(--tx-command-palette-panel-border-radius);background:var(--tx-command-palette-panel-background);box-shadow:var(--tx-command-palette-panel-shadow);color:var(--tx-command-palette-panel-color)}.tx-command-palette__overlay[data-styled] .tx-command-palette__panel--enter{animation:tx-command-palette-pop-in var(--tx-command-palette-panel-enter-duration) var(--tx-command-palette-panel-easing)}.tx-command-palette__overlay[data-styled] .tx-command-palette__panel--leave{animation:tx-command-palette-pop-out var(--tx-command-palette-panel-leave-duration) ease-in forwards}.tx-command-palette__overlay[data-styled] .tx-command-palette__search{gap:var(--tx-command-palette-search-gap);padding:var(--tx-command-palette-search-padding);border-bottom:1px solid var(--tx-command-palette-panel-border-color);font-size:var(--tx-command-palette-search-font-size)}.tx-command-palette__overlay[data-styled] .tx-command-palette__search-icon{color:var(--tx-command-palette-search-icon-color);font-size:var(--tx-command-palette-search-icon-size)}.tx-command-palette__overlay[data-styled] .tx-command-palette__input::placeholder{color:var(--tx-command-palette-search-placeholder-color)}.tx-command-palette__overlay[data-styled] .tx-command-palette__spinner{color:var(--tx-command-palette-search-icon-color)}.tx-command-palette__overlay[data-styled] .tx-command-palette__results{padding:var(--tx-command-palette-results-padding)}.tx-command-palette__overlay[data-styled] .tx-command-palette__group{padding:var(--tx-command-palette-results-group-padding);color:var(--tx-command-palette-results-group-color);font-size:var(--tx-command-palette-results-group-font-size);font-weight:var(--tx-command-palette-results-group-font-weight);letter-spacing:var(--tx-command-palette-results-group-letter-spacing);text-transform:uppercase}.tx-command-palette__overlay[data-styled] .tx-command-palette__item{gap:var(--tx-command-palette-item-gap);padding:var(--tx-command-palette-item-padding);border-radius:var(--tx-command-palette-item-border-radius);color:var(--tx-command-palette-item-color);font-size:var(--tx-command-palette-item-font-size);transition:background-color var(--tx-command-palette-item-duration)}.tx-command-palette__overlay[data-styled] .tx-command-palette__item--active{background:var(--tx-command-palette-item-active-background)}.tx-command-palette__overlay[data-styled] .tx-command-palette__item-icon{width:var(--tx-command-palette-item-icon-size);height:var(--tx-command-palette-item-icon-size);border-radius:var(--tx-command-palette-item-icon-border-radius);background:var(--tx-command-palette-item-icon-background);color:var(--tx-command-palette-item-icon-color);font-size:var(--tx-command-palette-item-icon-font-size);transition:background-color var(--tx-command-palette-item-duration),color var(--tx-command-palette-item-duration)}.tx-command-palette__overlay[data-styled] .tx-command-palette__item--active .tx-command-palette__item-icon{background:var(--tx-command-palette-item-active-icon-background);color:var(--tx-command-palette-item-active-icon-color)}.tx-command-palette__overlay[data-styled] .tx-command-palette__label{font-weight:var(--tx-command-palette-item-label-font-weight)}.tx-command-palette__overlay[data-styled] .tx-command-palette__sublabel{color:var(--tx-command-palette-item-sublabel-color);font-size:var(--tx-command-palette-item-sublabel-font-size)}.tx-command-palette__overlay[data-styled] .tx-command-palette__arrow{color:var(--tx-command-palette-item-arrow-color);font-size:var(--tx-command-palette-item-arrow-size);transition:opacity var(--tx-command-palette-item-duration)}.tx-command-palette__overlay[data-styled] .tx-command-palette__status{gap:var(--tx-command-palette-results-status-gap);padding:var(--tx-command-palette-results-status-padding);color:var(--tx-command-palette-results-status-color);font-size:var(--tx-command-palette-results-status-font-size)}.tx-command-palette__overlay[data-styled] .tx-command-palette__status--empty{padding:var(--tx-command-palette-results-empty-padding)}.tx-command-palette__overlay[data-styled] .tx-command-palette__footer{gap:var(--tx-command-palette-footer-gap);padding:var(--tx-command-palette-footer-padding);border-top:1px solid var(--tx-command-palette-panel-border-color);background:var(--tx-command-palette-footer-background)}.tx-command-palette__overlay[data-styled] .tx-command-palette__hint{gap:var(--tx-command-palette-footer-hint-gap);color:var(--tx-command-palette-footer-hint-color);font-size:var(--tx-command-palette-footer-hint-font-size)}.tx-command-palette__overlay[data-styled] .tx-command-palette__hint kbd{display:inline-flex;align-items:center;justify-content:center;min-width:var(--tx-command-palette-footer-kbd-min-width);box-sizing:border-box;padding:var(--tx-command-palette-footer-kbd-padding);border:1px solid var(--tx-command-palette-panel-border-color);border-radius:var(--tx-command-palette-footer-kbd-border-radius);background:var(--tx-command-palette-footer-kbd-background);font-family:inherit;font-size:var(--tx-command-palette-footer-kbd-font-size);font-weight:var(--tx-font-weight-medium)}:host([data-styled].tx-command-palette--compact) .tx-command-palette__trigger{justify-content:center;width:var(--tx-command-palette-trigger-height);padding:0}:host([data-styled].tx-command-palette--compact) .tx-command-palette__trigger .tx-command-palette__trigger-text{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([data-styled].tx-command-palette--compact) .tx-command-palette__trigger .tx-command-palette__kbd{display:none}@media(width<=768px){:host([data-styled]) .tx-command-palette__trigger{justify-content:center;width:var(--tx-command-palette-trigger-height);padding:0}:host([data-styled]) .tx-command-palette__trigger .tx-command-palette__trigger-text{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([data-styled]) .tx-command-palette__trigger .tx-command-palette__kbd{display:none}}@keyframes tx-command-palette-spin{to{rotate:360deg}}@keyframes tx-command-palette-fade-in{0%{opacity:0}}@keyframes tx-command-palette-fade-out{to{opacity:0}}@keyframes tx-command-palette-pop-in{0%{opacity:0;transform:translateY(-8px) scale(.98)}}@keyframes tx-command-palette-pop-out{to{opacity:0;transform:translateY(-8px) scale(.98)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-command-palette__trigger{transition:none}.tx-command-palette__overlay[data-styled].tx-command-palette__overlay--enter,.tx-command-palette__overlay[data-styled].tx-command-palette__overlay--leave,.tx-command-palette__overlay[data-styled] .tx-command-palette__panel--enter,.tx-command-palette__overlay[data-styled] .tx-command-palette__panel--leave{animation:none}.tx-command-palette__overlay[data-styled] .tx-command-palette__item,.tx-command-palette__overlay[data-styled] .tx-command-palette__item-icon,.tx-command-palette__overlay[data-styled] .tx-command-palette__arrow{transition:none}}\n"]
|
|
495
507
|
}]
|